Crossfire Server, Branch 1.12  R12190
Functions
spell_effect.c File Reference

The implementation of the Spell Effect class of objects. More...

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

Go to the source code of this file.

Functions

static void animate_bomb (object *op)
 This handles an exploding bomb.
static void check_spell_knockback (object *op)
 Checks to see if a spell pushes objects as well as flies over and damages them (only used for cones for now) but moved here so it could be applied to bolts too.
static void execute_word_of_recall (object *op)
 Handles the actual word of recalling.
static void explosion (object *op)
 Expands an explosion.
static void forklightning (object *op, object *tmp)
 Causes op to fork.
void init_type_spell_effect (void)
 Initializer for the SPELL_EFFECT object type.
static void move_aura (object *aura)
 Process an aura.
static void move_ball_spell (object *op)
 This handles ball type spells that just sort of wander about.
static void move_bolt (object *op)
 Moves bolt 'op'.
static void move_bullet (object *op)
 Moves bullet 'op'.
static void move_cone (object *op)
 Causes cone object 'op' to move a space/hit creatures.
static void move_missile (object *op)
 Move a missle object.
static void move_swarm_spell (object *op)
static method_ret spell_effect_type_move_on (ob_methods *context, object *trap, object *victim, object *originator)
 Move on this Spell Effect object.
static method_ret spell_effect_type_process (ob_methods *context, object *op)
 Handle ob_process for all SPELL_EFFECT objects.

Detailed Description

The implementation of the Spell Effect class of objects.

Todo:
Split the subtype functions into their own file each, and split large functions.

Definition in file spell_effect.c.


Function Documentation

static void animate_bomb ( object *  op) [static]

This handles an exploding bomb.

Parameters:
opThe original bomb object.

Definition at line 434 of file spell_effect.c.

References add_refcount(), arch_to_object(), copy_owner(), explode_bullet(), find_archetype(), FLAG_IS_TURNABLE, free_string(), freearr_x, insert_ob_in_map(), NUM_ANIMATIONS, ob_process(), object_get_env_recursive(), out_of_map(), QUERY_FLAG, remove_ob(), SET_ANIMATION, and SPLINT.

Referenced by spell_effect_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

static void check_spell_knockback ( object *  op) [static]

Checks to see if a spell pushes objects as well as flies over and damages them (only used for cones for now) but moved here so it could be applied to bolts too.

Parameters:
opThe spell object.

Definition at line 869 of file spell_effect.c.

References absdir(), FLAG_ALIVE, FLAG_IS_FLOOR, FLAG_NO_PICK, FLAG_WIZ, GET_MAP_OB, MOVE_FLYING, move_object(), QUERY_FLAG, and rndm().

Referenced by move_cone().

Here is the call graph for this function:

Here is the caller graph for this function:

static void execute_word_of_recall ( object *  op) [static]

Handles the actual word of recalling.

Called when force in player inventory expires.

Parameters:
opThe word of recall effect activating.

Definition at line 546 of file spell_effect.c.

References draw_ext_info(), enter_exit(), FLAG_WIZCAST, free_object(), get_map_flags(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, P_NO_CLERIC, PLAYER, QUERY_FLAG, and remove_ob().

Referenced by spell_effect_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

static void explosion ( object *  op) [static]

Expands an explosion.

op is a piece of the explosion - this expans it in the different directions. At least that is what I think this does.

Parameters:
oppiece of explosion expanding.

Definition at line 317 of file spell_effect.c.

References copy_object(), free_object(), freearr_x, freearr_y, get_object(), hit_map(), insert_ob_in_map(), merge_spell(), ok_to_put_more(), and remove_ob().

Referenced by spell_effect_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

static void forklightning ( object *  op,
object *  tmp 
) [static]

Causes op to fork.

Parameters:
oporiginal bolt.
tmpfirst piece of the fork.

Definition at line 816 of file spell_effect.c.

References absdir(), copy_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_object(), insert_ob_in_map(), OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, rndm(), and update_turn_face().

Referenced by move_bolt().

Here is the call graph for this function:

Here is the caller graph for this function:

void init_type_spell_effect ( void  )

Initializer for the SPELL_EFFECT object type.

Definition at line 54 of file spell_effect.c.

References register_move_on(), register_process(), SPELL_EFFECT, spell_effect_type_move_on(), and spell_effect_type_process().

Referenced by register_all_ob_types().

Here is the call graph for this function:

Here is the caller graph for this function:

static void move_aura ( object *  aura) [static]

Process an aura.

An aura is a part of someone's inventory, which he carries with him, but which acts on the map immediately around him. Aura parameters: duration: duration counter. attacktype: aura's attacktype other_arch: archetype to drop where we attack

Parameters:
auraThe spell effect.

Definition at line 748 of file spell_effect.c.

References arch_to_object(), check_spell_expiry(), free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_map(), insert_ob_in_map(), insert_ob_in_ob(), OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, and remove_ob().

Referenced by spell_effect_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

static void move_ball_spell ( object *  op) [static]

This handles ball type spells that just sort of wander about.

Note that duration is handled by process_object() in time.c

Parameters:
opThe spell effect.

Definition at line 568 of file spell_effect.c.

References absdir(), arch_to_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_owner(), hit_map(), insert_ob_in_map(), OB_TYPE_MOVE_BLOCK, on_same_map(), P_IS_ALIVE, P_OUT_OF_MAP, remove_ob(), rndm(), and spell_find_dir().

Referenced by spell_effect_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

static void move_bolt ( object *  op) [static]

Moves bolt 'op'.

Basically, it just advances a space, and checks for various things that may stop it.

Parameters:
opThe bolt object moving.

Definition at line 158 of file spell_effect.c.

References absdir(), copy_object(), DIRX, DIRY, FLAG_REFLECTING, forklightning(), free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_object(), hit_map(), insert_ob_in_map(), OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, reflwall(), remove_ob(), rndm(), and update_turn_face().

Referenced by spell_effect_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

static void move_bullet ( object *  op) [static]

Moves bullet 'op'.

Basically, we move 'op' one square, and if it hits something, call check_bullet. This function is only applicable to bullets, but not to all fired arches (eg, bolts).

Parameters:
opThe bullet being moved.

Definition at line 261 of file spell_effect.c.

References absdir(), check_bullet(), DIRX, DIRY, explode_bullet(), free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, reflwall(), remove_ob(), and update_turn_face().

Referenced by spell_effect_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

static void move_cone ( object *  op) [static]

Causes cone object 'op' to move a space/hit creatures.

Parameters:
opcone object moving.

Definition at line 363 of file spell_effect.c.

References absdir(), check_spell_knockback(), cone_drop(), copy_object(), FLAG_LIFESAVE, free_object(), freearr_x, freearr_y, get_object(), hit_map(), insert_ob_in_map(), llevError, LOG(), ok_to_put_more(), QUERY_FLAG, remove_ob(), and update_ob_speed().

Referenced by spell_effect_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

static void move_missile ( object *  op) [static]

Move a missle object.

Parameters:
opThe missile that needs to be moved.

Definition at line 492 of file spell_effect.c.

References AT_MAGIC, DIRX, DIRY, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_owner(), hit_map(), insert_ob_in_map(), OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, remove_ob(), SET_ANIMATION, and spell_find_dir().

Referenced by spell_effect_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

static void move_swarm_spell ( object *  op) [static]

Definition at line 678 of file spell_effect.c.

References absdir(), fire_arch_from_position(), fire_bullet(), free_object(), freearr_x, freearr_y, get_map_flags(), get_owner(), P_OUT_OF_MAP, remove_ob(), rndm(), SP_BULLET, SP_MAGIC_MISSILE, and SPELL.

Referenced by spell_effect_type_process().

Here is the call graph for this function:

Here is the caller graph for this function:

static method_ret spell_effect_type_move_on ( ob_methods context,
object *  trap,
object *  victim,
object *  originator 
) [static]

Move on this Spell Effect object.

Parameters:
contextThe method context
trapThe Spell Effect we're moving on
victimThe object moving over this one
originatorThe object that caused the move_on event
Returns:
METHOD_OK

Definition at line 67 of file spell_effect.c.

References common_post_ob_move_on(), common_pre_ob_move_on(), FLAG_ALIVE, free_object(), hit_player(), METHOD_ERROR, METHOD_OK, QUERY_FLAG, remove_ob(), save_throw_object(), SP_CONE, SP_MAGIC_MISSILE, and SP_MOVING_BALL.

Referenced by init_type_spell_effect().

Here is the call graph for this function:

Here is the caller graph for this function:

static method_ret spell_effect_type_process ( ob_methods context,
object *  op 
) [static]

Handle ob_process for all SPELL_EFFECT objects.

Parameters:
contextThe method context
opThe spell effect that's being processed.
Returns:
METHOD_OK

Definition at line 108 of file spell_effect.c.

References animate_bomb(), execute_word_of_recall(), explosion(), METHOD_OK, move_aura(), move_ball_spell(), move_bolt(), move_bullet(), move_cone(), move_missile(), move_swarm_spell(), SP_AURA, SP_BOLT, SP_BOMB, SP_BULLET, SP_CONE, SP_EXPLOSION, SP_MAGIC_MISSILE, SP_MOVING_BALL, SP_SWARM, and SP_WORD_OF_RECALL.

Referenced by init_type_spell_effect().

Here is the call graph for this function:

Here is the caller graph for this function: