Angband
Data Structures | Macros | Typedefs | Enumerations | Variables
monster.h File Reference

Flags, structures and variables for monsters. More...

#include "h-basic.h"
#include "z-bitflag.h"
#include "z-rand.h"
#include "cave.h"
#include "mon-timed.h"
#include "mon-blow-methods.h"
#include "mon-blow-effects.h"
#include "list-mon-temp-flags.h"
#include "list-mon-race-flags.h"
#include "list-mon-spells.h"

Go to the source code of this file.

Data Structures

struct  monster_blow
 Structures. More...
struct  monster_pain
 Monster pain messages. More...
struct  monster_spell
 Monster spell types. More...
struct  monster_base
 Base monster type. More...
struct  monster_drop
 Specified monster drops. More...
struct  monster_friends
 Monster friends (specific monster) More...
struct  monster_friends_base
 Monster friends (general type) More...
struct  monster_mimic
 How monsters mimic. More...
struct  monster_race
 Monster "race" information, including racial memories. More...
struct  monster
 Monster information, for a specific monster. More...

Macros

#define MFLAG(a, b)   MFLAG_##a,
#define MFLAG_SIZE   FLAG_SIZE(MFLAG_MAX)
#define mflag_has(f, flag)   flag_has_dbg(f, MFLAG_SIZE, flag, #f, #flag)
#define mflag_next(f, flag)   flag_next(f, MFLAG_SIZE, flag)
#define mflag_is_empty(f)   flag_is_empty(f, MFLAG_SIZE)
#define mflag_is_full(f)   flag_is_full(f, MFLAG_SIZE)
#define mflag_is_inter(f1, f2)   flag_is_inter(f1, f2, MFLAG_SIZE)
#define mflag_is_subset(f1, f2)   flag_is_subset(f1, f2, MFLAG_SIZE)
#define mflag_is_equal(f1, f2)   flag_is_equal(f1, f2, MFLAG_SIZE)
#define mflag_on(f, flag)   flag_on_dbg(f, MFLAG_SIZE, flag, #f, #flag)
#define mflag_off(f, flag)   flag_off(f, MFLAG_SIZE, flag)
#define mflag_wipe(f)   flag_wipe(f, MFLAG_SIZE)
#define mflag_setall(f)   flag_setall(f, MFLAG_SIZE)
#define mflag_negate(f)   flag_negate(f, MFLAG_SIZE)
#define mflag_copy(f1, f2)   flag_copy(f1, f2, MFLAG_SIZE)
#define mflag_union(f1, f2)   flag_union(f1, f2, MFLAG_SIZE)
#define mflag_comp_union(f1, f2)   flag_comp_union(f1, f2, MFLAG_SIZE)
#define mflag_inter(f1, f2)   flag_inter(f1, f2, MFLAG_SIZE)
#define mflag_diff(f1, f2)   flag_diff(f1, f2, MFLAG_SIZE)
#define RF(a, b, c)   RF_##a,
#define RF_SIZE   FLAG_SIZE(RF_MAX)
#define rf_has(f, flag)   flag_has_dbg(f, RF_SIZE, flag, #f, #flag)
#define rf_next(f, flag)   flag_next(f, RF_SIZE, flag)
#define rf_is_empty(f)   flag_is_empty(f, RF_SIZE)
#define rf_is_full(f)   flag_is_full(f, RF_SIZE)
#define rf_is_inter(f1, f2)   flag_is_inter(f1, f2, RF_SIZE)
#define rf_is_subset(f1, f2)   flag_is_subset(f1, f2, RF_SIZE)
#define rf_is_equal(f1, f2)   flag_is_equal(f1, f2, RF_SIZE)
#define rf_on(f, flag)   flag_on_dbg(f, RF_SIZE, flag, #f, #flag)
#define rf_off(f, flag)   flag_off(f, RF_SIZE, flag)
#define rf_wipe(f)   flag_wipe(f, RF_SIZE)
#define rf_setall(f)   flag_setall(f, RF_SIZE)
#define rf_negate(f)   flag_negate(f, RF_SIZE)
#define rf_copy(f1, f2)   flag_copy(f1, f2, RF_SIZE)
#define rf_union(f1, f2)   flag_union(f1, f2, RF_SIZE)
#define rf_comp_union(f1, f2)   flag_comp_union(f1, f2, RF_SIZE)
#define rf_inter(f1, f2)   flag_inter(f1, f2, RF_SIZE)
#define rf_diff(f1, f2)   flag_diff(f1, f2, RF_SIZE)
#define RF_OBVIOUS_MASK
#define RF_RACE_MASK
#define RF_DROP_MASK
#define RSF(a, b, c, d, e, f, g, h)   RSF_##a,
#define RSF_SIZE   FLAG_SIZE(RSF_MAX)

Typedefs

typedef struct monster_pain monster_pain
 Monster pain messages.
typedef struct monster_base monster_base
 Base monster type.
typedef struct monster_race monster_race
 Monster "race" information, including racial memories.
typedef struct monster monster_type
 Monster information, for a specific monster.

Enumerations

enum  { MFLAG_MAX }
 Special Monster Flags (all temporary) More...
enum  { RF_MAX }
 Monster property and ability flags (race flags) More...
enum  
 Monster spell flag indices. More...

Variables

s16b num_repro
 Variables.
monster_painpain_messages
struct monster_spellmonster_spells
monster_baserb_info
monster_racer_info
const monster_raceref_race

Detailed Description

Flags, structures and variables for monsters.

Copyright (c) 2007 Andi Sidwell Copyright (c) 2010 Chris Carr

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 MFLAG (   a,
 
)    MFLAG_##a,
#define mflag_comp_union (   f1,
  f2 
)    flag_comp_union(f1, f2, MFLAG_SIZE)
#define mflag_copy (   f1,
  f2 
)    flag_copy(f1, f2, MFLAG_SIZE)
#define mflag_diff (   f1,
  f2 
)    flag_diff(f1, f2, MFLAG_SIZE)
#define mflag_has (   f,
  flag 
)    flag_has_dbg(f, MFLAG_SIZE, flag, #f, #flag)
#define mflag_inter (   f1,
  f2 
)    flag_inter(f1, f2, MFLAG_SIZE)
#define mflag_is_empty (   f)    flag_is_empty(f, MFLAG_SIZE)
#define mflag_is_equal (   f1,
  f2 
)    flag_is_equal(f1, f2, MFLAG_SIZE)
#define mflag_is_full (   f)    flag_is_full(f, MFLAG_SIZE)
#define mflag_is_inter (   f1,
  f2 
)    flag_is_inter(f1, f2, MFLAG_SIZE)
#define mflag_is_subset (   f1,
  f2 
)    flag_is_subset(f1, f2, MFLAG_SIZE)
#define mflag_negate (   f)    flag_negate(f, MFLAG_SIZE)
#define mflag_next (   f,
  flag 
)    flag_next(f, MFLAG_SIZE, flag)
#define mflag_off (   f,
  flag 
)    flag_off(f, MFLAG_SIZE, flag)
#define mflag_on (   f,
  flag 
)    flag_on_dbg(f, MFLAG_SIZE, flag, #f, #flag)
#define mflag_setall (   f)    flag_setall(f, MFLAG_SIZE)
#define MFLAG_SIZE   FLAG_SIZE(MFLAG_MAX)
#define mflag_union (   f1,
  f2 
)    flag_union(f1, f2, MFLAG_SIZE)
#define mflag_wipe (   f)    flag_wipe(f, MFLAG_SIZE)
#define RF (   a,
  b,
 
)    RF_##a,
#define rf_comp_union (   f1,
  f2 
)    flag_comp_union(f1, f2, RF_SIZE)
#define rf_copy (   f1,
  f2 
)    flag_copy(f1, f2, RF_SIZE)

Referenced by monster_flags_known().

#define rf_diff (   f1,
  f2 
)    flag_diff(f1, f2, RF_SIZE)
#define RF_DROP_MASK
Value:
RF_DROP_GOOD, \
RF_DROP_GREAT, \
RF_ONLY_ITEM, \
RF_ONLY_GOLD, \
RF_DROP_20, \
RF_DROP_40, \
RF_DROP_60, \
RF_DROP_4, \
RF_DROP_3, \
RF_DROP_2, \
RF_DROP_1

Referenced by lore_update().

