Crossfire Server, Trunk
ob_methods.cpp File Reference
#include <global.h>
#include <ob_methods.h>
#include <ob_types.h>
#include <sproto.h>
+ Include dependency graph for ob_methods.cpp:

Go to the source code of this file.

Functions

method_ret ob_apply (object *op, object *applier, int aflags)
 
char * ob_describe (const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
 
method_ret ob_move_on (object *op, object *victim, object *originator)
 
method_ret ob_process (object *op)
 
method_ret ob_trigger (object *op, object *cause, int state)
 

Detailed Description

Those functions deal with the object/type system.

Definition in file ob_methods.cpp.

Function Documentation

◆ ob_apply()

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

Apply an object by running an event hook or an object method. Consider using apply_manual() instead of this function if the applier should check for apply restrictions.

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 44 of file ob_methods.cpp.

References ob_methods::apply, EVENT_APPLY, events_execute_object_event(), ob_methods::fallback, METHOD_OK, METHOD_UNHANDLED, give::op, SCRIPT_FIX_ALL, and type_methods.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ob_describe()

char* ob_describe ( const object op,
const object observer,
int  use_media_tags,
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
use_media_tagswhether to add media tags or not on the description
bufBuffer that will contain the description
sizeSize of buf
Returns
buf.

Definition at line 91 of file ob_methods.cpp.

References buf, ob_methods::describe, ob_methods::fallback, give::op, and type_methods.

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

+ Here is the caller graph for this function:

◆ ob_move_on()

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 111 of file ob_methods.cpp.

References ob_methods::fallback, METHOD_UNHANDLED, ob_methods::move_on, give::op, type_methods, and sword_of_souls::victim.

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

+ Here is the caller graph for this function:

◆ ob_process()

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 67 of file ob_methods.cpp.

References ob_methods::fallback, METHOD_UNHANDLED, give::op, 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:

◆ ob_trigger()

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 133 of file ob_methods.cpp.

References ob_methods::fallback, METHOD_UNHANDLED, give::op, dragon::state, ob_methods::trigger, and type_methods.

Referenced by trigger_connected().

+ Here is the caller graph for this function: