Angband
Data Structures | Macros | Typedefs | Functions | Variables
effects.c File Reference

Handler and auxiliary functions for every effect in the game. More...

#include "angband.h"
#include "cave.h"
#include "effects.h"
#include "game-input.h"
#include "generate.h"
#include "init.h"
#include "mon-desc.h"
#include "mon-lore.h"
#include "mon-make.h"
#include "mon-msg.h"
#include "mon-predicate.h"
#include "mon-spell.h"
#include "mon-summon.h"
#include "mon-util.h"
#include "mon-timed.h"
#include "obj-chest.h"
#include "obj-curse.h"
#include "obj-desc.h"
#include "obj-gear.h"
#include "obj-ignore.h"
#include "obj-knowledge.h"
#include "obj-make.h"
#include "obj-pile.h"
#include "obj-power.h"
#include "obj-tval.h"
#include "obj-util.h"
#include "player-calcs.h"
#include "player-history.h"
#include "player-spell.h"
#include "player-timed.h"
#include "player-util.h"
#include "project.h"
#include "source.h"
#include "target.h"
#include "trap.h"
#include "list-effects.h"

Data Structures

struct  effect_handler_context_s
 

Structures and helper functions for effects

More...
 
struct  effect_kind
 Structure for effects. More...
 

Macros

#define ENCH_TOHIT   0x01
 Bit flags for the enchant() function. More...
 
#define ENCH_TODAM   0x02
 
#define ENCH_TOBOTH   0x03
 
#define ENCH_TOAC   0x04
 
#define F(x)   effect_handler_##x
 
#define EFFECT(x, a, b, c, d, e)   { EF_##x, a, b, F(x), e },
 
#define EFFECT(x, a, b, c, d, e)   #x,
 

Typedefs

typedef struct effect_handler_context_s effect_handler_context_t
 

Structures and helper functions for effects

More...
 
typedef bool(* effect_handler_f) (effect_handler_context_t *)
 

Functions

static const char * desc_stat (int stat, bool positive)
 Stat adjectives. More...
 
int effect_calculate_value (effect_handler_context_t *context, bool use_boost)
 
static void get_target (struct source origin, int dir, int *ty, int *tx, int *flags)
 
static struct monstermonster_target_monster (effect_handler_context_t *context)
 Check for monster targeting another monster. More...
 
static bool project_aimed (struct source origin, int typ, int dir, int dam, int flg, const struct object *obj)
 Apply the project() function in a direction, or at a target. More...
 
static bool project_touch (int dam, int rad, int typ, bool aware, const struct object *obj)
 Apply the project() function to grids around the target. More...
 
static bool item_tester_uncursable (const struct object *obj)
 Selects items that have at least one removable curse. More...
 
static void remove_object_curse (struct object *obj, int index, bool message)
 Removes an individual curse from an object. More...
 
static bool uncurse_object (struct object *obj, int strength, char *dice_string)
 Attempts to remove a curse from an object. More...
 
static bool item_tester_unknown (const struct object *obj)
 Selects items that have at least one unknown rune. More...
 
static bool item_tester_hook_weapon (const struct object *obj)
 Hook to specify "weapon". More...
 
static bool item_tester_hook_armour (const struct object *obj)
 Hook to specify "armour". More...
 
static bool enchant_score (s16b *score, bool is_artifact)
 Tries to increase an items bonus score, if possible. More...
 
static bool enchant2 (struct object *obj, s16b *score)
 Helper function for enchant() which tries increasing an item's bonuses. More...
 
bool enchant (struct object *obj, int n, int eflag)
 Enchant an item. More...
 
bool enchant_spell (int num_hit, int num_dam, int num_ac)
 Enchant an item (in the inventory or on the floor) Note that "num_ac" requires armour, else weapon Returns true if attempted, false if cancelled. More...
 
void brand_object (struct object *obj, const char *name)
 Brand weapons (or ammo) More...
 
static bool item_tester_hook_recharge (const struct object *obj)
 Hook for "get_item()". More...
 
static bool item_tester_hook_ammo (const struct object *obj)
 Hook to specify "ammo". More...
 
static bool item_tester_hook_bolt (const struct object *obj)
 Hook to specify bolts. More...
 
bool effect_handler_RANDOM (effect_handler_context_t *context)
 

Effect handlers

More...
 
bool effect_handler_DAMAGE (effect_handler_context_t *context)
 Deal damage from the current monster or trap to the player. More...
 
bool effect_handler_HEAL_HP (effect_handler_context_t *context)
 Heal the player by a given percentage of their wounds, or a minimum amount, whichever is larger. More...
 
bool effect_handler_MON_HEAL_HP (effect_handler_context_t *context)
 Monster self-healing. More...
 
bool effect_handler_MON_HEAL_KIN (effect_handler_context_t *context)
 Monster healing of kin. More...
 
bool effect_handler_NOURISH (effect_handler_context_t *context)
 Feed the player. More...
 
bool effect_handler_CRUNCH (effect_handler_context_t *context)
 
bool effect_handler_CURE (effect_handler_context_t *context)
 Cure a player status condition. More...
 
bool effect_handler_TIMED_SET (effect_handler_context_t *context)
 Set a (positive or negative) player status condition. More...
 
bool effect_handler_TIMED_INC (effect_handler_context_t *context)
 Extend a (positive or negative) player status condition. More...
 
bool effect_handler_TIMED_INC_NO_RES (effect_handler_context_t *context)
 Extend a (positive or negative) player status condition unresistably. More...
 
bool effect_handler_MON_TIMED_INC (effect_handler_context_t *context)
 Extend a (positive or negative) monster status condition. More...
 
bool effect_handler_TIMED_DEC (effect_handler_context_t *context)
 Reduce a (positive or negative) player status condition. More...
 
bool effect_handler_SET_NOURISH (effect_handler_context_t *context)
 Make the player, um, lose food. More...
 
bool effect_handler_GLYPH (effect_handler_context_t *context)
 Create a glyph. More...
 
bool effect_handler_RESTORE_STAT (effect_handler_context_t *context)
 Restore a stat; the stat index is context->subtype. More...
 
bool effect_handler_DRAIN_STAT (effect_handler_context_t *context)
 Drain a stat temporarily. More...
 
bool effect_handler_LOSE_RANDOM_STAT (effect_handler_context_t *context)
 Lose a stat point permanently, in a stat other than the one specified in context->subtype. More...
 
bool effect_handler_GAIN_STAT (effect_handler_context_t *context)
 Gain a stat point. More...
 
bool effect_handler_RESTORE_EXP (effect_handler_context_t *context)
 Restores any drained experience. More...
 
bool effect_handler_GAIN_EXP (effect_handler_context_t *context)
 
bool effect_handler_LOSE_EXP (effect_handler_context_t *context)
 
bool effect_handler_DRAIN_LIGHT (effect_handler_context_t *context)
 Drain some light from the player's light source, if possible. More...
 
bool effect_handler_DRAIN_MANA (effect_handler_context_t *context)
 Drain mana from the player, healing the caster. More...
 
bool effect_handler_RESTORE_MANA (effect_handler_context_t *context)
 
bool effect_handler_REMOVE_CURSE (effect_handler_context_t *context)
 Attempt to uncurse an object. More...
 
bool effect_handler_RECALL (effect_handler_context_t *context)
 Set word of recall as appropriate. More...
 
bool effect_handler_DEEP_DESCENT (effect_handler_context_t *context)
 
bool effect_handler_ALTER_REALITY (effect_handler_context_t *context)
 
bool effect_handler_MAP_AREA (effect_handler_context_t *context)
 Map an area around a point, usually the player. More...
 
bool effect_handler_READ_MINDS (effect_handler_context_t *context)
 Map an area around the recently detected monsters. More...
 
bool effect_handler_DETECT_TRAPS (effect_handler_context_t *context)
 Detect traps around the player. More...
 
bool effect_handler_DETECT_DOORS (effect_handler_context_t *context)
 Detect doors around the player. More...
 
bool effect_handler_DETECT_STAIRS (effect_handler_context_t *context)
 Detect stairs around the player. More...
 
bool effect_handler_DETECT_GOLD (effect_handler_context_t *context)
 Detect buried gold around the player. More...
 
bool effect_handler_SENSE_OBJECTS (effect_handler_context_t *context)
 Sense objects around the player. More...
 
bool effect_handler_DETECT_OBJECTS (effect_handler_context_t *context)
 Detect objects around the player. More...
 
static bool detect_monsters (int y_dist, int x_dist, monster_predicate pred)
 Detect monsters which satisfy the given predicate around the player. More...
 
bool effect_handler_DETECT_LIVING_MONSTERS (effect_handler_context_t *context)
 Detect living monsters around the player. More...
 
bool effect_handler_DETECT_VISIBLE_MONSTERS (effect_handler_context_t *context)
 Detect visible monsters around the player; note that this means monsters which are in principle visible, not monsters the player can currently see. More...
 
bool effect_handler_DETECT_INVISIBLE_MONSTERS (effect_handler_context_t *context)
 Detect invisible monsters around the player. More...
 
bool effect_handler_DETECT_EVIL (effect_handler_context_t *context)
 Detect evil monsters around the player. More...
 
bool effect_handler_DETECT_SOUL (effect_handler_context_t *context)
 Detect monsters possessing a spirit around the player. More...
 
bool effect_handler_IDENTIFY (effect_handler_context_t *context)
 Identify an unknown rune of an item. More...
 
bool effect_handler_CREATE_STAIRS (effect_handler_context_t *context)
 Create stairs at the player location. More...
 
bool effect_handler_DISENCHANT (effect_handler_context_t *context)
 Apply disenchantment to the player's stuff. More...
 
bool effect_handler_ENCHANT (effect_handler_context_t *context)
 Enchant an item (in the inventory or on the floor) Note that armour, to hit or to dam is controlled by context->subtype. More...
 
bool effect_handler_RECHARGE (effect_handler_context_t *context)
 Recharge a wand or staff from the pack or on the floor. More...
 
bool effect_handler_PROJECT_LOS (effect_handler_context_t *context)
 Apply a "project()" directly to all viewable monsters. More...
 
bool effect_handler_PROJECT_LOS_AWARE (effect_handler_context_t *context)
 Just like PROJECT_LOS except the player's awareness of an object using this effect is relevant. More...
 
bool effect_handler_ACQUIRE (effect_handler_context_t *context)
 
bool effect_handler_WAKE (effect_handler_context_t *context)
 Wake up all monsters in line of sight. More...
 
bool effect_handler_SUMMON (effect_handler_context_t *context)
 Summon context->value monsters of context->subtype type. More...
 
bool effect_handler_BANISH (effect_handler_context_t *context)
 

Delete all non-unique monsters of a given "type" from the level

Warning - this function assumes that the entered monster symbol is an ASCII

character, which may not be true in the future - NRM

More...
 
bool effect_handler_MASS_BANISH (effect_handler_context_t *context)
 Delete all nearby (non-unique) monsters. More...
 
bool effect_handler_PROBE (effect_handler_context_t *context)
 Probe nearby monsters. More...
 
bool effect_handler_TELEPORT (effect_handler_context_t *context)
 Teleport player or monster up to context->value.base grids away. More...
 
bool effect_handler_TELEPORT_TO (effect_handler_context_t *context)
 Teleport player or target monster to a grid near the given location Setting context->y and context->x treats them as y and x coordinates. More...
 
bool effect_handler_TELEPORT_LEVEL (effect_handler_context_t *context)
 Teleport the player one level up or down (random when legal) More...
 
bool effect_handler_RUBBLE (effect_handler_context_t *context)
 The rubble effect. More...
 
bool effect_handler_DESTRUCTION (effect_handler_context_t *context)
 The destruction effect. More...
 
bool effect_handler_EARTHQUAKE (effect_handler_context_t *context)
 Induce an earthquake of the radius context->radius centred on the instigator. More...
 
bool effect_handler_LIGHT_LEVEL (effect_handler_context_t *context)
 
bool effect_handler_DARKEN_LEVEL (effect_handler_context_t *context)
 
bool effect_handler_LIGHT_AREA (effect_handler_context_t *context)
 Call light around the player. More...
 
bool effect_handler_DARKEN_AREA (effect_handler_context_t *context)
 Call darkness around the player or target monster. More...
 
bool effect_handler_SPOT (effect_handler_context_t *context)
 Project from the player's grid at the player, act as a ball Affect the player, grids, objects, and monsters. More...
 
bool effect_handler_SPHERE (effect_handler_context_t *context)
 Project from the player's grid, act as a ball Affect grids, objects, and monsters. More...
 
bool effect_handler_BALL (effect_handler_context_t *context)
 Cast a ball spell Stop if we hit a monster or the player, act as a ball Allow target mode to pass over monsters Affect grids, objects, and monsters. More...
 
bool effect_handler_BREATH (effect_handler_context_t *context)
 Breathe an element, in a cone from the breather Affect grids, objects, and monsters context->subtype is element, context->other degrees of arc If context->radius is set it is radius of breath, but it usually isn't. More...
 
bool effect_handler_ARC (effect_handler_context_t *context)
 Cast an arc-shaped spell. More...
 
bool effect_handler_SHORT_BEAM (effect_handler_context_t *context)
 Cast an defined length beam spell. More...
 
bool effect_handler_SWARM (effect_handler_context_t *context)
 Cast multiple non-jumping ball spells at the same target. More...
 
bool effect_handler_STRIKE (effect_handler_context_t *context)
 Strike the target with a ball from above. More...
 
bool effect_handler_STAR (effect_handler_context_t *context)
 Cast a line spell in every direction Stop if we hit a monster, act as a ball Affect grids, objects, and monsters. More...
 
bool effect_handler_STAR_BALL (effect_handler_context_t *context)
 Cast a ball spell in every direction Stop if we hit a monster, act as a ball Affect grids, objects, and monsters. More...
 
bool effect_handler_BOLT (effect_handler_context_t *context)
 Cast a bolt spell Stop if we hit a monster, as a bolt Affect monsters (not grids or objects) More...
 
bool effect_handler_BEAM (effect_handler_context_t *context)
 Cast a beam spell Pass through monsters, as a beam Affect monsters (not grids or objects) More...
 
bool effect_handler_BOLT_OR_BEAM (effect_handler_context_t *context)
 Cast a bolt spell, or rarely, a beam spell context->other is used as any adjustment to the regular beam chance. More...
 
bool effect_handler_LINE (effect_handler_context_t *context)
 Cast a line spell Pass through monsters, as a beam Affect monsters and grids (not objects) More...
 
bool effect_handler_ALTER (effect_handler_context_t *context)
 Cast an alter spell Affect objects and grids (not monsters) More...
 
bool effect_handler_BOLT_STATUS (effect_handler_context_t *context)
 Cast a bolt spell Stop if we hit a monster, as a bolt Affect monsters (not grids or objects) Like BOLT, but only identifies on noticing an effect. More...
 
bool effect_handler_BOLT_STATUS_DAM (effect_handler_context_t *context)
 Cast a bolt spell Stop if we hit a monster, as a bolt Affect monsters (not grids or objects) The same as BOLT_STATUS, but done as a separate function to aid descriptions. More...
 
bool effect_handler_BOLT_AWARE (effect_handler_context_t *context)
 Cast a bolt spell Stop if we hit a monster, as a bolt Affect monsters (not grids or objects) Notice stuff based on awareness of the effect. More...
 
bool effect_handler_TOUCH (effect_handler_context_t *context)
 Affect adjacent grids (radius 1 ball attack) More...
 
bool effect_handler_TOUCH_AWARE (effect_handler_context_t *context)
 Affect adjacent grids (radius 1 ball attack) Notice stuff based on awareness of the effect. More...
 
bool effect_handler_CURSE_ARMOR (effect_handler_context_t *context)
 Curse the player's armor. More...
 
bool effect_handler_CURSE_WEAPON (effect_handler_context_t *context)
 Curse the player's weapon. More...
 
bool effect_handler_BRAND_WEAPON (effect_handler_context_t *context)
 Brand the current weapon. More...
 
bool effect_handler_BRAND_AMMO (effect_handler_context_t *context)
 Brand some (non-magical) ammo. More...
 
bool effect_handler_BRAND_BOLTS (effect_handler_context_t *context)
 Enchant some (non-magical) bolts. More...
 
bool effect_handler_TAP_DEVICE (effect_handler_context_t *context)
 Draw energy from a magical device. More...
 
bool effect_handler_SHAPECHANGE (effect_handler_context_t *context)
 Perform a player shapechange. More...
 
bool effect_handler_CURSE (effect_handler_context_t *context)
 Curse a monster for direct damage. More...
 
bool effect_handler_COMMAND (effect_handler_context_t *context)
 Take control of a monster. More...
 
bool effect_handler_JUMP_AND_BITE (effect_handler_context_t *context)
 Jump next to a living monster and draw hitpoints and nourishment from it. More...
 
bool effect_handler_SINGLE_COMBAT (effect_handler_context_t *context)
 Enter single combat with an enemy. More...
 
bool effect_handler_BIZARRE (effect_handler_context_t *context)
 One Ring activation. More...
 
bool effect_handler_WONDER (effect_handler_context_t *context)
 The "wonder" effect. More...
 
void free_effect (struct effect *source)
 Free all the effects in a structure. More...
 
bool effect_valid (const struct effect *effect)
 
bool effect_aim (const struct effect *effect)
 
const char * effect_info (const struct effect *effect)
 
const char * effect_desc (const struct effect *effect)
 
effect_index effect_lookup (const char *name)
 
int effect_subtype (int index, const char *type)
 Translate a string to an effect parameter subtype index. More...
 
bool effect_do (struct effect *effect, struct source origin, struct object *obj, bool *ident, bool aware, int dir, int beam, int boost)
 

Execution of effects

More...
 
void effect_simple (int index, struct source origin, const char *dice_string, int subtype, int radius, int other, int y, int x, bool *ident)
 Perform a single effect with a simple dice string and parameters Calling with ident a valid pointer will (depending on effect) give success information; ident = NULL will ignore this. More...
 

Variables

static const int enchant_table [16]
 Used by the enchant() function (chance of failure) More...
 
static const struct effect_kind effects []
 

Properties of effects

More...
 
static const char * effect_names []
 

Detailed Description

Handler and auxiliary functions for every effect in the game.

Copyright (c) 2007 Andi Sidwell Copyright (c) 2016 Ben Semmler, Nick McConnell

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Macro Definition Documentation

◆ EFFECT [1/2]

#define EFFECT (   x,
  a,
  b,
  c,
  d,
 
)    { EF_##x, a, b, F(x), e },

◆ EFFECT [2/2]

#define EFFECT (   x,
  a,
  b,
  c,
  d,
 
)    #x,

◆ ENCH_TOAC

#define ENCH_TOAC   0x04

◆ ENCH_TOBOTH

#define ENCH_TOBOTH   0x03

◆ ENCH_TODAM

#define ENCH_TODAM   0x02

◆ ENCH_TOHIT

#define ENCH_TOHIT   0x01

Bit flags for the enchant() function.

Referenced by brand_object(), effect_handler_ENCHANT(), effect_subtype(), enchant(), and enchant_spell().

◆ F

#define F (   x)    effect_handler_##x

Typedef Documentation

◆ effect_handler_context_t


Structures and helper functions for effects

◆ effect_handler_f

typedef bool(* effect_handler_f) (effect_handler_context_t *)

Function Documentation

◆ brand_object()

void brand_object ( struct object obj,
const char *  name 
)

◆ desc_stat()

static const char* desc_stat ( int  stat,
bool  positive 
)
static

◆ detect_monsters()

static bool detect_monsters ( int  y_dist,
int  x_dist,
monster_predicate  pred 
)
static

