Angband
Macros | Functions | Variables
mon-init.c File Reference

Monster initialization routines. More...

#include "angband.h"
#include "datafile.h"
#include "effects.h"
#include "generate.h"
#include "init.h"
#include "mon-init.h"
#include "mon-lore.h"
#include "mon-msg.h"
#include "mon-spell.h"
#include "mon-util.h"
#include "mon-blows.h"
#include "monster.h"
#include "obj-tval.h"
#include "obj-util.h"
#include "object.h"
#include "player-spell.h"
#include "project.h"
#include "list-mon-race-flags.h"
#include "list-mon-spells.h"
#include "list-object-flags.h"
#include "list-effects.h"

Macros

#define RF(a, b, c)   #a,
 
#define RSF(a, b)   #a,
 
#define OF(a)   #a,
 
#define EFFECT(x, a, b, c, d, e)   #x,
 

Functions

int flag_index_by_name (const char *name)
 Return the index of a flag from its name. More...
 
static struct blow_methodfindmeth (const char *meth_name)
 

Initialize monster blow methods

More...
 
static enum parser_error parse_meth_name (struct parser *p)
 
static enum parser_error parse_meth_cut (struct parser *p)
 
static enum parser_error parse_meth_stun (struct parser *p)
 
static enum parser_error parse_meth_miss (struct parser *p)
 
static enum parser_error parse_meth_phys (struct parser *p)
 
static enum parser_error parse_meth_message_type (struct parser *p)
 
static enum parser_error parse_meth_act_msg (struct parser *p)
 
static enum parser_error parse_meth_desc (struct parser *p)
 
struct parserinit_parse_meth (void)
 
static errr run_parse_meth (struct parser *p)
 
static errr finish_parse_meth (struct parser *p)
 
static void cleanup_meth (void)
 
static struct blow_effectfindeff (const char *eff_name)
 

Initialize monster blow effects

More...
 
static enum parser_error parse_eff_name (struct parser *p)
 
static enum parser_error parse_eff_power (struct parser *p)
 
static enum parser_error parse_eff_eval (struct parser *p)
 
static enum parser_error parse_eff_desc (struct parser *p)
 
static enum parser_error parse_eff_lore_color (struct parser *p)
 
static enum parser_error parse_eff_lore_color_resist (struct parser *p)
 
static enum parser_error parse_eff_lore_color_immune (struct parser *p)
 
static enum parser_error parse_eff_effect_type (struct parser *p)
 
static enum parser_error parse_eff_resist (struct parser *p)
 
struct parserinit_parse_eff (void)
 
static errr run_parse_eff (struct parser *p)
 
static errr finish_parse_eff (struct parser *p)
 
static void cleanup_eff (void)
 
static enum parser_error parse_pain_type (struct parser *p)
 

Initialize monster pain messages

More...
 
static enum parser_error parse_pain_message (struct parser *p)
 
struct parserinit_parse_pain (void)
 
static errr run_parse_pain (struct parser *p)
 
static errr finish_parse_pain (struct parser *p)
 
static void cleanup_pain (void)
 
static enum parser_error parse_mon_spell_name (struct parser *p)
 

Initialize monster spells

More...
 
static enum parser_error parse_mon_spell_lore_color (struct parser *p)
 
static enum parser_error parse_mon_spell_lore_color_resist (struct parser *p)
 
static enum parser_error parse_mon_spell_lore_color_immune (struct parser *p)
 
static enum parser_error parse_mon_spell_message_type (struct parser *p)
 
static enum parser_error parse_mon_spell_message (struct parser *p)
 
static enum parser_error parse_mon_spell_message_strong (struct parser *p)
 
static enum parser_error parse_mon_spell_blind_message (struct parser *p)
 
static enum parser_error parse_mon_spell_blind_message_strong (struct parser *p)
 
static enum parser_error parse_mon_spell_miss_message (struct parser *p)
 
static enum parser_error parse_mon_spell_save_message (struct parser *p)
 
static enum parser_error parse_mon_spell_lore_desc (struct parser *p)
 
static enum parser_error parse_mon_spell_lore_desc_strong (struct parser *p)
 
static enum parser_error parse_mon_spell_hit (struct parser *p)
 
static enum parser_error parse_mon_spell_effect (struct parser *p)
 
static enum parser_error parse_mon_spell_param (struct parser *p)
 
static enum parser_error parse_mon_spell_dice (struct parser *p)
 
static enum parser_error parse_mon_spell_expr (struct parser *p)
 
struct parserinit_parse_mon_spell (void)
 
