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 */
67  /* Monster gameplay constants, read from constants.txt */
74  /* Dungeon generation constants, read from constants.txt */
84  /* World shape constants, read from constants.txt */
85  u16b max_depth; /* Maximum dungeon level */
86  u16b day_length; /* Number of turns from dawn to dawn */
91  u16b feeling_total; /* Total number of feeling squares per level */
92  u16b feeling_need; /* Squares needed to see to get first feeling */
93  u16b stair_skip; /* Number of levels to skip for each down stair */
94  u16b move_energy; /* Energy the player or monster needs to move */
96  /* Carrying capacity constants, read from constants.txt */
102  /* Store parameters, read from constants.txt */
108  /* Object creation constants, read from constants.txt */
109  u16b max_obj_depth; /* Maximum depth used in object allocation */
110  u16b great_obj; /* 1/chance of inflating the requested object level */
111  u16b great_ego; /* 1/chance of inflating the requested ego item level */
112  u16b fuel_torch; /* Maximum amount of fuel in a torch */
113  u16b fuel_lamp; /* Maximum amount of fuel in a lantern */
114  u16b default_lamp; /* Default amount of fuel in a lantern */
116  /* Player constants, read from constants.txt */
117  u16b max_sight; /* Maximum visual range */
118  u16b max_range; /* Maximum missile and spell range */
119  u16b start_gold; /* Amount of gold the player starts with */
120 };
122 struct init_module {
123  const char *name;
124  void (*init)(void);
125  void (*cleanup)(void);
126 };
128 extern const char *list_element_names[];
129 extern const char *list_obj_flag_names[];
131 extern struct angband_constants *z_info;
133 extern const char *ANGBAND_SYS;
135 extern char *ANGBAND_DIR_GAMEDATA;
136 extern char *ANGBAND_DIR_CUSTOMIZE;
137 extern char *ANGBAND_DIR_HELP;
138 extern char *ANGBAND_DIR_SCREENS;
139 extern char *ANGBAND_DIR_FONTS;
140 extern char *ANGBAND_DIR_TILES;
141 extern char *ANGBAND_DIR_SOUNDS;
142 extern char *ANGBAND_DIR_ICONS;
143 extern char *ANGBAND_DIR_USER;
144 extern char *ANGBAND_DIR_SAVE;
145 extern char *ANGBAND_DIR_SCORES;
146 extern char *ANGBAND_DIR_INFO;
147 extern char *ANGBAND_DIR_ARCHIVE;
149 extern struct parser *init_parse_artifact(void);
150 extern struct parser *init_parse_class(void);
151 extern struct parser *init_parse_ego(void);
152 extern struct parser *init_parse_feat(void);
153 extern struct parser *init_parse_history(void);
154 extern struct parser *init_parse_object(void);
155 extern struct parser *init_parse_object_base(void);
156 extern struct parser *init_parse_pain(void);
157 extern struct parser *init_parse_p_race(void);
158 extern struct parser *init_parse_pit(void);
159 extern struct parser *init_parse_monster(void);
160 extern struct parser *init_parse_vault(void);
161 extern struct parser *init_parse_constants(void);
162 extern struct parser *init_parse_flavor(void);
163 extern struct parser *init_parse_names(void);
164 extern struct parser *init_parse_hints(void);
165 extern struct parser *init_parse_trap(void);
166 extern struct parser *init_parse_quest(void);
168 extern struct file_parser flavor_parser;
170 errr grab_effect_data(struct parser *p, struct effect *effect);
171 extern void init_file_paths(const char *config, const char *lib, const char *data);
172 extern void init_game_constants(void);
173 extern void init_arrays(void);
174 extern void create_needed_dirs(void);
175 extern bool init_angband(void);
176 extern void cleanup_angband(void);
178 #endif /* INCLUDED_INIT_H */
uint16_t u16b
Definition: h-basic.h:169
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:70
u16b both_item_av
Average number of items in random places.
Definition: init.h:80
struct parser * init_parse_quest(void)
Definition: player-quest.c:76
const char * name
Definition: init.h:123
u16b max_sight
Definition: init.h:117
u16b great_obj
Definition: init.h:110
u16b great_ego
Definition: init.h:111
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:82
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
struct parser * init_parse_hints(void)
Definition: init.c:3359
Low-level bit vector manipulation.
u16b level_monster_min
Minimum number generated.
Definition: init.h:60
u16b max_range
Definition: init.h:118
u16b day_length
Definition: init.h:86
u16b alloc_monster_chance
1/per-turn-chance of generation
Definition: init.h:59
u16b feeling_total
Definition: init.h:91
errr grab_effect_data(struct parser *p, struct effect *effect)
Definition: init.c:167
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:1317
u16b blow_effects_max
Maximum number of monster blow effects.
Definition: init.h:45
struct parser * init_parse_object(void)
Definition: obj-init.c:1862
void init_game_constants(void)
Initialize game constants.
Definition: init.c:727
Various directories.
Definition: init.c:81
struct angband_constants * z_info
Structure (not array) of game constants.
Definition: init.c:70
u16b glyph_hardness
How hard for a monster to break a glyph.
Definition: init.h:68
static term_data data[MAX_TERM_DATA]
Definition: main-nds.c:156
u16b fuel_lamp
Definition: init.h:113
Definition: init.c:84
Definition: init.c:83
u16b property_max
Maximum number of object properties.
Definition: init.h:51
u16b store_turns
Number of turns between turnovers.
Definition: init.h:104
u16b pack_size
Maximum number of pack slots.
Definition: init.h:97
Definition: init.c:93
int errr
ANSI C headers.
Definition: h-basic.h:164
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:90
Definition: init.c:92
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:3334
u16b feeling_need
Definition: init.h:92
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:3525
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:69
u16b wall_pierce_max
Maximum number of potential wall piercings.
Definition: init.h:77
struct parser * init_parse_vault(void)
Definition: generate.c:553
u16b store_shuffle
1/per-day-chance of owner changing
Definition: init.h:105
u16b repro_monster_max
Maximum breeders on a level.
Definition: init.h:63
struct parser * init_parse_monster(void)
Definition: mon-init.c:1488
The lowest level header.
struct parser * init_parse_ego(void)
Definition: obj-init.c:2310
struct parser * init_parse_flavor(void)
Definition: init.c:3298
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:395
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:3452
u16b tunn_grid_max
Maximum number of tunnel grids.
Definition: init.h:78
u16b fuel_torch
Definition: init.h:112
u16b room_item_av
Average number of items in rooms.
Definition: init.h:79
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:106
u16b ood_monster_chance
Chance of OoD monster is 1 in this.
Definition: init.h:64
Definition: init.c:91
const char * ANGBAND_SYS
Definition: init.c:76
u16b turn_range
Monsters turn to fight closer than this.
Definition: init.h:72
Definition: init.h:122
Definition: init.c:88
Definition: datafile.h:25
u16b dungeon_hgt
Maximum number of vertical grids on a level.
Definition: init.h:87
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:114
const char * list_obj_flag_names[]
Definition: init.c:102
u16b both_gold_av
Average number of money items.
Definition: init.h:81
basic object structs and enums
Definition: init.c:82
u16b town_hgt
Maximum number of vertical grids in the town.
Definition: init.h:89
u16b max_depth
Definition: init.h:85
struct parser * init_parse_artifact(void)
Definition: obj-init.c:2676
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:299
u16b flee_range
Monsters run this many grids out of view.
Definition: init.h:71
struct parser * init_parse_class(void)
Definition: init.c:3138
u16b equip_slots_max
Maximum number of player equipment slots.
Definition: init.h:46
struct parser * init_parse_pain(void)
Definition: mon-init.c:510
u16b quiver_slot_size
Maximum number of missiles per quiver slot.
Definition: init.h:99
u16b level_room_max
Maximum number of rooms on a level.
Definition: init.h:75
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:100
struct parser * init_parse_history(void)
Definition: init.c:1810
u16b move_energy
Definition: init.h:94
u16b mp_max
Maximum number of monster pain message sets.
Definition: init.h:36
void cleanup_angband(void)
Free all the stuff initialised in init_angband()
Definition: init.c:3555
Definition: init.c:87
Definition: object.h:52
struct parser * init_parse_object_base(void)
Definition: obj-init.c:557
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:76
Definition: init.c:90
Definition: init.c:89
u16b max_obj_depth
Definition: init.h:109
struct parser * init_parse_constants(void)
Definition: init.c:682
u16b dungeon_wid
Maximum number of horizontical grids on a level.
Definition: init.h:88
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:1871
u16b quiver_size
Maximum number of quiver slots.
Definition: init.h:98
Definition: init.c:85
struct parser * init_parse_feat(void)
Definition: init.c:1554
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:103
struct parser * init_parse_p_race(void)
Definition: init.c:2099
u16b stair_skip
Definition: init.h:93
u16b start_gold
Definition: init.h:119
struct parser * init_parse_names(void)
Definition: init.c:870
Definition: init.c:86
const char * list_element_names[]
Definition: init.c:120
A Random Number Generator for Angband.