#define rf_has (   f,
  flag 
)    flag_has_dbg(f, RF_SIZE, flag, #f, #flag)

Referenced by add_monster_lights(), become_aware(), cave_generate(), cave_light(), compact_monsters(), count_known_monsters(), delete_monster_idx(), describe_origin(), display_monster(), do_animation(), do_cmd_knowledge_monsters(), do_cmd_query_symbol(), draw_path(), effect_handler_BALL(), effect_handler_BANISH(), effect_handler_BREATH(), effect_handler_DETECT_EVIL(), effect_handler_DETECT_INVISIBLE_MONSTERS(), effect_handler_DETECT_VISIBLE_MONSTERS(), effect_handler_EARTHQUAKE(), effect_handler_MASS_BANISH(), eval_hp_adjust(), eval_max_dam(), eval_monster_power(), find_range(), flush_monster_messages(), get_mon_name(), get_mon_num(), get_moves(), grid_data_as_text(), improve_attack_modifier(), lore_append_abilities(), lore_append_attack(), lore_append_drop(), lore_append_exp(), lore_append_friends(), lore_append_kills(), lore_append_movement(), lore_append_spells(), lore_append_toughness(), lore_description(), lore_insert_flag_description(), lore_insert_unknown_vulnerability(), lore_monster_sex(), lore_title(), make_attack_normal(), make_attack_spell(), mon_create_drop(), mon_create_drop_count(), mon_pit_hook(), mon_resist_effect(), mon_restrict(), mon_select(), mon_summary(), mon_take_hit(), monster_death(), monster_desc(), monster_is_unusual(), monster_list_entry_line_color(), monster_swap(), object_absorb_merge(), object_notice_brands(), place_friends(), place_monster(), place_monster_base_okay(), place_new_monster_one(), player_init(), poly_race(), process_monster(), process_monster_can_move(), process_monster_grab_objects(), process_monster_multiply(), process_monster_should_stagger(), process_monster_try_push(), process_player_cleanup(), project_m_apply_side_effects(), project_m_monster_attack(), project_monster_dispel(), project_monster_handler_LIGHT(), project_monster_handler_NETHER(), project_monster_hurt_immune(), project_monster_hurt_only(), project_monster_resist_element(), project_monster_resist_other(), project_monster_scare(), project_monster_teleport_away(), quest_check(), rd_monster_memory(), react_to_specific_slay(), regen_monster(), remove_bad_spells(), spoil_mon_desc(), spoil_mon_info(), store_object_absorb(), summon_specific_okay(), target_set_interactive_aux(), unset_spells(), update_mon(), and update_smart_learn().

#define rf_inter (   f1,
  f2 
)    flag_inter(f1, f2, RF_SIZE)

Referenced by monster_flags_known().

#define rf_is_empty (   f)    flag_is_empty(f, RF_SIZE)
#define rf_is_equal (   f1,
  f2 
)    flag_is_equal(f1, f2, RF_SIZE)
#define rf_is_full (   f)    flag_is_full(f, RF_SIZE)
#define rf_is_inter (   f1,
  f2 
)    flag_is_inter(f1, f2, RF_SIZE)

Referenced by mon_pit_hook().

#define rf_is_subset (   f1,
  f2 
)    flag_is_subset(f1, f2, RF_SIZE)

Referenced by mon_pit_hook().

#define rf_negate (   f)    flag_negate(f, RF_SIZE)
#define rf_next (   f,
  flag 
)    flag_next(f, RF_SIZE, flag)
#define RF_OBVIOUS_MASK
Value:
RF_UNIQUE, RF_QUESTOR, RF_MALE, RF_FEMALE, \
RF_GROUP_AI

Referenced by lore_update().

#define rf_off (   f,
  flag 
)    flag_off(f, RF_SIZE, flag)
#define rf_on (   f,
  flag 
)    flag_on_dbg(f, RF_SIZE, flag, #f, #flag)
#define RF_RACE_MASK
Value:
RF_ORC, RF_TROLL, RF_GIANT, RF_DRAGON, RF_DEMON, \
RF_UNDEAD, RF_EVIL, RF_ANIMAL, RF_METAL, RF_NONLIVING

Referenced by lore_update().

#define rf_setall (   f)    flag_setall(f, RF_SIZE)
#define RF_SIZE   FLAG_SIZE(RF_MAX)
#define rf_union (   f1,
  f2 
)    flag_union(f1, f2, RF_SIZE)
#define rf_wipe (   f)    flag_wipe(f, RF_SIZE)
#define RSF (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h 
)    RSF_##a,
#define RSF_SIZE   FLAG_SIZE(RSF_MAX)

Typedef Documentation

typedef struct monster_base monster_base

Base monster type.

typedef struct monster_pain monster_pain

Monster pain messages.

typedef struct monster_race monster_race

Monster "race" information, including racial memories.

Note that "d_attr" and "d_char" are used for MORE than "visual" stuff.

Note that "cur_num" (and "max_num") represent the number of monsters of the given race currently on (and allowed on) the current level. This information yields the "dead" flag for Unique monsters.

Note that "max_num" is reset when a new player is created. Note that "cur_num" is reset when a new level is created.

Maybe "cur_num", and "max_num" should be moved out of this array since they are not read from "monster.txt".

typedef struct monster monster_type

Monster information, for a specific monster.

Note: fy, fx constrain dungeon size to 256x256

The "held_obj" field points to the first object of a stack of objects (if any) being carried by the monster (see above).

Enumeration Type Documentation

anonymous enum

Special Monster Flags (all temporary)

Enumerator:
MFLAG_MAX 
anonymous enum

Monster property and ability flags (race flags)

Enumerator:
RF_MAX 
anonymous enum

Monster spell flag indices.

Variable Documentation

struct monster_spell* monster_spells
s16b num_repro
monster_pain* pain_messages

Referenced by cleanup_pain(), and finish_parse_pain().

monster_race* r_info
monster_base* rb_info
const monster_race* ref_race