Go to the documentation of this file.
12 #ifndef INCLUDED_INIT_H
13 #define INCLUDED_INIT_H
15 #include "h-basic.h"
16 #include "z-bitflag.h"
17 #include "z-file.h"
18 #include "z-rand.h"
19 #include "datafile.h"
20 #include "object.h"
28 {
29  /* Array bounds etc, set on parsing edit files */
55  /* Maxima of things on a given level, read from constants.txt */
58  /* Monster generation constants, read from constants.txt */
69  /* Monster gameplay constants, read from constants.txt */
76  /* Dungeon generation constants, read from constants.txt */
86  /* World shape constants, read from constants.txt */
87  u16b max_depth; /* Maximum dungeon level */
88  u16b day_length; /* Number of turns from dawn to dawn */
93  u16b feeling_total; /* Total number of feeling squares per level */
94  u16b feeling_need; /* Squares needed to see to get first feeling */
95  u16b stair_skip; /* Number of levels to skip for each down stair */
96  u16b move_energy; /* Energy the player or monster needs to move */
98  /* Carrying capacity constants, read from constants.txt */
104  /* Store parameters, read from constants.txt */
110  /* Object creation constants, read from constants.txt */
111  u16b max_obj_depth; /* Maximum depth used in object allocation */
112  u16b great_obj; /* 1/chance of inflating the requested object level */
113  u16b great_ego; /* 1/chance of inflating the requested ego item level */
114  u16b fuel_torch; /* Maximum amount of fuel in a torch */
115  u16b fuel_lamp; /* Maximum amount of fuel in a lantern */
116  u16b default_lamp; /* Default amount of fuel in a lantern */
118  /* Player constants, read from constants.txt */
119  u16b max_sight; /* Maximum visual range */
120  u16b max_range; /* Maximum missile and spell range */
121  u16b start_gold; /* Amount of gold the player starts with */
122  u16b food_value; /* Number of turns 1% of food lasts */
123 };
125 struct init_module {
126  const char *name;
127  void (*init)(void);
128  void (*cleanup)(void);
129 };
131 extern bool play_again;
133 extern const char *list_element_names[];
134 extern const char *list_obj_flag_names[];
136 extern struct angband_constants *z_info;
138 extern const char *ANGBAND_SYS;
140 extern char *ANGBAND_DIR_GAMEDATA;
141 extern char *ANGBAND_DIR_CUSTOMIZE;
142 extern char *ANGBAND_DIR_HELP;
143 extern char *ANGBAND_DIR_SCREENS;
144 extern char *ANGBAND_DIR_FONTS;
145 extern char *ANGBAND_DIR_TILES;
146 extern char *ANGBAND_DIR_SOUNDS;
147 extern char *ANGBAND_DIR_ICONS;
148 extern char *ANGBAND_DIR_USER;
149 extern char *ANGBAND_DIR_SAVE;
150 extern char *ANGBAND_DIR_SCORES;
151 extern char *ANGBAND_DIR_INFO;
152 extern char *ANGBAND_DIR_ARCHIVE;
154 extern struct parser *init_parse_artifact(void);
155 extern struct parser *init_parse_class(void);
156 extern struct parser *init_parse_ego(void);
157 extern struct parser *init_parse_feat(void);
158 extern struct parser *init_parse_history(void);
159 extern struct parser *init_parse_object(void);
160 extern struct parser *init_parse_object_base(void);
161 extern struct parser *init_parse_pain(void);
162 extern struct parser *init_parse_p_race(void);
163 extern struct parser *init_parse_pit(void);
164 extern struct parser *init_parse_monster(void);
165 extern struct parser *init_parse_vault(void);
166 extern struct parser *init_parse_constants(void);
167 extern struct parser *init_parse_flavor(void);
168 extern struct parser *init_parse_names(void);
169 extern struct parser *init_parse_hints(void);
170 extern struct parser *init_parse_trap(void);
171 extern struct parser *init_parse_chest_trap(void);
172 extern struct parser *init_parse_quest(void);
174 extern struct file_parser flavor_parser;
176 errr grab_effect_data(struct parser *p, struct effect *effect);
177 extern void init_file_paths(const char *config, const char *lib, const char *data);
178 extern void init_game_constants(void);
179 extern void init_arrays(void);
180 extern void create_needed_dirs(void);
181 extern bool init_angband(void);
182 extern void cleanup_angband(void);
184 #endif /* INCLUDED_INIT_H */
uint16_t u16b
Definition: h-basic.h:161
u16b ordinary_kind_max
Maximum number of objects in object.txt.
Definition: init.h:52
u16b life_drain_percent
Percent of player life drained.
Definition: init.h:72
u16b both_item_av
Average number of items in random places.
Definition: init.h:82
struct parser * init_parse_quest(void)
Definition: player-quest.c:76
const char * name
Definition: init.h:126
u16b max_sight
Definition: init.h:119
u16b great_obj
Definition: init.h:112
u16b great_ego
Definition: init.h:113
u16b level_monster_max
Maximum number of monsters on a given level.
Definition: init.h:56
u16b level_pit_max
Maximum number of pits on a level.
Definition: init.h:84
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
struct parser * init_parse_hints(void)
Definition: init.c:3628
Low-level bit vector manipulation.
u16b level_monster_min
Minimum number generated.
Definition: init.h:60
u16b max_range
Definition: init.h:120
u16b day_length
Definition: init.h:88
u16b alloc_monster_chance
1/per-turn-chance of generation
Definition: init.h:59
u16b feeling_total
Definition: init.h:93
errr grab_effect_data(struct parser *p, struct effect *effect)
Definition: init.c:173
u16b r_max
Maximum number of monster races.
Definition: init.h:35
Low-level file (and directory) handling.
struct parser * init_parse_trap(void)
Definition: init.c:1563
u16b blow_effects_max
Maximum number of monster blow effects.
Definition: init.h:45
struct parser * init_parse_object(void)
Definition: obj-init.c:1941
void init_game_constants(void)
Initialize game constants.
Definition: init.c:739
Various directories.
Definition: init.c:87
struct angband_constants * z_info
Structure (not array) of game constants.
Definition: init.c:76
u16b glyph_hardness
How hard for a monster to break a glyph.
Definition: init.h:70
static term_data data[MAX_TERM_DATA]
Definition: main-nds.c:158
u16b fuel_lamp
Definition: init.h:115
Definition: init.c:90
u16b monster_group_max
Maximum size of a group.
Definition: init.h:66
Definition: init.c:89
u16b property_max
Maximum number of object properties.
Definition: init.h:51
u16b store_turns
Number of turns between turnovers.
Definition: init.h:106
u16b pack_size
Maximum number of pack slots.
Definition: init.h:99
Definition: init.c:99
int errr
ANSI C headers.
Definition: h-basic.h:156
u16b pit_max
Maximum number of monster pit types.
Definition: init.h:38
u16b town_wid
Maximum number of horizontical grids in the town.
Definition: init.h:92
Definition: init.c:98
u16b profile_max
Maximum number of cave_profiles.
Definition: init.h:47
u16b s_max
Maximum number of magic spells.
Definition: init.h:37
u16b town_monsters_day
Townsfolk generated - day.
Definition: init.h:61
struct file_parser flavor_parser
Definition: init.c:3603
u16b feeling_need
Definition: init.h:94
u16b curse_max
Maximum number of curses.
Definition: init.h:40
u16b brand_max
Maximum number of brands.
Definition: init.h:42
u16b act_max
Maximum number of activations for randarts.
Definition: init.h:39
bool init_angband(void)
Initialise Angband's data stores and allocate memory for structures, etc, so that the game can get st...
Definition: init.c:3802
u16b blow_methods_max
Maximum number of monster blow methods.
Definition: init.h:44
u16b repro_monster_rate
Monster reproduction rate-slower.
Definition: init.h:71
u16b wall_pierce_max
Maximum number of potential wall piercings.
Definition: init.h:79
struct parser * init_parse_vault(void)
Definition: generate.c:563
u16b store_shuffle
1/per-day-chance of owner changing
Definition: init.h:107
u16b repro_monster_max
Maximum breeders on a level.
Definition: init.h:63
struct parser * init_parse_monster(void)
Definition: mon-init.c:1599
The lowest level header.
struct parser * init_parse_ego(void)
Definition: obj-init.c:2392
struct parser * init_parse_flavor(void)
Definition: init.c:3567
u16b shape_max
Maximum number of player shapes.
Definition: init.h:53
u16b f_max
Maximum number of terrain features.
Definition: init.h:30
void create_needed_dirs(void)
Create any missing directories.
Definition: init.c:401
u16b ood_monster_amount
Max number of levels OoD.
Definition: init.h:65
u16b a_max
Maximum number of artifact kinds.
Definition: init.h:33
void init_arrays(void)
Initialize just the internal arrays.
Definition: init.c:3724
u16b tunn_grid_max
Maximum number of tunnel grids.
Definition: init.h:80
u16b fuel_torch
Definition: init.h:114
bool play_again
Definition: init.c:71
u16b room_item_av
Average number of items in rooms.
Definition: init.h:81
u16b trap_max
Maximum number of trap kinds.
Definition: init.h:31
const char ** p[]
Definition: name.c:40
u16b slay_max
Maximum number of slays.
Definition: init.h:41
u16b store_magic_level
Level for apply_magic() in normal stores.
Definition: init.h:108
u16b ood_monster_chance
Chance of OoD monster is 1 in this.
Definition: init.h:64
Definition: init.c:97
const char * ANGBAND_SYS
Definition: init.c:82
u16b turn_range
Monsters turn to fight closer than this.
Definition: init.h:74
Definition: init.h:125
Definition: init.c:94
u16b monster_group_dist
Max dist of a group from a related group.
Definition: init.h:67
Definition: datafile.h:25
u16b dungeon_hgt
Maximum number of vertical grids on a level.
Definition: init.h:89
Information about maximal indices of certain arrays.
Definition: init.h:27
u16b quest_max
Maximum number of quests.
Definition: init.h:48
u16b default_lamp
Definition: init.h:116
const char * list_obj_flag_names[]
Definition: init.c:108
u16b both_gold_av
Average number of money items.
Definition: init.h:83
basic object structs and enums
Definition: init.c:88
u16b town_hgt
Maximum number of vertical grids in the town.
Definition: init.h:91
u16b max_depth
Definition: init.h:87
struct parser * init_parse_artifact(void)
Definition: obj-init.c:2779
void init_file_paths(const char *config, const char *lib, const char *data)
Find the default paths to all of our important sub-directories.
Definition: init.c:305
u16b flee_range
Monsters run this many grids out of view.
Definition: init.h:73
struct parser * init_parse_class(void)
Definition: init.c:3407
u16b equip_slots_max
Maximum number of player equipment slots.
Definition: init.h:46
struct parser * init_parse_pain(void)
Definition: mon-init.c:514
u16b quiver_slot_size
Maximum number of missiles per quiver slot.
Definition: init.h:101
u16b level_room_max
Maximum number of rooms on a level.
Definition: init.h:77
u16b mon_blows_max
Maximum number of monster blows.
Definition: init.h:43
u16b floor_size
Maximum number of items per floor grid.
Definition: init.h:102
struct parser * init_parse_history(void)
Definition: init.c:2055
u16b move_energy
Definition: init.h:96
u16b mp_max
Maximum number of monster pain message sets.
Definition: init.h:36
u16b food_value
Definition: init.h:122
void cleanup_angband(void)
Free all the stuff initialised in init_angband()
Definition: init.c:3832
Definition: init.c:93
struct parser * init_parse_chest_trap(void)
Definition: obj-chest.c:242
Definition: object.h:52
struct parser * init_parse_object_base(void)
Definition: obj-init.c:576
u16b k_max
Maximum number of object base kinds.
Definition: init.h:32
u16b town_monsters_night
Townsfolk generated - night.
Definition: init.h:62
Definition: parser.c:74
u16b level_door_max
Maximum number of potential doors on a level.
Definition: init.h:78
Definition: init.c:96
Definition: init.c:95
u16b max_obj_depth
Definition: init.h:111
struct parser * init_parse_constants(void)
Definition: init.c:694
u16b dungeon_wid
Maximum number of horizontical grids on a level.
Definition: init.h:90
Data file writing routines.
u16b projection_max
Maximum number of projection types.
Definition: init.h:49
struct parser * init_parse_pit(void)
Definition: mon-init.c:2016
u16b quiver_size
Maximum number of quiver slots.
Definition: init.h:100
Definition: init.c:91
struct parser * init_parse_feat(void)
Definition: init.c:1800
u16b e_max
Maximum number of ego-item kinds.
Definition: init.h:34
u16b calculation_max
Maximum number of object power calculations.
Definition: init.h:50
u16b store_inven_max
Maximum number of objects in store inventory.
Definition: init.h:105
struct parser * init_parse_p_race(void)
Definition: init.c:2365
u16b stair_skip
Definition: init.h:95
u16b start_gold
Definition: init.h:121
struct parser * init_parse_names(void)
Definition: init.c:1116
Definition: init.c:92
const char * list_element_names[]
Definition: init.c:126
A Random Number Generator for Angband.