Mudlib effects
Documentation for the living-effects functions for the mudlib in /std/living/effects.c.
Module Information
Handles effects (ie delayed/repeating events) Each effect calls start_effect in the specified file when the effect starts Calls reinstate_effect when it restarts (at login etc) Calls do_effect periodically Calls end_effect when it ends Each of these functions takes arguments : effect sufferer, args, counter
where counter is the number of times it will repeat args is a mixed set of args as appropriate to the effect
Functions
-
int time_to_next_effect()
Returns time remaining in call_out to the next effect
-
int actual_period(mixed val)
Converts period to an actual interval, with suitable randomisation Formats : int val : period = val
int *({ fixed, var}) : period = fixed + random(var) function : evaluate it
-
void remove_effect_at(int pos)
Removes effect from queue at appropriate point
-
int find_effect_index(string ob)
Return position of effect with specified object in queue Return -1 on failure
-
int find_effect_name_index(string name)
Return position of effect with specified name in queue Return -1 on failure
-
int *find_effect_indexes_matching(string name)
Return array of positions of effects (part-)matching specified name Return ({})
-
int find_effect(string ob)
Return effect with specified object in queue Return 0 on failure
-
mixed query_effect_args(string ob)
Return args of specified effect
-
int remove_effect(string ob)
Locate effect matching the specified ob and remove it Return 1 on success, 0 on failure
-
int remove_effect_named(string name)
Locate effect matching the specified name and remove it Return 1 on success, 0 on failure
-
int remove_effects_matching(string name)
Locate effects matching the specified name and remove them Return 1 on success, 0 on failure
- void insert_effect_at(class effect_class effect, int pos)
Inserts effect into queue at appropriate point
- int insert_effect(class effect_class effect)
Finds appropriate point in queue to insert effect Adjusts delay to following effect Returns 1 on success, 0 on failure.
-
void next_effect()
Call the function specified in the function at the head of the queue Move it to appropriate place in queue Then call out to next effect in the queue
-
void clear_effects()
Clears the effects queue
-
mixed *query_effects()
Returns copy of the effects queue
-
void add_effect(string ob, mixed args, int repeats, mixed interval)
Adds the specified effect Usage: add_effect(string ob, mixed args, int repeats, mixed interval) repeats will default to ob->query_repeats() interval will default to ob->query_interval()
-
void reinstate_effects()
Called on relogging to restart effects.
File generated by Lima 1.1a4 reStructured Text daemon.