static errr run_parse_mon_spell (struct parser *p)
 
static errr finish_parse_mon_spell (struct parser *p)
 
static void cleanup_mon_spell (void)
 
static enum parser_error parse_mon_base_name (struct parser *p)
 

Initialize monster bases

More...
 
static enum parser_error parse_mon_base_glyph (struct parser *p)
 
static enum parser_error parse_mon_base_pain (struct parser *p)
 
static enum parser_error parse_mon_base_flags (struct parser *p)
 
static enum parser_error parse_mon_base_spells (struct parser *p)
 
static enum parser_error parse_mon_base_desc (struct parser *p)
 
static struct parserinit_parse_mon_base (void)
 
static errr run_parse_mon_base (struct parser *p)
 
static errr finish_parse_mon_base (struct parser *p)
 
static void cleanup_mon_base (void)
 
static enum parser_error parse_monster_name (struct parser *p)
 

Initialize monsters

More...
 
static enum parser_error parse_monster_base (struct parser *p)
 
static enum parser_error parse_monster_glyph (struct parser *p)
 
static enum parser_error parse_monster_color (struct parser *p)
 
static enum parser_error parse_monster_speed (struct parser *p)
 
static enum parser_error parse_monster_hit_points (struct parser *p)
 
static enum parser_error parse_monster_hearing (struct parser *p)
 
static enum parser_error parse_monster_smell (struct parser *p)
 
static enum parser_error parse_monster_armor_class (struct parser *p)
 
static enum parser_error parse_monster_sleepiness (struct parser *p)
 
static enum parser_error parse_monster_depth (struct parser *p)
 
static enum parser_error parse_monster_rarity (struct parser *p)
 
static enum parser_error parse_monster_experience (struct parser *p)
 
static enum parser_error parse_monster_blow (struct parser *p)
 
static enum parser_error parse_monster_flags (struct parser *p)
 
static enum parser_error parse_monster_flags_off (struct parser *p)
 
static enum parser_error parse_monster_desc (struct parser *p)
 
static enum parser_error parse_monster_spell_freq (struct parser *p)
 
static enum parser_error parse_monster_spell_power (struct parser *p)
 
static enum parser_error parse_monster_spells (struct parser *p)
 
static enum parser_error parse_monster_drop (struct parser *p)
 
static enum parser_error parse_monster_friends (struct parser *p)
 
static enum parser_error parse_monster_friends_base (struct parser *p)
 
static enum parser_error parse_monster_mimic (struct parser *p)
 
static enum parser_error parse_monster_plural (struct parser *p)
 
struct parserinit_parse_monster (void)
 
static errr run_parse_monster (struct parser *p)
 
static errr finish_parse_monster (struct parser *p)
 
static void cleanup_monster (void)
 
static enum parser_error parse_pit_name (struct parser *p)
 

Initialize monster pits

More...
 
static enum parser_error parse_pit_room (struct parser *p)
 
static enum parser_error parse_pit_alloc (struct parser *p)
 
static enum parser_error parse_pit_obj_rarity (struct parser *p)
 
static enum parser_error parse_pit_mon_base (struct parser *p)
 
static enum parser_error parse_pit_mon_ban (struct parser *p)
 
static enum parser_error parse_pit_color (struct parser *p)
 
static enum parser_error parse_pit_flags_req (struct parser *p)
 
static enum parser_error parse_pit_flags_ban (struct parser *p)
 
static enum parser_error parse_pit_spell_req (struct parser *p)
 
static enum parser_error parse_pit_spell_ban (struct parser *p)
 
struct parserinit_parse_pit (void)
 
static errr run_parse_pit (struct parser *p)
 
static errr finish_parse_pit (struct parser *p)
 
static void cleanup_pits (void)
 
static enum parser_error parse_lore_name (struct parser *p)
 

Initialize monster lore

More...
 
static enum parser_error parse_lore_base (struct parser *p)
 
static enum parser_error parse_lore_counts (struct parser *p)
 
static enum parser_error parse_lore_blow (struct parser *p)
 
static enum parser_error parse_lore_flags (struct parser *p)
 
static enum parser_error parse_lore_spells (struct parser *p)
 
static enum parser_error parse_lore_drop (struct parser *p)
 
static enum parser_error parse_lore_friends (struct parser *p)
 
static enum parser_error parse_lore_friends_base (struct parser *p)
 
static enum parser_error parse_lore_mimic (struct parser *p)
 
struct parserinit_parse_lore (void)
 
static errr run_parse_lore (struct parser *p)
 
