Crossfire Server, Branches 1.12
R18729
|
#include <global.h>
#include <object.h>
#include <living.h>
#include <sproto.h>
#include <spells.h>
#include <sounds.h>
Go to the source code of this file.
Functions | |
int | alchemy (object *op, object *caster, object *spell_ob) |
static void | alchemy_object (float value_adj, object *obj, int *small_nuggets, int *large_nuggets, int *weight) |
int | animate_weapon (object *op, object *caster, object *spell, int dir) |
int | cast_bless (object *op, object *caster, object *spell_ob, int dir) |
int | cast_change_ability (object *op, object *caster, object *spell_ob, int dir, int silent) |
int | cast_change_map_lightlevel (object *op, object *caster, object *spell) |
int | cast_consecrate (object *op, object *caster, object *spell) |
int | cast_create_food (object *op, object *caster, object *spell_ob, int dir, const char *stringarg) |
int | cast_create_missile (object *op, object *caster, object *spell, int dir, const char *stringarg) |
int | cast_create_town_portal (object *op, object *caster, object *spell, int dir) |
int | cast_detection (object *op, object *caster, object *spell) |
int | cast_earth_to_dust (object *op, object *caster, object *spell_ob) |
int | cast_heal (object *op, object *caster, object *spell, int dir) |
int | cast_identify (object *op, object *caster, object *spell) |
int | cast_invisible (object *op, object *caster, object *spell_ob) |
int | cast_item_curse_or_curse (object *op, object *caster, object *spell_ob) |
void | cast_magic_storm (object *op, object *tmp, int lvl) |
int | cast_polymorph (object *op, object *caster, object *spell_ob, int dir) |
int | cast_transfer (object *op, object *caster, object *spell, int dir) |
int | cast_wonder (object *op, object *caster, int dir, object *spell_ob) |
int | cast_word_of_recall (object *op, object *caster, object *spell_ob) |
static void | charge_mana_effect (object *victim, int caster_level) |
void | counterspell (object *op, int dir) |
int | create_aura (object *op, object *caster, object *spell) |
int | dimension_door (object *op, object *caster, object *spob, int dir) |
int | magic_wall (object *op, object *caster, int dir, object *spell_ob) |
int | makes_invisible_to (object *pl, object *mon) |
int | perceive_self (object *op) |
static void | place_alchemy_objects (object *op, mapstruct *m, int small_nuggets, int large_nuggets, int x, int y) |
void | polymorph (object *op, object *who, int level) |
static void | polymorph_item (object *who, object *op, int level) |
static void | polymorph_living (object *op, int level) |
static void | polymorph_melt (object *who, object *op) |
int | probe (object *op, object *caster, object *spell_ob, int dir) |
int | recharge (object *op, object *caster, object *spell_ob) |
int | remove_curse (object *op, object *caster, object *spell) |
int | write_mark (object *op, object *spell, const char *msg) |
Variables | |
static object * | large |
static uint64 | large_value |
static const char *const | no_gain_msgs [NUM_STATS] |
static object * | small |
static uint64 | small_value |
Various spell effects, non attacks.
Definition in file spell_effect.c.
Change items to gold nuggets. Only works for players.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
0 | op isn't a player. |
1 | op is a player. |
Definition at line 2208 of file spell_effect.c.
References obj::above, alchemy_object(), obj::below, obj::contr, create_archetype(), obj::duration, F_TRUE, FLAG_ALIVE, FLAG_IS_CAULDRON, FLAG_NO_PICK, free_object(), get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, obj::inv, large_value, socket_struct::look_position, obj::map, MOVE_WALK, P_NO_MAGIC, P_OUT_OF_MAP, place_alchemy_objects(), PLAYER, query_cost(), QUERY_FLAG, small_value, pl::socket, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::type, obj::weight, obj::x, and obj::y.
Referenced by cast_spell().
|
static |
Compute how many nuggets an object is worth, and remove it.
value_adj | how much to adjust the cost of obj. | |
obj | object to convert. | |
[out] | small_nuggets | how many small nuggets obj gives. |
[out] | large_nuggets | how many large nuggets obj gives. |
[out] | weight | the weight of the object. |
Definition at line 2109 of file spell_effect.c.
References F_TRUE, FLAG_UNPAID, free_object(), GEM, large_value, MONEY, query_cost(), QUERY_FLAG, remove_ob(), rndm(), small_value, obj::type, obj::value, and obj::weight.
Referenced by alchemy().
Generalization of staff_to_snake(). Makes a golem out of the caster's weapon. The golem is based on the archetype specified, modified by the caster's level and the attributes of the weapon. The weapon is inserted in the golem's inventory so that it falls to the ground when the golem dies. This code was very odd - code early on would only let players use the spell, yet the code wass full of player checks. I've presumed that the code that only let players use it was correct, and removed all the other player checks. MSW 2003-01-06
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
0 | spell failure. |
1 | spell was successful. |
Definition at line 2954 of file spell_effect.c.
References add_friendly_object(), add_string(), obj::anim_speed, obj::animation_id, obj::arch, arch_to_object(), AT_PHYSICAL, ATNR_BLIND, ATNR_CONFUSION, ATNR_DEATH, ATNR_DEPLETE, ATNR_FEAR, ATNR_PARALYZE, ATNR_PHYSICAL, ATNR_POISON, ATNR_SLOW, ATNR_TURN_UNDEAD, obj::attacktype, caster_level(), CLEAR_FLAG, archt::clone, liv::Con, obj::contr, control_golem(), obj::count, liv::dam, liv::Dex, obj::direction, draw_ext_info(), draw_ext_info_format(), obj::duration, esrv_update_item(), liv::exp, obj::face, find_free_spot(), find_marked_object(), fix_object(), FLAG_ANIMATE, FLAG_APPLIED, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_REMOVED, FLAG_UNPAID, FLAG_USE_WEAPON, free_string(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_split_ob(), GOLEM, pl::golem_count, liv::hp, insert_ob_in_map(), insert_ob_in_ob(), obj::last_anim, llevError, LOG(), obj::magic, obj::map, obj::materialname, MAX, MAX_BUF, liv::maxgrace, liv::maxhp, obj::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, archt::name, name_to_material(), NDI_BLACK, NDI_UNIQUE, obj::nrof, NROFATTACKS, obj::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, query_name(), obj::race, range_golem, pl::ranges, remove_ob(), obj::resist, _materialtype::save, SET_FLAG, set_owner(), set_spell_skill(), pl::shoottype, snprintf(), liv::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), obj::speed, obj::speed_left, obj::state, obj::stats, liv::Str, obj::type, UPD_NROF, update_ob_speed(), liv::wc, WEAPON, obj::x, and obj::y.
Referenced by cast_spell().
Improve statistics of some living object.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
dir | casting direction. |
0 | spell failed. |
1 | spell was successful. |
Definition at line 1965 of file spell_effect.c.
References liv::ac, add_refcount(), add_string(), AT_PHYSICAL, ATNR_GODPOWER, obj::attacktype, obj::below, change_abil(), create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), obj::duration, find_god(), find_target_for_friendly_spell(), fix_object(), FLAG_APPLIED, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), insert_ob_in_ob(), obj::inv, MIN, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, MSG_TYPE_SPELL_TARGET, obj::name, obj::name_pl, NDI_UNIQUE, NROFATTACKS, obj::path_attuned, obj::race, obj::resist, SET_FLAG, obj::slaying, SP_level_duration_adjust(), obj::speed, obj::speed_left, obj::stats, obj::subtype, obj::type, and liv::wc.
Referenced by cast_spell().
Cast some stat-improving spell.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
dir | casting direction. |
silent | if non zero, don't say when the spell is already is effect. |
0 | spell failed. |
1 | spell was successful. |
Definition at line 1825 of file spell_effect.c.
References liv::ac, add_refcount(), obj::attacktype, obj::below, change_abil(), CLEAR_FLAG, create_archetype(), draw_ext_info(), draw_ext_info_format(), obj::duration, liv::exp, find_target_for_friendly_spell(), FLAG_APPLIED, FLAG_NO_FIX_PLAYER, FLAG_SEE_IN_DARK, FLAG_XRAYS, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), get_attr_value(), liv::hp, insert_ob_in_ob(), obj::inv, obj::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, obj::name_pl, NDI_UNIQUE, no_gain_msgs, NROFATTACKS, NUM_STATS, PLAYER, QUERY_FLAG, obj::race, obj::resist, rndm(), set_attr_value(), SET_FLAG, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::speed, obj::speed_left, obj::stats, store_spell_expiry(), obj::subtype, obj::type, and liv::wc.
Referenced by cast_spell(), and god_intervention().
This changes the light level for the entire map.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
0 | light not affected. |
1 | light changed. |
Definition at line 3183 of file spell_effect.c.
References change_map_light(), liv::dam, draw_ext_info(), obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, and obj::stats.
Referenced by cast_spell().
A spell to make an altar your god's.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
0 | no consecration happened. |
1 | an altar waas consecrated. |
Definition at line 2873 of file spell_effect.c.
References arch_to_object(), obj::below, caster_level(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_archetype(), find_god(), FLAG_IS_FLOOR, HOLY_ALTAR, INS_BELOW_ORIGINATOR, insert_ob_in_map(), obj::level, llevError, LOG(), obj::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, NDI_UNIQUE, QUERY_FLAG, remove_ob(), snprintf(), tolower, obj::type, obj::x, and obj::y.
Referenced by cast_spell().
int cast_create_food | ( | object * | op, |
object * | caster, | ||
object * | spell_ob, | ||
int | dir, | ||
const char * | stringarg | ||
) |
Create food. Allows the choice of what sort of food object to make. If stringarg is NULL, it will create food dependent on level –PeterM
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
dir | casting direction. |
stringarg | optional parameter specifying what kind of items to create. |
0 | no food created. |
food | was created. |
Definition at line 639 of file spell_effect.c.
References cast_create_obj(), archt::clone, copy_object(), draw_ext_info(), DRINK, find_archetype_by_object_type_name(), first_archetype, liv::food, FOOD, get_object(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, archt::next, obj::nrof, SP_level_duration_adjust(), obj::stats, obj::type, and obj::value.
Referenced by cast_spell().
int cast_create_missile | ( | object * | op, |
object * | caster, | ||
object * | spell, | ||
int | dir, | ||
const char * | stringarg | ||
) |
Create a missile (nonmagic - magic +4). Will either create bolts or arrows based on whether a crossbow or bow is equiped. If neither, it defaults to arrows. Sets the plus based on the casters level. It is also settable with the invoke command. If the caster attempts to create missiles with too great a plus, the default is used. The # of arrows created also goes up with level, so if a 30th level mage wants LOTS of arrows, and doesn't care what the plus is he could create nonnmagic arrows, or even -1, etc...
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
stringarg | optional parameter specifying what kind of items to create. |
0 | no missile created. |
missiles | were created. |
Definition at line 525 of file spell_effect.c.
References obj::below, BOW, cast_create_obj(), obj::count, create_archetype(), liv::dam, draw_ext_info_format(), obj::duration, find_archetype(), find_artifactlist(), FLAG_APPLIED, FLAG_IDENTIFIED, free_object(), give_artifact_abilities(), obj::inv, artifactstruct::item, artifactliststruct::items, llevDebug, LOG(), obj::magic, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, NDI_UNIQUE, artifactstruct::next, obj::nrof, pick_up(), PLAYER, QUERY_FLAG, obj::race, SET_FLAG, obj::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), obj::stats, strcasecmp(), obj::type, obj::value, and was_destroyed.
Referenced by cast_spell().
This function cast the spell of town portal for op.
The spell operates in two passes. During the first one a place is marked as a destination for the portal. During the second one, 2 portals are created, one in the position the player cast it and one in the destination place. The portal are synchronized and 2 forces are inserted in the player to destruct the portal next time player creates a new portal pair. This spell has a side effect that it allows people to meet each other in a permanent, private, appartements by making a town portal from it to the town or another public place. So, check if the map is unique and if so return an error
Code by Tchize (david) .del becq@ usa. net
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
0 | spell was insuccessful for some reason. |
1 | spell worked. |
Definition at line 1122 of file spell_effect.c.
References obj::above, add_string(), arch_to_object(), cast_create_obj(), caster_level(), check_inv_recursive(), obj::contr, create_archetype(), Settings::create_home_portals, draw_ext_info(), EXIT_PATH, EXIT_X, EXIT_Y, find_archetype(), FREE_AND_COPY, free_object(), free_string(), insert_ob_in_map(), insert_ob_in_ob(), mapdef::last_reset_time, llevDebug, llevError, Settings::localdir, LOG(), obj::map, MAP_PLAYER_UNIQUE, obj::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, obj::name, obj::name_pl, NDI_NAVY, NDI_UNIQUE, obj::other_arch, mapdef::path, present_arch(), obj::race, ready_map_name(), remove_ob(), settings, obj::slaying, snprintf(), pl::transport, obj::weapontype, obj::x, and obj::y.
Referenced by cast_spell().
Detect magic or invisible items.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
Definition at line 2500 of file spell_effect.c.
References obj::above, ALTAR, obj::anim_speed, obj::animation_id, arch_to_object(), AT_MAGIC, obj::attacktype, obj::below, BOOK, BUTTON, caster_level(), CF_HANDLE, liv::Cha, CLEAR_FLAG, determine_god(), esrv_send_item(), EXIT, obj::face, find_god(), FLAG_ANIMATE, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_IS_FLOOR, FLAG_KNOWN_CURSED, FLAG_KNOWN_MAGICAL, FLAG_MAKE_INVIS, FLAG_MONSTER, FLAG_WIZ, GATE, get_map_flags(), GET_MAP_OB, HOLE, HOLY_ALTAR, insert_ob_in_map(), obj::inv, obj::invisible, is_magical(), obj::last_anim, obj::level, LOCKED_DOOR, obj::map, obj::other_arch, P_OUT_OF_MAP, PLAYER, PREFER_HIGH, QUERY_FLAG, obj::race, random_roll(), obj::range, RUNE, SET_FLAG, SIGN, obj::slaying, SP_level_range_adjust(), SPECIAL_KEY, obj::stats, TELEPORTER, TRAPDOOR, TREASURE, TRIGGER_PEDESTAL, obj::type, WEAPON, obj::x, and obj::y.
Referenced by cast_spell().
Basically destroys earthwalls in the area.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
0 | op isn't a player. |
1 | op is a player. |
Definition at line 882 of file spell_effect.c.
References obj::above, AT_PHYSICAL, FLAG_TEAR_DOWN, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, hit_player(), obj::map, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, SP_level_range_adjust(), obj::type, obj::x, and obj::y.
Referenced by cast_spell().
Heals something.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
Definition at line 1679 of file spell_effect.c.
References AT_BLIND, AT_CONFUSION, AT_DISEASE, AT_POISON, obj::attacktype, cure_disease(), liv::dam, draw_ext_info(), obj::duration, find_archetype(), find_target_for_friendly_spell(), liv::food, FORCE, liv::grace, liv::hp, obj::last_grace, obj::last_sp, liv::maxgrace, liv::maxhp, liv::maxsp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_HEAL, NDI_UNIQUE, PREFER_HIGH, present_arch_in_ob(), present_in_ob_by_name(), random_roll(), liv::sp, and obj::stats.
Referenced by cast_spell(), and god_intervention().
Identifies objects in the players inventory/on the ground.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
0 | nothing was identified. |
1 | at least one object was identified. |
Definition at line 2419 of file spell_effect.c.
References obj::above, obj::below, liv::dam, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), FLAG_IDENTIFIED, GET_MAP_OB, identify(), obj::inv, obj::invisible, obj::map, MAX_BUF, obj::msg, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, need_identify(), ob_describe(), PLAYER, QUERY_FLAG, SP_level_dam_adjust(), spell_effect(), obj::stats, obj::type, UPD_FLAGS, UPD_NAME, obj::x, and obj::y.
Referenced by cast_spell().
Makes the player or character invisible. Note the spells to 'stack', but perhaps in odd ways. the duration for all is cumulative. In terms of invis undead/normal invis, it is the last one cast that will determine if you are invisible to undead or normal monsters. For improved invis, if you cast it with a one of the others, you lose the improved part of it, and the above statement about undead/ normal applies.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
0 | invisibility was already in action. |
1 | op is now invisible. |
Definition at line 821 of file spell_effect.c.
References obj::active_next, active_objects, add_refcount(), obj::contr, draw_ext_info(), obj::duration, obj::enemy, FLAG_MAKE_INVIS, FREE_AND_CLEAR_STR, pl::hidden, pl::invis_race, obj::invisible, makes_invisible_to(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, obj::race, SP_level_duration_adjust(), pl::tmp_invis, obj::type, UP_OBJ_FACE, and update_object().
Referenced by cast_spell().
This alters player's marked item's cursed or blessed status, based on the spell_ob's fields.
op | player casting the spell. |
caster | what object was used to cast the spell. |
spell_ob | spell itself. |
Definition at line 2367 of file spell_effect.c.
References CLEAR_FLAG, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_marked_object(), FLAG_BLESSED, FLAG_CURSED, FLAG_IDENTIFIED, FLAG_KNOWN_BLESSED, FLAG_KNOWN_CURSED, FLAG_STARTEQUIP, HUGE_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, QUERY_FLAG, query_short_name(), SET_FLAG, and UPD_FLAGS.
Referenced by cast_spell().
This is really used mostly for spell fumbles at the like.
op | what is casting this. |
tmp | object to propogate. |
lvl | how nasty should the propagation be. |
Definition at line 55 of file spell_effect.c.
References obj::count, liv::dam, obj::duration, insert_ob_in_map(), obj::level, obj::map, liv::maxhp, obj::range, obj::stats, obj::x, and obj::y.
Referenced by alchemy_failure_effect(), become_follower(), god_examines_priest(), pray_at_altar(), prayer_failure(), and scroll_failure().
Polymorph spell casting.
op | who is casting the spell. |
caster | object used to cast spell. |
spell_ob | spell itself. |
dir | casting direction. 0 won't have any effect. |
Definition at line 453 of file spell_effect.c.
References obj::above, arch_to_object(), obj::below, caster_level(), FLAG_IS_FLOOR, liv::food, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, insert_ob_in_map(), obj::map, MOVE_FLY_LOW, obj::other_arch, P_NO_MAGIC, P_OUT_OF_MAP, polymorph(), QUERY_FLAG, obj::range, SP_level_range_adjust(), obj::speed_left, obj::stats, obj::x, and obj::y.
Referenced by cast_spell().
This spell transfers sp from the player to another person. We let the target go above their normal maximum SP.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
0 | no transfer happened. |
1 | transfer happened. |
Definition at line 2726 of file spell_effect.c.
References obj::above, caster_level(), charge_mana_effect(), liv::dam, draw_ext_info(), FLAG_ALIVE, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_BLACK, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, liv::sp, SP_level_dam_adjust(), obj::stats, obj::x, and obj::y.
Referenced by cast_spell().
wonder is really just a spell that will likely cast another spell.
op | who is casting. |
caster | what is casting. |
dir | casting direction. |
spell_ob | actual spell object. |
Definition at line 997 of file spell_effect.c.
References cast_cone(), cast_spell(), generate_treasure(), obj::level, llevError, LOG(), obj::name, obj::randomitems, rndm(), SP_WONDER, SPELL, obj::subtype, and obj::type.
Referenced by cast_spell(), and scroll_failure().
Word of recall causes the player to return 'home'. we put a force into the player object, so that there is a time delay effect.
op | who is casting. |
caster | what is casting. |
spell_ob | actual spell object. |
0 | op isn't a player. |
1 | word of recall initiated. |
Definition at line 935 of file spell_effect.c.
References add_string(), pl::bed_x, pl::bed_y, obj::contr, create_archetype(), draw_ext_info(), obj::duration, EXIT_PATH, EXIT_X, EXIT_Y, find_obj_by_type_subtype(), FORCE_NAME, insert_ob_in_ob(), llevError, LOG(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, pl::savebed_map, SP_level_duration_adjust(), SP_WORD_OF_RECALL, obj::speed, obj::speed_left, SPELL_EFFECT, obj::subtype, obj::type, and update_ob_speed().
Referenced by cast_spell().
|
static |
Checks if victim has overcharged mana, and if so does some fireball.
victim | who may have overcharged. |
caster_level | caster's (skill) level whose spell did cause the overcharge. |
Definition at line 2669 of file spell_effect.c.
References confuse_living(), create_archetype(), obj::dam_modifier, draw_ext_info(), EXPLODING_FIREBALL, insert_ob_in_map(), obj::map, liv::maxhp, liv::maxsp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_TARGET, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_SPELL, NDI_ORANGE, NDI_UNIQUE, PREFER_LOW, random_roll(), liv::sp, obj::stats, obj::x, and obj::y.
Referenced by cast_transfer().
void counterspell | ( | object * | op, |
int | dir | ||
) |
Nullifies spell effects. Basically, if the object has a magic attacktype, this may nullify it.
op | counterspell object. |
dir | direction it was cast in. |
Definition at line 2795 of file spell_effect.c.
References obj::above, AT_COUNTERSPELL, AT_MAGIC, obj::attacktype, FLAG_MONSTER, liv::food, free_object(), freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, liv::hp, obj::level, obj::map, obj::owner, P_OUT_OF_MAP, QUERY_FLAG, remove_ob(), rndm(), RUNE, obj::speed_left, SPELL_EFFECT, obj::stats, obj::type, obj::x, and obj::y.
Referenced by hit_map().
Create an aura spell object and put it in the player's inventory.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
Definition at line 3213 of file spell_effect.c.
References arch_to_object(), obj::attacktype, caster_level(), liv::dam, draw_ext_info(), obj::duration, insert_ob_in_ob(), obj::level, MSG_TYPE_SPELL, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, obj::other_arch, PLAYER, present_arch_in_ob(), set_owner(), set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), obj::stats, store_spell_expiry(), and obj::type.
Referenced by cast_spell().
Teleport through some doors and space.
op | who is casting. |
caster | what is casting. |
spob | actual spell object. |
dir | casting direction. |
0 | spell failure. |
1 | spell was successful. |
Definition at line 1551 of file spell_effect.c.
References obj::contr, pl::count, draw_ext_info(), FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, insert_ob_in_map(), obj::map, map_newmap_cmd(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_BLOCKSVIEW, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, PLAYER, obj::range, remove_ob(), pl::socket, SP_level_range_adjust(), obj::speed, obj::speed_left, obj::type, obj::x, and obj::y.
Referenced by cast_spell().
This creates magic walls. Really, it can create most any object, within some reason.
op | who is casting. |
caster | what is casting. |
dir | casting direction. |
spell_ob | actual spell object. |
0 | spell failed. |
1 | spell was successful. |
Definition at line 1391 of file spell_effect.c.
References arch_to_object(), obj::attacktype, caster_level(), archt::clone, copy_object(), liv::dam, draw_ext_info(), draw_ext_info_format(), obj::duration, obj::facing, find_archetype(), FLAG_ALIVE, FLAG_BLOCKSVIEW, FLAG_IS_USED_UP, FLAG_TEAR_DOWN, liv::food, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_object(), liv::hp, insert_ob_in_map(), insert_ob_in_ob(), obj::level, llevError, LOG(), obj::map, MAX_BUF, liv::maxhp, obj::move_block, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, obj::name, NDI_UNIQUE, obj::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, obj::race, obj::range, SET_FLAG, set_owner(), set_spell_skill(), snprintf(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SPELL, SPELL_EFFECT, obj::stats, obj::type, update_all_los(), obj::x, and obj::y.
Referenced by cast_spell().
This checks to see if 'pl' is invisible to 'mon'. Does race check, undead check, etc Returns TRUE if mon can't see pl, false otherwise. This doesn't check range, walls, etc. It only checks the racial adjustments, and in fact that pl is invisible.
pl | potentially invisible object. |
mon | who may see pl. |
0 | mon can see pl. |
1 | mon can't see pl. |
Definition at line 774 of file spell_effect.c.
References obj::contr, FLAG_UNDEAD, pl::invis_race, obj::invisible, is_true_undead(), PLAYER, QUERY_FLAG, obj::race, and obj::type.
Referenced by can_see_enemy(), and cast_invisible().
int perceive_self | ( | object * | op | ) |
Living thing wants to know information.
op | who wants information. |
Definition at line 1031 of file spell_effect.c.
References obj::arch, ARCH_DEPLETION, obj::below, change_resist_msg, describe_item(), determine_god(), draw_ext_info(), draw_ext_info_format(), liv::exp, find_archetype(), find_god(), FORCE, get_attr_value(), obj::glow_radius, obj::inv, is_dragon_pl(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PERCEIVE_SELF, obj::name, archt::name, NDI_UNIQUE, NUM_STATS, present_arch_in_ob(), snprintf(), statname, obj::stats, obj::type, and VERY_BIG_BUF.
Referenced by cast_spell().
|
static |
Place gold nuggets on the map.
op | player who is casting the spell. Just used so nuggets are inserted below her. |
m | map to insert to. |
small_nuggets | |
large_nuggets | how many nuggets to place. |
x | |
y | where to place the nuggets. |
Definition at line 2166 of file spell_effect.c.
References copy_object(), get_object(), INS_BELOW_ORIGINATOR, insert_ob_in_map(), obj::map, obj::x, and obj::y.
Referenced by alchemy().
Handles polymorphing an object, living or not. Will avoid some specific items (flying arrows and such).
op | object being polymorphed. |
who | spell caster. |
level | spell level. |
Definition at line 399 of file spell_effect.c.
References obj::arch, FABS, FLAG_ALIVE, FLAG_ANIMATE, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NO_PICK, obj::move_block, PLAYER, polymorph_item(), polymorph_living(), polymorph_melt(), QUERY_FLAG, rndm(), obj::speed, TREASURE, and obj::type.
Referenced by cast_polymorph().
Changes an item to another item of similar type.
who | spell caster. |
op | object being polymorphed. Should be a non living thing. |
level | spell level, required for monster resistance. |
Definition at line 302 of file spell_effect.c.
References archt::clone, copy_object(), FABS, first_archetype, fix_generated_item(), FLAG_NO_DROP, FLAG_STARTEQUIP, liv::food, FOOD, free_object(), get_object(), GT_ENVIRONMENT, INS_NO_MERGE, INS_NO_WALK_ON, insert_ob_in_map(), obj::invisible, llevError, LOG(), obj::magic, obj::map, obj::name, archt::next, obj::nrof, polymorph_melt(), QUERY_FLAG, remove_ob(), RING, rndm(), obj::stats, obj::type, obj::value, obj::x, and obj::y.
Referenced by polymorph().
|
static |
Takes a living object (op) and turns it into another monster of some sort.
op | object to try to polymorph. Should be monster. |
level | level of the polymorph spell. |
Definition at line 173 of file spell_effect.c.
References add_friendly_object(), ATNR_MAGIC, obj::attack_movement, obj::below, CLEAR_FLAG, archt::clone, copy_object(), create_treasure(), did_make_save(), mapdef::difficulty, find_free_spot(), first_archetype, FLAG_APPLIED, FLAG_FRIENDLY, FLAG_MONSTER, free_object(), get_owner(), GT_INVISIBLE, HAS_RANDOM_ITEMS, obj::head, insert_ob_in_map(), obj::inv, obj::level, manual_apply(), obj::map, monster_check_apply(), archt::next, PETMOVE, QUERY_FLAG, obj::randomitems, remove_friendly_object(), remove_ob(), obj::resist, rndm(), SET_FLAG, set_owner(), SIZEOFFREE, SPELL, obj::type, obj::x, and obj::y.
Referenced by polymorph().
Destroys item from polymorph failure
who | who cast the spell. |
op | spell victim. |
Definition at line 272 of file spell_effect.c.
References draw_ext_info_format(), free_object(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_GREY, obj::nrof, play_sound_map(), query_name(), remove_ob(), and SOUND_TYPE_ITEM.
Referenced by polymorph(), and polymorph_item().
Try to get information about a living thing.
op | who is casting. |
caster | what is casting. |
spell_ob | spell object being cast. |
dir | cast direction. |
0 | nothing probed. |
1 | something was probed. |
Definition at line 715 of file spell_effect.c.
References obj::above, draw_ext_info(), examine_monster(), FLAG_ALIVE, FLAG_MONSTER, FLAG_WIZCAST, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, obj::head, obj::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, obj::range, SP_level_range_adjust(), obj::type, obj::x, and obj::y.
Referenced by cast_spell().
Recharge wands.
op | who is casting. |
caster | what is casting. |
spell_ob | spell object. |
0 | nothing happened. |
1 | wand was recharged, or destroyed. |
Definition at line 90 of file spell_effect.c.
References obj::arch, archt::clone, create_archetype(), liv::dam, draw_ext_info(), draw_ext_info_format(), find_marked_object(), FLAG_ANIMATE, liv::food, free_object(), liv::hp, insert_ob_in_map(), obj::inv, obj::level, obj::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, play_sound_map(), PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), remove_ob(), SET_FLAG, SOUND_TYPE_ITEM, SP_level_dam_adjust(), obj::speed, obj::stats, obj::type, update_ob_speed(), WAND, obj::x, and obj::y.
Referenced by cast_spell().
This function removes the cursed/damned status on equipped items.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
Definition at line 2317 of file spell_effect.c.
References obj::below, caster_level(), CLEAR_FLAG, draw_ext_info(), esrv_update_item(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, obj::inv, obj::level, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, obj::type, UPD_FLAGS, and obj::value.
Referenced by cast_spell().
This writes a rune that contains the appropriate message. There really isn't any adjustments we make.
op | who is casting. |
spell | actual spell cast. |
msg | message to write. |
0 | failure. |
1 | success. |
Definition at line 3257 of file spell_effect.c.
References add_string(), arch_to_object(), draw_ext_info(), HUGE_BUF, INS_BELOW_ORIGINATOR, insert_ob_in_map(), llevInfo, LOG(), obj::map, obj::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, obj::name, NDI_UNIQUE, obj::other_arch, obj::race, strcasestr_local(), obj::x, and obj::y.
Referenced by cast_spell().
|
static |
|
static |
Value of nuggets.
Definition at line 2093 of file spell_effect.c.
Referenced by alchemy(), and alchemy_object().
|
static |
This is used for the spells that gain stats. There are no spells right now that icnrease wis/int/pow on a temp basis, so no good comments for those.
Definition at line 1796 of file spell_effect.c.
Referenced by cast_change_ability().
|
static |
Definition at line 2091 of file spell_effect.c.
Referenced by do_tiled_map_picture(), process_map(), and write_world_map().
|
static |
Definition at line 2093 of file spell_effect.c.
Referenced by alchemy(), and alchemy_object().