Crossfire Server, Trunk  R20513
Functions
marker.c File Reference

The implementation of marker objects. More...

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

Go to the source code of this file.

Functions

void init_type_marker (void)
 Initializer for the marker object type. More...
 
static method_ret marker_type_process (ob_methods *context, object *op)
 Processes a marker. More...
 
static method_ret marker_type_trigger (ob_methods *context, object *op, object *cause, int state)
 A marker is triggered. More...
 
static void move_marker (object *op)
 Move function for marker objects. More...
 

Detailed Description

The implementation of marker objects.

Definition in file marker.c.

Function Documentation

void init_type_marker ( void  )

Initializer for the marker object type.

Definition at line 40 of file marker.c.

References MARKER, marker_type_process(), marker_type_trigger(), register_process(), register_trigger(), and TRIGGER_MARKER.

Referenced by register_all_ob_types().

Here is the call graph for this function:

Here is the caller graph for this function:

static method_ret marker_type_process ( ob_methods context,
object op 
)
static

Processes a marker.

Parameters
contextThe method context
opThe marker to process
Return values
METHOD_OK

Definition at line 118 of file marker.c.

References METHOD_OK, and move_marker().

Referenced by init_type_marker().

Here is the call graph for this function:

Here is the caller graph for this function:

static method_ret marker_type_trigger ( ob_methods context,
object op,
object cause,
int  state 
)
static

A marker is triggered.

Parameters
contextIgnored.
opThe object being triggered
causeIgnored.
stateIgnored.
Return values
METHOD_OK

Definition at line 131 of file marker.c.

References METHOD_OK, and move_marker().

Referenced by init_type_marker().

Here is the call graph for this function:

Here is the caller graph for this function:

static void move_marker ( object op)
static

Move function for marker objects.

When moved, a marker will search for a player sitting above it, and insert an invisible, weightless force into him with a specific code as the slaying field.

At that time, it writes the contents of its own message field to the player. The marker will decrement hp to 0 and then delete itself every time it grants a mark. unless hp was zero to start with, in which case it is infinite.

Author
peter.nosp@m.m@so.nosp@m.da.cs.nosp@m.ua.b.nosp@m.erkel.nosp@m.ey.e.nosp@m.du
Parameters
opmarker to move. Can be removed if it reached its marking limit.

Definition at line 61 of file marker.c.

References obj::above, add_string(), create_archetype(), draw_ext_info(), liv::food, FORCE, FORCE_NAME, GET_MAP_OB, liv::hp, obj::lore, obj::map, obj::msg, MSG_SUBTYPE_NONE, MSG_TYPE_MISC, NDI_NAVY, NDI_UNIQUE, object_find_by_type_and_slaying(), object_free_drop_inventory(), object_insert_in_ob(), object_remove(), object_update_speed(), PLAYER, obj::slaying, obj::speed, obj::speed_left, obj::stats, obj::type, obj::x, and obj::y.

Referenced by marker_type_process(), and marker_type_trigger().

Here is the call graph for this function:

Here is the caller graph for this function: