![]() |
Crossfire Server, Trunk
1.75.0
|
#include <global.h>
#include <ob_methods.h>
#include <ob_types.h>
#include <sounds.h>
#include <sproto.h>
Go to the source code of this file.
Functions | |
static void | animate_bomb (object *op) |
This handles an exploding bomb. More... | |
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. More... | |
static void | execute_word_of_recall (object *op) |
Handles the actual word of recalling. More... | |
static void | explosion (object *op) |
Expands an explosion. More... | |
static void | forklightning (object *op, object *tmp) |
Causes op to fork. More... | |
void | init_type_spell_effect (void) |
Initializer for the SPELL_EFFECT object type. More... | |
static void | move_aura (object *aura) |
Process an aura. More... | |
static void | move_ball_spell (object *op) |
This handles ball type spells that just sort of wander about. More... | |
static void | move_bolt (object *op) |
Moves bolt 'op'. More... | |
static object * | move_bullet (object *op) |
Moves bullet 'op'. More... | |
static void | move_cone (object *op) |
Causes cone object 'op' to move a space/hit creatures. More... | |
static void | move_missile (object *op) |
Move a missile object. More... | |
static void | move_swarm_spell (object *op) |
static method_ret | spell_effect_type_move_on (object *trap, object *victim, object *originator) |
Move on this Spell Effect object. More... | |
static method_ret | spell_effect_type_process (object *op) |
Handle ob_process for all SPELL_EFFECT objects. More... | |
The implementation of the Spell Effect class of objects.
Definition in file spell_effect.cpp.
|
static |
This handles an exploding bomb.
op | The original bomb object. |
Definition at line 461 of file spell_effect.cpp.
References add_refcount(), arch_to_object(), object::attacktype, living::dam, object::direction, object::duration, object::env, env, explode_bullet(), find_archetype(), free_string(), freearr_x, object::map, NUM_ANIMATIONS, ob_process(), object_copy_owner(), object_get_env_recursive(), object_insert_in_map_at(), object_remove(), object_update_turn_face(), out_of_map(), object::range, object::skill, SPLINT, object::state, object::stats, object::x, and object::y.
Referenced by spell_effect_type_process().
|
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.
op | The spell object. |
Definition at line 899 of file spell_effect.cpp.
References object::above, absdir(), object::direction, FLAG_IS_FLOOR, FLAG_NO_PICK, FLAG_WIZ, GET_MAP_OB, object::head, object::level, object::map, object::more, MOVE_FLYING, move_object(), object::move_type, QUERY_FLAG, rndm(), living::sp, object::stats, object::weight, object::x, and object::y.
Referenced by explosion(), move_bolt(), and move_cone().
|
static |
Handles the actual word of recalling.
Called when force in player inventory expires.
op | The word of recall effect activating. |
Definition at line 537 of file spell_effect.cpp.
References enter_exit(), object::env, object::inv, object_free_drop_inventory(), object_remove(), PLAYER, remove_unpaid_objects(), and object::type.
Referenced by spell_effect_type_process().
|
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.
op | piece of explosion expanding. |
Definition at line 320 of file spell_effect.cpp.
References object::attacktype, check_spell_knockback(), object::direction, object::duration, freearr_x, freearr_y, hit_map(), m, object::map, object_copy(), object_free_drop_inventory(), object_insert_in_map_at(), object_merge_spell(), object_new(), object_remove(), ok_to_put_more(), object::range, object::speed_left, object::state, object::value, object::x, and object::y.
Referenced by spell_effect_type_process().
Causes op to fork.
op | original bolt. |
tmp | first piece of the fork. |
Definition at line 848 of file spell_effect.cpp.
References absdir(), living::Con, living::dam, living::Dex, object::direction, object::duration, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, m, object::map, OB_TYPE_MOVE_BLOCK, object_copy(), object_insert_in_map_at(), object_new(), object_update_turn_face(), P_OUT_OF_MAP, rndm(), object::speed_left, object::stats, object::x, and object::y.
Referenced by move_bolt().
void init_type_spell_effect | ( | void | ) |
Initializer for the SPELL_EFFECT object type.
Definition at line 54 of file spell_effect.cpp.
References register_move_on(), register_process(), SPELL_EFFECT, spell_effect_type_move_on(), and spell_effect_type_process().
Referenced by register_all_ob_types().
|
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
aura | The spell effect. |
Definition at line 728 of file spell_effect.cpp.
References animate_object(), object::animation, arch_to_object(), object::attacktype, cast_spell(), check_spell_expiry(), archetype::clone, object::duration, object::env, Animations::facings, FLAG_ALIVE, FLAG_ANIMATE, FLAG_FRIENDLY, FLAG_REMOVED, FLAG_UNAGGRESSIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, FREE_OBJ_FREE_INVENTORY, FREE_OBJ_NO_DESTROY_CALLBACK, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_map(), IS_PLAYER(), m, object::map, Animations::num_animations, OB_TYPE_MOVE_BLOCK, object_free(), object_free_drop_inventory(), object_get_value(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object::other_arch, P_OUT_OF_MAP, QUERY_FLAG, object::range, SET_FLAG, SPELL, sstring, object::state, try_find_animation(), object::type, object::x, and object::y.
Referenced by spell_effect_type_process().
|
static |
This handles ball type spells that just sort of wander about.
Note that duration is handled by process_object() in time.c
op | The spell effect. |
Definition at line 559 of file spell_effect.cpp.
References absdir(), adjust_dir(), arch_to_object(), object::attacktype, living::dam, object::direction, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_map(), m, object::map, OB_TYPE_MOVE_BLOCK, object_get_owner(), object_insert_in_map_at(), object_remove(), on_same_map(), object::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, rndm(), spell_find_dir(), object::stats, object::x, and object::y.
Referenced by spell_effect_type_process().
|
static |
Moves bolt 'op'.
Basically, it just advances a space, and checks for various things that may stop it.
op | The bolt object moving. |
Definition at line 156 of file spell_effect.cpp.
References absdir(), object::attacktype, check_spell_knockback(), living::Dex, object::direction, DIRX, DIRY, object::duration, FLAG_REFLECTING, forklightning(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_map(), m, object::map, OB_TYPE_MOVE_BLOCK, object_copy(), object_free_drop_inventory(), object_insert_in_map_at(), object_new(), object_remove(), object_update_turn_face(), P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, object::range, reflwall(), rndm(), object::speed_left, object::stats, object::x, and object::y.
Referenced by spell_effect_type_process().
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).
op | The bullet being moved. |
Definition at line 260 of file spell_effect.cpp.
References absdir(), check_bullet(), object::direction, DIRX, DIRY, explode_bullet(), FLAG_FREED, get_map_flags(), GET_MAP_MOVE_BLOCK, m, object::map, OB_TYPE_MOVE_BLOCK, object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_update_turn_face(), object::other_arch, P_OUT_OF_MAP, QUERY_FLAG, object::range, reflwall(), object::x, and object::y.
Referenced by move_missile(), and spell_effect_type_process().
|
static |
Causes cone object 'op' to move a space/hit creatures.
op | cone object moving. |
Definition at line 393 of file spell_effect.cpp.
References absdir(), object::attacktype, check_spell_knockback(), cone_drop(), object::count, object::duration, FLAG_LIFESAVE, freearr_x, freearr_y, hit_map(), llevError, LOG(), object::map, living::maxhp, object::name, object_copy(), object_free_drop_inventory(), object_insert_in_map_at(), object_new(), object_remove(), object_update_speed(), object_was_destroyed, ok_to_put_more(), object::other_arch, QUERY_FLAG, object::range, living::sp, object::speed, object::stats, object::x, and object::y.
Referenced by spell_effect_type_process().
|
static |
Move a missile object.
This is the same as move_bullet(), except that after moving, we update the projectile's direction (if it's still in existence) so that it homes in on things.
op | The missile that needs to be moved. |
Definition at line 516 of file spell_effect.cpp.
References adjust_dir(), object::direction, object::map, move_bullet(), object_get_owner(), object_update_turn_face(), spell_find_dir(), object::x, and object::y.
Referenced by spell_effect_type_process().
|
static |
Definition at line 658 of file spell_effect.cpp.
References absdir(), object::direction, object::duration, fire_arch_from_position(), freearr_x, freearr_y, get_map_flags(), get_random_dir(), m, object::map, object_free_drop_inventory(), object_get_owner(), object_remove(), P_OUT_OF_MAP, rndm(), SP_BULLET, SP_MAGIC_MISSILE, SPELL, object::spell, object::subtype, object::type, object::x, and object::y.
Referenced by spell_effect_type_process().
|
static |
Move on this Spell Effect object.
trap | The Spell Effect we're moving on |
victim | The object moving over this one |
originator | The object that caused the move_on event |
Definition at line 66 of file spell_effect.cpp.
References object::attacktype, common_post_ob_move_on(), common_pre_ob_move_on(), object::count, living::dam, FLAG_ALIVE, hit_player(), object::material, object::materialname, METHOD_ERROR, METHOD_OK, object_free_drop_inventory(), object_remove(), object_was_destroyed, QUERY_FLAG, save_throw_object(), SP_CONE, SP_MAGIC_MISSILE, SP_MOVING_BALL, object::speed, object::stats, and object::subtype.
Referenced by init_type_spell_effect().
|
static |
Handle ob_process for all SPELL_EFFECT objects.
op | The spell effect that's being processed. |
Definition at line 106 of file spell_effect.cpp.
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, SP_WORD_OF_RECALL, and object::subtype.
Referenced by init_type_spell_effect().