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 MON_TMD(a, b, c, d, e, f)   MON_TMD_##a,
#define MON_TMD_FLG_NOTIFY   0x01 /* Give notification */
 Flags for the monster timed functions.
#define MON_TMD_MON_SOURCE   0x02 /* Monster is causing the damage */
#define MON_TMD_FLG_NOMESSAGE   0x04 /* Never show a message */
#define MON_TMD_FLG_NOFAIL   0x08 /* Never fail */

Enumerations

enum  
 Constants. More...

Functions

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

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 MON_TMD (   a,
  b,
  c,
  d,
  e,
 
)    MON_TMD_##a,
#define MON_TMD_FLG_NOFAIL   0x08 /* Never fail */
#define MON_TMD_FLG_NOMESSAGE   0x04 /* Never show a message */
#define MON_TMD_FLG_NOTIFY   0x01 /* Give notification */
#define MON_TMD_MON_SOURCE   0x02 /* Monster is causing the damage */

Enumeration Type Documentation

anonymous enum

Constants.

Monster Timed Effects

Function Documentation

bool mon_clear_timed ( struct monster m_ptr,
int  ef_idx,
u16b  flag,
bool  id 
)
bool mon_dec_timed ( struct monster m_ptr,
int  ef_idx,
int  timer,
u16b  flag,
bool  id 
)

Decreases the timed effect ef_idx 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, mon_set_timed(), and MON_TMD_FLG_NOFAIL.

Referenced by mon_take_hit(), and process_monster_timed().

bool mon_inc_timed ( struct monster m_ptr,
int  ef_idx,
int  timer,
u16b  flag,
bool  id 
)

Increases the timed effect ef_idx 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 effect, effects, monster::m_timed, MAX_SHORT, mon_timed_effect::max_timer, and mon_set_timed().

Referenced by blow_side_effects(), effect_handler_AGGRAVATE(), effect_handler_MON_TIMED_INC(), make_attack_spell(), mon_take_hit(), project_m_apply_side_effects(), project_monster_handler_OLD_CLONE(), and summon_specific().

int mon_timed_name_to_idx ( const char *  name)

Functions.

References effects, i, and streq.

Referenced by effect_param().