Crossfire Server, Trunk
|
#include "global.h"
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "living.h"
#include "object.h"
#include "shop.h"
#include "sounds.h"
#include "spells.h"
#include "sproto.h"
#include "assets.h"
#include "AssetsManager.h"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE |
#define | LARGE_NUGGET "largenugget" |
#define | SMALL_NUGGET "smallnugget" |
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 *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 | 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_bless (object *op, 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) |
static void | food_each (archetype *arch) |
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 level) |
int | recharge (object *op, object *caster, object *spell_ob) |
int | remove_curse (object *op, object *caster, object *spell) |
static int | town_portal_destroy_existing (object *op, object *spell) |
static object * | town_portal_find_force (object *op, object *spell) |
int | write_mark (object *op, object *spell, const char *msg) |
Variables | |
static archetype * | food_choice |
static int | food_value_choice |
static const char *const | no_gain_msgs [NUM_STATS] |
Various spell effects, non attacks.
Definition in file spell_effect.cpp.
#define _GNU_SOURCE |
Definition at line 20 of file spell_effect.cpp.
#define LARGE_NUGGET "largenugget" |
Definition at line 2174 of file spell_effect.cpp.
#define SMALL_NUGGET "smallnugget" |
Definition at line 2173 of file spell_effect.cpp.
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 2304 of file spell_effect.cpp.
References alchemy_object(), object::duration, FLAG_ALIVE, FLAG_IS_CAULDRON, FLAG_NO_PICK, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, MOVE_WALK, give::op, P_NO_MAGIC, P_OUT_OF_MAP, place_alchemy_objects(), PLAYER, QUERY_FLAG, SP_level_dam_adjust(), SP_level_duration_adjust(), Ice::tmp, diamondslots::x, and diamondslots::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. |
< Value of nuggets.
Definition at line 2190 of file spell_effect.cpp.
References archetype::clone, disinfect::count, FLAG_UNPAID, FREE_OBJ_NO_DESTROY_CALLBACK, GEM, LARGE_NUGGET, MONEY, altar_valkyrie::obj, object_free(), object_remove(), price_base(), QUERY_FLAG, rndm(), SMALL_NUGGET, try_find_archetype(), and autojail::value.
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 was 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 3063 of file spell_effect.cpp.
References disinfect::a, add_friendly_object(), add_string(), object::anim_speed, object::animation, object::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, buf, caster_level(), CLEAR_FLAG, archetype::clone, living::Con, living::dam, living::Dex, draw_ext_info(), draw_ext_info_format(), object::duration, esrv_update_item(), object::face, 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, GOLEM, make_face_from_files::int, object::last_anim, llevError, LOG(), m, object::magic, MAX, MAX_BUF, living::maxgrace, object::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, object::name, archetype::name, name_to_material(), NDI_BLACK, NDI_UNIQUE, object::nrof, NROFATTACKS, object_find_free_spot(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_owner(), object_split(), object_update_speed(), give::op, object::other_arch, P_OUT_OF_MAP, pets_control_golem(), PLAYER, QUERY_FLAG, query_name(), object::race, range_golem, materialtype_t::save, SET_FLAG, set_spell_skill(), living::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::state, object::stats, living::Str, Ice::tmp, object::type, UPD_NROF, WEAPON, diamondslots::x, and diamondslots::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 2048 of file spell_effect.cpp.
References living::ac, add_refcount(), add_string(), arch_to_object(), AT_PHYSICAL, ATNR_GODPOWER, object::attacktype, change_abil(), create_archetype(), determine_god(), draw_ext_info(), draw_ext_info_format(), object::duration, find_god(), find_target_for_friendly_spell(), FLAG_APPLIED, FOR_INV_FINISH, FOR_INV_PREPARE, dragon_attune::force, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), INS_ON_TOP, MIN, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, MSG_TYPE_SPELL_TARGET, object::name, NDI_UNIQUE, NROFATTACKS, object_insert_in_map_at(), object_insert_in_ob(), give::op, object::other_arch, object::path_attuned, object::race, object::resist, SET_FLAG, object::slaying, SP_level_duration_adjust(), object::stats, store_spell_expiry(), Ice::tmp, and living::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 1900 of file spell_effect.cpp.
References living::ac, add_refcount(), arch_to_object(), object::attacktype, change_abil(), CLEAR_FLAG, create_archetype(), draw_ext_info(), draw_ext_info_format(), object::duration, living::exp, find_target_for_friendly_spell(), FLAG_APPLIED, FLAG_NO_FIX_PLAYER, FLAG_SEE_IN_DARK, FLAG_XRAYS, FOR_INV_FINISH, FOR_INV_PREPARE, dragon_attune::force, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), get_attr_value(), living::hp, INS_ON_TOP, object::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, NDI_UNIQUE, no_gain_msgs, NROFATTACKS, NUM_STATS, object_insert_in_map_at(), object_insert_in_ob(), give::op, object::other_arch, PLAYER, QUERY_FLAG, object::race, object::resist, rndm(), set_attr_value(), SET_FLAG, SP_level_dam_adjust(), SP_level_duration_adjust(), object::stats, store_spell_expiry(), Ice::tmp, and living::wc.
Referenced by cast_spell(), and god_intervention().
This changes the light level for the entire map.
op | who is casting. |
spell | actual spell object. |
0 | light not affected. |
1 | light changed. |
Definition at line 3293 of file spell_effect.cpp.
References change_map_light(), living::dam, draw_ext_info(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, give::op, and object::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 2985 of file spell_effect.cpp.
References arch_to_object(), buf, caster_level(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_god(), FLAG_IS_BUILDABLE, FLAG_IS_FLOOR, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, HOLY_ALTAR, INS_BELOW_ORIGINATOR, object::level, llevError, LOG(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, NDI_UNIQUE, object_insert_in_map_at(), object_remove(), give::op, QUERY_FLAG, SET_FLAG, Ice::tmp, tolower, and try_find_archetype().
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 627 of file spell_effect.cpp.
References archetypes_for_each(), cast_create_obj(), archetype::clone, draw_ext_info(), DRINK, find_archetype_by_object_type_name(), living::food, FOOD, food_choice, food_each(), food_value_choice, identify(), is_identified(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, object::nrof, object_copy(), object_new(), give::op, SP_level_duration_adjust(), object::stats, and object::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 493 of file spell_effect.cpp.
References BOW, cast_create_obj(), object::count, create_archetype(), living::dam, draw_ext_info_format(), object::duration, find_artifactlist(), FLAG_IDENTIFIED, FREE_OBJ_NO_DESTROY_CALLBACK, give_artifact_abilities(), artifact::item, artifactlist::items, llevDebug, LOG(), object::magic, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, object::nrof, object_find_by_type_applied(), object_free(), object_was_destroyed, give::op, pick_up(), PLAYER, SET_FLAG, object::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), object::stats, CFweardisguise::tag, Ice::tmp, try_find_archetype(), object::type, and object::value.
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, apartments 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. |
0 | spell was insuccessful for some reason. |
1 | spell worked. |
Definition at line 1241 of file spell_effect.cpp.
References add_string(), ARCH_PORTAL_FAILED, cast_create_obj(), caster_level(), create_archetype(), Settings::create_home_portals, draw_ext_info(), EXIT_PATH, EXIT_X, EXIT_Y, dragon_attune::force, FREE_AND_COPY, HUGE_BUF, mapstruct::last_reset_time, llevError, LOG(), map_path_unique(), MAP_PLAYER_UNIQUE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, object::name_pl, NDI_NAVY, NDI_UNIQUE, object_free(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_msg(), give::op, object::race, ready_map_name(), settings, object::slaying, Ice::tmp, town_portal_destroy_existing(), town_portal_find_force(), diamondslots::x, and diamondslots::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 2578 of file spell_effect.cpp.
References ALTAR, archininventory::arch, object::arch, arch_to_object(), AT_MAGIC, BOOK, BUTTON, caster_level(), CF_HANDLE, CLEAR_FLAG, archetype::clone, determine_god(), esrv_send_item(), EXIT, find_god(), FLAG_ANIMATE, FLAG_CURSED, FLAG_DAMNED, FLAG_IS_FLOOR, FLAG_KNOWN_CURSED, FLAG_KNOWN_MAGICAL, FLAG_MAKE_INVIS, FLAG_MONSTER, FLAG_WIZ, object::flags, living::food, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, FREE_AND_COPY, GATE, get_map_flags(), object::glow_radius, HEAD, HOLE, HOLY_ALTAR, object::invisible, is_magical(), object::last_anim, level, LOCKED_DOOR, m, object::map_layer, object::more, object::move_allow, object::move_block, object::move_type, object::name, object_create_arch(), object_insert_in_map_at(), object_update_speed(), give::op, object::other_arch, P_OUT_OF_MAP, PLAYER, PREFER_HIGH, QUERY_FLAG, object::race, random_roll(), object::range, archetype::reference_count, RUNE, SET_FLAG, SIGN, object::slaying, SP_level_range_adjust(), SPECIAL_KEY, object::speed, object::speed_left, object::stats, TELEPORTER, Ice::tmp, TRAPDOOR, TREASURE, TRIGGER_PEDESTAL, object::type, WEAPON, object::weight, diamondslots::x, and diamondslots::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 855 of file spell_effect.cpp.
References AT_PHYSICAL, FLAG_TEAR_DOWN, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_player(), m, give::op, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, object::range, SP_level_range_adjust(), and Ice::tmp.
Referenced by cast_spell().
Heals something.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
dir | casting direction. |
Definition at line 1745 of file spell_effect.cpp.
References arch_present_in_ob(), arch_to_object(), AT_BLIND, AT_CONFUSION, AT_DISEASE, AT_POISON, object::attacktype, cure_disease(), living::dam, draw_ext_info(), object::duration, find_target_for_friendly_spell(), living::food, FORCE, living::grace, living::hp, INS_ON_TOP, object::last_grace, object::last_sp, object::map, MAX_FOOD, living::maxgrace, living::maxhp, living::maxsp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_HEAL, NDI_UNIQUE, object_insert_in_map_at(), object_present_in_ob_by_name(), give::op, object::other_arch, PLAYER, PREFER_HIGH, random_roll(), object::skill, living::sp, object::stats, try_find_archetype(), object::type, object::x, and object::y.
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 2503 of file spell_effect.cpp.
References living::dam, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, identify(), is_identified(), MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, ob_describe(), give::op, PLAYER, SP_level_dam_adjust(), spell_effect(), object::stats, Ice::tmp, UPD_FLAGS, and UPD_NAME.
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 803 of file spell_effect.cpp.
References add_refcount(), draw_ext_info(), object::duration, FLAG_MAKE_INVIS, FREE_AND_CLEAR_STR, makes_invisible_to(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, object_update(), give::op, PLAYER, QUERY_FLAG, object::race, SP_level_duration_adjust(), and UP_OBJ_FACE.
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. |
spell_ob | spell itself. |
Definition at line 2452 of file spell_effect.cpp.
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, positioning_system::marked, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, give::name, NDI_UNIQUE, give::op, QUERY_FLAG, query_short_name(), SET_FLAG, and UPD_FLAGS.
Referenced by cast_spell().
This is really used mostly for spell fumbles and the like.
op | what is casting this. |
tmp | object to propagate. |
lvl | how nasty should the propagation be. |
Definition at line 49 of file spell_effect.cpp.
References object_insert_in_map_at(), give::op, and Ice::tmp.
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 425 of file spell_effect.cpp.
References arch_to_object(), caster_level(), FLAG_IS_FLOOR, living::food, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, level, m, MOVE_FLY_LOW, object_insert_in_map_at(), give::op, object::other_arch, P_NO_MAGIC, P_OUT_OF_MAP, polymorph(), QUERY_FLAG, object::range, SP_level_range_adjust(), object::speed_left, object::stats, Ice::tmp, diamondslots::x, and diamondslots::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 2836 of file spell_effect.cpp.
References caster_level(), charge_mana_effect(), living::dam, draw_ext_info(), FLAG_ALIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_BLACK, give::op, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, living::sp, SP_level_dam_adjust(), object::stats, Ice::tmp, diamondslots::x, and diamondslots::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 968 of file spell_effect.cpp.
References cast_cone(), cast_spell(), generate_treasure(), object::level, llevError, LOG(), object::name, give::op, object::randomitems, rndm(), SP_WONDER, SPELL, object::subtype, and object::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 906 of file spell_effect.cpp.
References add_string(), create_archetype(), draw_ext_info(), object::duration, EXIT_PATH, EXIT_X, EXIT_Y, FORCE_NAME, llevError, LOG(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, object_find_by_type_subtype(), object_insert_in_ob(), object_update_speed(), give::op, PLAYER, SP_level_duration_adjust(), SP_WORD_OF_RECALL, object::speed, object::speed_left, SPELL_EFFECT, object::subtype, object::type, and nlohmann::detail::void().
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 2781 of file spell_effect.cpp.
References caster_level(), confuse_living(), create_archetype(), draw_ext_info(), EXPLODING_FIREBALL, MSG_TYPE_SPELL, MSG_TYPE_SPELL_TARGET, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_SPELL, NDI_ORANGE, NDI_UNIQUE, object_insert_in_map_at(), PREFER_LOW, random_roll(), Ice::tmp, and sword_of_souls::victim.
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 2909 of file spell_effect.cpp.
References AT_COUNTERSPELL, AT_MAGIC, object::attacktype, FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, living::hp, object::level, m, object_free(), object_get_owner(), object_remove(), give::op, P_OUT_OF_MAP, QUERY_FLAG, rndm(), RUNE, SPELL_EFFECT, object::stats, Ice::tmp, and object::type.
Referenced by hit_map().
Create an aura spell object and put it in the player's inventory. This is also used for elemental shields - the creation is the same just the 'move' code is different.
op | who is casting. |
caster | what is casting. |
spell | actual spell object. |
Definition at line 3325 of file spell_effect.cpp.
References add_refcount(), arch_present_in_ob(), arch_to_object(), object::attacktype, caster_level(), change_abil(), create_archetype(), living::dam, draw_ext_info(), object::duration, fix_object(), FLAG_APPLIED, dragon_attune::force, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), object::level, MAX, MSG_TYPE_SPELL, MSG_TYPE_SPELL_SUCCESS, object::name, NDI_UNIQUE, NROFATTACKS, object_insert_in_ob(), object_present_in_ob_by_name(), object_set_owner(), give::op, object::other_arch, PLAYER, object::range, object::resist, SET_FLAG, set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::speed, object::stats, and store_spell_expiry().
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 1609 of file spell_effect.cpp.
References draw_ext_info(), FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, m, map_newmap_cmd(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, ob_apply(), OB_TYPE_MOVE_BLOCK, object_insert_in_map_at(), object_remove(), give::op, P_BLOCKSVIEW, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, PLAYER, player_update_bg_music(), object::range, SP_level_range_adjust(), and TRANSPORT.
Referenced by cast_spell().
|
static |
Definition at line 595 of file spell_effect.cpp.
References archininventory::arch, archetype::clone, DRINK, living::food, FOOD, food_choice, food_value_choice, and object::stats.
Referenced by cast_create_food().
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 1456 of file spell_effect.cpp.
References arch_to_object(), object::attacktype, caster_level(), archetype::clone, living::dam, draw_ext_info(), draw_ext_info_format(), object::duration, FLAG_ALIVE, FLAG_BLOCKSVIEW, FLAG_IS_USED_UP, FLAG_TEAR_DOWN, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, llevError, LOG(), m, MAX_BUF, object::move_block, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, give::name, object::name, NDI_UNIQUE, object_copy(), object_insert_in_map_at(), object_insert_in_ob(), object_new(), object_set_owner(), give::op, object::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, object::race, object::range, SET_FLAG, set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SPELL, SPELL_EFFECT, object::stats, Ice::tmp, try_find_archetype(), object::type, update_all_los(), diamondslots::x, and diamondslots::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 756 of file spell_effect.cpp.
References FLAG_UNDEAD, is_true_undead(), mon, altar_valkyrie::pl, PLAYER, QUERY_FLAG, and object::race.
Referenced by cast_invisible(), and monster_can_see_enemy().
int perceive_self | ( | object * | op | ) |
Living thing wants to know information.
op | who wants information. |
Definition at line 1002 of file spell_effect.cpp.
References ARCH_DEPLETION, arch_present_in_ob(), atnr_is_dragon_enabled(), buf, change_resist_msg, describe_item(), determine_god(), draw_ext_info(), draw_ext_info_format(), find_god(), FORCE, get_attr_value(), is_dragon_pl(), levels, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PERCEIVE_SELF, object::name, NDI_UNIQUE, NROFATTACKS, NUM_STATS, object_find_by_type_and_arch_name(), give::op, SIGN, statname, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_finish(), stringbuffer_new(), Ice::tmp, and try_find_archetype().
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 2268 of file spell_effect.cpp.
References create_archetype(), INS_BELOW_ORIGINATOR, LARGE_NUGGET, m, object_insert_in_map_at(), give::op, SMALL_NUGGET, Ice::tmp, diamondslots::x, and diamondslots::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 371 of file spell_effect.cpp.
References FABS, FLAG_ALIVE, FLAG_ANIMATE, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NO_PICK, give::op, PLAYER, polymorph_item(), polymorph_living(), polymorph_melt(), QUERY_FLAG, rndm(), Ice::tmp, TREASURE, and autojail::who.
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 280 of file spell_effect.cpp.
References AssetsManager::archetypes(), archetype::clone, AssetsCollection< T, Key >::each(), FABS, fix_generated_item(), FLAG_NO_DROP, FLAG_STARTEQUIP, FOOD, FREE_OBJ_NO_DESTROY_CALLBACK, getManager(), GT_ENVIRONMENT, INS_NO_MERGE, INS_NO_WALK_ON, object::invisible, llevError, LOG(), m, object::name, object::nrof, object_copy(), object_free(), object_insert_in_map_at(), object_new(), object_remove(), give::op, polymorph_melt(), QUERY_FLAG, RING, rndm(), object::type, object::value, autojail::who, diamondslots::x, and diamondslots::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 162 of file spell_effect.cpp.
References add_friendly_object(), apply_manual(), AssetsManager::archetypes(), ATNR_MAGIC, object::attack_movement, CLEAR_FLAG, create_treasure(), did_make_save(), AssetsCollection< T, Key >::each(), FLAG_APPLIED, FLAG_FRIENDLY, FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, FREE_OBJ_FREE_INVENTORY, FREE_OBJ_NO_DESTROY_CALLBACK, freearr_x, freearr_y, getManager(), GT_INVISIBLE, HAS_RANDOM_ITEMS, HEAD, disinfect::map, monster_check_apply_all(), object_create_arch(), object_find_first_free_spot(), object_free(), object_get_owner(), object_insert_in_map_at(), object_remove(), object_set_owner(), give::op, PETMOVE, QUERY_FLAG, object::randomitems, remove_friendly_object(), rndm(), SET_FLAG, SPELL, Ice::tmp, diamondslots::x, and diamondslots::y.
Referenced by polymorph().
Destroys item from polymorph failure
who | who cast the spell. |
op | spell victim. |
Definition at line 252 of file spell_effect.cpp.
References draw_ext_info_format(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, give::name, NDI_GREY, object_free(), object_remove(), give::op, play_sound_map(), query_name(), SOUND_TYPE_ITEM, and autojail::who.
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. |
level | probe level. |
0 | nothing probed. |
1 | something was probed. |
Definition at line 699 of file spell_effect.cpp.
References CAN_PROBE(), draw_ext_info(), examine_monster(), FLAG_WIZCAST, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, m, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, give::op, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, QUERY_FLAG, ring_occidental_mages::r, object::range, SP_level_range_adjust(), Ice::tmp, diamondslots::x, and diamondslots::y.
Referenced by cast_spell(), check_probe(), and examine_monster().
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 84 of file spell_effect.cpp.
References object::arch, archetype::clone, create_archetype(), living::dam, draw_ext_info(), draw_ext_info_format(), find_marked_object(), FLAG_ANIMATE, living::food, object::inv, object::level, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, give::name, NDI_UNIQUE, object_free(), object_insert_in_map_at(), object_remove(), object_update_speed(), give::op, play_sound_map(), PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), SET_FLAG, SOUND_TYPE_ITEM, SP_level_dam_adjust(), object::speed, object::stats, Ice::tmp, object::type, and WAND.
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 2404 of file spell_effect.cpp.
References caster_level(), CLEAR_FLAG, draw_ext_info(), esrv_update_item(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, FOR_INV_FINISH, FOR_INV_PREPARE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, give::op, PLAYER, QUERY_FLAG, Ice::tmp, and UPD_FLAGS.
Referenced by cast_spell().
Remove op's existing town portals. Returns 0 on success.
Definition at line 1149 of file spell_effect.cpp.
References archininventory::arch, check_inv_recursive(), create_archetype(), draw_ext_info(), EXIT_X, EXIT_Y, FOR_OB_AND_ABOVE_FINISH, FOR_OB_AND_ABOVE_PREPARE, FREE_OBJ_FREE_INVENTORY, FREE_OBJ_NO_DESTROY_CALLBACK, llevDebug, llevError, LOG(), map_find_by_archetype(), map_path_unique(), MAP_PLAYER_UNIQUE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, object::name, NDI_UNIQUE, object_free(), object_remove(), give::op, object::race, ready_map_name(), object::slaying, Ice::tmp, and try_find_archetype().
Referenced by cast_create_town_portal().
Definition at line 1110 of file spell_effect.cpp.
References add_string(), arch_to_object(), check_inv_recursive(), draw_ext_info(), EXIT_X, EXIT_Y, dragon_attune::force, FREE_OBJ_NO_DESTROY_CALLBACK, free_string(), llevError, LOG(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_SUCCESS, object::name, NDI_NAVY, NDI_UNIQUE, object_free(), object_insert_in_ob(), give::op, object::other_arch, and object::weapontype.
Referenced by cast_create_town_portal().
This writes a rune that contains the appropriate message. There really aren't any adjustments we make.
op | who is casting. |
spell | actual spell cast. |
msg | message to write. |
0 | failure. |
1 | success. |
Definition at line 3411 of file spell_effect.cpp.
References add_string(), arch_to_object(), draw_ext_info(), HUGE_BUF, INS_BELOW_ORIGINATOR, llevInfo, LOG(), navar-midane_pickup::msg, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, object_insert_in_map_at(), object_set_msg(), give::op, object::other_arch, strcasestr_local, and Ice::tmp.
Referenced by cast_spell().
|
static |
Definition at line 593 of file spell_effect.cpp.
Referenced by cast_create_food(), and food_each().
|
static |
Definition at line 594 of file spell_effect.cpp.
Referenced by cast_create_food(), and food_each().
|
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 1871 of file spell_effect.cpp.
Referenced by cast_change_ability().