static errr finish_parse_lore (struct parser *p)
 
static void cleanup_lore (void)
 

Variables

struct blow_methodblow_methods
 
struct blow_effectblow_effects
 
struct monster_painpain_messages
 
struct monster_spellmonster_spells
 
struct monster_baserb_info
 
struct monster_racer_info
 
const struct monster_raceref_race = NULL
 
struct monster_lorel_list
 Array[z_info->r_max] of monster lore. More...
 
const char * r_info_flags []
 
const char * r_info_spell_flags []
 
static const char * obj_flags []
 
static const char * effect_list []
 
struct file_parser meth_parser
 
struct file_parser eff_parser
 
struct file_parser pain_parser
 
struct file_parser mon_spell_parser
 
struct file_parser mon_base_parser
 
struct file_parser monster_parser
 
struct file_parser pit_parser
 
struct file_parser lore_parser
 

Detailed Description

Monster initialization routines.

Copyright (c) 1997 Ben Harrison

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 EFFECT (   x,
  a,
  b,
  c,
  d,
 
)    #x,
#define OF (   a)    #a,
#define RF (   a,
  b,
 
)    #a,
#define RSF (   a,
 
)    #a,

Function Documentation

static void cleanup_eff ( void  )
static
static void cleanup_lore ( void  )
static
static void cleanup_meth ( void  )
static
static void cleanup_mon_base ( void  )
static
static void cleanup_mon_spell ( void  )
static
static void cleanup_monster ( void  )
static
static void cleanup_pain ( void  )
static
static void cleanup_pits ( void  )
static
static struct blow_effect* findeff ( const char *  eff_name)
static


Initialize monster blow effects

References blow_effect::name, blow_effect::next, and streq.

Referenced by parse_lore_blow(), and parse_monster_blow().

static struct blow_method* findmeth ( const char *  meth_name)
static


Initialize monster blow methods

References blow_method::name, blow_method::next, and streq.

Referenced by parse_lore_blow(), and parse_monster_blow().

static errr finish_parse_eff ( struct parser p)
static
static errr finish_parse_lore ( struct parser p)
static
static errr finish_parse_meth ( struct parser p)
static
static errr finish_parse_mon_base ( struct parser p)
static

References parser_destroy(), and parser_priv().

static errr finish_parse_mon_spell ( struct parser p)
static

References parser_destroy(), and parser_priv().

static errr finish_parse_monster ( struct parser p)
static
static errr finish_parse_pain ( struct parser p)
static
static errr finish_parse_pit ( struct parser p)
static
int flag_index_by_name ( const char *  name)

Return the index of a flag from its name.

References i, N_ELEMENTS, obj_flags, and streq.

Referenced by parse_eff_resist().

