|
Crossfire Server, Branch 1.12
R12190
|
All rune-related functions. More...

Go to the source code of this file.
Defines | |
| #define | sqr(x) ((x)*(x)) |
Functions | |
| int | dispel_rune (object *op, object *caster, object *spell, object *skill, int dir) |
| Someone is trying to disarm a rune. | |
| static void | rune_attack (object *op, object *victim) |
| This function handles those runes which detonate but do not cast spells. | |
| void | spring_trap (object *trap, object *victim) |
| This function generalizes attacks by runes/traps. | |
| void | trap_adjust (object *trap, int difficulty) |
| Adjust trap difficulty to the map. | |
| int | trap_disarm (object *disarmer, object *trap, int risk, object *skill) |
| Try to disarm a trap/rune. | |
| int | trap_see (object *op, object *trap) |
| Should op see trap? | |
| int | trap_show (object *trap, object *where) |
| Handles showing a trap/rune detonation. | |
| int | write_rune (object *op, object *caster, object *spell, int dir, const char *runename) |
| Player is attempting to write a magical rune. | |
All rune-related functions.
Definition in file rune.c.
| #define sqr | ( | x | ) | ((x)*(x)) |
Definition at line 43 of file rune.c.
Referenced by trap_disarm().
| int dispel_rune | ( | object * | op, |
| object * | caster, | ||
| object * | spell, | ||
| object * | skill, | ||
| int | dir | ||
| ) |
Someone is trying to disarm a rune.
The actual attempt is done in trap_disarm().
| op | object trying to disarm. |
| caster | object casting the disarm spell. |
| spell | actual spell for casting. |
| skill | skill to disarm runes. |
| dir | direction to disarm. |
| 0 | rune wasn't disarmed. |
| 1 | a rune was disarmed. |
Definition at line 323 of file rune.c.
References draw_ext_info(), free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, P_OUT_OF_MAP, remove_ob(), RUNE, SIGN, TRAP, and trap_disarm().
Referenced by cast_spell().


| static void rune_attack | ( | object * | op, |
| object * | victim | ||
| ) | [static] |
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 197 of file rune.c.
References create_treasure(), DISEASE, free_object(), HAS_RANDOM_ITEMS, hit_map(), hit_player(), infect_object(), and remove_ob().
Referenced by spring_trap().


| void spring_trap | ( | object * | trap, |
| object * | victim | ||
| ) |
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 227 of file rune.c.
References arch_to_object(), cast_spell(), rv_vector::distance, draw_ext_info(), FLAG_ALIVE, FLAG_IS_LINKED, FLAG_IS_USED_UP, free_object(), get_rangevector(), insert_ob_in_map(), MAX, MSG_TYPE_APPLY, MSG_TYPE_APPLY_TRAP, NDI_UNIQUE, object_get_env_recursive(), PLAYER, QUERY_FLAG, remove_ob(), rune_attack(), SET_FLAG, SIGN, SPELL, trap_show(), and use_trigger().
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().


| void trap_adjust | ( | object * | trap, |
| int | difficulty | ||
| ) |
Adjust trap difficulty to the map.
The default traps are too strong for wimpy level 1 players, and unthreatening to anyone of high level
| trap | trap to adjust. |
| difficulty | map difficulty. |
Definition at line 508 of file rune.c.
References AT_DEATH, AT_POISON, and rndm().

| int trap_disarm | ( | object * | disarmer, |
| object * | trap, | ||
| int | risk, | ||
| object * | skill | ||
| ) |
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 459 of file rune.c.
References destroy_object(), draw_ext_info(), draw_ext_info_format(), MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, PLAYER, PREFER_LOW, random_roll(), spring_trap(), and sqr.
Referenced by dispel_rune(), and remove_trap().


| int trap_see | ( | object * | op, |
| object * | 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 403 of file rune.c.
References draw_ext_info_format(), MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, PREFER_HIGH, and random_roll().
Referenced by find_traps().


| int trap_show | ( | object * | trap, |
| object * | where | ||
| ) |
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 431 of file rune.c.
References create_archetype(), GET_ANIMATION, insert_ob_in_map(), and new_faces.
Referenced by find_traps(), remove_trap(), and spring_trap().


| int write_rune | ( | object * | op, |
| object * | caster, | ||
| object * | spell, | ||
| int | dir, | ||
| const char * | runename | ||
| ) |
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 66 of file rune.c.
References add_string(), arch_to_object(), blank_face, caster_level(), copy_object(), create_archetype(), draw_ext_info(), draw_ext_info_format(), freearr_x, freearr_y, GENERIC_RUNE, get_map_flags(), GET_MAP_OB, get_object(), insert_ob_in_map(), insert_ob_in_ob(), item_matched_string(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, RUNE, set_owner(), set_spell_skill(), snprintf(), SP_level_spellpoint_cost(), SPELL, SPELL_GRACE, and SPELL_MANA.
Referenced by cast_spell().


1.7.6.1