[Package Index | Mudlib Index | Effect Index]
.
void add_situation(mixed label, class situation sit)Adds a situation to the room. These situations can be invoked manually with start_situation or automatically via automate_situation.
#includeclass situation frogs; frogs = new(class situation, start_mess: "Water seeps out of the ground to form puddles.", extra_look: "There are large puddles on the ground here.", chats: ({"A hidden frog croaks quietly.", "There is a blooping sound." }), add_items:({ ({"puddle", "The puddles are dark and murky. " "They will probably dry up given time." }) }) ); add_situation( "frogs", frogs );
add_situation( "frogs", new(class situation, start_mess: "Water seeps out of the ground to form puddles.", extra_look: "There are large puddles on the ground here.", chats: ({"A hidden frog croaks quietly.", "There is a blooping sound." }), add_items: ({ ({"puddle", "The puddles are dark and murky. " "They will probably dry up given time." }) }) ));
void automate_situation(mixed label, mixed duration, mixed when, mixed chance, mixed category)Automate starting and ending of a situations. These situations can be invoked manually with start_situation. The automated starting and ending is unaffected by the room unloading. When the room reloads the situation will be restarted unless its duration is up. You must include the file situations.h for the definitions of the when masks.
#includeautomate_situation( "frog", 300, WHEN_ANY_TIME, 200 ); This will automatically start the situation labelled "frog" at a random time that is any time of the day with a 200/1000 chance of it starting per 300 seconds. It will last for 300 seconds (5 minutes).
automate_situation( ({"frog1","frog2"}), 240, WHEN_EVENING|WHEN_NIGHT, , 300 ); This will automatically start a situation that is a combination of "frog1" followed by "frog2" at a random time but only in the evening or at night. There will be a 300/1000 chance of it starting per 240 seconds. Both the "frog1" and "frog2" situations will get half the total time (as there are two), 120 seconds each, for a total duration of 240 seconds (4 minutes).
varargs mixed change_situation(mixed label, mixed duration, mixed words, mixed handle)Starts one or more situations that will end after a specified duration. You can use an array and make further situations commence when others end.
void check_situations()Tests for enabling situation managing. If situation managing is already active or turned off it does nothing.
void choose_words(mixed label, mixed choice)This function selects word replacements for #n in the text.
choose_words( "frog", ({ "#1", "tadpole", "#2", "pond" }));
void end_situation(mixed label)Ends a situation previously added and started on the room that is managed by this object. These situations can be invoked manually with start_situation or automatically via automate_situation.
string extra_look()
string * insert_words_chats(class situation sit, string * words)Replaces #1 in text with the one of the first array of words in wordlist and #2 with one of the second array of words and so on... Each string in the string array is changed.
mixed * insert_words_items(class situation sit, string * words)Replaces #1 in text with the one of the first array of words in wordlist and #2 with one of the second array of words and so on... For items only the item text is changed, not the key words.
void make_seed(int xval, int yval)Makes a seed value for the random part of when situations turn on and off. The two ints must be constant for a given room -- like the coordinates.
void manage_situations()Starts and ends situations according to the information in the sittiming array. It is called continuously automatically while there are interactives in the room.
int * query_current_situations()returns situations currently turned on.
int query_possible(class situation_timing sit, int it, int tod, int cnt)
object query_room()
mixed * query_sittiming()returns sittiming class with info about automated situations
mapping query_situations()returns mapping of situations.
int query_status()returns status of situation manager. If it is sleeping it will turn on again if a player enters the room.
object set_room(object room_o)
void shutdown_all_situations()Shuts down all current and pending situations. It also turns off the automated situation manager so no more are added. It does not destruct this object so all the add_situations are still loaded and may be recommenced with automate_situation or change_situation. dest_me is the appropriate call to permanently remove all situations.
void shutdown_situation(int handle, mixed label)Shuts down a change_situation based on the call_out handle returned by the call to change_situation.
void start_situation(mixed label, int do_start_mess)Starts a situation previously added to the room that is managed by this object. These situations can be invoked manually with start_situation or automatically via automate_situation.
class situation_timing { mixed label; mixed duration; mixed when; int chance; int * endat; mixed background; mixed category; int it; mapping it_data; }