Mudlib behaviors
Documentation for the adversary-behaviors functions for the mudlib in /std/adversary/behaviors.c.
Functions
- varargs int busy_with(object ob, string action, string bf, mixed args, int busy)
int busy_with(object ob, string action, string function, mixed *args) Add a call back to a function and keep the player busy in the mean time. It’s not possible to be busy with more than one thing at a time The action string is used for messaging like
You begin <action> … You are busy <action>!
The function is called in the object given after busy seconds (or BUSY_LENGTH if no busy given) with arguments args. BUSY_LENGTH is defined in /std/adversary/behaviors.
This function must return 1 if the player was successfully set busy or -1 if it failed. A 0 is also seen as a success.
The function is the object is called and if it returns 1, everything is assumed well, but on 0 a message of:
You fail at <action>.
is sent to the adversary.
-
void adversary_met(object who)
Function is called when this adversary meets someone or something. You can override it to add your own things when it meets things, but remember to call
::adversary_met(who);.
This function is only called for ADVERSARY, not if you are a player.
-
void adversary_moved()
Function is called when this adversary moves. You can override it to add your own things when it moves, but remember to call
::adversary_moved();
This function is only called for ADVERSARY, not if you are a player.
-
void flee()
Try to run away. Does nothing by default. Overload this function to modify the behavior of your monster when it panics.
-
void surrender()
Try to surrender. Does nothing by default. Overload this function to modify the behavior of your monster when it panicss.
-
void try_heal()
Called when the adversary is in combat and under pressure. This function consumes food and alchohol from inventory to stay alive.
-
void panic()
Do something intelligent when we are about to die. Overload this to have your monster do something else when it’s hp’s get low. The default behavior is to randomly flee or surrender.
-
void target_is_asleep()
Called with the person we are attacking is asleep or unconscious. Default behavior is to finish them off. Overload this function if you want your monster to do something other than killing its victims. Rob them, etc..
-
void do_move_away()
Moves through a random exit. Probable implementation of “flee”
File generated by Lima 1.1a4 reStructured Text daemon.