struct parser* init_parse_eff ( void  )
struct parser* init_parse_lore ( void  )
struct parser* init_parse_meth ( void  )
static struct parser* init_parse_mon_base ( void  )
static
struct parser* init_parse_mon_spell ( void  )
struct parser* init_parse_monster ( void  )
struct parser* init_parse_pain ( void  )
struct parser* init_parse_pit ( void  )
static enum parser_error parse_eff_desc ( struct parser p)
static
static enum parser_error parse_eff_effect_type ( struct parser p)
static
static enum parser_error parse_eff_eval ( struct parser p)
static
static enum parser_error parse_eff_lore_color ( struct parser p)
static
static enum parser_error parse_eff_lore_color_immune ( struct parser p)
static
static enum parser_error parse_eff_lore_color_resist ( struct parser p)
static
static enum parser_error parse_eff_name ( struct parser p)
static
static enum parser_error parse_eff_power ( struct parser p)
static
static enum parser_error parse_eff_resist ( struct parser p)
static
static enum parser_error parse_lore_base ( struct parser p)
static
static enum parser_error parse_lore_blow ( struct parser p)
static
static enum parser_error parse_lore_counts ( struct parser p)
static
static enum parser_error parse_lore_drop ( struct parser p)
static
static enum parser_error parse_lore_flags ( struct parser p)
static
static enum parser_error parse_lore_friends ( struct parser p)
static
static enum parser_error parse_lore_friends_base ( struct parser p)
static
static enum parser_error parse_lore_mimic ( struct parser p)
static
static enum parser_error parse_lore_name ( struct parser p)
static
static enum parser_error parse_lore_spells ( struct parser p)
static
static enum parser_error parse_meth_act_msg ( struct parser p)
static
static enum parser_error parse_meth_cut ( struct parser p)
static
static enum parser_error parse_meth_desc ( struct parser p)
static
static enum parser_error parse_meth_message_type ( struct parser p)
static
static enum parser_error parse_meth_miss ( struct parser p)
static
static enum parser_error parse_meth_name ( struct parser p)
static
static enum parser_error parse_meth_phys ( struct parser p)
static
static enum parser_error parse_meth_stun ( struct parser p)
static
static enum parser_error parse_mon_base_desc ( struct parser p)
static
static enum parser_error parse_mon_base_flags ( struct parser p)
static
static enum parser_error parse_mon_base_glyph ( struct parser p)
static
static enum parser_error parse_mon_base_name ( struct parser p)
static
static enum parser_error parse_mon_base_pain ( struct parser p)
static
static enum parser_error parse_mon_base_spells ( struct parser p)
static
static enum parser_error parse_mon_spell_blind_message ( struct parser p)
static
static enum parser_error parse_mon_spell_blind_message_strong ( struct parser p)
static
static enum parser_error parse_mon_spell_dice ( struct parser p)
static
static enum parser_error parse_mon_spell_effect ( struct parser p)
static
static enum parser_error parse_mon_spell_expr ( struct parser p)
static
static enum parser_error parse_mon_spell_hit ( struct parser p)
static
static enum parser_error parse_mon_spell_lore_color ( struct parser p)
static
static enum parser_error parse_mon_spell_lore_color_immune ( struct parser p)
static
static enum parser_error parse_mon_spell_lore_color_resist ( struct parser p)
static
static enum parser_error parse_mon_spell_lore_desc ( struct parser p)
static
static enum parser_error parse_mon_spell_lore_desc_strong ( struct parser p)
static
static enum parser_error parse_mon_spell_message ( struct parser p)
static
static enum parser_error parse_mon_spell_message_strong ( struct parser p)
static
static enum parser_error parse_mon_spell_message_type ( struct parser p)
static
static enum parser_error parse_mon_spell_miss_message ( struct parser p)
static
static enum parser_error parse_mon_spell_name ( struct parser p)
static
static enum parser_error parse_mon_spell_param ( struct parser p)
static
static enum parser_error parse_mon_spell_save_message ( struct parser p)
static
static enum parser_error parse_monster_armor_class ( struct parser p)
static
static enum parser_error parse_monster_base ( struct parser p)
static
static enum parser_error parse_monster_blow ( struct parser p)
static
static enum parser_error parse_monster_color ( struct parser p)
static
static enum parser_error parse_monster_depth ( struct parser p)
static
static enum parser_error parse_monster_desc ( struct parser p)
static
static enum parser_error parse_monster_drop ( struct parser p)
static
static enum parser_error parse_monster_experience ( struct parser p)
static
static enum parser_error parse_monster_flags ( struct parser p)
static
static enum parser_error parse_monster_flags_off ( struct parser p)
static
static enum parser_error parse_monster_friends ( struct parser p)
static
static enum parser_error parse_monster_friends_base ( struct parser p)
static
static enum parser_error parse_monster_glyph ( struct parser p)
static
static enum parser_error parse_monster_hearing ( struct parser p)
static
static enum parser_error parse_monster_hit_points ( struct parser p)
static
static enum parser_error parse_monster_mimic ( struct parser p)
static
static enum parser_error parse_monster_name ( struct parser p)
static
static enum parser_error parse_monster_plural ( struct parser p)
static
static enum parser_error parse_monster_rarity ( struct parser p)
static
static enum parser_error parse_monster_sleepiness ( struct parser p)
static
static enum parser_error parse_monster_smell ( struct parser p)
static
static enum parser_error parse_monster_speed ( struct parser p)
static
static enum parser_error parse_monster_spell_freq ( struct parser p)
static
static enum parser_error parse_monster_spell_power ( struct parser p)
static
static enum parser_error parse_monster_spells ( struct parser p)
static
static enum parser_error parse_pain_message ( struct parser p)
static
static enum parser_error parse_pain_type ( struct parser p)
static


Initialize monster pain messages

References h, mem_zalloc(), monster_pain::next, monster_pain::pain_idx, parser_getuint(), parser_priv(), and parser_setpriv().

Referenced by init_parse_pain().

