Crossfire Server, Trunk
|
Go to the source code of this file.
Macros | |
#define | sqr(x) ((x)*(x)) |
Functions | |
int | dispel_rune (object *op, object *skill, int dir) |
static void | rune_attack (object *op, object *victim) |
void | spring_trap (object *trap, object *victim) |
int | trap_disarm (object *disarmer, object *trap, int risk, object *skill) |
int | trap_see (object *op, object *trap) |
int | trap_show (object *trap, object *where) |
int | write_rune (object *op, object *caster, object *spell, int dir, const char *runename) |
All rune-related functions.
Definition in file rune.c.
Someone is trying to disarm a rune. The actual attempt is done in trap_disarm().
op | object trying to disarm. |
skill | skill to disarm runes. |
dir | direction to disarm. |
0 | rune wasn't disarmed. |
1 | a rune was disarmed. |
Definition at line 295 of file rune.c.
References draw_ext_info(), FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, object_find_by_type2(), object_free_drop_inventory(), object_remove(), give::op, P_OUT_OF_MAP, RUNE, SIGN, Ice::tmp, TRAP, trap_disarm(), diamondslots::x, and diamondslots::y.
Referenced by cast_spell().
This function handles those runes which detonate but do not cast spells. Typically, poisoned or diseased runes.
op | rune. |
victim | victim of the rune. |
Definition at line 175 of file rune.c.
References create_treasure(), DISEASE, HAS_RANDOM_ITEMS, hit_map(), hit_player(), infect_object(), object_free_drop_inventory(), object_remove(), object_was_destroyed, give::op, CFweardisguise::tag, and reputation::victim.
Referenced by spring_trap().
This function generalizes attacks by runes/traps. This ought to make it possible for runes to attack from the inventory, it'll spring the trap on the victim.
trap | trap that activates. |
victim | victim of the trap. |
Definition at line 205 of file rune.c.
References arch_to_object(), cast_spell(), archt::clone, obj::count, obj::direction, rv_vector::distance, draw_ext_info(), env, FLAG_ALIVE, FLAG_IS_LINKED, FLAG_IS_USED_UP, FLAG_LIFESAVE, liv::food, get_rangevector(), liv::hp, obj::inv, MAX, liv::maxhp, obj::msg, MSG_TYPE_APPLY, MSG_TYPE_APPLY_TRAP, NDI_UNIQUE, object_free_drop_inventory(), object_get_env_recursive(), object_insert_in_map_at(), object_remove(), object_was_destroyed, obj::other_arch, PLAYER, QUERY_FLAG, rune_attack(), SET_FLAG, SIGN, SPELL, obj::stats, trap_show(), obj::type, use_trigger(), and reputation::victim.
Referenced by attempt_pick_lock(), cfapi_object_spring_trap(), common_trap_type_move_on(), hit_player(), player_attack_door(), save_throw_object(), trap_disarm(), and treasure_type_apply().
Try to disarm a trap/rune.
disarmer | object disarming the trap/rune. |
trap | trap to disarm. |
risk | if 0, trap/rune won't spring if disarm failure. Else it will spring. |
skill | spell used to disarm. |
Definition at line 433 of file rune.c.
References liv::dam, destroy_object(), liv::Dex, mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), obj::inv, obj::level, obj::map, MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, object_get_owner(), PLAYER, PREFER_LOW, random_roll(), spring_trap(), sqr, obj::stats, and obj::type.
Referenced by dispel_rune(), and remove_trap().
Should op see trap?
op | living that could spot the trap. |
trap | trap that is invisible. |
0 | trap wasn't spotted. |
1 | trap was spotted. |
Definition at line 376 of file rune.c.
References liv::Cha, draw_ext_info_format(), obj::level, MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_UNIQUE, give::op, PREFER_HIGH, random_roll(), and obj::stats.
Referenced by find_traps().
Handles showing a trap/rune detonation.
trap | trap that detonates. |
where | object at the location to detonate. |
0 | no animation inserted. |
1 | animation inserted. |
Definition at line 403 of file rune.c.
References obj::animation, create_archetype(), obj::face, GET_ANIMATION, object_insert_in_map_at(), obj::temp_animation, and python_pickup::where.
Referenced by find_traps(), remove_trap(), and spring_trap().
Player is attempting to write a magical rune. This function does all checks for paths, sp/gr, ...
op | rune writer. |
caster | object used for casting this rune. |
spell | writing spell. |
dir | orientation of rune, direction rune's contained spell will be cast in, if applicable |
runename | name of the rune or message displayed by the rune for a rune of marking. |
0 | no rune was written. |
1 | rune written. |
Definition at line 50 of file rune.c.
References arch_to_object(), blank_face, buf, caster_level(), liv::Cha, create_archetype(), obj::direction, draw_ext_info(), draw_ext_info_format(), obj::face, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, GENERIC_RUNE, get_map_flags(), obj::level, m, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, NDI_UNIQUE, object_copy(), object_insert_in_map_at(), object_insert_in_ob(), object_matches_string(), object_new(), object_set_msg(), object_set_owner(), give::op, obj::other_arch, obj::path_attuned, obj::path_denied, RUNE, set_spell_skill(), obj::skill, SP_level_spellpoint_cost(), SPELL, SPELL_GRACE, SPELL_MANA, obj::stats, Ice::tmp, and obj::type.
Referenced by cast_spell().