Angband
init.h
Go to the documentation of this file.
1 
12 #ifndef INCLUDED_INIT_H
13 #define INCLUDED_INIT_H
14 
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"
21 
28 {
29  /* Array bounds, set on parsing edit files */
54  /* Maxima of things on a given level, read from constants.txt */
57  /* Monster generation constants, read from constants.txt */
66  /* Monster gameplay constants, read from constants.txt */
73  /* Dungeon generation constants, read from constants.txt */
83  /* World shape constants, read from constants.txt */
84  u16b max_depth; /* Maximum dungeon level */
85  u16b day_length; /* Number of turns from dawn to dawn */
90  u16b feeling_total; /* Total number of feeling squares per level */
91  u16b feeling_need; /* Squares needed to see to get first feeling */
92  u16b stair_skip; /* Number of levels to skip for each down stair */
93  u16b move_energy; /* Energy the player or monster needs to move */
94 
95  /* Carrying capacity constants, read from constants.txt */
101  /* Store parameters, read from constants.txt */
107  /* Object creation constants, read from constants.txt */
108  u16b max_obj_depth; /* Maximum depth used in object allocation */
109  u16b great_obj; /* 1/chance of inflating the requested object level */
110  u16b great_ego; /* 1/chance of inflating the requested ego item level */
111  u16b fuel_torch; /* Maximum amount of fuel in a torch */
112  u16b fuel_lamp; /* Maximum amount of fuel in a lantern */
113  u16b default_lamp; /* Default amount of fuel in a lantern */
114 
115  /* Player constants, read from constants.txt */
116  u16b max_sight; /* Maximum visual range */
117  u16b max_range; /* Maximum missile and spell range */
118  u16b start_gold; /* Amount of gold the player starts with */
119 };
120 
121 struct init_module {
122  const char *name;
125 };
126 
127 extern const char *list_element_names[];
128 extern const char *list_obj_flag_names[];
129 
130 extern struct angband_constants *z_info;
131 
132 extern const char *ANGBAND_SYS;
133 
134 extern char *ANGBAND_DIR_GAMEDATA;
135 extern char *ANGBAND_DIR_CUSTOMIZE;
136 extern char *ANGBAND_DIR_HELP;
137 extern char *ANGBAND_DIR_SCREENS;
138 extern char *ANGBAND_DIR_FONTS;
139 extern char *ANGBAND_DIR_TILES;
140 extern char *ANGBAND_DIR_SOUNDS;
141 extern char *ANGBAND_DIR_ICONS;
142 extern char *ANGBAND_DIR_USER;
143 extern char *ANGBAND_DIR_SAVE;
144 extern char *ANGBAND_DIR_SCORES;
145 extern char *ANGBAND_DIR_INFO;
146 extern char *ANGBAND_DIR_ARCHIVE;
147 
148 extern struct parser *init_parse_artifact(void);
149 extern struct parser *init_parse_class(void);
150 extern struct parser *init_parse_ego(void);
151 extern struct parser *init_parse_feat(void);
152 extern struct parser *init_parse_history(void);
153 extern struct parser *init_parse_object(void);
154 extern struct parser *init_parse_object_base(void);
155 extern struct parser *init_parse_pain(void);
156 extern struct parser *init_parse_p_race(void);
157 extern struct parser *init_parse_pit(void);
158 extern struct parser *init_parse_monster(void);
159 extern struct parser *init_parse_vault(void);
160 extern struct parser *init_parse_constants(void);
161 extern struct parser *init_parse_flavor(void);
162 extern struct parser *init_parse_names(void);
163 extern struct parser *init_parse_hints(void);
164 extern struct parser *init_parse_trap(void);
165 extern struct parser *init_parse_quest(void);
166 
167 errr grab_effect_data(struct parser *p, struct effect *effect);
168 extern void init_file_paths(const char *config, const char *lib, const char *data);
169 extern void init_game_constants(void);
170 extern void init_arrays(void);
171 extern void create_needed_dirs(void);
172 extern bool init_angband(void);
173 extern void cleanup_angband(void);
174 
175 #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:69
u16b both_item_av
Average number of items in random places.
Definition: init.h:79
struct parser * init_parse_quest(void)
Definition: player-quest.c:76
const char * name
Definition: init.h:122
u16b max_sight
Definition: init.h:116
u16b great_obj
Definition: init.h:109
u16b great_ego
Definition: init.h:110
u16b level_monster_max
Maximum number of monsters on a given level.
Definition: init.h:55
u16b level_pit_max
Maximum number of pits on a level.
Definition: init.h:81
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
struct parser * init_parse_hints(void)
Definition: init.c:2660
Low-level bit vector manipulation.
u16b level_monster_min
Minimum number generated.
Definition: init.h:59
u16b max_range
Definition: init.h:117
u16b day_length
Definition: init.h:85
u16b alloc_monster_chance
1/per-turn-chance of generation
Definition: init.h:58
u16b feeling_total
Definition: init.h:90
errr grab_effect_data(struct parser *p, struct effect *effect)
Definition: init.c:147
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:1137
u16b blow_effects_max
Maximum number of monster blow effects.
Definition: init.h:45
struct parser * init_parse_object(void)
Definition: obj-init.c:1855
void init_game_constants(void)
Initialize game constants.
Definition: init.c:636
char * ANGBAND_DIR_GAMEDATA
Various directories.
Definition: init.c:79
struct angband_constants * z_info
Structure (not array) of game constants.
Definition: init.c:68
u16b glyph_hardness
How hard for a monster to break a glyph.
Definition: init.h:67
static term_data data[MAX_TERM_DATA]
Definition: main-nds.c:156
u16b fuel_lamp
Definition: init.h:112
char * ANGBAND_DIR_SCREENS
Definition: init.c:82
char * ANGBAND_DIR_HELP
Definition: init.c:81
u16b property_max
Maximum number of object properties.
Definition: init.h:51
u16b store_turns
Number of turns between turnovers.
Definition: init.h:103
u16b pack_size
Maximum number of pack slots.
Definition: init.h:96
char * ANGBAND_DIR_ARCHIVE
Definition: init.c:91
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:89
char * ANGBAND_DIR_INFO
Definition: init.c:90
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:60
u16b feeling_need
Definition: init.h:91
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:2823
u16b blow_methods_max
Maximum number of monster blow methods.
Definition: init.h:44
void(* init)(void)
Definition: init.h:123
u16b repro_monster_rate
Monster reproduction rate-slower.
Definition: init.h:68
u16b wall_pierce_max
Maximum number of potential wall piercings.
Definition: init.h:76
struct parser * init_parse_vault(void)
Definition: generate.c:551
u16b store_shuffle
1/per-day-chance of owner changing
Definition: init.h:104
u16b repro_monster_max
Maximum breeders on a level.
Definition: init.h:62
struct parser * init_parse_monster(void)
Definition: mon-init.c:1509
The lowest level header.
struct parser * init_parse_ego(void)
Definition: obj-init.c:2303
struct parser * init_parse_flavor(void)
Definition: init.c:2599
u16b f_max
Maximum number of terrain features.
Definition: init.h:30
void create_needed_dirs(void)
Create any missing directories.
Definition: init.c:304
u16b ood_monster_amount
Max number of levels OoD.
Definition: init.h:64
u16b a_max
Maximum number of artifact kinds.
Definition: init.h:33
void init_arrays(void)
Initialize just the internal arrays.
Definition: init.c:2750
u16b tunn_grid_max
Maximum number of tunnel grids.
Definition: init.h:77
u16b fuel_torch
Definition: init.h:111
u16b room_item_av
Average number of items in rooms.
Definition: init.h:78
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:105
u16b ood_monster_chance
Chance of OoD monster is 1 in this.
Definition: init.h:63
char * ANGBAND_DIR_SCORES
Definition: init.c:89
const char * ANGBAND_SYS
Definition: init.c:74
u16b turn_range
Monsters turn to fight closer than this.
Definition: init.h:71
Definition: init.h:121
char * ANGBAND_DIR_ICONS
Definition: init.c:86
u16b dungeon_hgt
Maximum number of vertical grids on a level.
Definition: init.h:86
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:113
const char * list_obj_flag_names[]
Definition: init.c:100
u16b both_gold_av
Average number of money items.
Definition: init.h:80
basic object structs and enums
char * ANGBAND_DIR_CUSTOMIZE
Definition: init.c:80
u16b town_hgt
Maximum number of vertical grids in the town.
Definition: init.h:88
u16b max_depth
Definition: init.h:84
struct parser * init_parse_artifact(void)
Definition: obj-init.c:2660
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:208
u16b flee_range
Monsters run this many grids out of view.
Definition: init.h:70
struct parser * init_parse_class(void)
Definition: init.c:2444
u16b equip_slots_max
Maximum number of player equipment slots.
Definition: init.h:46
struct parser * init_parse_pain(void)
Definition: mon-init.c:497
u16b quiver_slot_size
Maximum number of missiles per quiver slot.
Definition: init.h:98
u16b level_room_max
Maximum number of rooms on a level.
Definition: init.h:74
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:99
struct parser * init_parse_history(void)
Definition: init.c:1573
u16b move_energy
Definition: init.h:93
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:2853
char * ANGBAND_DIR_SOUNDS
Definition: init.c:85
Effect.
Definition: object.h:52
struct parser * init_parse_object_base(void)
Definition: obj-init.c:556
u16b k_max
Maximum number of object base kinds.
Definition: init.h:32
u16b town_monsters_night
Townsfolk generated - night.
Definition: init.h:61
Definition: parser.c:74
u16b level_door_max
Maximum number of potential doors on a level.
Definition: init.h:75
char * ANGBAND_DIR_SAVE
Definition: init.c:88
char * ANGBAND_DIR_USER
Definition: init.c:87
u16b max_obj_depth
Definition: init.h:108
struct parser * init_parse_constants(void)
Definition: init.c:591
u16b dungeon_wid
Maximum number of horizontical grids on a level.
Definition: init.h:87
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:1892
u16b quiver_size
Maximum number of quiver slots.
Definition: init.h:97
char * ANGBAND_DIR_FONTS
Definition: init.c:83
struct parser * init_parse_feat(void)
Definition: init.c:1326
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:102
struct parser * init_parse_p_race(void)
Definition: init.c:1862
u16b stair_skip
Definition: init.h:92
u16b start_gold
Definition: init.h:118
struct parser * init_parse_names(void)
Definition: init.c:688
char * ANGBAND_DIR_TILES
Definition: init.c:84
const char * list_element_names[]
Definition: init.c:108
void(* cleanup)(void)
Definition: init.h:124
A Random Number Generator for Angband.