static enum parser_error parse_pit_alloc ( struct parser p)
static
static enum parser_error parse_pit_color ( struct parser p)
static
static enum parser_error parse_pit_flags_ban ( struct parser p)
static
static enum parser_error parse_pit_flags_req ( struct parser p)
static
static enum parser_error parse_pit_mon_ban ( struct parser p)
static
static enum parser_error parse_pit_mon_base ( struct parser p)
static
static enum parser_error parse_pit_name ( struct parser p)
static
static enum parser_error parse_pit_obj_rarity ( struct parser p)
static
static enum parser_error parse_pit_room ( struct parser p)
static
static enum parser_error parse_pit_spell_ban ( struct parser p)
static
static enum parser_error parse_pit_spell_req ( struct parser p)
static
static errr run_parse_eff ( struct parser p)
static
static errr run_parse_lore ( struct parser p)
static
static errr run_parse_meth ( struct parser p)
static
static errr run_parse_mon_base ( struct parser p)
static
static errr run_parse_mon_spell ( struct parser p)
static
static errr run_parse_monster ( struct parser p)
static
static errr run_parse_pain ( struct parser p)
static
static errr run_parse_pit ( struct parser p)
static

Variable Documentation

struct blow_effect* blow_effects

Referenced by cleanup_eff().

struct blow_method* blow_methods
struct file_parser eff_parser
Initial value:
= {
"blow_effects",
}
static errr finish_parse_eff(struct parser *p)
Definition: mon-init.c:415
static errr run_parse_eff(struct parser *p)
Definition: mon-init.c:411
struct parser * init_parse_eff(void)
Definition: mon-init.c:396
static void cleanup_eff(void)
Definition: mon-init.c:446
const char* effect_list[]
static

Referenced by parse_mon_spell_effect().

struct monster_lore* l_list
struct file_parser lore_parser
Initial value:
= {
"lore",
}
static errr run_parse_lore(struct parser *p)
Definition: mon-init.c:2224
static void cleanup_lore(void)
Definition: mon-init.c:2273
static errr finish_parse_lore(struct parser *p)
Definition: mon-init.c:2232
struct parser * init_parse_lore(void)
Definition: mon-init.c:2190
struct file_parser meth_parser
Initial value:
= {
"blow_methods",
}
static void cleanup_meth(void)
Definition: mon-init.c:245
static errr finish_parse_meth(struct parser *p)
Definition: mon-init.c:215
static errr run_parse_meth(struct parser *p)
Definition: mon-init.c:211
struct parser * init_parse_meth(void)
Definition: mon-init.c:197
struct file_parser mon_base_parser
Initial value:
= {
"monster_base",
}
static void cleanup_mon_base(void)
Definition: mon-init.c:1059
static struct parser * init_parse_mon_base(void)
Definition: mon-init.c:1036
static errr finish_parse_mon_base(struct parser *p)
Definition: mon-init.c:1053
static errr run_parse_mon_base(struct parser *p)
Definition: mon-init.c:1049
struct file_parser mon_spell_parser
Initial value:
= {
"monster_spell",
}
static errr finish_parse_mon_spell(struct parser *p)
Definition: mon-init.c:902
static errr run_parse_mon_spell(struct parser *p)
Definition: mon-init.c:898
static void cleanup_mon_spell(void)
Definition: mon-init.c:908
struct parser * init_parse_mon_spell(void)
Definition: mon-init.c:874
struct file_parser monster_parser
Initial value:
= {
"monster",
}
static errr run_parse_monster(struct parser *p)
Definition: mon-init.c:1513
static errr finish_parse_monster(struct parser *p)
Definition: mon-init.c:1517
static void cleanup_monster(void)
Definition: mon-init.c:1618
struct parser * init_parse_monster(void)
Definition: mon-init.c:1481
struct monster_spell* monster_spells
const char* obj_flags[]
static

Referenced by flag_index_by_name().

struct monster_pain* pain_messages
struct file_parser pain_parser
Initial value:
= {
"pain messages",
}
static errr run_parse_pain(struct parser *p)
Definition: mon-init.c:507
static void cleanup_pain(void)
Definition: mon-init.c:540
static errr finish_parse_pain(struct parser *p)
Definition: mon-init.c:511
struct parser * init_parse_pain(void)
Definition: mon-init.c:498
struct file_parser pit_parser
Initial value:
= {
"pits",
}
struct parser * init_parse_pit(void)
Definition: mon-init.c:1863
static void cleanup_pits(void)
Definition: mon-init.c:1919
static errr finish_parse_pit(struct parser *p)
Definition: mon-init.c:1885
static errr run_parse_pit(struct parser *p)
Definition: mon-init.c:1881
struct monster_race* r_info
const char* r_info_flags[]
const char* r_info_spell_flags[]
struct monster_base* rb_info
const struct monster_race* ref_race = NULL