◆ effect_aim()

bool effect_aim ( const struct effect effect)

◆ effect_calculate_value()

int effect_calculate_value ( effect_handler_context_t context,
bool  use_boost 
)

◆ effect_desc()

const char* effect_desc ( const struct effect effect)

◆ effect_do()

bool effect_do ( struct effect effect,
struct source  origin,
struct object obj,
bool *  ident,
bool  aware,
int  dir,
int  beam,
int  boost 
)


Execution of effects

Execute an effect chain.

Parameters
effectis the effect chain
originis the origin of the effect (player, monster etc.)
objis the object making the effect happen (or NULL)
identwill be updated if the effect is identifiable (NB: no effect ever sets *ident to false)
awareindicates whether the player is aware of the effect already
diris the direction the effect will go in
beamis the base chance out of 100 that a BOLT_OR_BEAM effect will beam
boostis the extent to which skill surpasses difficulty, used as % boost. It ranges from 0 to 138.

References effect_handler_context_s::aware, effect_handler_context_s::beam, effect_handler_context_s::boost, effect::dice, dice_roll(), effect_handler_context_s::dir, effect_valid(), effect_kind::handler, effect_handler_context_s::ident, effect::index, effect::msg, effect_handler_context_s::msg, effect::next, effect_handler_context_s::obj, effect_handler_context_s::origin, effect::other, effect::radius, randint0, effect::subtype, effect_handler_context_s::value, void(), effect::x, and effect::y.

Referenced by do_curse_effect(), do_mon_spell(), effect_handler_SHAPECHANGE(), effect_simple(), hit_trap(), spell_cast(), and use_aux().

◆ effect_handler_ACQUIRE()

bool effect_handler_ACQUIRE ( effect_handler_context_t context)

◆ effect_handler_ALTER()

bool effect_handler_ALTER ( effect_handler_context_t context)

◆ effect_handler_ALTER_REALITY()

bool effect_handler_ALTER_REALITY ( effect_handler_context_t context)

◆ effect_handler_ARC()

bool effect_handler_ARC ( effect_handler_context_t context)

Cast an arc-shaped spell.

This is nothing more than a sphere spell centered on the caster with a value for degrees_of_arc (how many degrees wide the the arc is) that is not 360, essentially the same as a breath. The direction given will be the center of the arc, which travels outwards from the caster to a distance given by rad. -LM-

Because all arcs start out as being one grid wide, arc spells with a value for degrees_of_arc less than (roughly) 60 do not dissipate as quickly.

Affect grids, objects, and monsters context->subtype is element, context->radius radius, context->other degrees of arc (minimum 20)

References ddx, ddy, effect_handler_context_s::dir, DIR_TARGET, effect_calculate_value(), effect_handler_context_s::ident, loc(), MAX, angband_constants::max_range, effect_handler_context_s::obj, effect_handler_context_s::origin, effect_handler_context_s::other, project(), PROJECT_ARC, PROJECT_GRID, PROJECT_ITEM, PROJECT_KILL, PROJECT_PLAY, player::px, player::py, effect_handler_context_s::radius, effect_handler_context_s::subtype, target_get(), target_okay(), type, source::what, loc::x, loc::y, and z_info.

◆ effect_handler_BALL()

bool effect_handler_BALL ( effect_handler_context_t context)

◆ effect_handler_BANISH()

bool effect_handler_BANISH ( effect_handler_context_t context)

Delete all non-unique monsters of a given "type" from the level

Warning - this function assumes that the entered monster symbol is an ASCII

character, which may not be true in the future - NRM

References cave, cave_monster(), cave_monster_max(), monster_race::d_char, delete_monster_idx(), get_com(), i, effect_handler_context_s::ident, monster_is_unique(), PR_MONLIST, monster::race, randint1, player_upkeep::redraw, take_hit(), and player::upkeep.

Referenced by effect_handler_WONDER().

◆ effect_handler_BEAM()

bool effect_handler_BEAM ( effect_handler_context_t context)

◆ effect_handler_BIZARRE()

bool effect_handler_BIZARRE ( effect_handler_context_t context)

◆ effect_handler_BOLT()

bool effect_handler_BOLT ( effect_handler_context_t context)

◆ effect_handler_BOLT_AWARE()

bool effect_handler_BOLT_AWARE ( effect_handler_context_t context)

Cast a bolt spell Stop if we hit a monster, as a bolt Affect monsters (not grids or objects) Notice stuff based on awareness of the effect.

References effect_handler_context_s::aware, effect_handler_context_s::dir, effect_calculate_value(), effect_handler_context_s::ident, effect_handler_context_s::obj, effect_handler_context_s::origin, project_aimed(), PROJECT_AWARE, PROJECT_KILL, PROJECT_STOP, and effect_handler_context_s::subtype.

◆ effect_handler_BOLT_OR_BEAM()

bool effect_handler_BOLT_OR_BEAM ( effect_handler_context_t context)

Cast a bolt spell, or rarely, a beam spell context->other is used as any adjustment to the regular beam chance.

References effect_handler_context_s::beam, effect_handler_BEAM(), effect_handler_BOLT(), effect_handler_context_s::other, and randint0.

Referenced by effect_handler_WONDER().

◆ effect_handler_BOLT_STATUS()

bool effect_handler_BOLT_STATUS ( effect_handler_context_t context)

Cast a bolt spell Stop if we hit a monster, as a bolt Affect monsters (not grids or objects) Like BOLT, but only identifies on noticing an effect.

References effect_handler_context_s::dir, effect_calculate_value(), effect_handler_context_s::ident, effect_handler_context_s::obj, effect_handler_context_s::origin, project_aimed(), PROJECT_KILL, PROJECT_STOP, and effect_handler_context_s::subtype.

◆ effect_handler_BOLT_STATUS_DAM()

bool effect_handler_BOLT_STATUS_DAM ( effect_handler_context_t context)

Cast a bolt spell Stop if we hit a monster, as a bolt Affect monsters (not grids or objects) The same as BOLT_STATUS, but done as a separate function to aid descriptions.

References effect_handler_context_s::dir, effect_calculate_value(), effect_handler_context_s::ident, effect_handler_context_s::obj, effect_handler_context_s::origin, project_aimed(), PROJECT_KILL, PROJECT_STOP, and effect_handler_context_s::subtype.

◆ effect_handler_BRAND_AMMO()

bool effect_handler_BRAND_AMMO ( effect_handler_context_t context)

◆ effect_handler_BRAND_BOLTS()

bool effect_handler_BRAND_BOLTS ( effect_handler_context_t context)

◆ effect_handler_BRAND_WEAPON()

bool effect_handler_BRAND_WEAPON ( effect_handler_context_t context)

◆ effect_handler_BREATH()

bool effect_handler_BREATH ( effect_handler_context_t context)

◆ effect_handler_COMMAND()

bool effect_handler_COMMAND ( effect_handler_context_t context)

◆ effect_handler_CREATE_STAIRS()

bool effect_handler_CREATE_STAIRS ( effect_handler_context_t context)

◆ effect_handler_CRUNCH()

bool effect_handler_CRUNCH ( effect_handler_context_t context)

◆ effect_handler_CURE()

bool effect_handler_CURE ( effect_handler_context_t context)

◆ effect_handler_CURSE()

bool effect_handler_CURSE ( effect_handler_context_t context)

◆ effect_handler_CURSE_ARMOR()

bool effect_handler_CURSE_ARMOR ( effect_handler_context_t context)

◆ effect_handler_CURSE_WEAPON()

bool effect_handler_CURSE_WEAPON ( effect_handler_context_t context)

◆ effect_handler_DAMAGE()

bool effect_handler_DAMAGE ( effect_handler_context_t context)

◆ effect_handler_DARKEN_AREA()

bool effect_handler_DARKEN_AREA ( effect_handler_context_t context)

◆ effect_handler_DARKEN_LEVEL()

bool effect_handler_DARKEN_LEVEL ( effect_handler_context_t context)

◆ effect_handler_DEEP_DESCENT()

bool effect_handler_DEEP_DESCENT ( effect_handler_context_t context)

◆ effect_handler_DESTRUCTION()

bool effect_handler_DESTRUCTION ( effect_handler_context_t context)

◆ effect_handler_DETECT_DOORS()

bool effect_handler_DETECT_DOORS ( effect_handler_context_t context)

◆ effect_handler_DETECT_EVIL()

bool effect_handler_DETECT_EVIL ( effect_handler_context_t context)

Detect evil monsters around the player.

The height to detect above and below the player is context->value.dice, the width either side of the player context->value.sides.

References effect_handler_context_s::aware, detect_monsters(), effect_handler_context_s::ident, monster_is_evil(), monsters, effect_handler_context_s::msg, effect_handler_context_s::x, and effect_handler_context_s::y.

◆ effect_handler_DETECT_GOLD()

bool effect_handler_DETECT_GOLD ( effect_handler_context_t context)

◆ effect_handler_DETECT_INVISIBLE_MONSTERS()

bool effect_handler_DETECT_INVISIBLE_MONSTERS ( effect_handler_context_t context)

Detect invisible monsters around the player.

The height to detect above and below the player is context->value.dice, the width either side of the player context->value.sides.

References effect_handler_context_s::aware, detect_monsters(), effect_handler_context_s::ident, monster_is_invisible(), monsters, effect_handler_context_s::msg, effect_handler_context_s::x, and effect_handler_context_s::y.

◆ effect_handler_DETECT_LIVING_MONSTERS()

bool effect_handler_DETECT_LIVING_MONSTERS ( effect_handler_context_t context)

Detect living monsters around the player.

The height to detect above and below the player is context->value.dice, the width either side of the player context->value.sides.

References effect_handler_context_s::aware, detect_monsters(), effect_handler_context_s::ident, monster_is_living(), monsters, effect_handler_context_s::msg, effect_handler_context_s::x, and effect_handler_context_s::y.

◆ effect_handler_DETECT_OBJECTS()

bool effect_handler_DETECT_OBJECTS ( effect_handler_context_t context)

◆ effect_handler_DETECT_SOUL()

bool effect_handler_DETECT_SOUL ( effect_handler_context_t context)

Detect monsters possessing a spirit around the player.

The height to detect above and below the player is context->value.dice, the width either side of the player context->value.sides.

References effect_handler_context_s::aware, detect_monsters(), effect_handler_context_s::ident, monster_has_spirit(), monsters, effect_handler_context_s::msg, effect_handler_context_s::x, and effect_handler_context_s::y.

◆ effect_handler_DETECT_STAIRS()

bool effect_handler_DETECT_STAIRS ( effect_handler_context_t context)

Detect stairs around the player.

The height to detect above and below the player is context->y, the width either side of the player context->x.

References effect_handler_context_s::aware, cave, chunk::height, effect_handler_context_s::ident, effect_handler_context_s::msg, player::px, player::py, square_in_bounds_fully(), square_isstairs(), square_light_spot(), square_memorize(), stairs, chunk::width, effect_handler_context_s::x, and effect_handler_context_s::y.

◆ effect_handler_DETECT_TRAPS()

bool effect_handler_DETECT_TRAPS ( effect_handler_context_t context)

◆ effect_handler_DETECT_VISIBLE_MONSTERS()

bool effect_handler_DETECT_VISIBLE_MONSTERS ( effect_handler_context_t context)

Detect visible monsters around the player; note that this means monsters which are in principle visible, not monsters the player can currently see.

The height to detect above and below the player is context->value.dice, the width either side of the player context->value.sides.

References effect_handler_context_s::aware, detect_monsters(), effect_handler_context_s::ident, monster_is_not_invisible(), monsters, effect_handler_context_s::msg, effect_handler_context_s::x, and effect_handler_context_s::y.

◆ effect_handler_DISENCHANT()

bool effect_handler_DISENCHANT ( effect_handler_context_t context)

◆ effect_handler_DRAIN_LIGHT()

bool effect_handler_DRAIN_LIGHT ( effect_handler_context_t context)

◆ effect_handler_DRAIN_MANA()

bool effect_handler_DRAIN_MANA ( effect_handler_context_t context)

◆ effect_handler_DRAIN_STAT()

bool effect_handler_DRAIN_STAT ( effect_handler_context_t context)

◆ effect_handler_EARTHQUAKE()

bool effect_handler_EARTHQUAKE ( effect_handler_context_t context)

Induce an earthquake of the radius context->radius centred on the instigator.

This will turn some walls into floors and some floors into walls.

The player will take damage and jump into a safe grid if possible, otherwise, he will tunnel through the rubble instantaneously.

Monsters will take damage, and jump into a safe grid if possible, otherwise they will be buried in the rubble, disappearing from the level in the same way that they do when banished.

Note that players and monsters (except eaters of walls and passers through walls) will never occupy the same grid as a wall (or door).

References cave, damroll(), ddx_ddd, ddy_ddd, delete_monster(), player::depth, effect_handler_context_s::dir, DIR_TARGET, distance(), FLAG_END, monster_race::flags, flags_test(), get_aim_dir(), monster::hp, i, effect_handler_context_s::ident, square::info, loc(), MDESC_STANDARD, square::mon, mon_clear_timed(), MON_TMD_FLG_NOMESSAGE, monster_desc(), monster_swap(), effect_handler_context_s::msg, effect_handler_context_s::origin, origin_get_loc(), player_inc_timed(), PR_HEALTH, PR_ITEMLIST, PR_MONLIST, PU_MONSTERS, PU_UPDATE_VIEW, player::px, player::py, monster::race, effect_handler_context_s::radius, randint0, randint1, player_upkeep::redraw, rf_has, RF_SIZE, sqinfo_off, square_changeable(), square_earthquake(), square_excise_pile(), square_forget(), square_in_bounds_fully(), square_isbright(), square_isempty(), square_iswarded(), square_light_spot(), square_monster(), chunk::squares, effect_handler_context_s::subtype, take_hit(), target_get(), target_okay(), player_upkeep::update, player::upkeep, void(), loc::x, effect_handler_context_s::x, loc::y, and effect_handler_context_s::y.

Referenced by effect_handler_WONDER().

◆ effect_handler_ENCHANT()

bool effect_handler_ENCHANT ( effect_handler_context_t context)

Enchant an item (in the inventory or on the floor) Note that armour, to hit or to dam is controlled by context->subtype.

Work on incorporating enchant_spell() has been postponed...NRM

References player::depth, ENCH_TOAC, ENCH_TOBOTH, ENCH_TODAM, ENCH_TOHIT, enchant_spell(), effect_handler_context_s::ident, randcalc(), RANDOMISE, effect_handler_context_s::subtype, and effect_handler_context_s::value.

◆ effect_handler_GAIN_EXP()

bool effect_handler_GAIN_EXP ( effect_handler_context_t context)

◆ effect_handler_GAIN_STAT()

bool effect_handler_GAIN_STAT ( effect_handler_context_t context)

Gain a stat point.

The stat index is context->subtype.

References desc_stat(), effect_handler_context_s::ident, effect_handler_context_s::msg, player_stat_inc(), and effect_handler_context_s::subtype.

◆ effect_handler_GLYPH()

bool effect_handler_GLYPH ( effect_handler_context_t context)

◆ effect_handler_HEAL_HP()

bool effect_handler_HEAL_HP ( effect_handler_context_t context)

Heal the player by a given percentage of their wounds, or a minimum amount, whichever is larger.

context->value.base should be the minimum, and context->value.m_bonus the percentage

References random::base, player::chp, player::chp_frac, effect_handler_context_s::ident, random::m_bonus, player::mhp, effect_handler_context_s::msg, num, PR_HP, player_upkeep::redraw, player::upkeep, and effect_handler_context_s::value.

◆ effect_handler_IDENTIFY()

bool effect_handler_IDENTIFY ( effect_handler_context_t context)

◆ effect_handler_JUMP_AND_BITE()

bool effect_handler_JUMP_AND_BITE ( effect_handler_context_t context)

◆ effect_handler_LIGHT_AREA()

bool effect_handler_LIGHT_AREA ( effect_handler_context_t context)

◆ effect_handler_LIGHT_LEVEL()

bool effect_handler_LIGHT_LEVEL ( effect_handler_context_t context)

◆ effect_handler_LINE()

bool effect_handler_LINE ( effect_handler_context_t context)

◆ effect_handler_LOSE_EXP()

bool effect_handler_LOSE_EXP ( effect_handler_context_t context)

◆ effect_handler_LOSE_RANDOM_STAT()

bool effect_handler_LOSE_RANDOM_STAT ( effect_handler_context_t context)

Lose a stat point permanently, in a stat other than the one specified in context->subtype.

References desc_stat(), effect_handler_context_s::ident, msgt(), player_stat_dec(), randint1, STAT_MAX, and effect_handler_context_s::subtype.

◆ effect_handler_MAP_AREA()

bool effect_handler_MAP_AREA ( effect_handler_context_t context)

Map an area around a point, usually the player.

The height to map above and below the player is context->y, the width either side of the player context->x. For player level dependent areas, we use the hack of applying value dice and sides as the height and width.

References cave, ddx_ddd, ddy_ddd, random::dice, chunk::height, i, effect_handler_context_s::ident, effect_handler_context_s::origin, origin_get_loc(), PR_ITEMLIST, PR_MAP, PR_MONLIST, PU_MONSTERS, PU_UPDATE_VIEW, player_upkeep::redraw, random::sides, square_forget(), square_in_bounds(), square_in_bounds_fully(), square_isfloor(), square_isno_map(), square_isnotknown(), square_memorize(), square_seemslikewall(), square_unmark(), player_upkeep::update, player::upkeep, effect_handler_context_s::value, chunk::width, loc::x, effect_handler_context_s::x, loc::y, and effect_handler_context_s::y.

◆ effect_handler_MASS_BANISH()

bool effect_handler_MASS_BANISH ( effect_handler_context_t context)

Delete all nearby (non-unique) monsters.

The radius of effect is context->radius if passed, otherwise the player view radius.

References cave, cave_monster(), cave_monster_max(), monster::cdis, delete_monster_idx(), i, effect_handler_context_s::ident, angband_constants::max_sight, monster_is_unique(), PR_MONLIST, monster::race, effect_handler_context_s::radius, randint1, player_upkeep::redraw, take_hit(), player::upkeep, and z_info.

◆ effect_handler_MON_HEAL_HP()

bool effect_handler_MON_HEAL_HP ( effect_handler_context_t context)

◆ effect_handler_MON_HEAL_KIN()

bool effect_handler_MON_HEAL_KIN ( effect_handler_context_t context)

◆ effect_handler_MON_TIMED_INC()

bool effect_handler_MON_TIMED_INC ( effect_handler_context_t context)

◆ effect_handler_NOURISH()

bool effect_handler_NOURISH ( effect_handler_context_t context)

◆ effect_handler_PROBE()

bool effect_handler_PROBE ( effect_handler_context_t context)

◆ effect_handler_PROJECT_LOS()

bool effect_handler_PROJECT_LOS ( effect_handler_context_t context)

Apply a "project()" directly to all viewable monsters.

If context->other is set, the effect damage boost is applied. This is a hack - NRM

Note that affected monsters are NOT auto-tracked by this usage.

References cave, cave_monster(), cave_monster_max(), effect_calculate_value(), monster::fx, monster::fy, i, effect_handler_context_s::ident, loc(), los(), effect_handler_context_s::obj, effect_handler_context_s::origin, origin_get_loc(), project(), PROJECT_HIDE, PROJECT_JUMP, PROJECT_KILL, monster::race, effect_handler_context_s::radius, source_player(), effect_handler_context_s::subtype, void(), loc::x, and loc::y.

Referenced by effect_handler_WONDER().

◆ effect_handler_PROJECT_LOS_AWARE()

bool effect_handler_PROJECT_LOS_AWARE ( effect_handler_context_t context)

◆ effect_handler_RANDOM()

bool effect_handler_RANDOM ( effect_handler_context_t context)


Effect handlers

Dummy effect, to tell the effect code to pick one of the next context->value.base effects at random.

◆ effect_handler_READ_MINDS()

bool effect_handler_READ_MINDS ( effect_handler_context_t context)

Map an area around the recently detected monsters.

The height to map above and below each monster is context->y, the width either side of each monster context->x. For player level dependent areas, we use the hack of applying value dice and sides as the height and width.

References cave, cave_monster(), cave_monster_max(), random::dice, effect_simple(), i, effect_handler_context_s::ident, monster::mflag, mflag_has, effect_handler_context_s::msg, monster::race, random::sides, source_monster(), effect_handler_context_s::value, effect_handler_context_s::x, and effect_handler_context_s::y.

◆ effect_handler_RECALL()

bool effect_handler_RECALL ( effect_handler_context_t context)

◆ effect_handler_RECHARGE()

bool effect_handler_RECHARGE ( effect_handler_context_t context)

◆ effect_handler_REMOVE_CURSE()

bool effect_handler_REMOVE_CURSE ( effect_handler_context_t context)

◆ effect_handler_RESTORE_EXP()

bool effect_handler_RESTORE_EXP ( effect_handler_context_t context)

◆ effect_handler_RESTORE_MANA()

bool effect_handler_RESTORE_MANA ( effect_handler_context_t context)

◆ effect_handler_RESTORE_STAT()

bool effect_handler_RESTORE_STAT ( effect_handler_context_t context)

◆ effect_handler_RUBBLE()

bool effect_handler_RUBBLE ( effect_handler_context_t context)

◆ effect_handler_SENSE_OBJECTS()

bool effect_handler_SENSE_OBJECTS ( effect_handler_context_t context)

◆ effect_handler_SET_NOURISH()

bool effect_handler_SET_NOURISH ( effect_handler_context_t context)

Make the player, um, lose food.

Or gain it.

References effect_calculate_value(), effect_handler_context_s::ident, MAX, player_set_food(), and void().

◆ effect_handler_SHAPECHANGE()

bool effect_handler_SHAPECHANGE ( effect_handler_context_t context)

◆ effect_handler_SHORT_BEAM()

bool effect_handler_SHORT_BEAM ( effect_handler_context_t context)

Cast an defined length beam spell.

Affect grids, objects, and monsters context->subtype is element, context->radius radius context->other allows an added radius of 1 every time the player level increases by a multiple of context->other, and will only take effect for player spells

References ddx, ddy, effect_handler_context_s::dir, DIR_TARGET, effect_calculate_value(), effect_handler_context_s::ident, player::lev, loc(), effect_handler_context_s::obj, effect_handler_context_s::origin, effect_handler_context_s::other, project(), PROJECT_ARC, PROJECT_GRID, PROJECT_ITEM, PROJECT_KILL, PROJECT_PLAY, player::px, player::py, effect_handler_context_s::radius, effect_handler_context_s::subtype, target_get(), target_okay(), type, source::what, loc::x, and loc::y.

◆ effect_handler_SINGLE_COMBAT()

bool effect_handler_SINGLE_COMBAT ( effect_handler_context_t context)

◆ effect_handler_SPHERE()

bool effect_handler_SPHERE ( effect_handler_context_t context)

◆ effect_handler_SPOT()

bool effect_handler_SPOT ( effect_handler_context_t context)

◆ effect_handler_STAR()

bool effect_handler_STAR ( effect_handler_context_t context)

◆ effect_handler_STAR_BALL()

bool effect_handler_STAR_BALL ( effect_handler_context_t context)

◆ effect_handler_STRIKE()

bool effect_handler_STRIKE ( effect_handler_context_t context)

Strike the target with a ball from above.

Targets absolute coordinates instead of a specific monster, so that the death of the monster doesn't change the target's location.

References effect_handler_context_s::dir, DIR_TARGET, effect_calculate_value(), effect_handler_context_s::ident, loc(), effect_handler_context_s::obj, project(), PROJECT_GRID, PROJECT_ITEM, PROJECT_JUMP, PROJECT_KILL, player::px, player::py, effect_handler_context_s::radius, source_player(), effect_handler_context_s::subtype, target_get(), target_okay(), loc::x, and loc::y.

◆ effect_handler_SUMMON()

bool effect_handler_SUMMON ( effect_handler_context_t context)

◆ effect_handler_SWARM()

bool effect_handler_SWARM ( effect_handler_context_t context)

◆ effect_handler_TAP_DEVICE()

bool effect_handler_TAP_DEVICE ( effect_handler_context_t context)

◆ effect_handler_TELEPORT()

bool effect_handler_TELEPORT ( effect_handler_context_t context)

◆ effect_handler_TELEPORT_LEVEL()

bool effect_handler_TELEPORT_LEVEL ( effect_handler_context_t context)

◆ effect_handler_TELEPORT_TO()

bool effect_handler_TELEPORT_TO ( effect_handler_context_t context)

◆ effect_handler_TIMED_DEC()

bool effect_handler_TIMED_DEC ( effect_handler_context_t context)

Reduce a (positive or negative) player status condition.

If context->other is set, decrease by the current value / context->other

References effect_calculate_value(), effect_handler_context_s::ident, MAX, effect_handler_context_s::other, player_dec_timed(), effect_handler_context_s::subtype, player::timed, and void().

◆ effect_handler_TIMED_INC()

bool effect_handler_TIMED_INC ( effect_handler_context_t context)

Extend a (positive or negative) player status condition.

If context->other is set, increase by that amount if the player already has the status

References cave, cave_find_decoy(), effect_calculate_value(), effect_handler_context_s::ident, MAX, mon_inc_timed(), monster_target_monster(), effect_handler_context_s::other, player_inc_timed(), square_destroy_decoy(), effect_handler_context_s::subtype, player::timed, loc::x, and loc::y.

◆ effect_handler_TIMED_INC_NO_RES()

bool effect_handler_TIMED_INC_NO_RES ( effect_handler_context_t context)

Extend a (positive or negative) player status condition unresistably.

If context->other is set, increase by that amount if the player already has the status

References effect_calculate_value(), effect_handler_context_s::ident, MAX, effect_handler_context_s::other, player_inc_timed(), effect_handler_context_s::subtype, and player::timed.

◆ effect_handler_TIMED_SET()

bool effect_handler_TIMED_SET ( effect_handler_context_t context)

Set a (positive or negative) player status condition.

References effect_calculate_value(), effect_handler_context_s::ident, MAX, player_set_timed(), and effect_handler_context_s::subtype.

◆ effect_handler_TOUCH()

bool effect_handler_TOUCH ( effect_handler_context_t context)

◆ effect_handler_TOUCH_AWARE()

bool effect_handler_TOUCH_AWARE ( effect_handler_context_t context)

◆ effect_handler_WAKE()

bool effect_handler_WAKE ( effect_handler_context_t context)

◆ effect_handler_WONDER()

bool effect_handler_WONDER ( effect_handler_context_t context)

◆ effect_info()

const char* effect_info ( const struct effect effect)

◆ effect_lookup()

effect_index effect_lookup ( const char *  name)

◆ effect_simple()

void effect_simple ( int  index,
struct source  origin,
const char *  dice_string,
int  subtype,
int  radius,
int  other,
int  y,
int  x,
bool *  ident 
)

◆ effect_subtype()

int effect_subtype ( int  index,
const char *  type 
)

◆ effect_valid()

bool effect_valid ( const struct effect effect)

◆ enchant()

bool enchant ( struct object obj,
int  n,
int  eflag 
)

Enchant an item.

Revamped! Now takes item pointer, number of times to try enchanting, and a flag of what to try enchanting. Artifacts resist enchantment some of the time. Also, any enchantment attempt (even unsuccessful) kicks off a parallel attempt to uncurse a cursed item.

Note that an item can technically be enchanted all the way to +15 if you wait a very, very, long time. Going from +9 to +10 only works about 5% of the time, and from +10 to +11 only about 1% of the time.

Note that this function can now be used on "piles" of items, and the larger the pile, the lower the chance of success.

Returns
true if the item was changed in some way

References ENCH_TOAC, ENCH_TODAM, ENCH_TOHIT, enchant2(), i, object::known, player_upkeep::notice, object::number, PN_COMBINE, PR_EQUIP, PR_INVEN, PU_BONUS, PU_INVEN, randint0, player_upkeep::redraw, object::to_a, object::to_d, object::to_h, tval_is_ammo(), player_upkeep::update, and player::upkeep.

Referenced by brand_object(), and enchant_spell().

◆ enchant2()

static bool enchant2 ( struct object obj,
s16b score 
)
static

Helper function for enchant() which tries increasing an item's bonuses.

Returns
true if a bonus was increased

References object::artifact, and enchant_score().

Referenced by enchant().

◆ enchant_score()

static bool enchant_score ( s16b score,
bool  is_artifact 
)
static

Tries to increase an items bonus score, if possible.

Returns
true if the bonus was increased

References enchant_table, randint0, and randint1.

Referenced by enchant2().

◆ enchant_spell()

bool enchant_spell ( int  num_hit,
int  num_dam,
int  num_ac 
)

Enchant an item (in the inventory or on the floor) Note that "num_ac" requires armour, else weapon Returns true if attempted, false if cancelled.

Enchanting with the TOBOTH flag will try to enchant both to_hit and to_dam with the same flag. This may not be the most desirable behavior (ACB).

References ENCH_TOAC, ENCH_TOBOTH, ENCH_TODAM, ENCH_TOHIT, enchant(), EVENT_INPUT_FLUSH, event_signal(), get_item(), item_tester_hook_armour(), item_tester_hook_weapon(), effect_handler_context_s::msg, object::number, effect_handler_context_s::obj, object_desc(), object_is_carried(), ODESC_BASE, USE_EQUIP, USE_FLOOR, USE_INVEN, and USE_QUIVER.

Referenced by effect_handler_ENCHANT().

◆ free_effect()

void free_effect ( struct effect source)

Free all the effects in a structure.

Parameters
sourcethe effects being freed

References effect::dice, dice_free(), mem_free(), and effect::next.

Referenced by cleanup_act(), cleanup_class(), cleanup_curse(), cleanup_ego(), cleanup_mon_spell(), cleanup_object(), cleanup_shape(), and cleanup_trap().

◆ get_target()

static void get_target ( struct source  origin,
int  dir,
int ty,
int tx,
int flags 
)
static

◆ item_tester_hook_ammo()

static bool item_tester_hook_ammo ( const struct object obj)
static

Hook to specify "ammo".

References tval_is_ammo().

Referenced by effect_handler_BRAND_AMMO().

◆ item_tester_hook_armour()

static bool item_tester_hook_armour ( const struct object obj)
static

Hook to specify "armour".

References tval_is_armor().

Referenced by enchant_spell().

◆ item_tester_hook_bolt()

static bool item_tester_hook_bolt ( const struct object obj)
static

Hook to specify bolts.

References object::tval.

Referenced by effect_handler_BRAND_BOLTS().

◆ item_tester_hook_recharge()

static bool item_tester_hook_recharge ( const struct object obj)
static

Hook for "get_item()".

Determine if something is rechargable.

References tval_can_have_charges().

Referenced by effect_handler_RECHARGE(), and effect_handler_TAP_DEVICE().

◆ item_tester_hook_weapon()

static bool item_tester_hook_weapon ( const struct object obj)
static

Hook to specify "weapon".

References tval_is_weapon().

Referenced by enchant_spell().

◆ item_tester_uncursable()

static bool item_tester_uncursable ( const struct object obj)
static

Selects items that have at least one removable curse.

References angband_constants::curse_max, object::curses, i, object::known, curse_data::power, and z_info.

Referenced by effect_handler_REMOVE_CURSE().

◆ item_tester_unknown()

static bool item_tester_unknown ( const struct object obj)
static

Selects items that have at least one unknown rune.

References object_runes_known().

Referenced by effect_handler_IDENTIFY().

◆ monster_target_monster()

static struct monster* monster_target_monster ( effect_handler_context_t context)
static

◆ project_aimed()

static bool project_aimed ( struct source  origin,
int  typ,
int  dir,
int  dam,
int  flg,
const struct object obj 
)
static

◆ project_touch()

static bool project_touch ( int  dam,
int  rad,
int  typ,
bool  aware,
const struct object obj 
)
static

◆ remove_object_curse()

static void remove_object_curse ( struct object obj,
int  index,
bool  message 
)
static

◆ uncurse_object()

static bool uncurse_object ( struct object obj,
int  strength,
char *  dice_string 
)
static

Variable Documentation

◆ effect_names

const char* effect_names[]
static

Referenced by effect_lookup().

◆ effects

const struct effect_kind effects[]
static


Properties of effects

Useful things about effects.

◆ enchant_table

const int enchant_table[16]
static
Initial value:
=
{
0, 10, 20, 40, 80,
160, 280, 400, 550, 700,
800, 900, 950, 970, 990,
1000
}

Used by the enchant() function (chance of failure)

Referenced by enchant_score().