Crossfire Server, Trunk  R20513
Functions
ob_methods.c File Reference

Those functions deal with the object/type system. More...

#include <global.h>
#include <ob_methods.h>
#include <ob_types.h>
#include <sproto.h>
Include dependency graph for ob_methods.c:

Go to the source code of this file.

Functions

method_ret ob_apply (object *op, object *applier, int aflags)
 Applies an object. More...
 
char * ob_describe (const object *op, const object *observer, char *buf, size_t size)
 Returns the description of an object, as seen by the given observer. More...
 
method_ret ob_move_on (object *op, object *victim, object *originator)
 Makes an object move on top of another one. More...
 
method_ret ob_process (object *op)
 Processes an object, giving it the opportunity to move or react. More...
 
method_ret ob_trigger (object *op, object *cause, int state)
 An object is triggered by another one. More...
 

Detailed Description

Those functions deal with the object/type system.

Definition in file ob_methods.c.

Function Documentation

method_ret ob_apply ( object op,
object applier,
int  aflags 
)

Applies an object.

Parameters
opThe object to apply
applierThe object that executes the apply action
aflagsSpecial (always apply/unapply) flags
Return values
0A player or monster can't apply objects of that type
1has been applied, or there was an error applying the object
2objects of that type can't be applied if not in inventory

Definition at line 42 of file ob_methods.c.

References ob_methods::apply, ob_methods::fallback, METHOD_UNHANDLED, obj::type, and type_methods.

Referenced by apply_by_living_below(), apply_manual(), create_player_cmd(), dimension_door(), enter_exit(), monster_use_scroll(), and thrown_item_effect().

Here is the caller graph for this function:

char* ob_describe ( const object op,
const object observer,
char *  buf,
size_t  size 
)

Returns the description of an object, as seen by the given observer.

Parameters
opThe object to describe
observerThe object to which the description is made
bufBuffer that will contain the description
sizeSize of buf
Returns
buf.

Definition at line 85 of file ob_methods.c.

References ob_methods::describe, ob_methods::fallback, obj::type, and type_methods.

Referenced by book_type_apply(), cast_identify(), examine(), identify_altar_type_move_on(), identify_object_with_skill(), and spellbook_type_apply().

Here is the caller graph for this function:

method_ret ob_move_on ( object op,
object victim,
object originator 
)

Makes an object move on top of another one.

Parameters
opThe object over which to move
victimThe object moving over op
originatorThe object that is the cause of the move
Return values
METHOD_UNHANDLEDif the process method does not exist for that object

Definition at line 105 of file ob_methods.c.

References ob_methods::fallback, METHOD_UNHANDLED, ob_methods::move_on, obj::type, and type_methods.

Referenced by move_hole(), object_check_move_on(), and object_remove().

Here is the caller graph for this function:

method_ret ob_process ( object op)

Processes an object, giving it the opportunity to move or react.

Note: The return value of ob_process doesn't seem to be used anymore.

Parameters
opThe object to process
Return values
METHOD_UNHANDLEDif the process method does not exist for that objec,

Definition at line 62 of file ob_methods.c.

References ob_methods::fallback, METHOD_UNHANDLED, ob_methods::process, obj::type, and type_methods.

Referenced by animate_bomb(), do_throw(), fire_arch_from_position(), fire_bolt(), fire_bow(), and process_object().

Here is the caller graph for this function:

method_ret ob_trigger ( object op,
object cause,
int  state 
)

An object is triggered by another one.

Parameters
opThe object being triggered
causeThe object that is the cause of the trigger
statetrigger state, 0 for released, other for pushed
Return values
METHOD_UNHANDLEDif the process method does not exist for that object
Todo:
check the exact state values/meaning

Definition at line 127 of file ob_methods.c.

References ob_methods::fallback, METHOD_UNHANDLED, ob_methods::trigger, obj::type, and type_methods.

Referenced by trigger_connected().

Here is the caller graph for this function: