Crossfire Server, Branch 1.12  R12190
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.
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.
method_ret ob_move_on (object *op, object *victim, object *originator)
 Makes an object move on top of another one.
method_ret ob_process (object *op)
 Processes an object, giving it the opportunity to move or react.
method_ret ob_trigger (object *op, object *cause, int state)
 An object is triggered by another one.

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 59 of file ob_methods.c.

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

Referenced by enter_exit(), manual_apply(), monster_use_scroll(), player_apply_below(), 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 102 of file ob_methods.c.

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

Referenced by book_type_apply(), cast_identify(), do_skill_ident2(), examine(), and identify_altar_type_move_on().

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 122 of file ob_methods.c.

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

Referenced by check_move_on(), move_hole(), and remove_ob().

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 79 of file ob_methods.c.

References ob_methods::fallback, METHOD_UNHANDLED, ob_methods::process, 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 144 of file ob_methods.c.

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

Referenced by trigger_connected().

Here is the caller graph for this function: