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

Go to the source code of this file.

Functions

method_ret common_process_projectile (ob_methods *context, object *op)
 
method_ret common_projectile_move_on (ob_methods *context, object *trap, object *victim, object *originator)
 
void stop_projectile (object *op)
 

Detailed Description

This file contains code common to projectile objects. For now it is limited to arrows and thrown objects.

Definition in file projectile.c.

Function Documentation

◆ common_process_projectile()

method_ret common_process_projectile ( ob_methods context,
object *  op 
)

Move an arrow or thrown object along its course.

Parameters
contextThe method context
opThe arrow or thrown object being moved.
Todo:
Split this function up.
Returns
METHOD_ERROR if op is not in a map, otherwise METHOD_OK

Definition at line 77 of file projectile.c.

References absdir(), DIRX, DIRY, FLAG_ALIVE, FLAG_REFL_MISSILE, FLAG_REFLECTING, freearr_x, freearr_y, GET_ANIM_ID, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_with_arrow(), llevError, LOG(), map_find_by_flag(), METHOD_ERROR, METHOD_OK, OB_TYPE_MOVE_BLOCK, object_free_drop_inventory(), object_get_owner(), object_insert_in_map_at(), object_remove(), object_update_turn_face(), P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, rndm(), and stop_projectile().

Referenced by arrow_type_process(), and thrown_object_type_process().

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

◆ common_projectile_move_on()

method_ret common_projectile_move_on ( ob_methods context,
object *  trap,
object *  victim,
object *  originator 
)

Move on this Thrown Object object.

Parameters
contextThe method context
trapThe thrown object or arrow we're moving on
victimThe object moving over this one
originatorThe object that caused the move_on event
Returns
METHOD_OK

Definition at line 225 of file projectile.c.

References common_post_ob_move_on(), common_pre_ob_move_on(), FLAG_ALIVE, hit_with_arrow(), METHOD_ERROR, METHOD_OK, object_get_owner(), and QUERY_FLAG.

Referenced by init_type_arrow(), and init_type_thrown_object().

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

◆ stop_projectile()

void stop_projectile ( object *  op)

Handle an arrow or thrown object stopping.

Parameters
opThe arrow or thrown object that is stopping.

Definition at line 36 of file projectile.c.

References EVENT_STOP, events_execute_object_event(), fix_stopped_arrow(), object_clear_owner(), object_free(), object_free_drop_inventory(), object_insert_in_map_at(), object_merge(), object_remove(), and SCRIPT_FIX_NOTHING.

Referenced by arrow_type_process(), common_process_projectile(), and thrown_object_type_process().

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