Angband
Macros | Enumerations | Functions
mon-timed.h File Reference

Structures and functions for monster timed effects. More...

#include "list-mon-timed.h"

Go to the source code of this file.

Macros

#define STUN_MISS_CHANCE   10 /* 1 in __ chance of missing turn when stunned */
 Monster timed effect constants. More...
 
#define STUN_HIT_REDUCTION   25 /* Percentage reduction in accuracy for combat */
 
#define STUN_DAM_REDUCTION   25 /* Percentage reduction in damage */
 
#define CONF_ERRATIC_CHANCE   30 /* Percentage chance of erratic movement when confused */
 
#define CONF_HIT_REDUCTION   20 /* Percentage reduction in accuracy for spells */
 
#define CONF_RANDOM_CHANCE   2 /* 1 in __ chance of an aimed spell going in random direction */
 
#define DEBUFF_CRITICAL_HIT   10 /* Effective increase in to-hit for critical hit calcs */
 
#define MON_TMD(a, b, c, d, e, f, g, h)   MON_TMD_##a,
 
#define MON_TMD_FLG_NOTIFY   0x01 /* Give notification */
 Flags for the monster timed functions. More...
 
#define MON_TMD_FLG_NOMESSAGE   0x04 /* Never show a message */
 
#define MON_TMD_FLG_NOFAIL   0x08 /* Never fail */
 

Enumerations

enum  
 Monster Timed Effects. More...
 

Functions

int mon_timed_name_to_idx (const char *name)
 Functions. More...
 
bool mon_inc_timed (struct monster *mon, int effect_type, int timer, int flag, bool id)
 Increases the timed effect effect_type by timer. More...
 
bool mon_dec_timed (struct monster *mon, int effect_type, int timer, int flag, bool id)
 Decreases the timed effect effect_type by timer. More...
 
bool mon_clear_timed (struct monster *mon, int effect_type, int flag, bool id)
 Clears the timed effect effect_type. More...
 

Detailed Description

Structures and functions for monster timed effects.

Copyright (c) 1997-2007 Ben Harrison, James E. Wilson, Robert A. Koeneke

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

#define CONF_ERRATIC_CHANCE   30 /* Percentage chance of erratic movement when confused */
#define CONF_HIT_REDUCTION   20 /* Percentage reduction in accuracy for spells */

Referenced by do_mon_spell().

#define CONF_RANDOM_CHANCE   2 /* 1 in __ chance of an aimed spell going in random direction */

Referenced by effect_handler_BALL(), and get_target().

#define DEBUFF_CRITICAL_HIT   10 /* Effective increase in to-hit for critical hit calcs */

Referenced by critical_norm(), and critical_shot().

#define MON_TMD (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h 
)    MON_TMD_##a,
#define MON_TMD_FLG_NOFAIL   0x08 /* Never fail */

Referenced by does_resist(), and mon_take_hit().

#define MON_TMD_FLG_NOMESSAGE   0x04 /* Never show a message */
#define MON_TMD_FLG_NOTIFY   0x01 /* Give notification */
#define STUN_DAM_REDUCTION   25 /* Percentage reduction in damage */

Referenced by make_attack_normal().

#define STUN_HIT_REDUCTION   25 /* Percentage reduction in accuracy for combat */

Referenced by make_attack_normal().

#define STUN_MISS_CHANCE   10 /* 1 in __ chance of missing turn when stunned */

Monster timed effect constants.

Referenced by process_monster_timed().

Enumeration Type Documentation

anonymous enum

Monster Timed Effects.

Function Documentation

bool mon_clear_timed ( struct monster mon,
int  effect_type,
int  flag,
bool  id 
)
bool mon_dec_timed ( struct monster mon,
int  effect_type,
int  timer,
int  flag,
bool  id 
)

Decreases the timed effect effect_type by timer.

Calculates the new timer, then passes that to mon_set_timed(). If a timer would be set to a negative number, it is set to 0 instead. Note that decreasing a timed effect should never fail.

Returns true if the monster's timer changed.

References monster::m_timed, and mon_set_timed().

Referenced by mon_take_hit(), monster_reduce_sleep(), process_monster_timed(), and restore_monsters().

bool mon_inc_timed ( struct monster mon,
int  effect_type,
int  timer,
int  flag,
bool  id 
)

Increases the timed effect effect_type by timer.

Calculates the new timer, then passes that to mon_set_timed(). Note that each effect has a maximum number of turns it can be active for. If this function would put an effect timer over that cap, it sets it for that cap instead.

Returns true if the monster's timer changed.

References effects, monster::m_timed, MAX, MON_INC_MIN_TURNS, mon_set_timed(), STACK_INCR, STACK_MAX, STACK_NO, and mon_timed_effect::stacking.

Referenced by blow_side_effects(), effect_handler_MON_TIMED_INC(), mon_take_hit(), project_m_apply_side_effects(), project_monster_handler_MON_CLONE(), and summon_specific().

int mon_timed_name_to_idx ( const char *  name)

Functions.

Functions.

Returns -1 on failure.

References effects, i, and streq.

Referenced by effect_param().