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

Monster initialization routines. More...

#include "angband.h"
#include "init.h"
#include "mon-init.h"
#include "mon-lore.h"
#include "mon-msg.h"
#include "mon-power.h"
#include "mon-spell.h"
#include "mon-util.h"
#include "mon-blow-methods.h"
#include "mon-blow-effects.h"
#include "monster.h"
#include "obj-tval.h"
#include "obj-util.h"
#include "object.h"
#include "parser.h"
#include "player-spell.h"
#include "list-mon-race-flags.h"
#include "list-mon-spells.h"
#include "list-effects.h"

Macros

#define RF(a, b, c)   #a,
#define RSF(a, b, c, d, e, f, g, h)   #a,
#define EFFECT(x, a, b, d)   #x,

Functions

void write_flags (ang_file *fff, const char *intro_text, bitflag *flags, int flag_size, const char *names[])
 Write the flag lines for a set of flags.
static enum parser_error parse_mon_spell_name (struct parser *p)
 Parsing functions for monster_spell.txt.
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)
static enum parser_error parse_mon_spell_power (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)
 Parsing functions for monster_base.txt.
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)
 Parsing functions for monster.txt.
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_info (struct parser *p)
static enum parser_error parse_monster_power (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_spells (struct parser *p)
static enum parser_error parse_monster_drop (struct parser *p)
static enum parser_error parse_monster_drop_artifact (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_lore_name (struct parser *p)
static enum parser_error parse_lore_t (struct parser *p)
static enum parser_error parse_lore_counts (struct parser *p)
static enum parser_error parse_lore_b (struct parser *p)
static enum parser_error parse_lore_f (struct parser *p)
static enum parser_error parse_lore_s (struct parser *p)
static enum parser_error parse_lore_drop (struct parser *p)
static enum parser_error parse_lore_drop_artifact (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

monster_painpain_messages
struct monster_spellmonster_spells
monster_baserb_info
monster_racer_info
const monster_raceref_race = NULL
monster_lorel_list
 Array[z_info->r_max] of monster lore.
const char * r_info_flags []
const char * r_info_spell_flags []
static const char * effect_list []
struct file_parser mon_spell_parser
struct file_parser mon_base_parser
struct file_parser monster_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,
 
)    #x,
#define RF (   a,
  b,
 
)    #a,
#define RSF (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h 
)    #a,

Function Documentation

static void cleanup_lore ( void  )
static
static void cleanup_mon_base ( void  )
static
static void cleanup_mon_spell ( void  )
static
static void cleanup_monster ( void  )
static
static errr finish_parse_lore ( 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
struct parser* init_parse_lore ( void  )
read
static struct parser* init_parse_mon_base ( void  )
staticread
struct parser* init_parse_mon_spell ( void  )
read
struct parser* init_parse_monster ( void  )
read
static enum parser_error parse_lore_b ( 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_drop_artifact ( struct parser p)
static
static enum parser_error parse_lore_f ( 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_s ( struct parser p)
static
static enum parser_error parse_lore_t ( 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

Parsing functions for monster_base.txt.

References h, mem_zalloc(), monster_base::name, monster_base::next, parser_getstr(), parser_priv(), parser_setpriv(), and string_make().

Referenced by init_parse_mon_base().

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_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_name ( struct parser p)
static
static enum parser_error parse_mon_spell_param ( struct parser p)
static
static enum parser_error parse_mon_spell_power ( 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_desc ( struct parser p)
static
static enum parser_error parse_monster_drop ( struct parser p)
static
static enum parser_error parse_monster_drop_artifact ( 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_info ( 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_power ( struct parser p)
static
static enum parser_error parse_monster_spell_freq ( struct parser p)
static
static enum parser_error parse_monster_spells ( struct parser p)
static
static errr run_parse_lore ( struct parser p)
static
static errr run_parse_mon_base ( struct parser p)
static

References parse_file().

static errr run_parse_mon_spell ( struct parser p)
static

References parse_file().

static errr run_parse_monster ( struct parser p)
static

References parse_file().

void write_flags ( ang_file fff,
const char *  intro_text,
bitflag flags,
int  flag_size,
const char *  names[] 
)

Write the flag lines for a set of flags.

References buf, file_putf(), flag, FLAG_END, flag_next(), FLAG_START, my_strcat(), and my_strcpy().

Variable Documentation

const char* effect_list[]
static

Referenced by parse_mon_spell_effect().

monster_lore* l_list
struct file_parser lore_parser
struct file_parser mon_base_parser
struct file_parser mon_spell_parser
struct file_parser monster_parser
struct monster_spell* monster_spells
monster_pain* pain_messages

Referenced by cleanup_pain(), and finish_parse_pain().

monster_race* r_info
const char* r_info_flags[]
const char* r_info_spell_flags[]
monster_base* rb_info
const monster_race* ref_race = NULL