summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/activation.hpp13
-rw-r--r--src/alchemist_recipe.hpp11
-rw-r--r--src/alchemist_recipe_fwd.hpp3
-rw-r--r--src/alloc_entry.hpp20
-rw-r--r--src/alloc_entry_fwd.hpp3
-rw-r--r--src/angband.h1
-rw-r--r--src/artifact_select_flag.hpp18
-rw-r--r--src/artifact_select_flag_fwd.hpp3
-rw-r--r--src/artifact_type.hpp60
-rw-r--r--src/artifact_type_fwd.hpp3
-rw-r--r--src/between_exit.hpp18
-rw-r--r--src/birth.cc16
-rw-r--r--src/birth.hpp2
-rw-r--r--src/birther.hpp35
-rw-r--r--src/bldg.cc11
-rw-r--r--src/bldg.hpp3
-rw-r--r--src/body.hpp12
-rw-r--r--src/cave.cc10
-rw-r--r--src/cave.hpp4
-rw-r--r--src/cave_type.hpp52
-rw-r--r--src/cave_type_fwd.hpp3
-rw-r--r--src/cli_comm.hpp13
-rw-r--r--src/cli_comm_fwd.hpp3
-rw-r--r--src/cmd1.cc9
-rw-r--r--src/cmd1.hpp4
-rw-r--r--src/cmd2.cc17
-rw-r--r--src/cmd2.hpp3
-rw-r--r--src/cmd3.cc12
-rw-r--r--src/cmd3.hpp2
-rw-r--r--src/cmd4.cc11
-rw-r--r--src/cmd4.hpp2
-rw-r--r--src/cmd5.cc9
-rw-r--r--src/cmd5.hpp3
-rw-r--r--src/cmd6.cc13
-rw-r--r--src/cmd6.hpp3
-rw-r--r--src/cmd7.cc10
-rw-r--r--src/cmd7.hpp4
-rw-r--r--src/corrupt.cc7
-rw-r--r--src/corrupt.hpp41
-rw-r--r--src/defines.h313
-rw-r--r--src/deity_type.hpp11
-rw-r--r--src/deity_type_fwd.hpp3
-rw-r--r--src/device_allocation_fwd.hpp2
-rw-r--r--src/dice.cc2
-rw-r--r--src/dice_fwd.hpp2
-rw-r--r--src/dungeon.cc16
-rw-r--r--src/dungeon_info_type.hpp72
-rw-r--r--src/dungeon_info_type_fwd.hpp3
-rw-r--r--src/effect_type.hpp17
-rw-r--r--src/ego_item_type.hpp68
-rw-r--r--src/ego_item_type_fwd.hpp3
-rw-r--r--src/fate.hpp22
-rw-r--r--src/feature_type.hpp37
-rw-r--r--src/feature_type_fwd.hpp3
-rw-r--r--src/files.cc20
-rw-r--r--src/files.hpp3
-rw-r--r--src/flags_group.hpp20
-rw-r--r--src/gen_evol.cc4
-rw-r--r--src/gen_maze.cc1
-rw-r--r--src/generate.cc15
-rw-r--r--src/generate.hpp2
-rw-r--r--src/gf_name_type.hpp10
-rw-r--r--src/gods.cc4
-rw-r--r--src/gods.hpp2
-rw-r--r--src/help.cc6
-rw-r--r--src/help.hpp2
-rw-r--r--src/help_info.hpp17
-rw-r--r--src/hiscore.cc1
-rw-r--r--src/hiscore.hpp5
-rw-r--r--src/hist_type.hpp16
-rw-r--r--src/hist_type_fwd.hpp3
-rw-r--r--src/hook_build_room1_in.hpp8
-rw-r--r--src/hook_calculate_hp_in.hpp7
-rw-r--r--src/hook_calculate_hp_out.hpp7
-rw-r--r--src/hook_chardump_in.hpp7
-rw-r--r--src/hook_chat_in.hpp7
-rw-r--r--src/hook_drop_in.hpp5
-rw-r--r--src/hook_eat_in.hpp7
-rw-r--r--src/hook_eat_out.hpp7
-rw-r--r--src/hook_enter_dungeon_in.hpp7
-rw-r--r--src/hook_get_in.hpp8
-rw-r--r--src/hook_give_in.hpp6
-rw-r--r--src/hook_identify_in.hpp9
-rw-r--r--src/hook_init_quest_in.hpp5
-rw-r--r--src/hook_mon_speak_in.hpp8
-rw-r--r--src/hook_monster_ai_in.hpp9
-rw-r--r--src/hook_monster_ai_out.hpp8
-rw-r--r--src/hook_monster_death_in.hpp7
-rw-r--r--src/hook_move_in.hpp6
-rw-r--r--src/hook_new_monster_end_in.hpp7
-rw-r--r--src/hook_new_monster_in.hpp7
-rw-r--r--src/hook_player_level_in.hpp5
-rw-r--r--src/hook_quest_fail_in.hpp7
-rw-r--r--src/hook_quest_finish_in.hpp7
-rw-r--r--src/hook_stair_in.hpp7
-rw-r--r--src/hook_stair_out.hpp7
-rw-r--r--src/hook_wield_in.hpp7
-rw-r--r--src/hook_wild_gen_in.hpp7
-rw-r--r--src/hooks.cc1
-rw-r--r--src/hooks.hpp2
-rw-r--r--src/identify_mode.hpp3
-rw-r--r--src/include/tome/squelch/automatizer.hpp7
-rw-r--r--src/include/tome/squelch/condition.hpp7
-rw-r--r--src/include/tome/squelch/object_status_fwd.hpp7
-rw-r--r--src/include/tome/squelch/rule.hpp7
-rw-r--r--src/init1.cc32
-rw-r--r--src/init2.cc31
-rw-r--r--src/inscription_info_type.hpp14
-rw-r--r--src/inventory.hpp35
-rw-r--r--src/joke.cc1
-rw-r--r--src/levels.cc2
-rw-r--r--src/loadsave.cc18
-rw-r--r--src/lua_bind.cc4
-rw-r--r--src/lua_bind.hpp3
-rw-r--r--src/magic_power.hpp15
-rw-r--r--src/main-gcu.c2
-rw-r--r--src/main-gtk2.c1
-rw-r--r--src/main-sdl.c1
-rw-r--r--src/main-x11.c1
-rw-r--r--src/main.c1
-rw-r--r--src/martial_arts.hpp18
-rw-r--r--src/melee1.cc5
-rw-r--r--src/melee2.cc10
-rw-r--r--src/melee2.hpp2
-rw-r--r--src/messages.cc4
-rw-r--r--src/meta_class_type.hpp10
-rw-r--r--src/meta_class_type_fwd.hpp3
-rw-r--r--src/mimic.cc3
-rw-r--r--src/mimic.hpp2
-rw-r--r--src/module_type.hpp64
-rw-r--r--src/modules.cc13
-rw-r--r--src/modules.hpp2
-rw-r--r--src/monster1.cc7
-rw-r--r--src/monster2.cc15
-rw-r--r--src/monster2.hpp5
-rw-r--r--src/monster3.cc5
-rw-r--r--src/monster3.hpp3
-rw-r--r--src/monster_blow.hpp19
-rw-r--r--src/monster_ego.hpp81
-rw-r--r--src/monster_ego_fwd.hpp3
-rw-r--r--src/monster_power.hpp14
-rw-r--r--src/monster_race.hpp116
-rw-r--r--src/monster_race_fwd.hpp3
-rw-r--r--src/monster_type.hpp60
-rw-r--r--src/monster_type_fwd.hpp3
-rw-r--r--src/move_info_type.hpp15
-rw-r--r--src/music.hpp17
-rw-r--r--src/notes.cc3
-rw-r--r--src/obj_theme.hpp15
-rw-r--r--src/obj_theme_fwd.hpp3
-rw-r--r--src/object1.cc20
-rw-r--r--src/object1.hpp2
-rw-r--r--src/object2.cc18
-rw-r--r--src/object2.hpp7
-rw-r--r--src/object_filter.cc1
-rw-r--r--src/object_filter.hpp4
-rw-r--r--src/object_kind.hpp86
-rw-r--r--src/object_kind_fwd.hpp3
-rw-r--r--src/object_type.hpp106
-rw-r--r--src/object_type_fwd.hpp3
-rw-r--r--src/option_type.hpp40
-rw-r--r--src/owner_type.hpp39
-rw-r--r--src/owner_type_fwd.hpp3
-rw-r--r--src/player_class.hpp105
-rw-r--r--src/player_class_fwd.hpp3
-rw-r--r--src/player_defs.hpp6
-rw-r--r--src/player_race.hpp83
-rw-r--r--src/player_race_fwd.hpp3
-rw-r--r--src/player_race_mod.hpp87
-rw-r--r--src/player_race_mod_fwd.hpp3
-rw-r--r--src/player_sex.hpp17
-rw-r--r--src/player_sex_fwd.hpp3
-rw-r--r--src/player_spec.hpp38
-rw-r--r--src/player_spec_fwd.hpp3
-rw-r--r--src/player_type.hpp423
-rw-r--r--src/player_type_fwd.hpp3
-rw-r--r--src/power_type.hpp19
-rw-r--r--src/powers.cc8
-rw-r--r--src/powers.hpp71
-rw-r--r--src/q_betwen.cc7
-rw-r--r--src/q_betwen.hpp2
-rw-r--r--src/q_bounty.cc4
-rw-r--r--src/q_bounty.hpp2
-rw-r--r--src/q_dragons.cc5
-rw-r--r--src/q_dragons.hpp2
-rw-r--r--src/q_eol.cc8
-rw-r--r--src/q_eol.hpp2
-rw-r--r--src/q_evil.cc5
-rw-r--r--src/q_evil.hpp2
-rw-r--r--src/q_fireprof.cc8
-rw-r--r--src/q_fireprof.hpp2
-rw-r--r--src/q_god.cc14
-rw-r--r--src/q_god.hpp2
-rw-r--r--src/q_haunted.cc5
-rw-r--r--src/q_haunted.hpp2
-rw-r--r--src/q_hobbit.cc8
-rw-r--r--src/q_hobbit.hpp2
-rw-r--r--src/q_invas.cc9
-rw-r--r--src/q_invas.hpp2
-rw-r--r--src/q_library.cc6
-rw-r--r--src/q_library.hpp2
-rw-r--r--src/q_main.cc6
-rw-r--r--src/q_main.hpp2
-rw-r--r--src/q_narsil.cc6
-rw-r--r--src/q_narsil.hpp2
-rw-r--r--src/q_nazgul.cc7
-rw-r--r--src/q_nazgul.hpp2
-rw-r--r--src/q_nirna.cc3
-rw-r--r--src/q_nirna.hpp2
-rw-r--r--src/q_one.cc13
-rw-r--r--src/q_one.hpp2
-rw-r--r--src/q_poison.cc12
-rw-r--r--src/q_poison.hpp2
-rw-r--r--src/q_rand.cc11
-rw-r--r--src/q_rand.hpp2
-rw-r--r--src/q_shroom.cc8
-rw-r--r--src/q_shroom.hpp2
-rw-r--r--src/q_spider.cc4
-rw-r--r--src/q_spider.hpp2
-rw-r--r--src/q_thief.cc6
-rw-r--r--src/q_thief.hpp2
-rw-r--r--src/q_thrain.cc7
-rw-r--r--src/q_thrain.hpp2
-rw-r--r--src/q_troll.cc7
-rw-r--r--src/q_troll.hpp2
-rw-r--r--src/q_ultrae.hpp2
-rw-r--r--src/q_ultrag.cc8
-rw-r--r--src/q_ultrag.hpp2
-rw-r--r--src/q_wight.cc5
-rw-r--r--src/q_wight.hpp2
-rw-r--r--src/q_wolves.cc6
-rw-r--r--src/q_wolves.hpp2
-rw-r--r--src/quark.cc2
-rw-r--r--src/quark.hpp5
-rw-r--r--src/quest.cc1
-rw-r--r--src/quest_type.hpp27
-rw-r--r--src/randart.cc4
-rw-r--r--src/randart.hpp3
-rw-r--r--src/randart_gen_type.hpp9
-rw-r--r--src/randart_gen_type_fwd.hpp3
-rw-r--r--src/randart_part_type.hpp43
-rw-r--r--src/randart_part_type_fwd.hpp3
-rw-r--r--src/random_artifact.hpp18
-rw-r--r--src/random_quest.hpp10
-rw-r--r--src/random_spell.hpp21
-rw-r--r--src/range.hpp2
-rw-r--r--src/rule_type.hpp22
-rw-r--r--src/rune_spell.hpp15
-rw-r--r--src/rune_spell_fwd.hpp3
-rw-r--r--src/school_type.hpp21
-rw-r--r--src/school_type_fwd.hpp3
-rw-r--r--src/script.cc1
-rw-r--r--src/set_type.hpp28
-rw-r--r--src/set_type_fwd.hpp3
-rw-r--r--src/skill_type.hpp37
-rw-r--r--src/skill_type_fwd.hpp3
-rw-r--r--src/skills.cc7
-rw-r--r--src/skills.hpp3
-rw-r--r--src/skills_defs.hpp64
-rw-r--r--src/spell_type.cc5
-rw-r--r--src/spell_type.hpp1
-rw-r--r--src/spells1.cc11
-rw-r--r--src/spells2.cc11
-rw-r--r--src/spells2.hpp4
-rw-r--r--src/spells3.cc10
-rw-r--r--src/spells3.hpp2
-rw-r--r--src/spells4.cc1
-rw-r--r--src/spells4.hpp5
-rw-r--r--src/spells5.cc1
-rw-r--r--src/spells6.cc4
-rw-r--r--src/spells6.hpp2
-rw-r--r--src/squelch/automatizer.cc2
-rw-r--r--src/squelch/condition.cc22
-rw-r--r--src/squelch/condition_metadata.cc2
-rw-r--r--src/squelch/object_status.cc9
-rw-r--r--src/squelch/rule.cc1
-rw-r--r--src/squelch/tree_printer.cc2
-rw-r--r--src/squeltch.cc4
-rw-r--r--src/squeltch.hpp4
-rw-r--r--src/stairs_direction.hpp3
-rw-r--r--src/stats.hpp11
-rw-r--r--src/status.cc4
-rw-r--r--src/store.cc10
-rw-r--r--src/store.hpp2
-rw-r--r--src/store_action_type.hpp17
-rw-r--r--src/store_action_type_fwd.hpp3
-rw-r--r--src/store_info_type.hpp32
-rw-r--r--src/store_info_type_fwd.hpp3
-rw-r--r--src/store_type.hpp43
-rw-r--r--src/store_type_fwd.hpp3
-rw-r--r--src/tables.cc2
-rw-r--r--src/tables.hpp20
-rw-r--r--src/tactic_info_type.hpp17
-rw-r--r--src/terrain.hpp19
-rw-r--r--src/timer_type.hpp18
-rw-r--r--src/timer_type_fwd.hpp3
-rw-r--r--src/town_type.hpp21
-rw-r--r--src/town_type_fwd.hpp3
-rw-r--r--src/trap_type.hpp24
-rw-r--r--src/trap_type_fwd.hpp3
-rw-r--r--src/traps.cc14
-rw-r--r--src/traps.hpp3
-rw-r--r--src/tval_desc.hpp17
-rw-r--r--src/types.h2566
-rw-r--r--src/types_fwd.h79
-rw-r--r--src/util.cc9
-rw-r--r--src/util.hpp3
-rw-r--r--src/variable.cc6
-rw-r--r--src/variable.h2
-rw-r--r--src/variable.hpp49
-rw-r--r--src/vault_type.hpp24
-rw-r--r--src/vault_type_fwd.hpp3
-rw-r--r--src/wild.cc29
-rw-r--r--src/wilderness_map.hpp15
-rw-r--r--src/wilderness_map_fwd.hpp3
-rw-r--r--src/wilderness_type_info.hpp25
-rw-r--r--src/wilderness_type_info_fwd.hpp3
-rw-r--r--src/wizard1.cc9
-rw-r--r--src/wizard2.cc11
-rw-r--r--src/xtra1.cc17
-rw-r--r--src/xtra1.hpp2
-rw-r--r--src/xtra2.cc22
-rw-r--r--src/xtra2.hpp5
-rw-r--r--src/z-term.c4
-rw-r--r--src/z-term.h24
325 files changed, 4052 insertions, 3145 deletions
diff --git a/src/activation.hpp b/src/activation.hpp
new file mode 100644
index 0000000..adb9d8b
--- /dev/null
+++ b/src/activation.hpp
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Activation descriptor.
+ */
+struct activation
+{
+ char desc[80]; /* Desc of the activation */
+ u32b cost; /* costs value */
+ s16b spell; /* Spell. */
+};
diff --git a/src/alchemist_recipe.hpp b/src/alchemist_recipe.hpp
new file mode 100644
index 0000000..e87531f
--- /dev/null
+++ b/src/alchemist_recipe.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct alchemist_recipe
+{
+ int sval_essence;
+ byte tval;
+ byte sval;
+ byte qty;
+};
diff --git a/src/alchemist_recipe_fwd.hpp b/src/alchemist_recipe_fwd.hpp
new file mode 100644
index 0000000..d1a8bb7
--- /dev/null
+++ b/src/alchemist_recipe_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct alchemist_recipe;
diff --git a/src/alloc_entry.hpp b/src/alloc_entry.hpp
new file mode 100644
index 0000000..41ec3b6
--- /dev/null
+++ b/src/alloc_entry.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * An entry for the object/monster allocation functions
+ *
+ * Pass 1 is determined from allocation information
+ * Pass 2 is determined from allocation restriction
+ * Pass 3 is determined from allocation calculation
+ */
+struct alloc_entry
+{
+ s16b index; /* The actual index */
+
+ byte level; /* Base dungeon level */
+ byte prob1; /* Probability, pass 1 */
+ byte prob2; /* Probability, pass 2 */
+ byte prob3; /* Probability, pass 3 */
+};
diff --git a/src/alloc_entry_fwd.hpp b/src/alloc_entry_fwd.hpp
new file mode 100644
index 0000000..167af11
--- /dev/null
+++ b/src/alloc_entry_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct alloc_entry;
diff --git a/src/angband.h b/src/angband.h
index a4646d0..ccf5295 100644
--- a/src/angband.h
+++ b/src/angband.h
@@ -41,7 +41,6 @@ extern "C" {
* Now, include the defines and the types
*/
#include "defines.h"
-#include "types.h"
/***** Some copyright messages follow below *****/
diff --git a/src/artifact_select_flag.hpp b/src/artifact_select_flag.hpp
new file mode 100644
index 0000000..313f3a1
--- /dev/null
+++ b/src/artifact_select_flag.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct artifact_select_flag {
+ byte group; /* Flag group to display it in */
+ int flag; /* item flag to set */
+ byte level; /* Player skill level to start at */
+ char *desc; /* Display this description to select flag */
+ u32b xp; /* xp cost for this flag */
+ bool_ pval; /* indicates this flag benifits from pval */
+ char *item_desc; /* Description of required item */
+ char *item_descp; /* Description of required item; plural */
+ byte rtval; /* Required items' tval */
+ byte rsval; /* Required items' sval */
+ int rpval; /* Required items' pval (zero for no req) */
+ int rflag[6]; /* Monster Race flags for required Corpses */
+};
diff --git a/src/artifact_select_flag_fwd.hpp b/src/artifact_select_flag_fwd.hpp
new file mode 100644
index 0000000..f56ec3c
--- /dev/null
+++ b/src/artifact_select_flag_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct artifact_select_flag;
diff --git a/src/artifact_type.hpp b/src/artifact_type.hpp
new file mode 100644
index 0000000..7a4340a
--- /dev/null
+++ b/src/artifact_type.hpp
@@ -0,0 +1,60 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Artifact descriptor.
+ *
+ * Note that the save-file only writes "cur_num" to the savefile.
+ *
+ * Note that "max_num" is always "1" (if that artifact "exists")
+ */
+struct artifact_type
+{
+ char const *name; /* Artifact name */
+ char *text; /* Artifact description */
+
+ byte tval; /* Artifact type */
+ byte sval; /* Artifact sub type */
+
+ s16b pval; /* Artifact extra info */
+
+ s16b to_h; /* Bonus to hit */
+ s16b to_d; /* Bonus to damage */
+ s16b to_a; /* Bonus to armor */
+
+ s16b activate; /* Activation Number */
+
+ s16b ac; /* Base armor */
+
+ byte dd, ds; /* Damage when hits */
+
+ s16b weight; /* Weight */
+
+ s32b cost; /* Artifact "cost" */
+
+ u32b flags1; /* Artifact Flags, set 1 */
+ u32b flags2; /* Artifact Flags, set 2 */
+ u32b flags3; /* Artifact Flags, set 3 */
+ u32b flags4; /* Artifact Flags, set 4 */
+ u32b flags5; /* Artifact Flags, set 5 */
+
+ u32b oflags1; /* Obvious Flags, set 1 */
+ u32b oflags2; /* Obvious Flags, set 2 */
+ u32b oflags3; /* Obvious Flags, set 3 */
+ u32b oflags4; /* Obvious Flags, set 4 */
+ u32b oflags5; /* Obvious Flags, set 5 */
+
+ byte level; /* Artifact level */
+ byte rarity; /* Artifact rarity */
+
+ byte cur_num; /* Number created (0 or 1) */
+ byte max_num; /* Unused (should be "1") */
+
+ u32b esp; /* ESP flags */
+ u32b oesp; /* ESP flags */
+
+ s16b power; /* Power granted(if any) */
+
+ s16b set; /* Does it belongs to a set ?*/
+};
diff --git a/src/artifact_type_fwd.hpp b/src/artifact_type_fwd.hpp
new file mode 100644
index 0000000..f3862d5
--- /dev/null
+++ b/src/artifact_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct artifact_type;
diff --git a/src/between_exit.hpp b/src/between_exit.hpp
new file mode 100644
index 0000000..7ea686d
--- /dev/null
+++ b/src/between_exit.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Surface-level void gates descriptor.
+ */
+struct between_exit
+{
+ s16b corresp; /* Corresponding between gate */
+ bool_ dungeon; /* Do we exit in a dungeon or in the wild ? */
+
+ s16b wild_x, wild_y; /* Wilderness spot to land onto */
+ s16b px, py; /* Location of the map */
+
+ s16b d_idx; /* Dungeon to land onto */
+ s16b level;
+};
diff --git a/src/birth.cc b/src/birth.cc
index 573c9ce..9716cc8 100644
--- a/src/birth.cc
+++ b/src/birth.cc
@@ -8,36 +8,50 @@
#include "birth.hpp"
#include "birth.h"
-#include "angband.h"
#include "ability_type.hpp"
+#include "artifact_type.hpp"
#include "corrupt.hpp"
#include "cmd4.hpp"
#include "cmd5.hpp"
+#include "dungeon_info_type.hpp"
#include "files.h"
#include "files.hpp"
#include "gods.hpp"
#include "help.hpp"
+#include "hist_type.hpp"
#include "hooks.hpp"
#include "init2.hpp"
#include "mimic.hpp"
#include "messages.hpp"
+#include "meta_class_type.hpp"
#include "modules.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
#include "notes.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_class.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_type.hpp"
#include "q_rand.hpp"
+#include "skill_type.hpp"
#include "skills.hpp"
#include "spells2.hpp"
#include "spells3.hpp"
#include "spells5.hpp"
+#include "stats.hpp"
#include "store.hpp"
#include "tables.hpp"
+#include "town_type.hpp"
+#include "trap_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
#include "variable.hpp"
+#include "wilderness_map.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/birth.hpp b/src/birth.hpp
index 6947a42..fb036ec 100644
--- a/src/birth.hpp
+++ b/src/birth.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern void print_desc_aux(cptr txt, int y, int x);
extern void save_savefile_names(void);
diff --git a/src/birther.hpp b/src/birther.hpp
new file mode 100644
index 0000000..f517fb9
--- /dev/null
+++ b/src/birther.hpp
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Player information during the birth process.
+ */
+struct birther
+{
+ s16b sex;
+ s16b race;
+ s16b rmod;
+ s16b pclass;
+ s16b spec;
+
+ byte quests;
+
+ byte god;
+ s32b grace;
+ s32b god_favor;
+
+ s16b age;
+ s16b wt;
+ s16b ht;
+ s16b sc;
+
+ s32b au;
+
+ s16b stat[6];
+ s16b luck;
+
+ char history[4][60];
+
+ bool_ quick_ok;
+};
diff --git a/src/bldg.cc b/src/bldg.cc
index d4a1d51..dd43332 100644
--- a/src/bldg.cc
+++ b/src/bldg.cc
@@ -13,18 +13,27 @@
* Heavily modified for ToME by DarkGod
*/
-#include "angband.h"
+#include "cave_type.hpp"
#include "cmd3.hpp"
#include "files.hpp"
#include "hooks.hpp"
+#include "hook_quest_finish_in.hpp"
+#include "hook_quest_fail_in.hpp"
+#include "hook_init_quest_in.hpp"
#include "mimic.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "owner_type.hpp"
+#include "player_type.hpp"
#include "q_library.hpp"
#include "q_fireprof.hpp"
#include "q_bounty.hpp"
#include "spells2.hpp"
+#include "stats.hpp"
#include "store.hpp"
+#include "store_action_type.hpp"
+#include "store_info_type.hpp"
+#include "store_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
diff --git a/src/bldg.hpp b/src/bldg.hpp
index db6f885..0daebbe 100644
--- a/src/bldg.hpp
+++ b/src/bldg.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "store_type_fwd.hpp"
extern bool_ bldg_process_command(store_type *s_ptr, int i);
extern void show_building(store_type *s_ptr);
diff --git a/src/body.hpp b/src/body.hpp
new file mode 100644
index 0000000..dd0be28
--- /dev/null
+++ b/src/body.hpp
@@ -0,0 +1,12 @@
+#pragma once
+
+/*
+ * Body parts
+ */
+#define BODY_WEAPON 0
+#define BODY_TORSO 1
+#define BODY_ARMS 2
+#define BODY_FINGER 3
+#define BODY_HEAD 4
+#define BODY_LEGS 5
+#define BODY_MAX 6
diff --git a/src/cave.cc b/src/cave.cc
index fef642d..d73115f 100644
--- a/src/cave.cc
+++ b/src/cave.cc
@@ -1,12 +1,20 @@
#include "cave.hpp"
-#include "angband.h"
+#include "cave_type.hpp"
+#include "feature_type.hpp"
+#include "hook_enter_dungeon_in.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "q_rand.hpp"
#include "spells1.hpp"
+#include "store_info_type.hpp"
#include "tables.hpp"
+#include "trap_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
diff --git a/src/cave.hpp b/src/cave.hpp
index 21fa9a6..64f67db 100644
--- a/src/cave.hpp
+++ b/src/cave.hpp
@@ -1,6 +1,8 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "cave_type_fwd.hpp"
+#include "object_type_fwd.hpp"
extern int distance(int y1, int x1, int y2, int x2);
extern bool_ los(int y1, int x1, int y2, int x2);
diff --git a/src/cave_type.hpp b/src/cave_type.hpp
new file mode 100644
index 0000000..912e109
--- /dev/null
+++ b/src/cave_type.hpp
@@ -0,0 +1,52 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * A single "grid" in a Cave.
+ *
+ * Note that several aspects of the code restrict the actual cave
+ * to a max size of 256 by 256. In partcular, locations are often
+ * saved as bytes, limiting each coordinate to the 0-255 range.
+ *
+ * The "o_idx" and "m_idx" fields are very interesting. There are
+ * many places in the code where we need quick access to the actual
+ * monster or object(s) in a given cave grid. The easiest way to
+ * do this is to simply keep the index of the monster and object
+ * (if any) with the grid, but this takes 198*66*4 bytes of memory.
+ * Several other methods come to mind, which require only half this
+ * amound of memory, but they all seem rather complicated, and would
+ * probably add enough code that the savings would be lost. So for
+ * these reasons, we simply store an index into the "o_list" and
+ * "m_list" arrays, using "zero" when no monster/object is present.
+ *
+ * Note that "o_idx" is the index of the top object in a stack of
+ * objects, using the "next_o_idx" field of objects to create the
+ * singly linked list of objects. If "o_idx" is zero then there
+ * are no objects in the grid.
+ */
+struct cave_type
+{
+ u16b info; /* Hack -- cave flags */
+
+ byte feat; /* Hack -- feature type */
+
+ s16b o_idx; /* Object in this grid */
+
+ s16b m_idx; /* Monster in this grid */
+
+ s16b t_idx; /* trap index (in t_list) or zero */
+
+ s16b special, special2; /* Special cave info */
+
+ s16b inscription; /* Inscription of the grid */
+
+ byte mana; /* Magical energy of the grid */
+
+ byte mimic; /* Feature to mimic */
+
+ byte cost; /* Hack -- cost of flowing */
+ byte when; /* Hack -- when cost was computed */
+
+ s16b effect; /* The lasting effects */
+};
diff --git a/src/cave_type_fwd.hpp b/src/cave_type_fwd.hpp
new file mode 100644
index 0000000..f2569ea
--- /dev/null
+++ b/src/cave_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct cave_type;
diff --git a/src/cli_comm.hpp b/src/cli_comm.hpp
new file mode 100644
index 0000000..6ae53ed
--- /dev/null
+++ b/src/cli_comm.hpp
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * A structure for CLI commands.
+ */
+struct cli_comm
+{
+ cptr comm; /* Extended name of the command. */
+ cptr descrip; /* Description of the command. */
+ s16b key; /* Key to convert command to. */
+};
diff --git a/src/cli_comm_fwd.hpp b/src/cli_comm_fwd.hpp
new file mode 100644
index 0000000..6d9b76a
--- /dev/null
+++ b/src/cli_comm_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct cli_comm;
diff --git a/src/cmd1.cc b/src/cmd1.cc
index b7b7ef5..a936e83 100644
--- a/src/cmd1.cc
+++ b/src/cmd1.cc
@@ -8,22 +8,28 @@
#include "cmd1.hpp"
-#include "angband.h"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd4.hpp"
#include "cmd5.hpp"
+#include "dungeon_info_type.hpp"
+#include "feature_type.hpp"
#include "files.hpp"
#include "gods.hpp"
#include "hooks.hpp"
+#include "hook_move_in.hpp"
#include "lua_bind.hpp"
#include "melee1.hpp"
#include "melee2.hpp"
#include "mimic.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
#include "skills.hpp"
#include "spells1.hpp"
@@ -31,6 +37,7 @@
#include "spells3.hpp"
#include "tables.hpp"
#include "traps.hpp"
+#include "trap_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
diff --git a/src/cmd1.hpp b/src/cmd1.hpp
index 0e53003..3ae44ed 100644
--- a/src/cmd1.hpp
+++ b/src/cmd1.hpp
@@ -1,6 +1,8 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "monster_type_fwd.hpp"
+#include "object_type_fwd.hpp"
extern void attack_special(monster_type *m_ptr, s32b special, int dam);
extern bool_ test_hit_fire(int chance, int ac, int vis);
diff --git a/src/cmd2.cc b/src/cmd2.cc
index b516fcc..b176576 100644
--- a/src/cmd2.cc
+++ b/src/cmd2.cc
@@ -8,29 +8,44 @@
#include "cmd2.hpp"
-#include "angband.h"
#include "bldg.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd1.hpp"
+#include "dungeon_info_type.hpp"
+#include "feature_type.hpp"
#include "files.hpp"
#include "gods.hpp"
+#include "hook_chat_in.hpp"
+#include "hook_enter_dungeon_in.hpp"
+#include "hook_give_in.hpp"
+#include "hook_stair_in.hpp"
+#include "hook_stair_out.hpp"
#include "hooks.hpp"
#include "levels.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
#include "spells3.hpp"
+#include "stats.hpp"
#include "tables.hpp"
+#include "trap_type.hpp"
#include "traps.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
#include "variable.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/cmd2.hpp b/src/cmd2.hpp
index 0179ed1..ef82b83 100644
--- a/src/cmd2.hpp
+++ b/src/cmd2.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "object_type_fwd.hpp"
extern byte show_monster_inven(int m_idx, int *monst_list);
extern int breakage_chance(object_type *o_ptr);
diff --git a/src/cmd3.cc b/src/cmd3.cc
index d57d482..6f2d67e 100644
--- a/src/cmd3.cc
+++ b/src/cmd3.cc
@@ -7,19 +7,29 @@
*/
#include "cmd3.hpp"
-#include "angband.h"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "cli_comm.hpp"
#include "files.hpp"
#include "gods.hpp"
+#include "hook_drop_in.hpp"
+#include "hook_wield_in.hpp"
#include "hooks.hpp"
#include "monster1.hpp"
+#include "monster_race.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "object_type.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
#include "squeltch.hpp"
#include "store.hpp"
+#include "store_type.hpp"
#include "tables.hpp"
+#include "town_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
diff --git a/src/cmd3.hpp b/src/cmd3.hpp
index ae0dcf6..a496a42 100644
--- a/src/cmd3.hpp
+++ b/src/cmd3.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern void do_cmd_html_dump(void);
extern void cli_add(cptr active, cptr trigger, cptr descr);
diff --git a/src/cmd4.cc b/src/cmd4.cc
index 02e826b..d857c1a 100644
--- a/src/cmd4.cc
+++ b/src/cmd4.cc
@@ -7,20 +7,29 @@
*/
#include "cmd4.hpp"
-#include "angband.h"
+#include "artifact_type.hpp"
+#include "cave_type.hpp"
#include "corrupt.hpp"
+#include "dungeon_info_type.hpp"
+#include "feature_type.hpp"
#include "files.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "levels.hpp"
#include "messages.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "notes.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
#include "squeltch.hpp"
#include "tables.hpp"
+#include "town_type.hpp"
+#include "trap_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
diff --git a/src/cmd4.hpp b/src/cmd4.hpp
index c167502..4470c94 100644
--- a/src/cmd4.hpp
+++ b/src/cmd4.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern void macro_recorder_start(void);
extern void macro_recorder_add(char c);
diff --git a/src/cmd5.cc b/src/cmd5.cc
index 3e45fe8..bb0349a 100644
--- a/src/cmd5.cc
+++ b/src/cmd5.cc
@@ -8,20 +8,27 @@
#include "cmd5.hpp"
-#include "angband.h"
#include "birth.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "corrupt.hpp"
#include "lua_bind.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
+#include "player_class.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
#include "spell_type.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
#include "spells4.hpp"
#include "spells5.hpp"
+#include "stats.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
diff --git a/src/cmd5.hpp b/src/cmd5.hpp
index 39cfeef..1b3b062 100644
--- a/src/cmd5.hpp
+++ b/src/cmd5.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "object_type_fwd.hpp"
extern bool_ is_magestaff(void);
extern void do_cmd_browse_aux(object_type *o_ptr);
diff --git a/src/cmd6.cc b/src/cmd6.cc
index 792dd9a..97ee2cb 100644
--- a/src/cmd6.cc
+++ b/src/cmd6.cc
@@ -8,25 +8,36 @@
#include "cmd6.hpp"
-#include "angband.h"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd1.hpp"
#include "cmd7.hpp"
#include "corrupt.hpp"
+#include "dungeon_info_type.hpp"
+#include "ego_item_type.hpp"
#include "files.hpp"
+#include "hook_eat_in.hpp"
+#include "hook_eat_out.hpp"
#include "hooks.hpp"
#include "lua_bind.hpp"
#include "mimic.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "object_type.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "randart.hpp"
#include "skills.hpp"
#include "spell_type.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
#include "spells5.hpp"
+#include "stats.hpp"
#include "store.hpp"
#include "tables.hpp"
#include "util.hpp"
diff --git a/src/cmd6.hpp b/src/cmd6.hpp
index b979645..ad6619f 100644
--- a/src/cmd6.hpp
+++ b/src/cmd6.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "object_type_fwd.hpp"
extern void set_stick_mode(object_type *o_ptr);
extern void unset_stick_mode(void);
diff --git a/src/cmd7.cc b/src/cmd7.cc
index 71e4651..8b47d94 100644
--- a/src/cmd7.cc
+++ b/src/cmd7.cc
@@ -8,22 +8,30 @@
#include "cmd7.hpp"
-#include "angband.h"
+#include "alchemist_recipe.hpp"
+#include "artifact_select_flag.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd1.hpp"
#include "cmd5.hpp"
#include "cmd6.hpp"
+#include "ego_item_type.hpp"
#include "files.hpp"
#include "hooks.hpp"
#include "mimic.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
#include "skills.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
+#include "stats.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
diff --git a/src/cmd7.hpp b/src/cmd7.hpp
index 27935fa..da96bb5 100644
--- a/src/cmd7.hpp
+++ b/src/cmd7.hpp
@@ -1,6 +1,8 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "rune_spell_fwd.hpp"
+#include "object_type_fwd.hpp"
extern void do_cmd_pray(void);
extern void do_cmd_create_boulder(void);
diff --git a/src/corrupt.cc b/src/corrupt.cc
index 4d37595..d1a7c53 100644
--- a/src/corrupt.cc
+++ b/src/corrupt.cc
@@ -1,5 +1,10 @@
-#include "angband.h"
+#include "corrupt.hpp"
+
#include "init1.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_type.hpp"
+#include "stats.hpp"
#include "util.hpp"
#include "variable.hpp"
#include "xtra1.hpp"
diff --git a/src/corrupt.hpp b/src/corrupt.hpp
index d5568f2..c200762 100644
--- a/src/corrupt.hpp
+++ b/src/corrupt.hpp
@@ -1,4 +1,4 @@
-#include "angband.h"
+#include "h-basic.h"
extern void gain_random_corruption();
extern void dump_corruptions(FILE *OutFile, bool_ color, bool_ header);
@@ -6,3 +6,42 @@ extern void lose_corruption();
extern bool_ player_has_corruption(int corruption_idx);
extern void player_gain_corruption(int corruption_idx);
extern s16b get_corruption_power(int corruption_idx);
+
+/*
+ * Corruptions
+ */
+#define CORRUPT_BALROG_AURA 0
+#define CORRUPT_BALROG_WINGS 1
+#define CORRUPT_BALROG_STRENGTH 2
+#define CORRUPT_BALROG_FORM 3
+#define CORRUPT_DEMON_SPIRIT 4
+#define CORRUPT_DEMON_HIDE 5
+#define CORRUPT_DEMON_BREATH 6
+#define CORRUPT_DEMON_REALM 7
+#define CORRUPT_RANDOM_TELEPORT 8
+#define CORRUPT_ANTI_TELEPORT 9
+#define CORRUPT_TROLL_BLOOD 10
+#define CORRUPT_VAMPIRE_TEETH 11
+#define CORRUPT_VAMPIRE_STRENGTH 12
+#define CORRUPT_VAMPIRE_VAMPIRE 13
+#define MUT1_SPIT_ACID 14
+#define MUT1_BR_FIRE 15
+#define MUT1_HYPN_GAZE 16
+#define MUT1_TELEKINES 17
+#define MUT1_VTELEPORT 18
+#define MUT1_MIND_BLST 19
+#define MUT1_VAMPIRISM 20
+#define MUT1_SMELL_MET 21
+#define MUT1_SMELL_MON 22
+#define MUT1_BLINK 23
+#define MUT1_EAT_ROCK 24
+#define MUT1_SWAP_POS 25
+#define MUT1_SHRIEK 26
+#define MUT1_ILLUMINE 27
+#define MUT1_DET_CURSE 28
+#define MUT1_BERSERK 29
+#define MUT1_MIDAS_TCH 30
+#define MUT1_GROW_MOLD 31
+#define MUT1_RESIST 32
+#define MUT1_EARTHQUAKE 33
+#define CORRUPTIONS_MAX 34
diff --git a/src/defines.h b/src/defines.h
index c2955e4..72acb00 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -172,12 +172,6 @@
/*
- * Maximum number of high scores in the high score file
- */
-#define MAX_HISCORES 100
-
-
-/*
* Maximum dungeon level. The player can never reach this level
* in the dungeon, and this value is used for various calculations
* involving object and monster creation. It must be at least 100.
@@ -235,13 +229,6 @@
#define MACRO_MAX 256
/*
- * OPTION: Maximum number of "quarks" (see "io.c")
- * Default: assume at most 512 different inscriptions are used
- */
-#define QUARK_MAX 768
- /* Was 512... 256 quarks added for random artifacts */
-
-/*
* Maximum value storable in a "byte" (hard-coded)
*/
#define MAX_UCHAR 255
@@ -256,7 +243,6 @@
* Store constants
*/
#define STORE_INVEN_MAX 255 /* Max number of discrete objs in inven */
-#define STORE_CHOICES 56 /* Number of items to choose stock from */
#define STORE_OBJ_LEVEL 5 /* Magic Level for normal stores */
#define STORE_TURNOVER 9 /* Normal shop turnover, per day */
#define STORE_MIN_KEEP 6 /* Min slots to "always" keep full */
@@ -333,18 +319,6 @@
/*
- * Size of allocation table for objects
- */
-#define ALLOCATION_MAX 8
-
-
-/*
- * Size of flag rarity tables
- */
-#define FLAG_RARITY_MAX 6
-
-
-/*
* Refueling constants
*/
#define FUEL_TORCH 5000 /* Maximum amount of fuel in a torch */
@@ -385,7 +359,6 @@
#define SUBRACE_SAVE 9 /* Ugly hack, should be in foo-info, the subrace saved to the savefile */
#define PY_MAX_EXP 99999999L /* Maximum exp */
#define PY_MAX_GOLD 999999999L /* Maximum gold */
-#define PY_MAX_LEVEL 50 /* Maximum level */
/*
* Player "food" crucial values
@@ -407,67 +380,11 @@
#define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
/*
- * Maximum number of "normal" pack slots, and the index of the "overflow"
- * slot, which can hold an item, but only temporarily, since it causes the
- * pack to "overflow", dropping the "last" item onto the ground. Since this
- * value is used as an actual slot, it must be less than "INVEN_WIELD" (below).
- * Note that "INVEN_PACK" is probably hard-coded by its use in savefiles, and
- * by the fact that the screen can only show 23 items plus a one-line prompt.
- */
-#define INVEN_PACK 23
-
-/*
- * Body parts
- */
-#define BODY_WEAPON 0
-#define BODY_TORSO 1
-#define BODY_ARMS 2
-#define BODY_FINGER 3
-#define BODY_HEAD 4
-#define BODY_LEGS 5
-#define BODY_MAX 6
-
-/*
- * Indexes used for various "equipment" slots (hard-coded by savefiles, etc).
- */
-#define INVEN_WIELD 24 /* 3 weapons -- WEAPONS */
-#define INVEN_BOW 27 /* 1 bow -- WEAPON */
-#define INVEN_RING 28 /* 6 rings -- FINGER */
-#define INVEN_NECK 34 /* 2 amulets -- HEAD */
-#define INVEN_LITE 36 /* 1 lite -- TORSO */
-#define INVEN_BODY 37 /* 1 body -- TORSO */
-#define INVEN_OUTER 38 /* 1 cloak -- TORSO */
-#define INVEN_ARM 39 /* 3 arms -- ARMS */
-#define INVEN_HEAD 42 /* 2 heads -- HEAD */
-#define INVEN_HANDS 44 /* 3 hands -- ARMS */
-#define INVEN_FEET 47 /* 2 feets -- LEGS */
-#define INVEN_CARRY 49 /* 1 carried monster -- TORSO */
-#define INVEN_AMMO 50 /* 1 quiver -- TORSO */
-#define INVEN_TOOL 51 /* 1 tool -- ARMS */
-
-/*
- * Total number of inventory slots (hard-coded).
- */
-#define INVEN_TOTAL 52
-#define INVEN_EQ (INVEN_TOTAL - INVEN_WIELD)
-
-/*
* A "stack" of items is limited to less than 100 items (hard-coded).
*/
#define MAX_STACK_SIZE 100
-
-/*
- * Indexes of the various "stats" (hard-coded by savefiles, etc).
- */
-#define A_STR 0
-#define A_INT 1
-#define A_WIS 2
-#define A_DEX 3
-#define A_CON 4
-#define A_CHR 5
-
/*
* Player sex constants (hard-coded by save-files, arrays, etc)
*/
@@ -771,24 +688,6 @@
#define EFF_DIR8 0x00000200 /* Directed effect */
#define EFF_DIR9 0x00000400 /* Directed effect */
-/*
- * Wilderness terrains
- */
-#define TERRAIN_EDGE 0 /* Edge of the World */
-#define TERRAIN_TOWN 1 /* Town */
-#define TERRAIN_DEEP_WATER 2 /* Deep water */
-#define TERRAIN_SHALLOW_WATER 3 /* Shallow water */
-#define TERRAIN_SWAMP 4 /* Swamp */
-#define TERRAIN_DIRT 5 /* Dirt */
-#define TERRAIN_GRASS 6 /* Grass */
-#define TERRAIN_TREES 7 /* Trees */
-#define TERRAIN_DESERT 8 /* Desert */
-#define TERRAIN_SHALLOW_LAVA 9 /* Shallow lava */
-#define TERRAIN_DEEP_LAVA 10 /* Deep lava */
-#define TERRAIN_MOUNTAIN 11 /* Mountain */
-
-#define MAX_WILD_TERRAIN 18
-
/*** Artifact indexes (see "lib/edit/a_info.txt") ***/
@@ -3383,34 +3282,6 @@
-
-/*** Color constants ***/
-
-
-/*
- * Angband "attributes" (with symbols, and base (R,G,B) codes)
- *
- * The "(R,G,B)" codes are given in "fourths" of the "maximal" value,
- * and should "gamma corrected" on most (non-Macintosh) machines.
- */
-#define TERM_DARK 0 /* 'd' */ /* 0,0,0 */
-#define TERM_WHITE 1 /* 'w' */ /* 4,4,4 */
-#define TERM_SLATE 2 /* 's' */ /* 2,2,2 */
-#define TERM_ORANGE 3 /* 'o' */ /* 4,2,0 */
-#define TERM_RED 4 /* 'r' */ /* 3,0,0 */
-#define TERM_GREEN 5 /* 'g' */ /* 0,2,1 */
-#define TERM_BLUE 6 /* 'b' */ /* 0,0,4 */
-#define TERM_UMBER 7 /* 'u' */ /* 2,1,0 */
-#define TERM_L_DARK 8 /* 'D' */ /* 1,1,1 */
-#define TERM_L_WHITE 9 /* 'W' */ /* 3,3,3 */
-#define TERM_VIOLET 10 /* 'v' */ /* 4,0,4 */
-#define TERM_YELLOW 11 /* 'y' */ /* 4,4,0 */
-#define TERM_L_RED 12 /* 'R' */ /* 4,0,0 */
-#define TERM_L_GREEN 13 /* 'G' */ /* 0,4,0 */
-#define TERM_L_BLUE 14 /* 'B' */ /* 0,4,4 */
-#define TERM_L_UMBER 15 /* 'U' */ /* 3,2,1 */
-
-
/*** Sound constants ***/
@@ -3725,7 +3596,6 @@
/* Town defines */
#define TOWN_RANDOM 20 /* First random town */
-#define TOWN_DUNGEON 4 /* Maximun number of towns per dungeon */
#define TOWN_CHANCE 50 /* Chance of 1 town */
@@ -3745,77 +3615,6 @@
#define SF1_MUSEUM 0x00000400L
/*
- * Powers (mutation, activations, ...)
- */
-#define POWER_MAX 65
-
-#define PWR_SPIT_ACID 0
-#define PWR_BR_FIRE 1
-#define PWR_HYPN_GAZE 2
-#define PWR_TELEKINES 3
-#define PWR_VTELEPORT 4
-#define PWR_MIND_BLST 5
-#define PWR_RADIATION 6
-#define PWR_VAMPIRISM 7
-#define PWR_SMELL_MET 8
-#define PWR_SMELL_MON 9
-#define PWR_BLINK 10
-#define PWR_EAT_ROCK 11
-#define PWR_SWAP_POS 12
-#define PWR_SHRIEK 13
-#define PWR_ILLUMINE 14
-#define PWR_DET_CURSE 15
-#define PWR_BERSERK 16
-#define PWR_POLYMORPH 17
-#define PWR_MIDAS_TCH 18
-#define PWR_GROW_MOLD 19
-#define PWR_RESIST 20
-#define PWR_EARTHQUAKE 21
-#define PWR_EAT_MAGIC 22
-#define PWR_WEIGH_MAG 23
-#define PWR_STERILITY 24
-#define PWR_PANIC_HIT 25
-#define PWR_DAZZLE 26
-#define PWR_DARKRAY 27
-#define PWR_RECALL 28
-#define PWR_BANISH 29
-#define PWR_COLD_TOUCH 30
-#define PWR_LAUNCHER 31
-
-#define PWR_PASSWALL 32
-#define PWR_DETECT_TD 33
-#define PWR_COOK_FOOD 34
-#define PWR_UNFEAR 35
-#define PWR_EXPL_RUNE 36
-#define PWR_STM 37
-#define PWR_POIS_DART 38
-#define PWR_MAGIC_MISSILE 39
-#define PWR_GROW_TREE 40
-#define PWR_BR_COLD 41
-#define PWR_BR_CHAOS 42
-#define PWR_BR_ELEM 43
-#define PWR_WRECK_WORLD 44
-#define PWR_SCARE 45
-#define PWR_REST_LIFE 46
-#define PWR_SUMMON_MONSTER 47
-#define PWR_NECRO 48
-#define PWR_ROHAN 49
-#define PWR_THUNDER 50
-#define PWR_DEATHMOLD 51
-#define PWR_HYPNO 52
-#define PWR_UNHYPNO 53
-#define PWR_INCARNATE 54
-#define PWR_MAGIC_MAP 55
-#define PWR_LAY_TRAP 56
-#define PWR_COMPANION 58
-#define PWR_BEAR 59
-#define PWR_DODGE 60
-#define PWR_BALROG 61
-#define POWER_INVISIBILITY 62
-#define POWER_WEB 63
-#define POWER_COR_SPACE_TIME 64
-
-/*
* Shield effect options
*/
#define SHIELD_NONE 0x0000
@@ -3881,45 +3680,6 @@
#define MAX_MODULES 2
/*
- * Corruptions
- */
-#define CORRUPT_BALROG_AURA 0
-#define CORRUPT_BALROG_WINGS 1
-#define CORRUPT_BALROG_STRENGTH 2
-#define CORRUPT_BALROG_FORM 3
-#define CORRUPT_DEMON_SPIRIT 4
-#define CORRUPT_DEMON_HIDE 5
-#define CORRUPT_DEMON_BREATH 6
-#define CORRUPT_DEMON_REALM 7
-#define CORRUPT_RANDOM_TELEPORT 8
-#define CORRUPT_ANTI_TELEPORT 9
-#define CORRUPT_TROLL_BLOOD 10
-#define CORRUPT_VAMPIRE_TEETH 11
-#define CORRUPT_VAMPIRE_STRENGTH 12
-#define CORRUPT_VAMPIRE_VAMPIRE 13
-#define MUT1_SPIT_ACID 14
-#define MUT1_BR_FIRE 15
-#define MUT1_HYPN_GAZE 16
-#define MUT1_TELEKINES 17
-#define MUT1_VTELEPORT 18
-#define MUT1_MIND_BLST 19
-#define MUT1_VAMPIRISM 20
-#define MUT1_SMELL_MET 21
-#define MUT1_SMELL_MON 22
-#define MUT1_BLINK 23
-#define MUT1_EAT_ROCK 24
-#define MUT1_SWAP_POS 25
-#define MUT1_SHRIEK 26
-#define MUT1_ILLUMINE 27
-#define MUT1_DET_CURSE 28
-#define MUT1_BERSERK 29
-#define MUT1_MIDAS_TCH 30
-#define MUT1_GROW_MOLD 31
-#define MUT1_RESIST 32
-#define MUT1_EARTHQUAKE 33
-#define CORRUPTIONS_MAX 34
-
-/*
* Races
*/
#define RACE_HUMAN 0
@@ -3999,11 +3759,6 @@
#define HOOK_FORBID_TRAVEL 75
/*
- * In game help
- */
-#define HELP_MAX 64
-
-/*
* Special weapon effects
*/
#define SPEC_POIS 0x00000001L
@@ -4030,69 +3785,6 @@
#define SKILL_EXCLUSIVE 9999 /* Flag to tell exclusive skills */
-#define SKILL_CONVEYANCE 1
-#define SKILL_MANA 2
-#define SKILL_FIRE 3
-#define SKILL_AIR 4
-#define SKILL_WATER 5
-#define SKILL_NATURE 6
-#define SKILL_EARTH 7
-#define SKILL_SYMBIOTIC 8
-#define SKILL_MUSIC 9
-#define SKILL_DIVINATION 10
-#define SKILL_TEMPORAL 11
-#define SKILL_DRUID 12
-#define SKILL_DAEMON 13
-#define SKILL_META 14
-#define SKILL_MAGIC 15
-#define SKILL_COMBAT 16
-#define SKILL_MASTERY 17
-#define SKILL_SWORD 18
-#define SKILL_AXE 19
-#define SKILL_POLEARM 20
-#define SKILL_HAFTED 21
-#define SKILL_BACKSTAB 22
-#define SKILL_ARCHERY 23
-#define SKILL_SLING 24
-#define SKILL_BOW 25
-#define SKILL_XBOW 26
-#define SKILL_BOOMERANG 27
-#define SKILL_SPIRITUALITY 28
-#define SKILL_MINDCRAFT 29
-#define SKILL_MISC 30
-#define SKILL_NECROMANCY 31
-#define SKILL_MIMICRY 32
-#define SKILL_ANTIMAGIC 33
-#define SKILL_RUNECRAFT 34
-#define SKILL_SNEAK 35
-#define SKILL_STEALTH 36
-#define SKILL_DISARMING 37
-/* XXX */
-#define SKILL_ALCHEMY 39
-#define SKILL_STEALING 40
-#define SKILL_SORCERY 41
-#define SKILL_HAND 42
-#define SKILL_THAUMATURGY 43
-#define SKILL_SUMMON 44
-#define SKILL_SPELL 45
-#define SKILL_DODGE 46
-#define SKILL_BEAR 47
-#define SKILL_LORE 48
-#define SKILL_PRESERVATION 49
-#define SKILL_POSSESSION 50
-#define SKILL_MIND 51
-#define SKILL_CRITS 52
-#define SKILL_PRAY 53
-#define SKILL_LEARN 54
-#define SKILL_UDUN 55
-#define SKILL_DEVICE 56
-#define SKILL_STUN 57
-#define SKILL_BOULDER 58
-#define SKILL_GEOMANCY 59
-
-/* Ugly but needed */
-#define MAX_SKILLS 200
-
/* Number of skill choices for Lost Sword quests. */
#define LOST_SWORD_NSKILLS 4
@@ -4103,11 +3795,6 @@
#define MAX_MELEE 3
-/*
- * Player specialities, should be external but ti would be a mess
- */
-#define MAX_SPEC 20
-
/*
* Spellbinder triggers
diff --git a/src/deity_type.hpp b/src/deity_type.hpp
new file mode 100644
index 0000000..0dcbb81
--- /dev/null
+++ b/src/deity_type.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+/**
+ * A structure for deity information.
+ */
+struct deity_type
+{
+ int modules[3]; /* terminated with -1 */
+ char const *name;
+ char desc[10][80];
+};
diff --git a/src/deity_type_fwd.hpp b/src/deity_type_fwd.hpp
new file mode 100644
index 0000000..492bf1f
--- /dev/null
+++ b/src/deity_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct deity_type;
diff --git a/src/device_allocation_fwd.hpp b/src/device_allocation_fwd.hpp
index 8d5b3c6..70e53fc 100644
--- a/src/device_allocation_fwd.hpp
+++ b/src/device_allocation_fwd.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
typedef struct device_allocation device_allocation;
struct device_allocation;
diff --git a/src/dice.cc b/src/dice.cc
index 91bbdca..637d277 100644
--- a/src/dice.cc
+++ b/src/dice.cc
@@ -1,5 +1,7 @@
#include "dice.hpp"
+#include "z-rand.h"
+
#include <cassert>
void dice_init(dice_type *dice, long base, long num, long sides)
diff --git a/src/dice_fwd.hpp b/src/dice_fwd.hpp
index ffc8fbf..72b3b5c 100644
--- a/src/dice_fwd.hpp
+++ b/src/dice_fwd.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
typedef struct dice_type dice_type;
struct dice_type;
diff --git a/src/dungeon.cc b/src/dungeon.cc
index 34dd781..7f276b8 100644
--- a/src/dungeon.cc
+++ b/src/dungeon.cc
@@ -9,10 +9,10 @@
#include "dungeon.hpp"
#include "dungeon.h"
-#include "angband.h"
#include "birth.hpp"
#include "birth.h"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd1.hpp"
#include "cmd2.hpp"
#include "cmd3.hpp"
@@ -21,6 +21,8 @@
#include "cmd6.hpp"
#include "cmd7.hpp"
#include "corrupt.hpp"
+#include "dungeon_info_type.hpp"
+#include "feature_type.hpp"
#include "files.h"
#include "files.hpp"
#include "generate.hpp"
@@ -37,11 +39,19 @@
#include "melee2.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "modules.hpp"
#include "notes.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "object_type.hpp"
#include "options.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_spec.hpp"
+#include "player_type.hpp"
#include "powers.hpp"
#include "quest.hpp"
#include "quark.hpp"
@@ -51,13 +61,17 @@
#include "spells2.hpp"
#include "spells5.hpp"
#include "squeltch.hpp"
+#include "stats.hpp"
#include "store.hpp"
#include "tables.hpp"
+#include "timer_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
#include "variable.hpp"
#include "wild.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
#include "wizard2.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/dungeon_info_type.hpp b/src/dungeon_info_type.hpp
new file mode 100644
index 0000000..5f6fc9d
--- /dev/null
+++ b/src/dungeon_info_type.hpp
@@ -0,0 +1,72 @@
+#pragma once
+
+#include "h-basic.h"
+#include "rule_type.hpp"
+#include "obj_theme.hpp"
+
+/**
+ * Maximum number of towns per dungeon
+ */
+constexpr int TOWN_DUNGEON = 4;
+
+/* A structure for the != dungeon types */
+struct dungeon_info_type
+{
+ const char *name; /* Name */
+ char *text; /* Description */
+ char short_name[3]; /* Short name */
+
+ char generator[30]; /* Name of the level generator */
+
+ s16b floor1; /* Floor tile 1 */
+ byte floor_percent1[2]; /* Chance of type 1 */
+ s16b floor2; /* Floor tile 2 */
+ byte floor_percent2[2]; /* Chance of type 2 */
+ s16b floor3; /* Floor tile 3 */
+ byte floor_percent3[2]; /* Chance of type 3 */
+ s16b outer_wall; /* Outer wall tile */
+ s16b inner_wall; /* Inner wall tile */
+ s16b fill_type1; /* Cave tile 1 */
+ byte fill_percent1[2]; /* Chance of type 1 */
+ s16b fill_type2; /* Cave tile 2 */
+ byte fill_percent2[2]; /* Chance of type 2 */
+ s16b fill_type3; /* Cave tile 3 */
+ byte fill_percent3[2]; /* Chance of type 3 */
+ byte fill_method; /* Smoothing parameter for the above */
+
+ s16b mindepth; /* Minimal depth */
+ s16b maxdepth; /* Maximal depth */
+
+ bool_ principal; /* If it's a part of the main dungeon */
+ byte next; /* The next part of the main dungeon */
+ byte min_plev; /* Minimal plev needed to enter -- it's an anti-cheating mesure */
+
+ int min_m_alloc_level; /* Minimal number of monsters per level */
+ int max_m_alloc_chance; /* There is a 1/max_m_alloc_chance chance per round of creating a new monster */
+
+ u32b flags1; /* Flags 1 */
+ u32b flags2; /* Flags 1 */
+
+ int size_x, size_y; /* Desired numers of panels */
+
+ byte rule_percents[100]; /* Flat rule percents */
+ rule_type rules[5]; /* Monster generation rules */
+
+ int final_object; /* The object you'll find at the bottom */
+ int final_artifact; /* The artifact you'll find at the bottom */
+ int final_guardian; /* The artifact's guardian. If an artifact is specified, then it's NEEDED */
+
+ int ix, iy, ox, oy; /* Wilderness coordinates of the entrance/output of the dungeon */
+
+ obj_theme objs; /* The drops type */
+
+ int d_dice[4]; /* Number of dices */
+ int d_side[4]; /* Number of sides */
+ int d_frequency[4]; /* Frequency of damage (1 is the minimum) */
+ int d_type[4]; /* Type of damage */
+
+ s16b t_idx[TOWN_DUNGEON]; /* The towns */
+ s16b t_level[TOWN_DUNGEON]; /* The towns levels */
+ s16b t_num; /* Number of towns */
+};
+
diff --git a/src/dungeon_info_type_fwd.hpp b/src/dungeon_info_type_fwd.hpp
new file mode 100644
index 0000000..26ed028
--- /dev/null
+++ b/src/dungeon_info_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct dungeon_info_type;
diff --git a/src/effect_type.hpp b/src/effect_type.hpp
new file mode 100644
index 0000000..8cd638c
--- /dev/null
+++ b/src/effect_type.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Lasting spell effects. (Clouds, etc.)
+ */
+struct effect_type
+{
+ s16b time; /* For how long */
+ s16b dam; /* How much damage */
+ s16b type; /* Of which type */
+ s16b cy; /* Center of the cast*/
+ s16b cx; /* Center of the cast*/
+ s16b rad; /* Radius -- if needed */
+ u32b flags; /* Flags */
+};
diff --git a/src/ego_item_type.hpp b/src/ego_item_type.hpp
new file mode 100644
index 0000000..f9b6970
--- /dev/null
+++ b/src/ego_item_type.hpp
@@ -0,0 +1,68 @@
+#pragma once
+
+#include "h-basic.h"
+
+/*
+ * Size of flag rarity tables
+ */
+constexpr int FLAG_RARITY_MAX = 6;
+
+/**
+ * Ego item descriptors.
+ */
+struct ego_item_type
+{
+ const char *name; /* Name (offset) */
+
+ bool_ before; /* Before or after the object name ? */
+
+ byte tval[10];
+ byte min_sval[10];
+ byte max_sval[10];
+
+ byte rating; /* Rating boost */
+
+ byte level; /* Minimum level */
+ byte rarity; /* Object rarity */
+ byte mrarity; /* Object rarity */
+
+ s16b max_to_h; /* Maximum to-hit bonus */
+ s16b max_to_d; /* Maximum to-dam bonus */
+ s16b max_to_a; /* Maximum to-ac bonus */
+
+ s16b activate; /* Activation Number */
+
+ s32b max_pval; /* Maximum pval */
+
+ s32b cost; /* Ego-item "cost" */
+
+ byte rar[FLAG_RARITY_MAX];
+ u32b flags1[FLAG_RARITY_MAX]; /* Ego-Item Flags, set 1 */
+ u32b flags2[FLAG_RARITY_MAX]; /* Ego-Item Flags, set 2 */
+ u32b flags3[FLAG_RARITY_MAX]; /* Ego-Item Flags, set 3 */
+ u32b flags4[FLAG_RARITY_MAX]; /* Ego-Item Flags, set 4 */
+ u32b flags5[FLAG_RARITY_MAX]; /* Ego-Item Flags, set 5 */
+ u32b esp[FLAG_RARITY_MAX]; /* ESP flags */
+ u32b oflags1[FLAG_RARITY_MAX]; /* Ego-Item Obvious Flags, set 1 */
+ u32b oflags2[FLAG_RARITY_MAX]; /* Ego-Item Obvious Flags, set 2 */
+ u32b oflags3[FLAG_RARITY_MAX]; /* Ego-Item Obvious Flags, set 3 */
+ u32b oflags4[FLAG_RARITY_MAX]; /* Ego-Item Obvious Flags, set 4 */
+ u32b oflags5[FLAG_RARITY_MAX]; /* Ego-Item Obvious Flags, set 5 */
+ u32b oesp[FLAG_RARITY_MAX]; /* Obvious ESP flags */
+ u32b fego[FLAG_RARITY_MAX]; /* ego flags */
+
+ u32b need_flags1; /* Ego-Item Flags, set 1 */
+ u32b need_flags2; /* Ego-Item Flags, set 2 */
+ u32b need_flags3; /* Ego-Item Flags, set 3 */
+ u32b need_flags4; /* Ego-Item Flags, set 4 */
+ u32b need_flags5; /* Ego-Item Flags, set 5 */
+ u32b need_esp; /* ESP flags */
+ u32b forbid_flags1; /* Ego-Item Flags, set 1 */
+ u32b forbid_flags2; /* Ego-Item Flags, set 2 */
+ u32b forbid_flags3; /* Ego-Item Flags, set 3 */
+ u32b forbid_flags4; /* Ego-Item Flags, set 4 */
+ u32b forbid_flags5; /* Ego-Item Flags, set 5 */
+ u32b forbid_esp; /* ESP flags */
+
+ s16b power; /* Power granted(if any) */
+};
diff --git a/src/ego_item_type_fwd.hpp b/src/ego_item_type_fwd.hpp
new file mode 100644
index 0000000..795f440
--- /dev/null
+++ b/src/ego_item_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct ego_item_type;
diff --git a/src/fate.hpp b/src/fate.hpp
new file mode 100644
index 0000000..906bc99
--- /dev/null
+++ b/src/fate.hpp
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Fate descritpor.
+ */
+struct fate
+{
+ byte fate; /* Which fate */
+ byte level; /* On which level */
+ byte serious; /* Is it sure? */
+ s16b o_idx; /* Object to find */
+ s16b e_idx; /* Ego-Item to find */
+ s16b a_idx; /* Artifact to find */
+ s16b v_idx; /* Vault to find */
+ s16b r_idx; /* Monster to find */
+ s16b count; /* Number of things */
+ s16b time; /* Turn before */
+ bool_ know; /* Has it been predicted? */
+ bool_ icky; /* Hackish runtime-only flag */
+};
diff --git a/src/feature_type.hpp b/src/feature_type.hpp
new file mode 100644
index 0000000..1a79aeb
--- /dev/null
+++ b/src/feature_type.hpp
@@ -0,0 +1,37 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Terrain feature descriptor.
+ */
+struct feature_type
+{
+ char *name; /* Name */
+
+ const char *text; /* Text. May point to shared read-only memory, DO NOT FREE! */
+ const char *tunnel; /* Text for tunneling. May point to shared read-only memory, DO NOT FREE! */
+ const char *block; /* Text for blocking. May point to shared read-only memory, DO NOT FREE! */
+
+ byte mimic; /* Feature to mimic */
+
+ u32b flags1; /* First set of flags */
+
+ byte extra; /* Extra byte (unused) */
+
+ s16b unused; /* Extra bytes (unused) */
+
+ byte d_attr; /* Default feature attribute */
+ char d_char; /* Default feature character */
+
+
+ byte x_attr; /* Desired feature attribute */
+ char x_char; /* Desired feature character */
+
+ byte shimmer[7]; /* Shimmer colors */
+
+ int d_dice[4]; /* Number of dices */
+ int d_side[4]; /* Number of sides */
+ int d_frequency[4]; /* Frequency of damage (1 is the minimum) */
+ int d_type[4]; /* Type of damage */
+};
diff --git a/src/feature_type_fwd.hpp b/src/feature_type_fwd.hpp
new file mode 100644
index 0000000..168ec6c
--- /dev/null
+++ b/src/feature_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct feature_type;
diff --git a/src/files.cc b/src/files.cc
index 2313b27..2ff6a90 100644
--- a/src/files.cc
+++ b/src/files.cc
@@ -9,11 +9,14 @@
#include "files.hpp"
#include "files.h"
-#include "angband.h"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "corrupt.hpp"
#include "cmd3.hpp"
+#include "dungeon_info_type.hpp"
+#include "feature_type.hpp"
#include "hiscore.hpp"
+#include "hook_chardump_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "levels.hpp"
@@ -22,17 +25,32 @@
#include "mimic.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_ego.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "notes.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_class.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_spec.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
#include "spells2.hpp"
+#include "store_info_type.hpp"
+#include "store_type.hpp"
#include "tables.hpp"
+#include "town_type.hpp"
+#include "trap_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
#include "variable.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
#include "xtra1.hpp"
#include <memory>
diff --git a/src/files.hpp b/src/files.hpp
index b09c85b..52206d1 100644
--- a/src/files.hpp
+++ b/src/files.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "monster_type_fwd.hpp"
extern void html_screenshot(cptr name);
extern void help_file_screenshot(cptr name);
diff --git a/src/flags_group.hpp b/src/flags_group.hpp
new file mode 100644
index 0000000..f71e370
--- /dev/null
+++ b/src/flags_group.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * For level gaining artifacts, artifact creation, ...
+ */
+struct flags_group
+{
+ char name[30]; /* Name */
+ byte color; /* Color */
+
+ byte price; /* Price to "buy" it */
+
+ u32b flags1; /* Flags set 1 */
+ u32b flags2; /* Flags set 2 */
+ u32b flags3; /* Flags set 3 */
+ u32b flags4; /* Flags set 4 */
+ u32b esp; /* ESP flags set */
+};
diff --git a/src/gen_evol.cc b/src/gen_evol.cc
index d2676fa..0ccd063 100644
--- a/src/gen_evol.cc
+++ b/src/gen_evol.cc
@@ -8,10 +8,12 @@
#include "gen_evol.hpp"
-#include "angband.h"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "feature_type.hpp"
#include "generate.hpp"
#include "levels.hpp"
+#include "player_type.hpp"
#include "variable.hpp"
/*
diff --git a/src/gen_maze.cc b/src/gen_maze.cc
index 4c59fb5..9a3706f 100644
--- a/src/gen_maze.cc
+++ b/src/gen_maze.cc
@@ -9,7 +9,6 @@
#include "gen_evol.hpp"
-#include "angband.h"
#include "cave.hpp"
#include "generate.hpp"
#include "levels.hpp"
diff --git a/src/generate.cc b/src/generate.cc
index a874a6e..4d3b2bc 100644
--- a/src/generate.cc
+++ b/src/generate.cc
@@ -6,22 +6,35 @@
* included in all such copies.
*/
-#include "angband.h"
+#include "generate.hpp"
+
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "dungeon_info_type.hpp"
+#include "feature_type.hpp"
+#include "hook_build_room1_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "levels.hpp"
#include "loadsave.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "randart.hpp"
#include "spells1.hpp"
#include "tables.hpp"
+#include "town_type.hpp"
#include "traps.hpp"
#include "util.hpp"
#include "variable.hpp"
+#include "vault_type.hpp"
#include "wild.hpp"
+#include "wilderness_map.hpp"
#include <cassert>
#include <memory>
diff --git a/src/generate.hpp b/src/generate.hpp
index 5f3b7e3..d09907b 100644
--- a/src/generate.hpp
+++ b/src/generate.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern bool_ new_player_spot(int branch);
extern void add_level_generator(cptr name, bool_ (*generator)());
diff --git a/src/gf_name_type.hpp b/src/gf_name_type.hpp
new file mode 100644
index 0000000..0b17bdb
--- /dev/null
+++ b/src/gf_name_type.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+/**
+ * GF_XXX descriptor entry.
+ */
+struct gf_name_type
+{
+ int gf;
+ char const *name;
+};
diff --git a/src/gods.cc b/src/gods.cc
index abb10c1..1163e9b 100644
--- a/src/gods.cc
+++ b/src/gods.cc
@@ -7,8 +7,10 @@
*/
#include "gods.hpp"
-#include "angband.h"
+#include "player_type.hpp"
#include "skills.hpp"
+#include "skill_type.hpp"
+#include "stats.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
diff --git a/src/gods.hpp b/src/gods.hpp
index a7d6082..7035dd1 100644
--- a/src/gods.hpp
+++ b/src/gods.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern void inc_piety(int god, s32b amt);
extern void abandon_god(int god);
diff --git a/src/help.cc b/src/help.cc
index 6391851..9b607b6 100644
--- a/src/help.cc
+++ b/src/help.cc
@@ -9,11 +9,15 @@
#include "help.hpp"
-#include "angband.h"
+#include "cave_type.hpp"
#include "files.hpp"
+#include "hook_get_in.hpp"
+#include "hook_identify_in.hpp"
+#include "hook_move_in.hpp"
#include "hooks.hpp"
#include "object1.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/help.hpp b/src/help.hpp
index 7c6ad3f..7c057a0 100644
--- a/src/help.hpp
+++ b/src/help.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern void init_hooks_help();
extern void help_race(cptr race);
diff --git a/src/help_info.hpp b/src/help_info.hpp
new file mode 100644
index 0000000..ea440bb
--- /dev/null
+++ b/src/help_info.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Maximum number of help items.
+ */
+constexpr int HELP_MAX = 64;
+
+/**
+ * Context help runtime data.
+ */
+struct help_info
+{
+ bool_ enabled; /* ingame help enabled */
+ bool_ activated[HELP_MAX]; /* help item #i activated? */
+};
diff --git a/src/hiscore.cc b/src/hiscore.cc
index 9d55bbd..971b84c 100644
--- a/src/hiscore.cc
+++ b/src/hiscore.cc
@@ -1,6 +1,5 @@
#include "hiscore.hpp"
-#include "angband.h"
#include "util.hpp"
#include <cassert>
diff --git a/src/hiscore.hpp b/src/hiscore.hpp
index 0e9afa4..0b1b713 100644
--- a/src/hiscore.hpp
+++ b/src/hiscore.hpp
@@ -2,6 +2,11 @@
#include "h-basic.h"
+/**
+ * Maximum number of high scores in the high score file
+ */
+constexpr int MAX_HISCORES = 100;
+
/*
* Semi-Portable High Score List Entry (128 bytes) -- BEN
*
diff --git a/src/hist_type.hpp b/src/hist_type.hpp
new file mode 100644
index 0000000..2da47b7
--- /dev/null
+++ b/src/hist_type.hpp
@@ -0,0 +1,16 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Player background descriptor.
+ */
+struct hist_type
+{
+ char *info; /* Textual History */
+
+ byte roll; /* Frequency of this entry */
+ s16b chart; /* Chart index */
+ s16b next; /* Next chart index */
+ byte bonus; /* Social Class Bonus + 50 */
+};
diff --git a/src/hist_type_fwd.hpp b/src/hist_type_fwd.hpp
new file mode 100644
index 0000000..d1cbce9
--- /dev/null
+++ b/src/hist_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct hist_type;
diff --git a/src/hook_build_room1_in.hpp b/src/hook_build_room1_in.hpp
new file mode 100644
index 0000000..e9a5d36
--- /dev/null
+++ b/src/hook_build_room1_in.hpp
@@ -0,0 +1,8 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_build_room1_in {
+ s32b y;
+ s32b x;
+};
diff --git a/src/hook_calculate_hp_in.hpp b/src/hook_calculate_hp_in.hpp
new file mode 100644
index 0000000..924add4
--- /dev/null
+++ b/src/hook_calculate_hp_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_calculate_hp_in {
+ s32b mhp;
+};
diff --git a/src/hook_calculate_hp_out.hpp b/src/hook_calculate_hp_out.hpp
new file mode 100644
index 0000000..7923997
--- /dev/null
+++ b/src/hook_calculate_hp_out.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_calculate_hp_out {
+ s32b mhp;
+};
diff --git a/src/hook_chardump_in.hpp b/src/hook_chardump_in.hpp
new file mode 100644
index 0000000..c8edea6
--- /dev/null
+++ b/src/hook_chardump_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_chardump_in {
+ FILE *file;
+};
diff --git a/src/hook_chat_in.hpp b/src/hook_chat_in.hpp
new file mode 100644
index 0000000..5062b0e
--- /dev/null
+++ b/src/hook_chat_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_chat_in {
+ s32b m_idx;
+};
diff --git a/src/hook_drop_in.hpp b/src/hook_drop_in.hpp
new file mode 100644
index 0000000..acaa10f
--- /dev/null
+++ b/src/hook_drop_in.hpp
@@ -0,0 +1,5 @@
+#pragma once
+
+struct hook_drop_in {
+ int o_idx;
+};
diff --git a/src/hook_eat_in.hpp b/src/hook_eat_in.hpp
new file mode 100644
index 0000000..075bb2b
--- /dev/null
+++ b/src/hook_eat_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "object_type_fwd.hpp"
+
+struct hook_eat_in {
+ object_type *o_ptr;
+};
diff --git a/src/hook_eat_out.hpp b/src/hook_eat_out.hpp
new file mode 100644
index 0000000..70bb92a
--- /dev/null
+++ b/src/hook_eat_out.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_eat_out {
+ bool_ ident;
+};
diff --git a/src/hook_enter_dungeon_in.hpp b/src/hook_enter_dungeon_in.hpp
new file mode 100644
index 0000000..2f667c7
--- /dev/null
+++ b/src/hook_enter_dungeon_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_enter_dungeon_in {
+ s32b d_idx;
+};
diff --git a/src/hook_get_in.hpp b/src/hook_get_in.hpp
new file mode 100644
index 0000000..9bc4b79
--- /dev/null
+++ b/src/hook_get_in.hpp
@@ -0,0 +1,8 @@
+#pragma once
+
+#include "object_type_fwd.hpp"
+
+struct hook_get_in {
+ object_type *o_ptr;
+ int o_idx;
+};
diff --git a/src/hook_give_in.hpp b/src/hook_give_in.hpp
new file mode 100644
index 0000000..0ef5a11
--- /dev/null
+++ b/src/hook_give_in.hpp
@@ -0,0 +1,6 @@
+#pragma once
+
+struct hook_give_in {
+ int m_idx;
+ int item;
+};
diff --git a/src/hook_identify_in.hpp b/src/hook_identify_in.hpp
new file mode 100644
index 0000000..40a8fc7
--- /dev/null
+++ b/src/hook_identify_in.hpp
@@ -0,0 +1,9 @@
+#pragma once
+
+#include "object_type_fwd.hpp"
+#include "identify_mode.hpp"
+
+struct hook_identify_in {
+ object_type *o_ptr;
+ identify_mode mode;
+};
diff --git a/src/hook_init_quest_in.hpp b/src/hook_init_quest_in.hpp
new file mode 100644
index 0000000..5d4b274
--- /dev/null
+++ b/src/hook_init_quest_in.hpp
@@ -0,0 +1,5 @@
+#pragma once
+
+struct hook_init_quest_in {
+ int q_idx;
+};
diff --git a/src/hook_mon_speak_in.hpp b/src/hook_mon_speak_in.hpp
new file mode 100644
index 0000000..f3a1433
--- /dev/null
+++ b/src/hook_mon_speak_in.hpp
@@ -0,0 +1,8 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_mon_speak_in {
+ s32b m_idx;
+ cptr m_name;
+};
diff --git a/src/hook_monster_ai_in.hpp b/src/hook_monster_ai_in.hpp
new file mode 100644
index 0000000..492006a
--- /dev/null
+++ b/src/hook_monster_ai_in.hpp
@@ -0,0 +1,9 @@
+#pragma once
+
+#include "h-basic.h"
+#include "monster_type_fwd.hpp"
+
+struct hook_monster_ai_in {
+ s32b m_idx;
+ monster_type *m_ptr;
+};
diff --git a/src/hook_monster_ai_out.hpp b/src/hook_monster_ai_out.hpp
new file mode 100644
index 0000000..4c5ef28
--- /dev/null
+++ b/src/hook_monster_ai_out.hpp
@@ -0,0 +1,8 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_monster_ai_out {
+ s32b y;
+ s32b x;
+};
diff --git a/src/hook_monster_death_in.hpp b/src/hook_monster_death_in.hpp
new file mode 100644
index 0000000..354c37d
--- /dev/null
+++ b/src/hook_monster_death_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_monster_death_in {
+ s32b m_idx;
+};
diff --git a/src/hook_move_in.hpp b/src/hook_move_in.hpp
new file mode 100644
index 0000000..6e299e5
--- /dev/null
+++ b/src/hook_move_in.hpp
@@ -0,0 +1,6 @@
+#pragma once
+
+struct hook_move_in {
+ int y;
+ int x;
+};
diff --git a/src/hook_new_monster_end_in.hpp b/src/hook_new_monster_end_in.hpp
new file mode 100644
index 0000000..3c5f835
--- /dev/null
+++ b/src/hook_new_monster_end_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "monster_type_fwd.hpp"
+
+struct hook_new_monster_end_in {
+ monster_type *m_ptr;
+};
diff --git a/src/hook_new_monster_in.hpp b/src/hook_new_monster_in.hpp
new file mode 100644
index 0000000..10b0420
--- /dev/null
+++ b/src/hook_new_monster_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_new_monster_in {
+ s32b r_idx;
+};
diff --git a/src/hook_player_level_in.hpp b/src/hook_player_level_in.hpp
new file mode 100644
index 0000000..90804e2
--- /dev/null
+++ b/src/hook_player_level_in.hpp
@@ -0,0 +1,5 @@
+#pragma once
+
+struct hook_player_level_in {
+ int gained_levels;
+};
diff --git a/src/hook_quest_fail_in.hpp b/src/hook_quest_fail_in.hpp
new file mode 100644
index 0000000..2edf86a
--- /dev/null
+++ b/src/hook_quest_fail_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_quest_fail_in {
+ s16b q_idx;
+};
diff --git a/src/hook_quest_finish_in.hpp b/src/hook_quest_finish_in.hpp
new file mode 100644
index 0000000..55490be
--- /dev/null
+++ b/src/hook_quest_finish_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_quest_finish_in {
+ s32b q_idx;
+};
diff --git a/src/hook_stair_in.hpp b/src/hook_stair_in.hpp
new file mode 100644
index 0000000..884a187
--- /dev/null
+++ b/src/hook_stair_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "stairs_direction.hpp"
+
+struct hook_stair_in {
+ stairs_direction direction;
+};
diff --git a/src/hook_stair_out.hpp b/src/hook_stair_out.hpp
new file mode 100644
index 0000000..5e3d515
--- /dev/null
+++ b/src/hook_stair_out.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_stair_out {
+ bool_ allow;
+};
diff --git a/src/hook_wield_in.hpp b/src/hook_wield_in.hpp
new file mode 100644
index 0000000..036e62d
--- /dev/null
+++ b/src/hook_wield_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "object_type_fwd.hpp"
+
+struct hook_wield_in {
+ object_type *o_ptr;
+};
diff --git a/src/hook_wild_gen_in.hpp b/src/hook_wild_gen_in.hpp
new file mode 100644
index 0000000..147a74d
--- /dev/null
+++ b/src/hook_wild_gen_in.hpp
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct hook_wild_gen_in {
+ bool_ small;
+};
diff --git a/src/hooks.cc b/src/hooks.cc
index 43c6e6d..4fcc39d 100644
--- a/src/hooks.cc
+++ b/src/hooks.cc
@@ -6,7 +6,6 @@
* included in all such copies.
*/
#include "hooks.hpp"
-#include "angband.h"
#include <algorithm>
#include <assert.h>
diff --git a/src/hooks.hpp b/src/hooks.hpp
index 9c17fe5..b6124e6 100644
--- a/src/hooks.hpp
+++ b/src/hooks.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
typedef bool_ (*hook_func_t)(void *, void *, void *);
diff --git a/src/identify_mode.hpp b/src/identify_mode.hpp
new file mode 100644
index 0000000..687a1fa
--- /dev/null
+++ b/src/identify_mode.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+typedef enum { IDENT_NORMAL, IDENT_FULL } identify_mode;
diff --git a/src/include/tome/squelch/automatizer.hpp b/src/include/tome/squelch/automatizer.hpp
index fae52a2..786ca1a 100644
--- a/src/include/tome/squelch/automatizer.hpp
+++ b/src/include/tome/squelch/automatizer.hpp
@@ -1,5 +1,4 @@
-#ifndef H_53108fce_b059_4a82_99db_e1d4970ebd77
-#define H_53108fce_b059_4a82_99db_e1d4970ebd77
+#pragma once
#include <boost/noncopyable.hpp>
#include <memory>
@@ -10,7 +9,7 @@
#include "tome/squelch/cursor_fwd.hpp"
#include "tome/squelch/tree_printer_fwd.hpp"
#include "tome/squelch/condition_fwd.hpp"
-#include "types_fwd.h"
+#include "../object_type_fwd.hpp"
namespace squelch {
@@ -155,5 +154,3 @@ private:
};
} // namespace
-
-#endif
diff --git a/src/include/tome/squelch/condition.hpp b/src/include/tome/squelch/condition.hpp
index 7aad5ff..5d1240f 100644
--- a/src/include/tome/squelch/condition.hpp
+++ b/src/include/tome/squelch/condition.hpp
@@ -1,5 +1,4 @@
-#ifndef H_e31ae6cc_eb8a_4909_ad6c_da485e4264a2
-#define H_e31ae6cc_eb8a_4909_ad6c_da485e4264a2
+#pragma once
#include "tome/squelch/condition_fwd.hpp"
@@ -13,7 +12,7 @@
#include "tome/squelch/tree_printer_fwd.hpp"
#include "tome/squelch/object_status_fwd.hpp"
#include "tome/enum_string_map.hpp"
-#include "types_fwd.h"
+#include "../object_type_fwd.hpp"
namespace squelch {
@@ -631,5 +630,3 @@ protected:
};
} // namespace
-
-#endif
diff --git a/src/include/tome/squelch/object_status_fwd.hpp b/src/include/tome/squelch/object_status_fwd.hpp
index 1072505..361ea2f 100644
--- a/src/include/tome/squelch/object_status_fwd.hpp
+++ b/src/include/tome/squelch/object_status_fwd.hpp
@@ -1,7 +1,6 @@
-#ifndef H_3261a8ad_ee1c_4a2b_9d21_7c9955f09542
-#define H_3261a8ad_ee1c_4a2b_9d21_7c9955f09542
+#pragma once
-#include "types_fwd.h"
+#include "../object_type_fwd.hpp"
#include "tome/enum_string_map.hpp"
namespace squelch {
@@ -11,5 +10,3 @@ EnumStringMap<status_type> &status_mapping();
status_type object_status(object_type *o_ptr);
} // namespace
-
-#endif
diff --git a/src/include/tome/squelch/rule.hpp b/src/include/tome/squelch/rule.hpp
index 4d4c7c5..63f1b6c 100644
--- a/src/include/tome/squelch/rule.hpp
+++ b/src/include/tome/squelch/rule.hpp
@@ -1,5 +1,4 @@
-#ifndef H_c3dd858a_4663_44a0_8871_ff6c8148a613
-#define H_c3dd858a_4663_44a0_8871_ff6c8148a613
+#pragma once
#include <jansson.h>
#include <memory>
@@ -8,7 +7,7 @@
#include "tome/squelch/cursor_fwd.hpp"
#include "tome/squelch/tree_printer_fwd.hpp"
#include "tome/enum_string_map.hpp"
-#include "types_fwd.h"
+#include "../object_type_fwd.hpp"
namespace squelch {
@@ -161,5 +160,3 @@ private:
};
} // namespace
-
-#endif
diff --git a/src/init1.cc b/src/init1.cc
index 30eed94..a1d2b7a 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -1,22 +1,51 @@
#include "init1.hpp"
-#include "angband.h"
#include "ability_type.hpp"
+#include "alchemist_recipe.hpp"
+#include "artifact_type.hpp"
+#include "artifact_select_flag.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "dungeon_info_type.hpp"
+#include "ego_item_type.hpp"
+#include "feature_type.hpp"
#include "files.hpp"
#include "gods.hpp"
+#include "hist_type.hpp"
#include "init2.hpp"
+#include "meta_class_type.hpp"
#include "monster2.hpp"
+#include "monster_ego.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "owner_type.hpp"
+#include "player_class.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_type.hpp"
+#include "randart_gen_type.hpp"
+#include "randart_part_type.hpp"
+#include "set_type.hpp"
+#include "skill_type.hpp"
#include "skills.hpp"
#include "spells5.hpp"
+#include "store_action_type.hpp"
+#include "store_info_type.hpp"
+#include "store_type.hpp"
#include "tables.hpp"
+#include "town_type.hpp"
+#include "trap_type.hpp"
#include "traps.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
#include "variable.hpp"
+#include "vault_type.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
#include <boost/algorithm/string/predicate.hpp>
@@ -9202,6 +9231,7 @@ errr init_st_info_txt(FILE *fp)
st_ptr->table[item_idx++][0] = test_item_name(s);
st_ptr->table_num = item_idx;
+ assert(st_ptr->table_num <= STORE_CHOICES);
/* Next... */
continue;
diff --git a/src/init2.cc b/src/init2.cc
index edef495..e950868 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -1,29 +1,58 @@
#include "init2.hpp"
#include "init2.h"
-#include "angband.h"
#include "ability_type.hpp"
+#include "alchemist_recipe.hpp"
+#include "alloc_entry.hpp"
+#include "artifact_select_flag.hpp"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "cli_comm.hpp"
+#include "dungeon_info_type.hpp"
+#include "ego_item_type.hpp"
#include "files.hpp"
+#include "feature_type.hpp"
#include "generate.hpp"
#include "gen_evol.hpp"
#include "gen_maze.hpp"
+#include "hist_type.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "lua_bind.hpp"
#include "messages.hpp"
+#include "meta_class_type.hpp"
#include "modules.hpp"
+#include "monster_ego.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
+#include "object_kind.hpp"
+#include "owner_type.hpp"
+#include "player_class.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
#include "quark.hpp"
#include "randart.hpp"
+#include "randart_part_type.hpp"
#include "script.h"
+#include "set_type.hpp"
+#include "skill_type.hpp"
#include "spells3.hpp"
#include "squeltch.hpp"
+#include "store_action_type.hpp"
+#include "store_info_type.hpp"
+#include "store_type.hpp"
#include "tables.hpp"
+#include "trap_type.hpp"
#include "tome/make_array.hpp"
+#include "town_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
#include "variable.hpp"
+#include "vault_type.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
#include <cassert>
#include <type_traits>
diff --git a/src/inscription_info_type.hpp b/src/inscription_info_type.hpp
new file mode 100644
index 0000000..6dbb67f
--- /dev/null
+++ b/src/inscription_info_type.hpp
@@ -0,0 +1,14 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Inscriptions
+ */
+struct inscription_info_type
+{
+ char text[40]; /* The inscription itself */
+ byte when; /* When it is executed */
+ bool_ know; /* Is the inscription know ? */
+ byte mana; /* Grid mana needed */
+};
diff --git a/src/inventory.hpp b/src/inventory.hpp
new file mode 100644
index 0000000..775f7a7
--- /dev/null
+++ b/src/inventory.hpp
@@ -0,0 +1,35 @@
+#pragma once
+
+/*
+ * Maximum number of "normal" pack slots, and the index of the "overflow"
+ * slot, which can hold an item, but only temporarily, since it causes the
+ * pack to "overflow", dropping the "last" item onto the ground. Since this
+ * value is used as an actual slot, it must be less than "INVEN_WIELD" (below).
+ * Note that "INVEN_PACK" is probably hard-coded by its use in savefiles, and
+ * by the fact that the screen can only show 23 items plus a one-line prompt.
+ */
+#define INVEN_PACK 23
+
+/*
+ * Indexes used for various "equipment" slots (hard-coded by savefiles, etc).
+ */
+#define INVEN_WIELD 24 /* 3 weapons -- WEAPONS */
+#define INVEN_BOW 27 /* 1 bow -- WEAPON */
+#define INVEN_RING 28 /* 6 rings -- FINGER */
+#define INVEN_NECK 34 /* 2 amulets -- HEAD */
+#define INVEN_LITE 36 /* 1 lite -- TORSO */
+#define INVEN_BODY 37 /* 1 body -- TORSO */
+#define INVEN_OUTER 38 /* 1 cloak -- TORSO */
+#define INVEN_ARM 39 /* 3 arms -- ARMS */
+#define INVEN_HEAD 42 /* 2 heads -- HEAD */
+#define INVEN_HANDS 44 /* 3 hands -- ARMS */
+#define INVEN_FEET 47 /* 2 feets -- LEGS */
+#define INVEN_CARRY 49 /* 1 carried monster -- TORSO */
+#define INVEN_AMMO 50 /* 1 quiver -- TORSO */
+#define INVEN_TOOL 51 /* 1 tool -- ARMS */
+
+/*
+ * Total number of inventory slots (hard-coded).
+ */
+#define INVEN_TOTAL 52
+#define INVEN_EQ (INVEN_TOTAL - INVEN_WIELD)
diff --git a/src/joke.cc b/src/joke.cc
index 890dbc6..fa66024 100644
--- a/src/joke.cc
+++ b/src/joke.cc
@@ -1,6 +1,5 @@
#include "joke.hpp"
-#include "angband.h"
#include "monster2.hpp"
#include "options.hpp"
#include "util.hpp"
diff --git a/src/levels.cc b/src/levels.cc
index d8820a7..ac3aa3d 100644
--- a/src/levels.cc
+++ b/src/levels.cc
@@ -8,7 +8,7 @@
#include "levels.hpp"
-#include "angband.h"
+#include "dungeon_info_type.hpp"
#include "init1.hpp"
#include "util.hpp"
#include "util.h"
diff --git a/src/loadsave.cc b/src/loadsave.cc
index 0de2f3e..5ada8f3 100644
--- a/src/loadsave.cc
+++ b/src/loadsave.cc
@@ -1,22 +1,38 @@
#include "loadsave.hpp"
#include "loadsave.h"
-#include "angband.h"
#include "ability_type.hpp"
+#include "artifact_type.hpp"
#include "birth.hpp"
+#include "cave_type.hpp"
+#include "dungeon_info_type.hpp"
+#include "ego_item_type.hpp"
#include "init1.hpp"
#include "init2.hpp"
#include "levels.hpp"
#include "messages.hpp"
#include "modules.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "player_class.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
#include "hooks.hpp"
+#include "skill_type.hpp"
+#include "store_type.hpp"
#include "tables.hpp"
+#include "timer_type.hpp"
+#include "town_type.hpp"
+#include "trap_type.hpp"
#include "util.hpp"
#include "util.h"
+#include "wilderness_map.hpp"
#include "variable.h"
#include "variable.hpp"
#include "xtra2.hpp"
diff --git a/src/lua_bind.cc b/src/lua_bind.cc
index 501d9ed..aa2c3a2 100644
--- a/src/lua_bind.cc
+++ b/src/lua_bind.cc
@@ -8,17 +8,19 @@
#include "lua_bind.hpp"
-#include "angband.h"
#include "cmd7.hpp"
#include "corrupt.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "player_type.hpp"
#include "range.hpp"
#include "skills.hpp"
+#include "skill_type.hpp"
#include "spell_type.hpp"
#include "spells2.hpp"
#include "spells5.hpp"
#include "tables.hpp"
+#include "timer_type.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/lua_bind.hpp b/src/lua_bind.hpp
index 5117fcb..b2a6c9a 100644
--- a/src/lua_bind.hpp
+++ b/src/lua_bind.hpp
@@ -1,7 +1,8 @@
#pragma once
#include "h-basic.h"
-#include "types_fwd.h"
+#include "spell_type_fwd.hpp"
+#include "timer_type_fwd.hpp"
/** Calculate spell failure rate for a device, i.e. a wand or staff. */
extern s32b spell_chance_device(spell_type *spell_ptr);
diff --git a/src/magic_power.hpp b/src/magic_power.hpp
new file mode 100644
index 0000000..b02c6c1
--- /dev/null
+++ b/src/magic_power.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Powers, used by Mindcrafters and Necromancers
+ */
+struct magic_power
+{
+ int min_lev;
+ int mana_cost;
+ int fail;
+ cptr name;
+ cptr desc;
+};
diff --git a/src/main-gcu.c b/src/main-gcu.c
index 426345b..3e1d1ff 100644
--- a/src/main-gcu.c
+++ b/src/main-gcu.c
@@ -38,8 +38,6 @@
* Consider the use of "savetty()" and "resetty()". XXX XXX XXX
*/
-
-#include "angband.h"
#include "util.h"
#include "variable.h"
diff --git a/src/main-gtk2.c b/src/main-gtk2.c
index a7d7b75..bdf7f6a 100644
--- a/src/main-gtk2.c
+++ b/src/main-gtk2.c
@@ -30,7 +30,6 @@
* and reorganised the file a bit.
*/
-#include "angband.h"
#include "files.h"
#include "util.h"
#include "variable.h"
diff --git a/src/main-sdl.c b/src/main-sdl.c
index 9126c72..da26e9a 100644
--- a/src/main-sdl.c
+++ b/src/main-sdl.c
@@ -25,7 +25,6 @@
#ifdef USE_SDL
-#include "angband.h"
#include "loadsave.h"
#include "util.h"
#include "variable.h"
diff --git a/src/main-x11.c b/src/main-x11.c
index 2553712..6d12274 100644
--- a/src/main-x11.c
+++ b/src/main-x11.c
@@ -92,7 +92,6 @@
*
*/
-#include "angband.h"
#include "loadsave.h"
#include "util.h"
#include "variable.h"
diff --git a/src/main.c b/src/main.c
index 1ffd61c..a20eb6b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -8,7 +8,6 @@
* are included in all such copies.
*/
-#include "angband.h"
#include "birth.h"
#include "dungeon.h"
#include "files.h"
diff --git a/src/martial_arts.hpp b/src/martial_arts.hpp
new file mode 100644
index 0000000..1f2f0cb
--- /dev/null
+++ b/src/martial_arts.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Martial arts descriptors
+ */
+struct martial_arts
+{
+ cptr desc; /* A verbose attack description */
+ int min_level; /* Minimum level to use */
+ int chance; /* Chance of 'success' */
+ int dd; /* Damage dice */
+ int ds; /* Damage sides */
+ s16b effect; /* Special effects */
+ s16b power; /* Special effects power */
+};
+
diff --git a/src/melee1.cc b/src/melee1.cc
index 5e3dba8..0f78998 100644
--- a/src/melee1.cc
+++ b/src/melee1.cc
@@ -8,18 +8,21 @@
#include "melee1.hpp"
-#include "angband.h"
#include "cave.hpp"
#include "cmd5.hpp"
#include "gods.hpp"
#include "mimic.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
+#include "stats.hpp"
#include "store.hpp"
#include "tables.hpp"
#include "util.hpp"
diff --git a/src/melee2.cc b/src/melee2.cc
index 09c4734..da37f76 100644
--- a/src/melee2.cc
+++ b/src/melee2.cc
@@ -13,22 +13,30 @@
#include "melee2.hpp"
-#include "angband.h"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd1.hpp"
+#include "feature_type.hpp"
#include "files.hpp"
+#include "hook_mon_speak_in.hpp"
+#include "hook_monster_ai_in.hpp"
+#include "hook_monster_ai_out.hpp"
#include "hooks.hpp"
#include "melee1.hpp"
#include "messages.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
#include "skills.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
+#include "stats.hpp"
#include "tables.hpp"
#include "traps.hpp"
#include "util.hpp"
diff --git a/src/melee2.hpp b/src/melee2.hpp
index 22f3b1a..fece056 100644
--- a/src/melee2.hpp
+++ b/src/melee2.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "h-basic.h"
-#include "types_fwd.h"
+#include "monster_type_fwd.hpp"
extern int monst_spell_monst_spell;
extern bool_ mon_take_hit_mon(int s_idx, int m_idx, int dam, bool_ *fear, cptr note);
diff --git a/src/messages.cc b/src/messages.cc
index 4701f86..a4ce949 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -2,7 +2,9 @@
#include "tome/make_array.hpp"
-#include "angband.h"
+#include "z-term.h"
+#include "z-form.h"
+#include "z-util.h"
/*
* OPTION: Maximum number of messages to remember (see "io.c")
diff --git a/src/meta_class_type.hpp b/src/meta_class_type.hpp
new file mode 100644
index 0000000..e74e75b
--- /dev/null
+++ b/src/meta_class_type.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct meta_class_type
+{
+ char name[80]; /* Name */
+ byte color;
+ s16b *classes; /* list of classes */
+};
diff --git a/src/meta_class_type_fwd.hpp b/src/meta_class_type_fwd.hpp
new file mode 100644
index 0000000..2d0e482
--- /dev/null
+++ b/src/meta_class_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct meta_class_type;
diff --git a/src/mimic.cc b/src/mimic.cc
index 6fec9ec..b888ec5 100644
--- a/src/mimic.cc
+++ b/src/mimic.cc
@@ -1,5 +1,8 @@
#include "mimic.hpp"
+#include "player_type.hpp"
+#include "skill_type.hpp"
+#include "stats.hpp"
#include "variable.hpp"
#include "xtra1.hpp"
diff --git a/src/mimic.hpp b/src/mimic.hpp
index ca11f2a..d9c8f3b 100644
--- a/src/mimic.hpp
+++ b/src/mimic.hpp
@@ -1,4 +1,4 @@
-#include "angband.h"
+#include "h-basic.h"
extern s16b resolve_mimic_name(cptr name);
extern s16b find_random_mimic_shape(byte level, bool_ limit);
diff --git a/src/module_type.hpp b/src/module_type.hpp
new file mode 100644
index 0000000..9693885
--- /dev/null
+++ b/src/module_type.hpp
@@ -0,0 +1,64 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Module descriptor.
+ */
+struct module_type
+{
+ /* Metadata about the module: author, description, etc. */
+ struct {
+ /* Module name */
+ cptr name;
+
+ /* Module version number */
+ struct {
+ s32b major;
+ s32b minor;
+ s32b patch;
+ } version;
+
+ /* Module author */
+ struct {
+ cptr name;
+ cptr email;
+ } author;
+
+ /* Module description */
+ cptr desc;
+
+ /* Save file tag */
+ cptr save_file_tag;
+
+ /* Module directory */
+ cptr module_dir;
+ } meta;
+
+ /* Random artifact generation chances */
+ struct {
+ s32b weapon_chance;
+ s32b armor_chance;
+ s32b jewelry_chance;
+ } randarts;
+
+ /* Max player level. */
+ int max_plev;
+
+ /* Skills */
+ struct {
+ /* Skill points per level */
+ s32b skill_per_level;
+ /* Maximum "overage" for skill points, i.e. how many skill
+ points you can go above your current level. */
+ s32b max_skill_overage;
+ } skills;
+
+ /* Function to show introduction to module */
+ void (*intro)();
+
+ /* Function to compute race status, i.e. whether monsters
+ are friendly/neutral towards the player. Returns NULL
+ to indicate that no override happens. */
+ s16b *(*race_status)(int r_idx);
+};
diff --git a/src/modules.cc b/src/modules.cc
index ffcf743..8eebb35 100644
--- a/src/modules.cc
+++ b/src/modules.cc
@@ -9,17 +9,28 @@
#include "modules.hpp"
#include "modules.h"
-#include "angband.h"
#include "birth.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "corrupt.hpp"
#include "files.hpp"
+#include "hook_eat_in.hpp"
+#include "hook_give_in.hpp"
+#include "hook_move_in.hpp"
+#include "hook_stair_in.hpp"
+#include "hook_stair_out.hpp"
+#include "hook_new_monster_end_in.hpp"
#include "hooks.hpp"
#include "joke.hpp"
#include "lua_bind.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
#include "spells2.hpp"
+#include "stats.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
diff --git a/src/modules.hpp b/src/modules.hpp
index 5ea515e..d83e3e2 100644
--- a/src/modules.hpp
+++ b/src/modules.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern bool_ select_module(void);
extern bool_ module_savefile_loadable(cptr savefile_mod);
diff --git a/src/monster1.cc b/src/monster1.cc
index 20f23e5..77f916a 100644
--- a/src/monster1.cc
+++ b/src/monster1.cc
@@ -8,10 +8,15 @@
#include "monster1.hpp"
-#include "angband.h"
+#include "cave_type.hpp"
#include "monster2.hpp"
+#include "monster_ego.hpp"
+#include "monster_race.hpp"
+#include "player_type.hpp"
#include "util.hpp"
#include "variable.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
/*
* Pronoun arrays, by gender.
diff --git a/src/monster2.cc b/src/monster2.cc
index d7f9697..07048d9 100644
--- a/src/monster2.cc
+++ b/src/monster2.cc
@@ -7,22 +7,35 @@
*/
#include "monster2.hpp"
-#include "angband.h"
+#include "alloc_entry.hpp"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "dungeon_info_type.hpp"
#include "files.hpp"
+#include "hook_new_monster_in.hpp"
+#include "hook_new_monster_end_in.hpp"
#include "hooks.hpp"
#include "levels.hpp"
#include "mimic.hpp"
#include "monster3.hpp"
+#include "monster_ego.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "object_type.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "randart.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
+#include "stats.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
+#include "wilderness_map.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/monster2.hpp b/src/monster2.hpp
index 050afd9..ffe7b3c 100644
--- a/src/monster2.hpp
+++ b/src/monster2.hpp
@@ -1,6 +1,9 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "monster_race_fwd.hpp"
+#include "monster_type_fwd.hpp"
+#include "object_type_fwd.hpp"
extern s32b monster_exp(s16b level);
extern void monster_set_level(int m_idx, int level);
diff --git a/src/monster3.cc b/src/monster3.cc
index c4d2295..6201f19 100644
--- a/src/monster3.cc
+++ b/src/monster3.cc
@@ -8,12 +8,15 @@
#include "monster3.hpp"
-#include "angband.h"
+#include "cave_type.hpp"
#include "cmd2.hpp"
#include "gods.hpp"
#include "melee2.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
#include "tables.hpp"
#include "util.hpp"
diff --git a/src/monster3.hpp b/src/monster3.hpp
index 394c5c1..7cf8ccd 100644
--- a/src/monster3.hpp
+++ b/src/monster3.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "monster_type_fwd.hpp"
extern void dump_companions(FILE *outfile);
extern void do_cmd_companion(void);
diff --git a/src/monster_blow.hpp b/src/monster_blow.hpp
new file mode 100644
index 0000000..0f19f64
--- /dev/null
+++ b/src/monster_blow.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Monster blow descriptor.
+ *
+ * - Method (RBM_*)
+ * - Effect (RBE_*)
+ * - Damage Dice
+ * - Damage Sides
+ */
+struct monster_blow
+{
+ byte method;
+ byte effect;
+ byte d_dice;
+ byte d_side;
+};
diff --git a/src/monster_ego.hpp b/src/monster_ego.hpp
new file mode 100644
index 0000000..00464c2
--- /dev/null
+++ b/src/monster_ego.hpp
@@ -0,0 +1,81 @@
+#pragma once
+
+#include "h-basic.h"
+#include "monster_blow.hpp"
+
+/**
+ * Monster ego descriptors.
+ */
+struct monster_ego
+{
+ const char *name; /* Name */
+ bool_ before; /* Display ego before or after */
+
+ monster_blow blow[4]; /* Up to four blows per round */
+ byte blowm[4][2];
+
+ s16b hdice; /* Creatures hit dice count */
+ s16b hside; /* Creatures hit dice sides */
+
+ s16b ac; /* Armour Class */
+
+ s16b sleep; /* Inactive counter (base) */
+ s16b aaf; /* Area affect radius (1-100) */
+ s16b speed; /* Speed (normally 110) */
+
+ s32b mexp; /* Exp value for kill */
+
+ s32b weight; /* Weight of the monster */
+
+ byte freq_inate; /* Inate spell frequency */
+ byte freq_spell; /* Other spell frequency */
+
+ /* Ego flags */
+ u32b flags1; /* Flags 1 */
+ u32b flags2; /* Flags 1 */
+ u32b flags3; /* Flags 1 */
+ u32b flags7; /* Flags 1 */
+ u32b flags8; /* Flags 1 */
+ u32b flags9; /* Flags 1 */
+ u32b hflags1; /* Flags 1 */
+ u32b hflags2; /* Flags 1 */
+ u32b hflags3; /* Flags 1 */
+ u32b hflags7; /* Flags 1 */
+ u32b hflags8; /* Flags 1 */
+ u32b hflags9; /* Flags 1 */
+
+ /* Monster flags */
+ u32b mflags1; /* Flags 1 (general) */
+ u32b mflags2; /* Flags 2 (abilities) */
+ u32b mflags3; /* Flags 3 (race/resist) */
+ u32b mflags4; /* Flags 4 (inate/breath) */
+ u32b mflags5; /* Flags 5 (normal spells) */
+ u32b mflags6; /* Flags 6 (special spells) */
+ u32b mflags7; /* Flags 7 (movement related abilities) */
+ u32b mflags8; /* Flags 8 (wilderness info) */
+ u32b mflags9; /* Flags 9 (drops info) */
+
+ /* Negative Flags, to be removed from the monster flags */
+ u32b nflags1; /* Flags 1 (general) */
+ u32b nflags2; /* Flags 2 (abilities) */
+ u32b nflags3; /* Flags 3 (race/resist) */
+ u32b nflags4; /* Flags 4 (inate/breath) */
+ u32b nflags5; /* Flags 5 (normal spells) */
+ u32b nflags6; /* Flags 6 (special spells) */
+ u32b nflags7; /* Flags 7 (movement related abilities) */
+ u32b nflags8; /* Flags 8 (wilderness info) */
+ u32b nflags9; /* Flags 9 (drops info) */
+
+ s16b level; /* Level of creature */
+ s16b rarity; /* Rarity of creature */
+
+
+ byte d_attr; /* Default monster attribute */
+ char d_char; /* Default monster character */
+
+ byte g_attr; /* Overlay graphic attribute */
+ char g_char; /* Overlay graphic character */
+
+ char r_char[5]; /* Monster race allowed */
+ char nr_char[5]; /* Monster race not allowed */
+};
diff --git a/src/monster_ego_fwd.hpp b/src/monster_ego_fwd.hpp
new file mode 100644
index 0000000..5b47f3e
--- /dev/null
+++ b/src/monster_ego_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct monster_ego;
diff --git a/src/monster_power.hpp b/src/monster_power.hpp
new file mode 100644
index 0000000..03d0f8a
--- /dev/null
+++ b/src/monster_power.hpp
@@ -0,0 +1,14 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Monster powers that players can use via e.g. Symbiosis.
+ */
+struct monster_power
+{
+ u32b power; /* Power RF?_xxx */
+ cptr name; /* Name of it */
+ int mana; /* Mana needed */
+ bool_ great; /* Need the use of great spells */
+};
diff --git a/src/monster_race.hpp b/src/monster_race.hpp
new file mode 100644
index 0000000..7e5d508
--- /dev/null
+++ b/src/monster_race.hpp
@@ -0,0 +1,116 @@
+#pragma once
+
+#include "body.hpp"
+#include "h-basic.h"
+#include "monster_blow.hpp"
+#include "obj_theme.hpp"
+
+/**
+ * Monster race descriptors and runtime data, including racial memories.
+ *
+ * Note that "d_attr" and "d_char" are used for MORE than "visual" stuff.
+ *
+ * Note that "x_attr" and "x_char" are used ONLY for "visual" stuff.
+ *
+ * Note that "cur_num" (and "max_num") represent the number of monsters
+ * of the given race currently on (and allowed on) the current level.
+ * This information yields the "dead" flag for Unique monsters.
+ *
+ * Note that "max_num" is reset when a new player is created.
+ * Note that "cur_num" is reset when a new level is created.
+ *
+ * Note that several of these fields, related to "recall", can be
+ * scrapped if space becomes an issue, resulting in less "complete"
+ * monster recall (no knowledge of spells, etc). All of the "recall"
+ * fields have a special prefix to aid in searching for them.
+ */
+struct monster_race
+{
+ const char *name; /* Name */
+ char *text; /* Text */
+
+ u16b hdice; /* Creatures hit dice count */
+ u16b hside; /* Creatures hit dice sides */
+
+ s16b ac; /* Armour Class */
+
+ s16b sleep; /* Inactive counter (base) */
+ byte aaf; /* Area affect radius (1-100) */
+ byte speed; /* Speed (normally 110) */
+
+ s32b mexp; /* Exp value for kill */
+
+ s32b weight; /* Weight of the monster */
+
+ byte freq_inate; /* Inate spell frequency */
+ byte freq_spell; /* Other spell frequency */
+
+ u32b flags1; /* Flags 1 (general) */
+ u32b flags2; /* Flags 2 (abilities) */
+ u32b flags3; /* Flags 3 (race/resist) */
+ u32b flags4; /* Flags 4 (inate/breath) */
+ u32b flags5; /* Flags 5 (normal spells) */
+ u32b flags6; /* Flags 6 (special spells) */
+ u32b flags7; /* Flags 7 (movement related abilities) */
+ u32b flags8; /* Flags 8 (wilderness info) */
+ u32b flags9; /* Flags 9 (drops info) */
+
+ monster_blow blow[4]; /* Up to four blows per round */
+
+ byte body_parts[BODY_MAX]; /* To help to decide what to use when body changing */
+
+ byte level; /* Level of creature */
+ byte rarity; /* Rarity of creature */
+
+
+ byte d_attr; /* Default monster attribute */
+ char d_char; /* Default monster character */
+
+
+ byte x_attr; /* Desired monster attribute */
+ char x_char; /* Desired monster character */
+
+
+ s16b max_num; /* Maximum population allowed per level */
+
+ byte cur_num; /* Monster population on current level */
+
+
+ s16b r_sights; /* Count sightings of this monster */
+ s16b r_deaths; /* Count deaths from this monster */
+
+ s16b r_pkills; /* Count monsters killed in this life */
+ s16b r_tkills; /* Count monsters killed in all lives */
+
+ byte r_wake; /* Number of times woken up (?) */
+ byte r_ignore; /* Number of times ignored (?) */
+
+ byte r_xtra1; /* Something (unused) */
+ byte r_xtra2; /* Something (unused) */
+
+ byte r_drop_gold; /* Max number of gold dropped at once */
+ byte r_drop_item; /* Max number of item dropped at once */
+
+ byte r_cast_inate; /* Max number of inate spells seen */
+ byte r_cast_spell; /* Max number of other spells seen */
+
+ byte r_blows[4]; /* Number of times each blow type was seen */
+
+ u32b r_flags1; /* Observed racial flags */
+ u32b r_flags2; /* Observed racial flags */
+ u32b r_flags3; /* Observed racial flags */
+ u32b r_flags4; /* Observed racial flags */
+ u32b r_flags5; /* Observed racial flags */
+ u32b r_flags6; /* Observed racial flags */
+ u32b r_flags7; /* Observed racial flags */
+ u32b r_flags8; /* Observed racial flags */
+ u32b r_flags9; /* Observed racial flags */
+
+ bool_ on_saved; /* Is the (unique) on a saved level ? */
+
+ byte total_visible; /* Amount of this race that are visible */
+
+ obj_theme drops; /* The drops type */
+};
+
+
diff --git a/src/monster_race_fwd.hpp b/src/monster_race_fwd.hpp
new file mode 100644
index 0000000..9ee9658
--- /dev/null
+++ b/src/monster_race_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct monster_race;
diff --git a/src/monster_type.hpp b/src/monster_type.hpp
new file mode 100644
index 0000000..ccb555d
--- /dev/null
+++ b/src/monster_type.hpp
@@ -0,0 +1,60 @@
+#pragma once
+
+#include "h-basic.h"
+#include "monster_blow.hpp"
+
+/**
+ * Monster information for a specific monster.
+ *
+ * Note: fy, fx constrain dungeon size to 256x256
+ *
+ * The "hold_o_idx" field points to the first object of a stack
+ * of objects (if any) being carried by the monster (see above).
+ */
+struct monster_type
+{
+ s16b r_idx; /* Monster race index */
+
+ u16b ego; /* Ego monster type */
+
+ byte fy; /* Y location on map */
+ byte fx; /* X location on map */
+
+ s32b hp; /* Current Hit points */
+ s32b maxhp; /* Max Hit points */
+
+ monster_blow blow[4]; /* Up to four blows per round */
+
+ byte speed; /* Speed (normally 110) */
+ byte level; /* Level of creature */
+ s16b ac; /* Armour Class */
+ s32b exp; /* Experience */
+
+ s16b csleep; /* Inactive counter */
+
+ byte mspeed; /* Monster "speed" */
+ byte energy; /* Monster "energy" */
+
+ byte stunned; /* Monster is stunned */
+ byte confused; /* Monster is confused */
+ byte monfear; /* Monster is afraid */
+
+ s16b bleeding; /* Monster is bleeding */
+ s16b poisoned; /* Monster is poisoned */
+
+ byte cdis; /* Current dis from player */
+
+ s32b mflag; /* Extra monster flags */
+
+ bool_ ml; /* Monster is "visible" */
+
+ s16b hold_o_idx; /* Object being held (if any) */
+
+ u32b smart; /* Field for "smart_learn" */
+
+ s16b status; /* Status(friendly, pet, companion, ..) */
+
+ s16b target; /* Monster target */
+
+ s16b possessor; /* Is it under the control of a possessor ? */
+};
diff --git a/src/monster_type_fwd.hpp b/src/monster_type_fwd.hpp
new file mode 100644
index 0000000..a44baa9
--- /dev/null
+++ b/src/monster_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct monster_type;
diff --git a/src/move_info_type.hpp b/src/move_info_type.hpp
new file mode 100644
index 0000000..5f8aa3d
--- /dev/null
+++ b/src/move_info_type.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Movement typse
+ */
+struct move_info_type
+{
+ s16b to_speed;
+ s16b to_search;
+ s16b to_stealth;
+ s16b to_percep;
+ cptr name;
+};
diff --git a/src/music.hpp b/src/music.hpp
new file mode 100644
index 0000000..5f37c57
--- /dev/null
+++ b/src/music.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Music descriptor.
+ */
+struct music
+{
+ char desc[80]; /* Desc of the music */
+ s16b music; /* Music. */
+ s16b dur; /* Duration(if any) */
+ s16b init_recharge; /* Minimal recharge time */
+ s16b turn_recharge; /* Recharge time for each more turn */
+ byte min_inst; /* Minimum instrument for the music */
+ byte rarity; /* Rarity of the music(use 100 to unallow to be randomly generated) */
+};
diff --git a/src/notes.cc b/src/notes.cc
index 0aa632f..2696007 100644
--- a/src/notes.cc
+++ b/src/notes.cc
@@ -9,8 +9,9 @@
#include "notes.hpp"
-#include "angband.h"
#include "files.hpp"
+#include "player_class.hpp"
+#include "player_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
diff --git a/src/obj_theme.hpp b/src/obj_theme.hpp
new file mode 100644
index 0000000..13f185e
--- /dev/null
+++ b/src/obj_theme.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Object theme. Probability in percent for each class of
+ * objects to be dropped.
+ */
+struct obj_theme
+{
+ byte treasure;
+ byte combat;
+ byte magic;
+ byte tools;
+};
diff --git a/src/obj_theme_fwd.hpp b/src/obj_theme_fwd.hpp
new file mode 100644
index 0000000..6c0d19a
--- /dev/null
+++ b/src/obj_theme_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct obj_theme;
diff --git a/src/object1.cc b/src/object1.cc
index ccfd5ac..231faa1 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -8,29 +8,47 @@
#include "object1.hpp"
-#include "angband.h"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd2.hpp"
#include "cmd6.hpp"
#include "dungeon.hpp"
+#include "dungeon_info_type.hpp"
+#include "ego_item_type.hpp"
+#include "feature_type.hpp"
#include "files.hpp"
+#include "hook_get_in.hpp"
#include "hooks.hpp"
#include "lua_bind.hpp"
#include "mimic.hpp"
#include "monster1.hpp"
#include "monster2.hpp"
+#include "monster_ego.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "object_type.hpp"
#include "options.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
+#include "set_type.hpp"
#include "skills.hpp"
#include "spell_type.hpp"
#include "spells5.hpp"
#include "squeltch.hpp"
+#include "stats.hpp"
+#include "store_info_type.hpp"
#include "tables.hpp"
+#include "trap_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
#include "variable.hpp"
+#include "wilderness_type_info.hpp"
#include "xtra1.hpp"
#include <cassert>
diff --git a/src/object1.hpp b/src/object1.hpp
index ba45761..ec8f936 100644
--- a/src/object1.hpp
+++ b/src/object1.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
#include "object_filter.hpp"
#include <boost/optional.hpp>
diff --git a/src/object2.cc b/src/object2.cc
index a702930..2d7e5e3 100644
--- a/src/object2.cc
+++ b/src/object2.cc
@@ -8,16 +8,27 @@
#include "object2.hpp"
-#include "angband.h"
+#include "alloc_entry.hpp"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "spell_type.hpp"
#include "device_allocation.hpp"
+#include "dungeon_info_type.hpp"
+#include "ego_item_type.hpp"
+#include "feature_type.hpp"
#include "hooks.hpp"
#include "mimic.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
+#include "object_kind.hpp"
+#include "object_type.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "randart.hpp"
+#include "randart_part_type.hpp"
#include "skills.hpp"
#include "spells2.hpp"
#include "spells3.hpp"
@@ -26,6 +37,7 @@
#include "traps.hpp"
#include "util.hpp"
#include "variable.hpp"
+#include "wilderness_map.hpp"
#include "xtra1.hpp"
#include <cassert>
@@ -4412,7 +4424,7 @@ static obj_theme match_theme;
* XXX XXX XXX It relies on the fact that obj_theme is a four byte structure
* for its efficient operation. A horrendous hack, I'd say.
*/
-void init_match_theme(obj_theme theme)
+void init_match_theme(obj_theme const &theme)
{
/* Save the theme */
match_theme = theme;
@@ -4814,7 +4826,7 @@ bool_ kind_is_artifactable(int k_idx)
* through the forge--object_prep()--apply_magic() sequence and
* get_obj_num() should never be called for that purpose XXX XXX XXX
*/
-bool_ make_object(object_type *j_ptr, bool_ good, bool_ great, obj_theme theme)
+bool_ make_object(object_type *j_ptr, bool_ good, bool_ great, obj_theme const &theme)
{
int invprob, base;
diff --git a/src/object2.hpp b/src/object2.hpp
index 6cb1104..6d5d716 100644
--- a/src/object2.hpp
+++ b/src/object2.hpp
@@ -1,7 +1,8 @@
#pragma once
#include "h-basic.h"
-#include "types_fwd.h"
+#include "object_type_fwd.hpp"
+#include "obj_theme_fwd.hpp"
typedef enum { OPTIMIZE, NO_OPTIMIZE } optimize_flag;
typedef enum { DESCRIBE, NO_DESCRIBE } describe_flag;
@@ -11,7 +12,7 @@ extern void inc_stack_size_ex(int item, int delta, optimize_flag opt, describe_f
extern object_type *get_object(int item);
extern s32b calc_total_weight(void);
extern void add_random_ego_flag(object_type *o_ptr, int fego, bool_ *limit_blows);
-extern void init_match_theme(obj_theme theme);
+extern void init_match_theme(obj_theme const &theme);
extern bool_ kind_is_artifactable(int k_idx);
extern bool_ kind_is_legal(int k_idx);
extern void inven_item_charges(int item);
@@ -50,7 +51,7 @@ extern void object_prep(object_type *o_ptr, int k_idx);
extern void object_copy(object_type *o_ptr, object_type *j_ptr);
extern int hack_apply_magic_power;
extern void apply_magic(object_type *o_ptr, int lev, bool_ okay, bool_ good, bool_ great);
-extern bool_ make_object(object_type *j_ptr, bool_ good, bool_ great, obj_theme theme);
+extern bool_ make_object(object_type *j_ptr, bool_ good, bool_ great, obj_theme const &theme);
extern void place_object(int y, int x, bool_ good, bool_ great, int where);
extern bool_ make_gold(object_type *j_ptr);
extern void place_gold(int y, int x);
diff --git a/src/object_filter.cc b/src/object_filter.cc
index 8d87213..3996114 100644
--- a/src/object_filter.cc
+++ b/src/object_filter.cc
@@ -1,6 +1,7 @@
#include "object_filter.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
namespace object_filter {
diff --git a/src/object_filter.hpp b/src/object_filter.hpp
index 469b1fa..9a22090 100644
--- a/src/object_filter.hpp
+++ b/src/object_filter.hpp
@@ -1,6 +1,8 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "object_type_fwd.hpp"
+
#include <functional>
#include <initializer_list>
diff --git a/src/object_kind.hpp b/src/object_kind.hpp
new file mode 100644
index 0000000..40a7758
--- /dev/null
+++ b/src/object_kind.hpp
@@ -0,0 +1,86 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Size of allocation table for objects
+ */
+constexpr int ALLOCATION_MAX = 8;
+
+/**
+ * Object "kind" descriptor. Includes player knowledge.
+ *
+ * Only "aware" and "tried" are saved in the savefile
+ */
+struct object_kind
+{
+ const char *name; /* Name */
+ char *text; /* Text */
+
+ byte tval; /* Object type */
+ byte sval; /* Object sub type */
+
+ s32b pval; /* Object extra info */
+ s32b pval2; /* Object extra info */
+
+ s16b to_h; /* Bonus to hit */
+ s16b to_d; /* Bonus to damage */
+ s16b to_a; /* Bonus to armor */
+
+ s16b activate; /* Activation number */
+
+ s16b ac; /* Base armor */
+
+ byte dd, ds; /* Damage dice/sides */
+
+ s32b weight; /* Weight */
+
+ s32b cost; /* Object "base cost" */
+
+ u32b flags1; /* Flags, set 1 */
+ u32b flags2; /* Flags, set 2 */
+ u32b flags3; /* Flags, set 3 */
+ u32b flags4; /* Flags, set 4 */
+ u32b flags5; /* Flags, set 5 */
+
+ u32b oflags1; /* Obvious Flags, set 1 */
+ u32b oflags2; /* Obvious Flags, set 2 */
+ u32b oflags3; /* Obvious Flags, set 3 */
+ u32b oflags4; /* Obvious Flags, set 4 */
+ u32b oflags5; /* Obvious Flags, set 5 */
+
+ byte locale[ALLOCATION_MAX]; /* Allocation level(s) */
+ byte chance[ALLOCATION_MAX]; /* Allocation chance(s) */
+
+ byte level; /* Level */
+ byte extra; /* Something */
+
+
+ byte d_attr; /* Default object attribute */
+ char d_char; /* Default object character */
+
+
+ byte x_attr; /* Desired object attribute */
+ char x_char; /* Desired object character */
+
+
+ byte flavor; /* Special object flavor (or zero) */
+
+ bool_ easy_know; /* This object is always known (if aware) */
+
+
+ bool_ aware; /* The player is "aware" of the item's effects */
+
+ bool_ tried; /* The player has "tried" one of the items */
+
+ bool_ know; /* extractable flag for the alchemist */
+
+ u32b esp; /* ESP flags */
+ u32b oesp; /* Obvious ESP flags */
+
+ byte btval; /* Become Object type */
+ byte bsval; /* Become Object sub type */
+ bool_ artifact; /* Is it a normal artifact(already generated) */
+
+ s16b power; /* Power granted(if any) */
+};
diff --git a/src/object_kind_fwd.hpp b/src/object_kind_fwd.hpp
new file mode 100644
index 0000000..6d26db9
--- /dev/null
+++ b/src/object_kind_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct object_kind;
diff --git a/src/object_type.hpp b/src/object_type.hpp
new file mode 100644
index 0000000..cadfa6b
--- /dev/null
+++ b/src/object_type.hpp
@@ -0,0 +1,106 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Object information for a specific object.
+ *
+ * Note that a "discount" on an item is permanent and never goes away.
+ *
+ * Note that inscriptions are now handled via the "quark_str()" function
+ * applied to the "note" field, which will return NULL if "note" is zero.
+ *
+ * Note that "object" records are "copied" on a fairly regular basis,
+ * and care must be taken when handling such objects.
+ *
+ * Note that "object flags" must now be derived from the object kind,
+ * the artifact and ego-item indexes, and the two "xtra" fields.
+ *
+ * Each cave grid points to one (or zero) objects via the "o_idx"
+ * field (above). Each object then points to one (or zero) objects
+ * via the "next_o_idx" field, forming a singly linked list, which
+ * in game terms, represents a "stack" of objects in the same grid.
+ *
+ * Each monster points to one (or zero) objects via the "hold_o_idx"
+ * field (below). Each object then points to one (or zero) objects
+ * via the "next_o_idx" field, forming a singly linked list, which
+ * in game terms, represents a pile of objects held by the monster.
+ *
+ * The "held_m_idx" field is used to indicate which monster, if any,
+ * is holding the object. Objects being held have "ix=0" and "iy=0".
+ */
+struct object_type
+{
+ s16b k_idx; /* Kind index (zero if "dead") */
+
+ byte iy; /* Y-position on map, or zero */
+ byte ix; /* X-position on map, or zero */
+
+ byte tval; /* Item type (from kind) */
+ byte sval; /* Item sub-type (from kind) */
+
+ s32b pval; /* Item extra-parameter */
+ s16b pval2; /* Item extra-parameter for some special
+ items*/
+ s32b pval3; /* Item extra-parameter for some special
+ items*/
+
+ byte discount; /* Discount (if any) */
+
+ byte number; /* Number of items */
+
+ s32b weight; /* Item weight */
+
+ byte elevel; /* Item exp level */
+ s32b exp; /* Item exp */
+
+ byte name1; /* Artifact type, if any */
+ s16b name2; /* Ego-Item type, if any */
+ s16b name2b; /* Second Ego-Item type, if any */
+
+ byte xtra1; /* Extra info type */
+ s16b xtra2; /* Extra info index */
+
+ s16b to_h; /* Plusses to hit */
+ s16b to_d; /* Plusses to damage */
+ s16b to_a; /* Plusses to AC */
+
+ s16b ac; /* Normal AC */
+
+ byte dd, ds; /* Damage dice/sides */
+
+ s16b timeout; /* Timeout Counter */
+
+ byte ident; /* Special flags */
+
+ byte marked; /* Object is marked */
+
+ u16b note; /* Inscription index */
+ u16b art_name; /* Artifact name (random artifacts) */
+
+ u32b art_flags1; /* Flags, set 1 Alas, these were necessary */
+ u32b art_flags2; /* Flags, set 2 for the random artifacts of*/
+ u32b art_flags3; /* Flags, set 3 Zangband */
+ u32b art_flags4; /* Flags, set 4 PernAngband */
+ u32b art_flags5; /* Flags, set 5 PernAngband */
+ u32b art_esp; /* Flags, set esp PernAngband */
+
+ u32b art_oflags1; /* Obvious Flags, set 1 */
+ u32b art_oflags2; /* Obvious Flags, set 2 */
+ u32b art_oflags3; /* Obvious Flags, set 3 */
+ u32b art_oflags4; /* Obvious Flags, set 4 */
+ u32b art_oflags5; /* Obvious Flags, set 5 */
+ u32b art_oesp; /* Obvious Flags, set esp */
+
+ s16b next_o_idx; /* Next object in stack (if any) */
+
+ s16b held_m_idx; /* Monster holding us (if any) */
+
+ byte sense; /* Pseudo-id status */
+
+ byte found; /* How did we find it */
+ s16b found_aux1; /* Stores info for found */
+ s16b found_aux2; /* Stores info for found */
+ s16b found_aux3; /* Stores info for found */
+ s16b found_aux4; /* Stores info for found */
+};
diff --git a/src/object_type_fwd.hpp b/src/object_type_fwd.hpp
new file mode 100644
index 0000000..d99e60a
--- /dev/null
+++ b/src/object_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct object_type;
diff --git a/src/option_type.hpp b/src/option_type.hpp
new file mode 100644
index 0000000..58834b7
--- /dev/null
+++ b/src/option_type.hpp
@@ -0,0 +1,40 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Option descriptor.
+ */
+struct option_type
+{
+ /**
+ * Address of actual option variable. NULL signals the
+ * end of the table.
+ */
+ bool_ *o_var;
+
+ /**
+ * Default value.
+ */
+ byte o_norm;
+
+ /**
+ * Option page number.
+ */
+ byte o_page;
+
+ /**
+ * Savefile bit in the page-specific list of options.
+ */
+ byte o_bit;
+
+ /**
+ * Textual name.
+ */
+ cptr o_text;
+
+ /**
+ * Textual description
+ */
+ cptr o_desc;
+};
diff --git a/src/owner_type.hpp b/src/owner_type.hpp
new file mode 100644
index 0000000..703d315
--- /dev/null
+++ b/src/owner_type.hpp
@@ -0,0 +1,39 @@
+#pragma once
+
+#include "h-basic.h"
+
+/*
+ * Store owner descriptor.
+ */
+struct owner_type
+{
+ /**
+ * Name
+ */
+ const char *name;
+
+ /**
+ * Purse limit
+ */
+ s16b max_cost;
+
+ /**
+ * Inflation
+ */
+ s16b inflation;
+
+ /**
+ * Liked/hated races.
+ */
+ u32b races[2][2];
+
+ /**
+ * Liked/hated classes
+ */
+ u32b classes[2][2];
+
+ /**
+ * Costs for liked people
+ */
+ s16b costs[3];
+};
diff --git a/src/owner_type_fwd.hpp b/src/owner_type_fwd.hpp
new file mode 100644
index 0000000..20c2580
--- /dev/null
+++ b/src/owner_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct owner_type;
diff --git a/src/player_class.hpp b/src/player_class.hpp
new file mode 100644
index 0000000..d67d1d7
--- /dev/null
+++ b/src/player_class.hpp
@@ -0,0 +1,105 @@
+#pragma once
+
+#include "body.hpp"
+#include "h-basic.h"
+#include "player_defs.hpp"
+#include "player_spec.hpp"
+
+/**
+ * Maximum number of specialties.
+ */
+constexpr int MAX_SPEC = 20;
+
+/**
+ * Player descriptor and runtime data.
+ */
+struct player_class
+{
+ const char *title; /* Type of class */
+ char *desc; /* Small desc of the class */
+ const char *titles[PY_MAX_LEVEL / 5];
+ /* Titles */
+
+ s16b c_adj[6]; /* Class stat modifier */
+
+ s16b c_dis; /* class disarming */
+ s16b c_dev; /* class magic devices */
+ s16b c_sav; /* class saving throws */
+ s16b c_stl; /* class stealth */
+ s16b c_srh; /* class searching ability */
+ s16b c_fos; /* class searching frequency */
+ s16b c_thn; /* class to hit (normal) */
+ s16b c_thb; /* class to hit (bows) */
+
+ s16b x_dis; /* extra disarming */
+ s16b x_dev; /* extra magic devices */
+ s16b x_sav; /* extra saving throws */
+ s16b x_stl; /* extra stealth */
+ s16b x_srh; /* extra searching ability */
+ s16b x_fos; /* extra searching frequency */
+ s16b x_thn; /* extra to hit (normal) */
+ s16b x_thb; /* extra to hit (bows) */
+
+ s16b c_mhp; /* Class hit-dice adjustment */
+ s16b c_exp; /* Class experience factor */
+
+ s16b powers[4]; /* Powers of the class */
+
+ s16b spell_book; /* Tval of spell books (if any) */
+ s16b spell_stat; /* Stat for spells (if any) */
+ s16b spell_lev; /* The higher it is the higher the spells level are */
+ s16b spell_fail; /* The higher it is the higher the spells failure are */
+ s16b spell_mana; /* The higher it is the higher the spells mana are */
+ s16b spell_first; /* Level of first spell */
+ s16b spell_weight; /* Weight that hurts spells */
+ byte max_spell_level; /* Maximun spell level */
+ byte magic_max_spell; /* Maximun numbner of spells one can learn by natural means */
+
+ u32b flags1; /* flags */
+ u32b flags2; /* flags */
+
+ s16b mana;
+ s16b blow_num;
+ s16b blow_wgt;
+ s16b blow_mul;
+ s16b extra_blows;
+
+ s32b sense_base;
+ s32b sense_pl;
+ s32b sense_plus;
+ byte sense_heavy;
+ byte sense_heavy_magic;
+
+ s16b obj_tval[5];
+ s16b obj_sval[5];
+ s16b obj_pval[5];
+ s16b obj_dd[5];
+ s16b obj_ds[5];
+ s16b obj_num;
+
+ char body_parts[BODY_MAX]; /* To help to decide what to use when body changing */
+
+ u32b oflags1[PY_MAX_LEVEL + 1];
+ u32b oflags2[PY_MAX_LEVEL + 1];
+ u32b oflags3[PY_MAX_LEVEL + 1];
+ u32b oflags4[PY_MAX_LEVEL + 1];
+ u32b oflags5[PY_MAX_LEVEL + 1];
+ u32b oesp[PY_MAX_LEVEL + 1];
+ s16b opval[PY_MAX_LEVEL + 1];
+
+ char skill_basem[MAX_SKILLS];
+ u32b skill_base[MAX_SKILLS];
+ char skill_modm[MAX_SKILLS];
+ s16b skill_mod[MAX_SKILLS];
+
+ u32b gods;
+
+ player_spec spec[MAX_SPEC];
+
+ struct
+ {
+ s16b ability;
+ s16b level;
+ } abilities[10]; /* Abilitiers to be gained by level(doesnt take prereqs in account) */
+};
+
diff --git a/src/player_class_fwd.hpp b/src/player_class_fwd.hpp
new file mode 100644
index 0000000..2402934
--- /dev/null
+++ b/src/player_class_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct player_class;
diff --git a/src/player_defs.hpp b/src/player_defs.hpp
new file mode 100644
index 0000000..2f57409
--- /dev/null
+++ b/src/player_defs.hpp
@@ -0,0 +1,6 @@
+#pragma once
+
+/**
+ * Maximum player level
+ */
+#define PY_MAX_LEVEL 50
diff --git a/src/player_race.hpp b/src/player_race.hpp
new file mode 100644
index 0000000..edb304f
--- /dev/null
+++ b/src/player_race.hpp
@@ -0,0 +1,83 @@
+#pragma once
+
+#include "h-basic.h"
+#include "body.hpp"
+#include "player_defs.hpp"
+#include "skills_defs.hpp"
+
+/**
+ * Player racial descriptior.
+ */
+struct player_race
+{
+ const char *title; /* Type of race */
+ char *desc;
+
+ s16b r_adj[6]; /* Racial stat bonuses */
+
+ char luck; /* Luck */
+
+ s16b r_dis; /* disarming */
+ s16b r_dev; /* magic devices */
+ s16b r_sav; /* saving throw */
+ s16b r_stl; /* stealth */
+ s16b r_srh; /* search ability */
+ s16b r_fos; /* search frequency */
+ s16b r_thn; /* combat (normal) */
+ s16b r_thb; /* combat (shooting) */
+
+ byte r_mhp; /* Race hit-dice modifier */
+ u16b r_exp; /* Race experience factor */
+
+ byte b_age; /* base age */
+ byte m_age; /* mod age */
+
+ byte m_b_ht; /* base height (males) */
+ byte m_m_ht; /* mod height (males) */
+ byte m_b_wt; /* base weight (males) */
+ byte m_m_wt; /* mod weight (males) */
+
+ byte f_b_ht; /* base height (females) */
+ byte f_m_ht; /* mod height (females) */
+ byte f_b_wt; /* base weight (females) */
+ byte f_m_wt; /* mod weight (females) */
+
+ byte infra; /* Infra-vision range */
+
+ u32b choice[2]; /* Legal class choices */
+
+ s16b powers[4]; /* Powers of the race */
+
+ byte body_parts[BODY_MAX]; /* To help to decide what to use when body changing */
+
+ s16b chart; /* Chart history */
+
+ u32b flags1;
+ u32b flags2; /* flags */
+
+ u32b oflags1[PY_MAX_LEVEL + 1];
+ u32b oflags2[PY_MAX_LEVEL + 1];
+ u32b oflags3[PY_MAX_LEVEL + 1];
+ u32b oflags4[PY_MAX_LEVEL + 1];
+ u32b oflags5[PY_MAX_LEVEL + 1];
+ u32b oesp[PY_MAX_LEVEL + 1];
+ s16b opval[PY_MAX_LEVEL + 1];
+
+ char skill_basem[MAX_SKILLS];
+ u32b skill_base[MAX_SKILLS];
+ char skill_modm[MAX_SKILLS];
+ s16b skill_mod[MAX_SKILLS];
+
+ s16b obj_tval[5];
+ s16b obj_sval[5];
+ s16b obj_pval[5];
+ s16b obj_dd[5];
+ s16b obj_ds[5];
+ s16b obj_num;
+
+ struct
+ {
+ s16b ability;
+ s16b level;
+ } abilities[10]; /* Abilitiers to be gained by level(doesnt take prereqs in account) */
+};
diff --git a/src/player_race_fwd.hpp b/src/player_race_fwd.hpp
new file mode 100644
index 0000000..c3c3350
--- /dev/null
+++ b/src/player_race_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct player_race;
diff --git a/src/player_race_mod.hpp b/src/player_race_mod.hpp
new file mode 100644
index 0000000..72f975c
--- /dev/null
+++ b/src/player_race_mod.hpp
@@ -0,0 +1,87 @@
+#pragma once
+
+#include "body.hpp"
+#include "h-basic.h"
+#include "skills_defs.hpp"
+
+struct player_race_mod
+{
+ char *title; /* Type of race mod */
+ char *desc; /* Desc */
+
+ bool_ place; /* TRUE = race race modifier, FALSE = Race modifier race */
+
+ s16b r_adj[6]; /* (+) Racial stat bonuses */
+
+ char luck; /* Luck */
+ s16b mana; /* Mana % */
+
+ s16b r_dis; /* (+) disarming */
+ s16b r_dev; /* (+) magic devices */
+ s16b r_sav; /* (+) saving throw */
+ s16b r_stl; /* (+) stealth */
+ s16b r_srh; /* (+) search ability */
+ s16b r_fos; /* (+) search frequency */
+ s16b r_thn; /* (+) combat (normal) */
+ s16b r_thb; /* (+) combat (shooting) */
+
+ char r_mhp; /* (+) Race mod hit-dice modifier */
+ s16b r_exp; /* (+) Race mod experience factor */
+
+ char b_age; /* (+) base age */
+ char m_age; /* (+) mod age */
+
+ char m_b_ht; /* (+) base height (males) */
+ char m_m_ht; /* (+) mod height (males) */
+ char m_b_wt; /* (+) base weight (males) */
+ char m_m_wt; /* (+) mod weight (males) */
+
+ char f_b_ht; /* (+) base height (females) */
+ char f_m_ht; /* (+) mod height (females) */
+ char f_b_wt; /* (+) base weight (females) */
+ char f_m_wt; /* (+) mod weight (females) */
+
+ char infra; /* (+) Infra-vision range */
+
+ u32b choice[2]; /* Legal race choices */
+
+ u32b pclass[2]; /* Classes allowed */
+ u32b mclass[2]; /* Classes restricted */
+
+ s16b powers[4]; /* Powers of the subrace */
+
+ char body_parts[BODY_MAX]; /* To help to decide what to use when body changing */
+
+ u32b flags1;
+ u32b flags2; /* flags */
+
+ u32b oflags1[PY_MAX_LEVEL + 1];
+ u32b oflags2[PY_MAX_LEVEL + 1];
+ u32b oflags3[PY_MAX_LEVEL + 1];
+ u32b oflags4[PY_MAX_LEVEL + 1];
+ u32b oflags5[PY_MAX_LEVEL + 1];
+ u32b oesp[PY_MAX_LEVEL + 1];
+ s16b opval[PY_MAX_LEVEL + 1];
+
+ byte g_attr; /* Overlay graphic attribute */
+ char g_char; /* Overlay graphic character */
+
+ char skill_basem[MAX_SKILLS];
+ u32b skill_base[MAX_SKILLS];
+ char skill_modm[MAX_SKILLS];
+ s16b skill_mod[MAX_SKILLS];
+
+ s16b obj_tval[5];
+ s16b obj_sval[5];
+ s16b obj_pval[5];
+ s16b obj_dd[5];
+ s16b obj_ds[5];
+ s16b obj_num;
+
+ struct
+ {
+ s16b ability;
+ s16b level;
+ } abilities[10]; /* Abilitiers to be gained by level(doesnt take prereqs in account) */
+};
+
diff --git a/src/player_race_mod_fwd.hpp b/src/player_race_mod_fwd.hpp
new file mode 100644
index 0000000..12eb468
--- /dev/null
+++ b/src/player_race_mod_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct player_race_mod;
diff --git a/src/player_sex.hpp b/src/player_sex.hpp
new file mode 100644
index 0000000..5722f1a
--- /dev/null
+++ b/src/player_sex.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+/**
+ * Player sex descriptor.
+ */
+struct player_sex
+{
+ /**
+ * Type of sex.
+ */
+ char const *title;
+
+ /**
+ * Winner title.
+ */
+ char const *winner;
+};
diff --git a/src/player_sex_fwd.hpp b/src/player_sex_fwd.hpp
new file mode 100644
index 0000000..eabea48
--- /dev/null
+++ b/src/player_sex_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct player_sex;
diff --git a/src/player_spec.hpp b/src/player_spec.hpp
new file mode 100644
index 0000000..28b3283
--- /dev/null
+++ b/src/player_spec.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include "h-basic.h"
+#include "skills_defs.hpp"
+
+/**
+ * Player class descriptor.
+ */
+struct player_spec
+{
+ const char *title; /* Type of class spec */
+ char *desc; /* Small desc of the class spec */
+
+ char skill_basem[MAX_SKILLS]; /* Mod for value */
+ u32b skill_base[MAX_SKILLS]; /* value */
+ char skill_modm[MAX_SKILLS]; /* mod for mod */
+ s16b skill_mod[MAX_SKILLS]; /* mod */
+
+ u32b skill_ideal[MAX_SKILLS]; /* Ideal skill levels at level 50 */
+
+ s16b obj_tval[5];
+ s16b obj_sval[5];
+ s16b obj_pval[5];
+ s16b obj_dd[5];
+ s16b obj_ds[5];
+ s16b obj_num;
+
+ u32b gods;
+
+ u32b flags1;
+ u32b flags2; /* flags */
+
+ struct
+ {
+ s16b ability;
+ s16b level;
+ } abilities[10]; /* Abilitiers to be gained by level(doesnt take prereqs in account) */
+};
diff --git a/src/player_spec_fwd.hpp b/src/player_spec_fwd.hpp
new file mode 100644
index 0000000..9083acd
--- /dev/null
+++ b/src/player_spec_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct player_spec;
diff --git a/src/player_type.hpp b/src/player_type.hpp
new file mode 100644
index 0000000..d9410dc
--- /dev/null
+++ b/src/player_type.hpp
@@ -0,0 +1,423 @@
+#pragma once
+
+#include "corrupt.hpp"
+#include "h-basic.h"
+#include "help_info.hpp"
+#include "inventory.hpp"
+#include "object_type.hpp"
+#include "powers.hpp"
+
+/*
+ * Most of the "player" information goes here.
+ *
+ * This stucture gives us a large collection of player variables.
+ *
+ * This structure contains several "blocks" of information.
+ * (1) the "permanent" info
+ * (2) the "variable" info
+ * (3) the "transient" info
+ *
+ * All of the "permanent" info, and most of the "variable" info,
+ * is saved in the savefile. The "transient" info is recomputed
+ * whenever anything important changes.
+ */
+
+struct player_type
+{
+ s32b lives; /* How many times we resurected */
+
+ s16b oldpy; /* Previous player location -KMW- */
+ s16b oldpx; /* Previous player location -KMW- */
+
+ s16b py; /* Player location */
+ s16b px; /* Player location */
+
+ byte psex; /* Sex index */
+ byte prace; /* Race index */
+ byte pracem; /* Race Mod index */
+ byte pclass; /* Class index */
+ byte pspec; /* Class spec index */
+ byte mimic_form; /* Actualy transformation */
+ s16b mimic_level; /* Level of the mimic effect */
+ byte oops; /* Unused */
+
+ object_type inventory[INVEN_TOTAL]; /* Player inventory */
+
+ byte hitdie; /* Hit dice (sides) */
+ u16b expfact; /* Experience factor */
+
+ byte preserve; /* Preserve artifacts */
+ byte special; /* Special levels */
+ byte allow_one_death; /* Blood of life */
+
+ s16b age; /* Characters age */
+ s16b ht; /* Height */
+ s16b wt; /* Weight */
+ s16b sc; /* Social Class */
+
+
+ s32b au; /* Current Gold */
+
+ s32b max_exp; /* Max experience */
+ s32b exp; /* Cur experience */
+ u16b exp_frac; /* Cur exp frac (times 2^16) */
+
+ s16b lev; /* Level */
+
+ s16b town_num; /* Current town number */
+ s16b inside_quest; /* Inside quest level */
+
+ s32b wilderness_x; /* Coordinates in the wilderness */
+ s32b wilderness_y;
+ bool_ wild_mode; /* TRUE = Small map, FLASE = Big map */
+ bool_ old_wild_mode; /* TRUE = Small map, FLASE = Big map */
+
+ s16b mhp; /* Max hit pts */
+ s16b chp; /* Cur hit pts */
+ u16b chp_frac; /* Cur hit frac (times 2^16) */
+ s16b hp_mod; /* A modificator(permanent) */
+
+ s16b msp; /* Max mana pts */
+ s16b csp; /* Cur mana pts */
+ u16b csp_frac; /* Cur mana frac (times 2^16) */
+
+ s16b msane; /* Max sanity */
+ s16b csane; /* Cur sanity */
+ u16b csane_frac; /* Cur sanity frac */
+
+ s32b grace; /* Your God's appreciation factor. */
+ s32b grace_delay; /* Delay factor for granting piety. */
+ byte pgod; /* Your God. */
+ bool_ praying; /* Praying to your god. */
+ s16b melkor_sacrifice; /* How much hp has been sacrified for damage */
+
+ s16b max_plv; /* Max Player Level */
+
+ s16b stat_max[6]; /* Current "maximal" stat values */
+ s16b stat_cur[6]; /* Current "natural" stat values */
+
+ s16b luck_cur; /* Current "natural" luck value (range -30 <> 30) */
+ s16b luck_max; /* Current "maximal base" luck value (range -30 <> 30) */
+ s16b luck_base; /* Current "base" luck value (range -30 <> 30) */
+
+ s16b speed_factor; /* Timed -- Fast */
+ s16b fast; /* Timed -- Fast */
+ s16b lightspeed; /* Timed -- Light Speed */
+ s16b slow; /* Timed -- Slow */
+ s16b blind; /* Timed -- Blindness */
+ s16b paralyzed; /* Timed -- Paralysis */
+ s16b confused; /* Timed -- Confusion */
+ s16b afraid; /* Timed -- Fear */
+ s16b image; /* Timed -- Hallucination */
+ s16b poisoned; /* Timed -- Poisoned */
+ s16b cut; /* Timed -- Cut */
+ s16b stun; /* Timed -- Stun */
+
+ s16b protevil; /* Timed -- Protection from Evil*/
+ s16b protgood; /* Timed -- Protection from Good*/
+ s16b protundead; /* Timed -- Protection from Undead*/
+ s16b invuln; /* Timed -- Invulnerable */
+ s16b hero; /* Timed -- Heroism */
+ s16b shero; /* Timed -- Super Heroism */
+ s16b shield; /* Timed -- Shield Spell */
+ s16b shield_power; /* Timed -- Shield Spell Power */
+ s16b shield_opt; /* Timed -- Shield Spell options */
+ s16b shield_power_opt; /* Timed -- Shield Spell Power */
+ s16b shield_power_opt2; /* Timed -- Shield Spell Power */
+ s16b blessed; /* Timed -- Blessed */
+ s16b tim_invis; /* Timed -- See Invisible */
+ s16b tim_infra; /* Timed -- Infra Vision */
+
+ s16b oppose_acid; /* Timed -- oppose acid */
+ s16b oppose_elec; /* Timed -- oppose lightning */
+ s16b oppose_fire; /* Timed -- oppose heat */
+ s16b oppose_cold; /* Timed -- oppose cold */
+ s16b oppose_pois; /* Timed -- oppose poison */
+ s16b oppose_ld; /* Timed -- oppose light & dark */
+ s16b oppose_cc; /* Timed -- oppose chaos & confusion */
+ s16b oppose_ss; /* Timed -- oppose sound & shards */
+ s16b oppose_nex; /* Timed -- oppose nexus */
+
+ s16b tim_esp; /* Timed ESP */
+ s16b tim_wraith; /* Timed wraithform */
+ s16b tim_ffall; /* Timed Levitation */
+ s16b tim_fly; /* Timed Levitation */
+ s16b tim_poison; /* Timed poison hands */
+ s16b tim_thunder; /* Timed thunderstorm */
+ s16b tim_thunder_p1; /* Timed thunderstorm */
+ s16b tim_thunder_p2; /* Timed thunderstorm */
+
+ s16b tim_project; /* Timed project upon melee blow */
+ s16b tim_project_dam;
+ s16b tim_project_gf;
+ s16b tim_project_rad;
+ s16b tim_project_flag;
+
+ s16b tim_roots; /* Timed roots */
+ s16b tim_roots_ac;
+ s16b tim_roots_dam;
+
+ s16b tim_invisible; /* Timed Invisibility */
+ s16b tim_inv_pow; /* Power of timed invisibility */
+ s16b tim_mimic; /* Timed Mimic */
+ s16b tim_lite; /* Timed Lite */
+ s16b tim_regen; /* Timed extra regen */
+ s16b tim_regen_pow; /* Timed extra regen power */
+ s16b holy; /* Holy Aura */
+ s16b strike; /* True Strike(+25 hit) */
+ s16b tim_reflect; /* Timed Reflection */
+ s16b tim_deadly; /* Timed deadly blow */
+ s16b prob_travel; /* Timed probability travel */
+ s16b disrupt_shield;/* Timed disruption shield */
+ s16b parasite; /* Timed parasite */
+ s16b parasite_r_idx;/* Timed parasite monster */
+ s16b absorb_soul; /* Timed soul absordtion */
+ s16b tim_magic_breath; /* Magical breathing -- can breath anywhere */
+ s16b tim_water_breath; /* Water breathing -- can breath underwater */
+ s16b tim_precognition; /* Timed precognition */
+
+ s16b immov_cntr; /* Timed -- Last ``immovable'' command. */
+
+ s16b recall_dungeon; /* Recall in which dungeon */
+ s16b word_recall; /* Word of recall counter */
+
+ s32b energy; /* Current energy */
+
+ s16b food; /* Current nutrition */
+
+ byte confusing; /* Glowing hands */
+ byte searching; /* Currently searching */
+
+ bool_ old_cumber_armor;
+ bool_ old_cumber_glove;
+ bool_ old_heavy_wield;
+ bool_ old_heavy_shoot;
+ bool_ old_icky_wield;
+
+ s16b old_lite; /* Old radius of lite (if any) */
+ s16b old_view; /* Old radius of view (if any) */
+
+ s16b old_food_aux; /* Old value of food */
+
+
+ bool_ cumber_armor; /* Mana draining armor */
+ bool_ cumber_glove; /* Mana draining gloves */
+ bool_ heavy_wield; /* Heavy weapon */
+ bool_ heavy_shoot; /* Heavy shooter */
+ bool_ icky_wield; /* Icky weapon */
+ bool_ immovable; /* Immovable character */
+
+ s16b cur_lite; /* Radius of lite (if any) */
+
+
+ u32b notice; /* Special Updates (bit flags) */
+ u32b update; /* Pending Updates (bit flags) */
+ u32b redraw; /* Normal Redraws (bit flags) */
+ u32b window; /* Window Redraws (bit flags) */
+
+ s16b stat_use[6]; /* Current modified stats */
+ s16b stat_top[6]; /* Maximal modified stats */
+
+ s16b stat_add[6]; /* Modifiers to stat values */
+ s16b stat_ind[6]; /* Indexes into stat tables */
+ s16b stat_cnt[6]; /* Counter for temporary drains */
+ s16b stat_los[6]; /* Amount of temporary drains */
+
+ bool_ immune_acid; /* Immunity to acid */
+ bool_ immune_elec; /* Immunity to lightning */
+ bool_ immune_fire; /* Immunity to fire */
+ bool_ immune_cold; /* Immunity to cold */
+ bool_ immune_neth; /* Immunity to nether */
+
+ bool_ resist_acid; /* Resist acid */
+ bool_ resist_elec; /* Resist lightning */
+ bool_ resist_fire; /* Resist fire */
+ bool_ resist_cold; /* Resist cold */
+ bool_ resist_pois; /* Resist poison */
+
+ bool_ resist_conf; /* Resist confusion */
+ bool_ resist_sound; /* Resist sound */
+ bool_ resist_lite; /* Resist light */
+ bool_ resist_dark; /* Resist darkness */
+ bool_ resist_chaos; /* Resist chaos */
+ bool_ resist_disen; /* Resist disenchant */
+ bool_ resist_shard; /* Resist shards */
+ bool_ resist_nexus; /* Resist nexus */
+ bool_ resist_blind; /* Resist blindness */
+ bool_ resist_neth; /* Resist nether */
+ bool_ resist_fear; /* Resist fear */
+ bool_ resist_continuum; /* Resist space-time continuum disruption */
+
+ bool_ sensible_fire; /* Fire does more damage on the player */
+ bool_ sensible_lite; /* Lite does more damage on the player and blinds her/him */
+
+ bool_ reflect; /* Reflect 'bolt' attacks */
+ bool_ sh_fire; /* Fiery 'immolation' effect */
+ bool_ sh_elec; /* Electric 'immolation' effect */
+ bool_ wraith_form; /* wraithform */
+
+ bool_ anti_magic; /* Anti-magic */
+ bool_ anti_tele; /* Prevent teleportation */
+
+ bool_ sustain_str; /* Keep strength */
+ bool_ sustain_int; /* Keep intelligence */
+ bool_ sustain_wis; /* Keep wisdom */
+ bool_ sustain_dex; /* Keep dexterity */
+ bool_ sustain_con; /* Keep constitution */
+ bool_ sustain_chr; /* Keep charisma */
+
+ bool_ aggravate; /* Aggravate monsters */
+ bool_ teleport; /* Random teleporting */
+
+ bool_ exp_drain; /* Experience draining */
+ byte drain_mana; /* mana draining */
+ byte drain_life; /* hp draining */
+
+ bool_ magical_breath; /* Magical breathing -- can breath anywhere */
+ bool_ water_breath; /* Water breathing -- can breath underwater */
+ bool_ climb; /* Can climb mountains */
+ bool_ fly; /* Can fly over some features */
+ bool_ ffall; /* No damage falling */
+ bool_ lite; /* Permanent light */
+ bool_ free_act; /* Never paralyzed */
+ bool_ see_inv; /* Can see invisible */
+ bool_ regenerate; /* Regenerate hit pts */
+ bool_ hold_life; /* Resist life draining */
+ u32b telepathy; /* Telepathy */
+ bool_ slow_digest; /* Slower digestion */
+ bool_ bless_blade; /* Blessed blade */
+ byte xtra_might; /* Extra might bow */
+ bool_ impact; /* Earthquake blows */
+ bool_ auto_id; /* Auto id items */
+
+ s16b invis; /* Invisibility */
+
+ s16b dis_to_h; /* Known bonus to hit */
+ s16b dis_to_d; /* Known bonus to dam */
+ s16b dis_to_a; /* Known bonus to ac */
+
+ s16b dis_ac; /* Known base ac */
+
+ s16b to_l; /* Bonus to life */
+ s16b to_m; /* Bonus to mana */
+ s16b to_s; /* Bonus to spell */
+ s16b to_h; /* Bonus to hit */
+ s16b to_d; /* Bonus to dam */
+ s16b to_h_melee; /* Bonus to hit for melee */
+ s16b to_d_melee; /* Bonus to dam for melee */
+ s16b to_h_ranged; /* Bonus to hit for ranged */
+ s16b to_d_ranged; /* Bonus to dam for ranged */
+ s16b to_a; /* Bonus to ac */
+
+ s16b ac; /* Base ac */
+
+ byte antimagic; /* Power of the anti magic field */
+ byte antimagic_dis; /* Radius of the anti magic field */
+
+ s16b see_infra; /* Infravision range */
+
+ s16b skill_dis; /* Skill: Disarming */
+ s16b skill_dev; /* Skill: Magic Devices */
+ s16b skill_sav; /* Skill: Saving throw */
+ s16b skill_stl; /* Skill: Stealth factor */
+ s16b skill_srh; /* Skill: Searching ability */
+ s16b skill_fos; /* Skill: Searching frequency */
+ s16b skill_thn; /* Skill: To hit (normal) */
+ s16b skill_thb; /* Skill: To hit (shooting) */
+ s16b skill_tht; /* Skill: To hit (throwing) */
+ s16b skill_dig; /* Skill: Digging */
+
+ s16b num_blow; /* Number of blows */
+ s16b num_fire; /* Number of shots */
+ s16b xtra_crit; /* % of increased crits */
+
+ byte throw_mult; /* Multiplier for throw damage */
+
+ byte tval_ammo; /* Correct ammo tval */
+
+ s16b pspeed; /* Current speed */
+
+ u32b mimic_extra; /* Mimicry powers use that */
+ u32b antimagic_extra; /* Antimagic powers */
+ u32b music_extra; /* Music songs */
+ u32b necro_extra; /* Necro powers */
+ u32b necro_extra2; /* Necro powers */
+
+ s16b dodge_chance; /* Dodging chance */
+
+ u32b maintain_sum; /* Do we have partial summons */
+
+ byte spellbinder_num; /* Number of spells bound */
+ u32b spellbinder[4]; /* Spell bounds */
+ byte spellbinder_trigger; /* Spellbinder trigger condition */
+
+ cptr mimic_name;
+
+ char tactic; /* from 128-4 extremely coward to */
+ /* 128+4 berserker */
+ char movement; /* base movement way */
+
+ s16b companion_killed; /* Number of companion death */
+
+ bool_ no_mortal; /* Fated to never die by the hand of a mortal being */
+
+ bool_ black_breath; /* The Tolkien's Black Breath */
+
+ bool_ precognition; /* Like the cheat mode */
+
+ /*** Extra flags -- used for lua and easying stuff ***/
+ u32b xtra_f1;
+ u32b xtra_f2;
+ u32b xtra_f3;
+ u32b xtra_f4;
+ u32b xtra_f5;
+ u32b xtra_esp;
+
+ /* Corruptions */
+ bool_ corruptions[CORRUPTIONS_MAX];
+ bool_ corrupt_anti_teleport_stopped;
+
+ /*** Pet commands ***/
+ byte pet_follow_distance; /* Length of the imaginary "leash" for pets */
+ byte pet_open_doors; /* flag - allow pets to open doors */
+ byte pet_pickup_items; /* flag - allow pets to pickup items */
+
+ s16b control; /* Controlled monster */
+ byte control_dir; /* Controlled monster */
+
+ /*** Body changing variables ***/
+ u16b body_monster; /* In which body is the player */
+ bool_ disembodied; /* Is the player in a body ? */
+ byte body_parts[INVEN_TOTAL - INVEN_WIELD]; /* Which body parts does he have ? */
+
+ /* Astral */
+ bool_ astral; /* We started at the bottom ? */
+
+ /* Powers */
+ bool_ powers[POWER_MAX]; /* Actual powers */
+ bool_ powers_mod[POWER_MAX]; /* Intrinsinc powers */
+
+ /* Skills */
+ s16b skill_points;
+ s16b skill_last_level; /* Prevents gaining skills by losing level and regaining them */
+ s16b melee_style; /* How are */
+ s16b use_piercing_shots; /* for archery */
+
+ /* Dripping Tread spell timer */
+ s16b dripping_tread;
+
+ /* Help */
+ help_info help;
+
+ /* Inertia control */
+ s32b inertia_controlled_spell;
+
+ /* For automatic stat-gain */
+ s16b last_rewarded_level;
+
+ /*** Temporary fields ***/
+
+ bool_ did_nothing; /* True if the last action wasnt a real action */
+ bool_ leaving; /* True if player is leaving */
+};
+
diff --git a/src/player_type_fwd.hpp b/src/player_type_fwd.hpp
new file mode 100644
index 0000000..45a4bbc
--- /dev/null
+++ b/src/player_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct player_type;
diff --git a/src/power_type.hpp b/src/power_type.hpp
new file mode 100644
index 0000000..6cf8c29
--- /dev/null
+++ b/src/power_type.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Power descriptor. (Racial, class, mutation, artifacts, ...)
+ */
+struct power_type
+{
+ const char *name; /* Name */
+ const char *desc_text; /* Text describing power */
+ const char *gain_text; /* Text displayed on gaining the power */
+ const char *lose_text; /* Text displayed on losing the power */
+
+ byte level; /* Min level */
+ byte cost; /* Mana/Life cost */
+ byte stat; /* Stat used */
+ byte diff; /* Difficulty */
+};
diff --git a/src/powers.cc b/src/powers.cc
index b5c3841..ce71585 100644
--- a/src/powers.cc
+++ b/src/powers.cc
@@ -8,22 +8,28 @@
#include "powers.hpp"
-#include "angband.h"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd1.hpp"
#include "cmd2.hpp"
#include "cmd7.hpp"
+#include "feature_type.hpp"
#include "files.hpp"
#include "hooks.hpp"
#include "mimic.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
+#include "stats.hpp"
#include "tables.hpp"
#include "traps.hpp"
#include "util.hpp"
diff --git a/src/powers.hpp b/src/powers.hpp
index df1497c..35d317b 100644
--- a/src/powers.hpp
+++ b/src/powers.hpp
@@ -1,3 +1,74 @@
#pragma once
extern void do_cmd_power();
+
+/*
+ * Powers (mutation, activations, ...)
+ */
+#define POWER_MAX 65
+
+#define PWR_SPIT_ACID 0
+#define PWR_BR_FIRE 1
+#define PWR_HYPN_GAZE 2
+#define PWR_TELEKINES 3
+#define PWR_VTELEPORT 4
+#define PWR_MIND_BLST 5
+#define PWR_RADIATION 6
+#define PWR_VAMPIRISM 7
+#define PWR_SMELL_MET 8
+#define PWR_SMELL_MON 9
+#define PWR_BLINK 10
+#define PWR_EAT_ROCK 11
+#define PWR_SWAP_POS 12
+#define PWR_SHRIEK 13
+#define PWR_ILLUMINE 14
+#define PWR_DET_CURSE 15
+#define PWR_BERSERK 16
+#define PWR_POLYMORPH 17
+#define PWR_MIDAS_TCH 18
+#define PWR_GROW_MOLD 19
+#define PWR_RESIST 20
+#define PWR_EARTHQUAKE 21
+#define PWR_EAT_MAGIC 22
+#define PWR_WEIGH_MAG 23
+#define PWR_STERILITY 24
+#define PWR_PANIC_HIT 25
+#define PWR_DAZZLE 26
+#define PWR_DARKRAY 27
+#define PWR_RECALL 28
+#define PWR_BANISH 29
+#define PWR_COLD_TOUCH 30
+#define PWR_LAUNCHER 31
+
+#define PWR_PASSWALL 32
+#define PWR_DETECT_TD 33
+#define PWR_COOK_FOOD 34
+#define PWR_UNFEAR 35
+#define PWR_EXPL_RUNE 36
+#define PWR_STM 37
+#define PWR_POIS_DART 38
+#define PWR_MAGIC_MISSILE 39
+#define PWR_GROW_TREE 40
+#define PWR_BR_COLD 41
+#define PWR_BR_CHAOS 42
+#define PWR_BR_ELEM 43
+#define PWR_WRECK_WORLD 44
+#define PWR_SCARE 45
+#define PWR_REST_LIFE 46
+#define PWR_SUMMON_MONSTER 47
+#define PWR_NECRO 48
+#define PWR_ROHAN 49
+#define PWR_THUNDER 50
+#define PWR_DEATHMOLD 51
+#define PWR_HYPNO 52
+#define PWR_UNHYPNO 53
+#define PWR_INCARNATE 54
+#define PWR_MAGIC_MAP 55
+#define PWR_LAY_TRAP 56
+#define PWR_COMPANION 58
+#define PWR_BEAR 59
+#define PWR_DODGE 60
+#define PWR_BALROG 61
+#define POWER_INVISIBILITY 62
+#define POWER_WEB 63
+#define POWER_COR_SPACE_TIME 64
diff --git a/src/q_betwen.cc b/src/q_betwen.cc
index 2dafc80..2bebe45 100644
--- a/src/q_betwen.cc
+++ b/src/q_betwen.cc
@@ -1,10 +1,17 @@
#include "q_betwen.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_init_quest_in.hpp"
+#include "hook_move_in.hpp"
+#include "hook_quest_finish_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_betwen.hpp b/src/q_betwen.hpp
index 86132ac..d2fc08f 100644
--- a/src/q_betwen.hpp
+++ b/src/q_betwen.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_between_init_hook(int q_idx);
diff --git a/src/q_bounty.cc b/src/q_bounty.cc
index d804255..bb84d48 100644
--- a/src/q_bounty.cc
+++ b/src/q_bounty.cc
@@ -1,8 +1,12 @@
#include "q_bounty.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
+#include "skill_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_bounty.hpp b/src/q_bounty.hpp
index 869dfc3..234c036 100644
--- a/src/q_bounty.hpp
+++ b/src/q_bounty.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern bool_ quest_bounty_init_hook(int q_idx);
extern bool_ quest_bounty_drop_item();
diff --git a/src/q_dragons.cc b/src/q_dragons.cc
index cd8b2ef..d6f5b1f 100644
--- a/src/q_dragons.cc
+++ b/src/q_dragons.cc
@@ -1,9 +1,14 @@
#include "q_dragons.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "feature_type.hpp"
+#include "hook_quest_finish_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_dragons.hpp b/src/q_dragons.hpp
index 9131e08..f0aa50f 100644
--- a/src/q_dragons.hpp
+++ b/src/q_dragons.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_dragons_init_hook(int q_idx);
diff --git a/src/q_eol.cc b/src/q_eol.cc
index c5ce523..cfccd15 100644
--- a/src/q_eol.cc
+++ b/src/q_eol.cc
@@ -1,10 +1,18 @@
#include "q_eol.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "generate.hpp"
+#include "hook_stair_in.hpp"
+#include "hook_quest_finish_in.hpp"
+#include "hook_quest_fail_in.hpp"
+#include "hook_monster_death_in.hpp"
#include "hooks.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "traps.hpp"
#include "util.hpp"
diff --git a/src/q_eol.hpp b/src/q_eol.hpp
index 2fe2657..ab7f127 100644
--- a/src/q_eol.hpp
+++ b/src/q_eol.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_eol_init_hook(int q_idx);
diff --git a/src/q_evil.cc b/src/q_evil.cc
index 1398ccf..511644a 100644
--- a/src/q_evil.cc
+++ b/src/q_evil.cc
@@ -1,9 +1,14 @@
#include "q_evil.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "feature_type.hpp"
+#include "hook_quest_finish_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_evil.hpp b/src/q_evil.hpp
index 35c57d9..06fb17e 100644
--- a/src/q_evil.hpp
+++ b/src/q_evil.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_evil_init_hook(int q_idx);
diff --git a/src/q_fireprof.cc b/src/q_fireprof.cc
index d768ad8..b11c966 100644
--- a/src/q_fireprof.cc
+++ b/src/q_fireprof.cc
@@ -1,9 +1,15 @@
#include "q_fireprof.hpp"
-#include "quark.hpp"
+
+#include "cave_type.hpp"
+#include "feature_type.hpp"
+#include "hook_get_in.hpp"
#include "hooks.hpp"
#include "lua_bind.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
+#include "quark.hpp"
#include "tables.hpp"
#include "traps.hpp"
#include "util.hpp"
diff --git a/src/q_fireprof.hpp b/src/q_fireprof.hpp
index 587cf6c..53d368b 100644
--- a/src/q_fireprof.hpp
+++ b/src/q_fireprof.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern void quest_fireproof_building(bool_ *paid, bool_ *recreate);
extern bool_ quest_fireproof_init_hook(int q);
diff --git a/src/q_god.cc b/src/q_god.cc
index c648817..754802f 100644
--- a/src/q_god.cc
+++ b/src/q_god.cc
@@ -1,10 +1,22 @@
#include "q_god.hpp"
-#include "quark.hpp"
+
+#include "cave_type.hpp"
+#include "dungeon_info_type.hpp"
+#include "feature_type.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_get_in.hpp"
+#include "hook_enter_dungeon_in.hpp"
+#include "hook_player_level_in.hpp"
#include "hooks.hpp"
#include "object2.hpp"
+#include "player_type.hpp"
+#include "quark.hpp"
+#include "skill_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
#include <assert.h>
diff --git a/src/q_god.hpp b/src/q_god.hpp
index 5ab6e84..d9513bd 100644
--- a/src/q_god.hpp
+++ b/src/q_god.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_god_describe(FILE *);
bool_ quest_god_init_hook(int q);
diff --git a/src/q_haunted.cc b/src/q_haunted.cc
index 3b0b99f..cbfaa17 100644
--- a/src/q_haunted.cc
+++ b/src/q_haunted.cc
@@ -1,9 +1,14 @@
#include "q_haunted.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "feature_type.hpp"
+#include "hook_quest_finish_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
+#include "player_type.hpp"
#include "traps.hpp"
#include "tables.hpp"
#include "util.hpp"
diff --git a/src/q_haunted.hpp b/src/q_haunted.hpp
index c78c02c..4f51bce 100644
--- a/src/q_haunted.hpp
+++ b/src/q_haunted.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_haunted_init_hook(int q_idx);
diff --git a/src/q_hobbit.cc b/src/q_hobbit.cc
index 38dbcf6..bc3659e 100644
--- a/src/q_hobbit.cc
+++ b/src/q_hobbit.cc
@@ -1,10 +1,18 @@
#include "q_hobbit.hpp"
#include "cave.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_chat_in.hpp"
+#include "hook_give_in.hpp"
+#include "hook_mon_speak_in.hpp"
+#include "hook_wild_gen_in.hpp"
#include "hooks.hpp"
#include "messages.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_hobbit.hpp b/src/q_hobbit.hpp
index de79699..b187874 100644
--- a/src/q_hobbit.hpp
+++ b/src/q_hobbit.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_hobbit_init_hook(int q_idx);
diff --git a/src/q_invas.cc b/src/q_invas.cc
index a34b67c..64483d2 100644
--- a/src/q_invas.cc
+++ b/src/q_invas.cc
@@ -1,10 +1,19 @@
#include "q_invas.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_monster_death_in.hpp"
+#include "hook_monster_ai_in.hpp"
+#include "hook_monster_ai_out.hpp"
+#include "hook_stair_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
+#include "town_type.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_invas.hpp b/src/q_invas.hpp
index 56625a1..87b8fc7 100644
--- a/src/q_invas.hpp
+++ b/src/q_invas.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_invasion_init_hook(int q_idx);
diff --git a/src/q_library.cc b/src/q_library.cc
index 8cbadbf..979fbb2 100644
--- a/src/q_library.cc
+++ b/src/q_library.cc
@@ -1,9 +1,13 @@
#include "q_library.hpp"
-#include "quark.hpp"
+
+#include "cave_type.hpp"
#include "hooks.hpp"
#include "lua_bind.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "player_type.hpp"
+#include "quark.hpp"
#include "spells3.hpp"
#include "spells4.hpp"
#include "tables.hpp"
diff --git a/src/q_library.hpp b/src/q_library.hpp
index a7a3566..8150893 100644
--- a/src/q_library.hpp
+++ b/src/q_library.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_library_init_hook(int q);
bool_ quest_library_describe(FILE *fff);
diff --git a/src/q_main.cc b/src/q_main.cc
index 27aa9ad..ed11b9d 100644
--- a/src/q_main.cc
+++ b/src/q_main.cc
@@ -1,6 +1,12 @@
#include "q_main.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_monster_death_in.hpp"
+#include "hook_new_monster_in.hpp"
#include "hooks.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_main.hpp b/src/q_main.hpp
index 8cc6440..a88530f 100644
--- a/src/q_main.hpp
+++ b/src/q_main.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_necro_init_hook(int q_idx);
bool_ quest_sauron_init_hook(int q_idx);
diff --git a/src/q_narsil.cc b/src/q_narsil.cc
index e2188c3..a6c0eed 100644
--- a/src/q_narsil.cc
+++ b/src/q_narsil.cc
@@ -1,7 +1,13 @@
#include "q_narsil.hpp"
+#include "cave_type.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_identify_in.hpp"
+#include "hook_move_in.hpp"
#include "hooks.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_narsil.hpp b/src/q_narsil.hpp
index e0f2d25..b83e63c 100644
--- a/src/q_narsil.hpp
+++ b/src/q_narsil.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_narsil_init_hook(int q_idx);
diff --git a/src/q_nazgul.cc b/src/q_nazgul.cc
index 267e712..21bc95c 100644
--- a/src/q_nazgul.cc
+++ b/src/q_nazgul.cc
@@ -1,9 +1,16 @@
#include "q_nazgul.hpp"
#include "cave.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_init_quest_in.hpp"
+#include "hook_monster_death_in.hpp"
+#include "hook_quest_finish_in.hpp"
+#include "hook_wild_gen_in.hpp"
#include "hooks.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_nazgul.hpp b/src/q_nazgul.hpp
index 206b3af..32e3237 100644
--- a/src/q_nazgul.hpp
+++ b/src/q_nazgul.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_nazgul_init_hook(int q_idx);
diff --git a/src/q_nirna.cc b/src/q_nirna.cc
index a86f9a1..a92ba6e 100644
--- a/src/q_nirna.cc
+++ b/src/q_nirna.cc
@@ -1,9 +1,12 @@
#include "q_nirna.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "hook_quest_finish_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_nirna.hpp b/src/q_nirna.hpp
index bdf470a..24a8759 100644
--- a/src/q_nirna.hpp
+++ b/src/q_nirna.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_nirnaeth_init_hook(int q_idx);
diff --git a/src/q_one.cc b/src/q_one.cc
index 19076f4..1aa7761 100644
--- a/src/q_one.cc
+++ b/src/q_one.cc
@@ -1,12 +1,25 @@
#include "q_one.hpp"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "gods.hpp"
+#include "hook_calculate_hp_in.hpp"
+#include "hook_calculate_hp_out.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_drop_in.hpp"
+#include "hook_identify_in.hpp"
+#include "hook_monster_death_in.hpp"
+#include "hook_move_in.hpp"
+#include "hook_wield_in.hpp"
#include "hooks.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
+#include "town_type.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_one.hpp b/src/q_one.hpp
index 1bd6ddf..a85a573 100644
--- a/src/q_one.hpp
+++ b/src/q_one.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_one_init_hook(int q_idx);
diff --git a/src/q_poison.cc b/src/q_poison.cc
index 3a834e3..d8ecf94 100644
--- a/src/q_poison.cc
+++ b/src/q_poison.cc
@@ -1,11 +1,19 @@
#include "q_poison.hpp"
#include "cave.hpp"
-#include "quark.hpp"
+#include "cave_type.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_drop_in.hpp"
+#include "hook_init_quest_in.hpp"
+#include "hook_quest_finish_in.hpp"
+#include "hooks.hpp"
#include "messages.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
-#include "hooks.hpp"
+#include "player_type.hpp"
+#include "quark.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_poison.hpp b/src/q_poison.hpp
index b38ae22..f8d97ac 100644
--- a/src/q_poison.hpp
+++ b/src/q_poison.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_poison_init_hook(int q_idx);
diff --git a/src/q_rand.cc b/src/q_rand.cc
index 2703705..5b26562 100644
--- a/src/q_rand.cc
+++ b/src/q_rand.cc
@@ -1,15 +1,26 @@
#include "q_rand.hpp"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "dungeon_info_type.hpp"
#include "generate.hpp"
+#include "hook_build_room1_in.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_monster_death_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "lua_bind.hpp"
#include "messages.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_type.hpp"
+#include "monster_race.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
#include "tables.hpp"
#include "util.hpp"
diff --git a/src/q_rand.hpp b/src/q_rand.hpp
index a86830f..fe87289 100644
--- a/src/q_rand.hpp
+++ b/src/q_rand.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
void initialize_random_quests(int n);
bool_ is_randhero(int level);
diff --git a/src/q_shroom.cc b/src/q_shroom.cc
index 3e2ffed..f3a7dd1 100644
--- a/src/q_shroom.cc
+++ b/src/q_shroom.cc
@@ -1,10 +1,18 @@
#include "q_shroom.hpp"
#include "cave.hpp"
+#include "hook_chat_in.hpp"
+#include "hook_give_in.hpp"
+#include "hook_monster_death_in.hpp"
+#include "hook_mon_speak_in.hpp"
+#include "hook_wild_gen_in.hpp"
#include "hooks.hpp"
#include "messages.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_shroom.hpp b/src/q_shroom.hpp
index f35ba52..6124775 100644
--- a/src/q_shroom.hpp
+++ b/src/q_shroom.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_shroom_init_hook(int q_idx);
diff --git a/src/q_spider.cc b/src/q_spider.cc
index 957399a..07531b9 100644
--- a/src/q_spider.cc
+++ b/src/q_spider.cc
@@ -2,10 +2,14 @@
#include "cave.hpp"
#include "gods.hpp"
+#include "hook_quest_finish_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_spider.hpp b/src/q_spider.hpp
index ac4cf5b..e17cb52 100644
--- a/src/q_spider.hpp
+++ b/src/q_spider.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_spider_init_hook(int q_idx);
diff --git a/src/q_thief.cc b/src/q_thief.cc
index 2560e9f..5019d9d 100644
--- a/src/q_thief.cc
+++ b/src/q_thief.cc
@@ -1,11 +1,17 @@
#include "q_thief.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "hook_quest_finish_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
+#include "skill_type.hpp"
#include "spells2.hpp"
#include "tables.hpp"
#include "util.hpp"
diff --git a/src/q_thief.hpp b/src/q_thief.hpp
index 57fdc79..48e5dc8 100644
--- a/src/q_thief.hpp
+++ b/src/q_thief.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_thieves_init_hook(int q_idx);
diff --git a/src/q_thrain.cc b/src/q_thrain.cc
index dc215fe..4cdb856 100644
--- a/src/q_thrain.cc
+++ b/src/q_thrain.cc
@@ -1,14 +1,21 @@
#include "q_thrain.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "dungeon_info_type.hpp"
#include "generate.hpp"
+#include "hook_build_room1_in.hpp"
+#include "hook_move_in.hpp"
+#include "hook_monster_death_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "lua_bind.hpp"
+#include "object_type.hpp"
#include "quark.hpp"
#include "randart.hpp"
#include "messages.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
diff --git a/src/q_thrain.hpp b/src/q_thrain.hpp
index 705e596..830da01 100644
--- a/src/q_thrain.hpp
+++ b/src/q_thrain.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern bool_ quest_thrain_init_hook(int q_idx);
diff --git a/src/q_troll.cc b/src/q_troll.cc
index 500c62c..7aa27ac 100644
--- a/src/q_troll.cc
+++ b/src/q_troll.cc
@@ -1,10 +1,17 @@
#include "q_troll.hpp"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "hook_monster_death_in.hpp"
+#include "hook_quest_finish_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_troll.hpp b/src/q_troll.hpp
index a3b2599..140fe0b 100644
--- a/src/q_troll.hpp
+++ b/src/q_troll.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_troll_init_hook(int q_idx);
diff --git a/src/q_ultrae.hpp b/src/q_ultrae.hpp
index 1b6a0fb..5b08127 100644
--- a/src/q_ultrae.hpp
+++ b/src/q_ultrae.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_ultra_evil_init_hook(int q_idx);
diff --git a/src/q_ultrag.cc b/src/q_ultrag.cc
index 96c80d0..c7c0312 100644
--- a/src/q_ultrag.cc
+++ b/src/q_ultrag.cc
@@ -1,10 +1,18 @@
#include "q_ultrag.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "hook_chardump_in.hpp"
+#include "hook_move_in.hpp"
+#include "hook_stair_in.hpp"
+#include "hook_monster_death_in.hpp"
#include "hooks.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_ultrag.hpp b/src/q_ultrag.hpp
index ead1fdc..0064b87 100644
--- a/src/q_ultrag.hpp
+++ b/src/q_ultrag.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_ultra_good_init_hook(int q_idx);
diff --git a/src/q_wight.cc b/src/q_wight.cc
index 70ea86d..d040592 100644
--- a/src/q_wight.cc
+++ b/src/q_wight.cc
@@ -1,10 +1,15 @@
#include "q_wight.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "hook_monster_death_in.hpp"
+#include "hook_quest_finish_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object2.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
#include "tables.hpp"
#include "util.hpp"
diff --git a/src/q_wight.hpp b/src/q_wight.hpp
index eb0386b..1252e4f 100644
--- a/src/q_wight.hpp
+++ b/src/q_wight.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_wight_init_hook(int q_idx);
diff --git a/src/q_wolves.cc b/src/q_wolves.cc
index 2270f49..117e8d4 100644
--- a/src/q_wolves.cc
+++ b/src/q_wolves.cc
@@ -1,9 +1,15 @@
#include "q_wolves.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "feature_type.hpp"
+#include "hook_quest_finish_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
+#include "player_type.hpp"
+#include "quest_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "variable.hpp"
diff --git a/src/q_wolves.hpp b/src/q_wolves.hpp
index a8deba1..59a83c5 100644
--- a/src/q_wolves.hpp
+++ b/src/q_wolves.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
bool_ quest_wolves_init_hook(int q_idx);
diff --git a/src/quark.cc b/src/quark.cc
index add1683..45072de 100644
--- a/src/quark.cc
+++ b/src/quark.cc
@@ -1,6 +1,6 @@
#include "quark.hpp"
-#include "angband.h"
+#include "z-util.h"
#include <cassert>
diff --git a/src/quark.hpp b/src/quark.hpp
index f573ec2..0fce393 100644
--- a/src/quark.hpp
+++ b/src/quark.hpp
@@ -2,6 +2,11 @@
#include "h-basic.h"
+/**
+ * Maximum number of quarks.
+ */
+constexpr int QUARK_MAX = 768;
+
void quark_init();
cptr quark_str(s16b num);
s16b quark_add(cptr str);
diff --git a/src/quest.cc b/src/quest.cc
index c4e6887..a1aee67 100644
--- a/src/quest.cc
+++ b/src/quest.cc
@@ -1,6 +1,5 @@
#include "quest.hpp"
-#include "angband.h"
#include "tables.hpp"
#include <cstddef>
diff --git a/src/quest_type.hpp b/src/quest_type.hpp
new file mode 100644
index 0000000..aa99f40
--- /dev/null
+++ b/src/quest_type.hpp
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Quest descriptor and runtime data.
+ */
+struct quest_type
+{
+ bool_ silent;
+
+ char name[40]; /* Quest name */
+
+ char desc[10][80]; /* Quest desc */
+
+ s16b status; /* Is the quest taken, completed, finished? */
+
+ s16b level; /* Dungeon level */
+
+ s16b *plot; /* Which plot does it belongs to? */
+
+ bool_ (*init)(int q); /* Function that takes care of generating hardcoded quests */
+
+ s32b data[9]; /* Various datas used by the quests */
+
+ bool_ (*gen_desc)(FILE *fff); /* Function for generating description. */
+};
diff --git a/src/randart.cc b/src/randart.cc
index df5bd80..451bf94 100644
--- a/src/randart.cc
+++ b/src/randart.cc
@@ -10,8 +10,12 @@
#include "mimic.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
+#include "randart_gen_type.hpp"
+#include "randart_part_type.hpp"
#include "spells2.hpp"
#include "util.hpp"
#include "variable.h"
diff --git a/src/randart.hpp b/src/randart.hpp
index b24987b..31b70f0 100644
--- a/src/randart.hpp
+++ b/src/randart.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "object_type_fwd.hpp"
extern int get_activation_power(void);
extern void build_prob(cptr learn);
diff --git a/src/randart_gen_type.hpp b/src/randart_gen_type.hpp
new file mode 100644
index 0000000..09aedcd
--- /dev/null
+++ b/src/randart_gen_type.hpp
@@ -0,0 +1,9 @@
+#pragma once
+
+struct randart_gen_type
+{
+ int chance; /* Chance to have that number of powers */
+ int dd;
+ int ds;
+ int plus; /* xdy+plus power */
+};
diff --git a/src/randart_gen_type_fwd.hpp b/src/randart_gen_type_fwd.hpp
new file mode 100644
index 0000000..eba3e84
--- /dev/null
+++ b/src/randart_gen_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct randart_gen_type;
diff --git a/src/randart_part_type.hpp b/src/randart_part_type.hpp
new file mode 100644
index 0000000..c2fa538
--- /dev/null
+++ b/src/randart_part_type.hpp
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Random artifact part descriptor.
+ */
+struct randart_part_type
+{
+ byte tval[20];
+ byte min_sval[20];
+ byte max_sval[20];
+
+ byte level; /* Minimum level */
+ byte rarity; /* Object rarity */
+ byte mrarity; /* Object rarity */
+
+ s16b max_to_h; /* Maximum to-hit bonus */
+ s16b max_to_d; /* Maximum to-dam bonus */
+ s16b max_to_a; /* Maximum to-ac bonus */
+
+ s32b max_pval; /* Maximum pval */
+
+ s32b value; /* power value */
+ s16b max; /* Number of time it can appear on a single item */
+
+ u32b flags1; /* Ego-Item Flags, set 1 */
+ u32b flags2; /* Ego-Item Flags, set 2 */
+ u32b flags3; /* Ego-Item Flags, set 3 */
+ u32b flags4; /* Ego-Item Flags, set 4 */
+ u32b flags5; /* Ego-Item Flags, set 5 */
+ u32b esp; /* ESP flags */
+ u32b fego; /* ego flags */
+
+ u32b aflags1; /* Ego-Item Flags, set 1 */
+ u32b aflags2; /* Ego-Item Flags, set 2 */
+ u32b aflags3; /* Ego-Item Flags, set 3 */
+ u32b aflags4; /* Ego-Item Flags, set 4 */
+ u32b aflags5; /* Ego-Item Flags, set 5 */
+ u32b aesp; /* ESP flags */
+
+ s16b power; /* Power granted(if any) */
+};
diff --git a/src/randart_part_type_fwd.hpp b/src/randart_part_type_fwd.hpp
new file mode 100644
index 0000000..979fd72
--- /dev/null
+++ b/src/randart_part_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct randart_part_type;
diff --git a/src/random_artifact.hpp b/src/random_artifact.hpp
new file mode 100644
index 0000000..a3fc1c6
--- /dev/null
+++ b/src/random_artifact.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Random artifact descriptor.
+ */
+struct random_artifact
+{
+ char name_full[80]; /* Full name for the artifact */
+ char name_short[80]; /* Un-Id'd name */
+ byte level; /* Level of the artifact */
+ byte attr; /* Color that is used on the screen */
+ u32b cost; /* Object's value */
+ byte activation; /* Activation. */
+ s16b timeout; /* Timeout. */
+ byte generated; /* Does it exist already? */
+};
diff --git a/src/random_quest.hpp b/src/random_quest.hpp
new file mode 100644
index 0000000..11ebe79
--- /dev/null
+++ b/src/random_quest.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+#include "h-basic.h"
+
+struct random_quest
+{
+ byte type; /* Type/number of monsters to kill(0 = no quest) */
+ s16b r_idx; /* Monsters to crush */
+ bool_ done; /* Done ? */
+};
diff --git a/src/random_spell.hpp b/src/random_spell.hpp
new file mode 100644
index 0000000..01b5ba5
--- /dev/null
+++ b/src/random_spell.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * A structure to describe the random spells of the Power Mages
+ */
+struct random_spell
+{
+ char desc[30]; /* Desc of the spell */
+ char name[30]; /* Name of the spell */
+ s16b mana; /* Mana cost */
+ s16b fail; /* Failure rate */
+ u32b proj_flags; /* Project function flags */
+ byte GF; /* Type of the projection */
+ byte radius;
+ byte dam_sides;
+ byte dam_dice;
+ byte level; /* Level needed */
+ bool_ untried; /* Is the spell was tried? */
+};
diff --git a/src/range.hpp b/src/range.hpp
index 8e2c949..3c185ba 100644
--- a/src/range.hpp
+++ b/src/range.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "range_fwd.hpp"
-#include "angband.h"
+#include "h-basic.h"
/*
* Range
diff --git a/src/rule_type.hpp b/src/rule_type.hpp
new file mode 100644
index 0000000..a8b35ff
--- /dev/null
+++ b/src/rule_type.hpp
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "h-basic.h"
+
+/* Define monster generation rules */
+struct rule_type
+{
+ byte mode; /* Mode of combination of the monster flags */
+ byte percent; /* Percent of monsters affected by the rule */
+
+ u32b mflags1; /* The monster flags that are allowed */
+ u32b mflags2;
+ u32b mflags3;
+ u32b mflags4;
+ u32b mflags5;
+ u32b mflags6;
+ u32b mflags7;
+ u32b mflags8;
+ u32b mflags9;
+
+ char r_char[5]; /* Monster race allowed */
+};
diff --git a/src/rune_spell.hpp b/src/rune_spell.hpp
new file mode 100644
index 0000000..d04a8dc
--- /dev/null
+++ b/src/rune_spell.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Runecrafter prefered spells
+ */
+struct rune_spell
+{
+ char name[30]; /* name */
+
+ s16b type; /* Type of the spell(GF) */
+ s16b rune2; /* Modifiers */
+ s16b mana; /* Mana involved */
+};
diff --git a/src/rune_spell_fwd.hpp b/src/rune_spell_fwd.hpp
new file mode 100644
index 0000000..eb540a2
--- /dev/null
+++ b/src/rune_spell_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct rune_spell;
diff --git a/src/school_type.hpp b/src/school_type.hpp
new file mode 100644
index 0000000..7a5702b
--- /dev/null
+++ b/src/school_type.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+#include "h-basic.h"
+#include "deity_type_fwd.hpp"
+
+struct school_type
+{
+ cptr name; /* Name */
+ s16b skill; /* Skill used for that school */
+ bool_ spell_power; /* Does spell power affect spells in this school? */
+ bool_ sorcery; /* Does Sorcery affect this school? */
+
+ int deity_idx; /* Deity; if <=0, no deity required */
+ deity_type *deity; /* Direct pointer to deity */
+
+ int (*bonus_levels)(); /* Calculate number of bonus levels */
+
+ bool_ (*depends_satisfied)(); /* Are dependendies satisfied? */
+
+ struct school_provider_list *providers; /* List of secondary providers of this school */
+};
diff --git a/src/school_type_fwd.hpp b/src/school_type_fwd.hpp
new file mode 100644
index 0000000..dea0d3b
--- /dev/null
+++ b/src/school_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct school_type;
diff --git a/src/script.cc b/src/script.cc
index 6b0f4eb..84f7c3e 100644
--- a/src/script.cc
+++ b/src/script.cc
@@ -8,7 +8,6 @@
#include "script.h"
-#include "angband.h"
#include "init2.hpp"
#include "q_library.hpp"
#include "spells4.hpp"
diff --git a/src/set_type.hpp b/src/set_type.hpp
new file mode 100644
index 0000000..827c23a
--- /dev/null
+++ b/src/set_type.hpp
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Item set descriptor and runtime information.
+ */
+struct set_type
+{
+ const char *name; /* Name */
+ char *desc; /* Desc */
+
+ byte num; /* Number of artifacts used */
+ byte num_use; /* Number actually wore */
+
+ struct /* the various items */
+ {
+ bool_ present; /* Is it actually wore ? */
+ s16b a_idx; /* What artifact ? */
+ s16b pval[6]; /* Pval for each combination */
+ u32b flags1[6]; /* Flags */
+ u32b flags2[6]; /* Flags */
+ u32b flags3[6]; /* Flags */
+ u32b flags4[6]; /* Flags */
+ u32b flags5[6]; /* Flags */
+ u32b esp[6]; /* Flags */
+ } arts[6];
+};
diff --git a/src/set_type_fwd.hpp b/src/set_type_fwd.hpp
new file mode 100644
index 0000000..3b31180
--- /dev/null
+++ b/src/set_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct set_type;
diff --git a/src/skill_type.hpp b/src/skill_type.hpp
new file mode 100644
index 0000000..c6de1dc
--- /dev/null
+++ b/src/skill_type.hpp
@@ -0,0 +1,37 @@
+#pragma once
+
+#include "h-basic.h"
+#include "skills_defs.hpp"
+
+/**
+ * Skill descriptors and runtime data.
+ */
+struct skill_type
+{
+ const char *name; /* Name */
+ char *desc; /* Description */
+
+ const char *action_desc; /* Action Description */
+
+ s16b action_mkey; /* Action do to */
+
+ s32b i_value; /* Actual value */
+ s32b i_mod; /* Modifier(1 skill point = modifier skill) */
+
+ s32b value; /* Actual value */
+ s32b mod; /* Modifier(1 skill point = modifier skill) */
+ s16b rate; /* Modifier decreasing rate */
+
+ u32b uses; /* Number of times used */
+
+ s16b action[MAX_SKILLS]; /* List of actions against other skills */
+
+ s16b father; /* Father in the skill tree */
+ bool_ dev; /* Is the branch developped ? */
+ s16b order; /* Order in the tree */
+ bool_ hidden; /* Innactive */
+
+ byte random_gain_chance; /* random gain chance, still needs the flag */
+
+ u32b flags1; /* Skill flags */
+};
diff --git a/src/skill_type_fwd.hpp b/src/skill_type_fwd.hpp
new file mode 100644
index 0000000..0a06dad
--- /dev/null
+++ b/src/skill_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct skill_type;
diff --git a/src/skills.cc b/src/skills.cc
index 7936b68..a5808b3 100644
--- a/src/skills.cc
+++ b/src/skills.cc
@@ -8,7 +8,6 @@
#include "skills.hpp"
-#include "angband.h"
#include "ability_type.hpp"
#include "birth.hpp"
#include "cmd2.hpp"
@@ -23,6 +22,12 @@
#include "monster3.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "player_class.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_spec.hpp"
+#include "player_type.hpp"
+#include "skill_type.hpp"
#include "spells1.hpp"
#include "spells4.hpp"
#include "tables.hpp"
diff --git a/src/skills.hpp b/src/skills.hpp
index 72ca0c9..6c1880a 100644
--- a/src/skills.hpp
+++ b/src/skills.hpp
@@ -1,7 +1,8 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+/* Skill functions */
extern void dump_skills(FILE *fff);
extern s16b find_skill(cptr name);
extern s16b find_skill_i(cptr name);
diff --git a/src/skills_defs.hpp b/src/skills_defs.hpp
new file mode 100644
index 0000000..59e1f05
--- /dev/null
+++ b/src/skills_defs.hpp
@@ -0,0 +1,64 @@
+#pragma once
+
+/*
+ * Skill constants
+ */
+#define SKILL_CONVEYANCE 1
+#define SKILL_MANA 2
+#define SKILL_FIRE 3
+#define SKILL_AIR 4
+#define SKILL_WATER 5
+#define SKILL_NATURE 6
+#define SKILL_EARTH 7
+#define SKILL_SYMBIOTIC 8
+#define SKILL_MUSIC 9
+#define SKILL_DIVINATION 10
+#define SKILL_TEMPORAL 11
+#define SKILL_DRUID 12
+#define SKILL_DAEMON 13
+#define SKILL_META 14
+#define SKILL_MAGIC 15
+#define SKILL_COMBAT 16
+#define SKILL_MASTERY 17
+#define SKILL_SWORD 18
+#define SKILL_AXE 19
+#define SKILL_POLEARM 20
+#define SKILL_HAFTED 21
+#define SKILL_BACKSTAB 22
+#define SKILL_ARCHERY 23
+#define SKILL_SLING 24
+#define SKILL_BOW 25
+#define SKILL_XBOW 26
+#define SKILL_BOOMERANG 27
+#define SKILL_SPIRITUALITY 28
+#define SKILL_MINDCRAFT 29
+#define SKILL_MISC 30
+#define SKILL_NECROMANCY 31
+#define SKILL_MIMICRY 32
+#define SKILL_ANTIMAGIC 33
+#define SKILL_RUNECRAFT 34
+#define SKILL_SNEAK 35
+#define SKILL_STEALTH 36
+#define SKILL_DISARMING 37
+#define SKILL_ALCHEMY 39
+#define SKILL_STEALING 40
+#define SKILL_SORCERY 41
+#define SKILL_HAND 42
+#define SKILL_THAUMATURGY 43
+#define SKILL_SUMMON 44
+#define SKILL_SPELL 45
+#define SKILL_DODGE 46
+#define SKILL_BEAR 47
+#define SKILL_LORE 48
+#define SKILL_PRESERVATION 49
+#define SKILL_POSSESSION 50
+#define SKILL_MIND 51
+#define SKILL_CRITS 52
+#define SKILL_PRAY 53
+#define SKILL_LEARN 54
+#define SKILL_UDUN 55
+#define SKILL_DEVICE 56
+#define SKILL_STUN 57
+#define SKILL_BOULDER 58
+#define SKILL_GEOMANCY 59
+#define MAX_SKILLS 200
diff --git a/src/spell_type.cc b/src/spell_type.cc
index 1b9d31e..6cf6e35 100644
--- a/src/spell_type.cc
+++ b/src/spell_type.cc
@@ -1,10 +1,11 @@
#include "spell_type.hpp"
+
#include "range.hpp"
#include "device_allocation.hpp"
#include "dice.hpp"
+#include "skills_defs.hpp"
#include "spells4.hpp"
-
-#include "angband.h"
+#include "stats.hpp"
#include <cassert>
#include <vector>
diff --git a/src/spell_type.hpp b/src/spell_type.hpp
index c08742d..4375810 100644
--- a/src/spell_type.hpp
+++ b/src/spell_type.hpp
@@ -5,7 +5,6 @@
#include <string>
#include <functional>
#include "h-basic.h"
-#include "types_fwd.h"
#include "device_allocation_fwd.hpp"
#include "range_fwd.hpp"
diff --git a/src/spells1.cc b/src/spells1.cc
index 084fd6b..773e71b 100644
--- a/src/spells1.cc
+++ b/src/spells1.cc
@@ -7,27 +7,36 @@
*/
#include "spells1.hpp"
-#include "angband.h"
+
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd1.hpp"
#include "cmd3.hpp"
#include "cmd5.hpp"
+#include "dungeon_info_type.hpp"
#include "files.hpp"
+#include "feature_type.hpp"
#include "gods.hpp"
#include "melee2.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_type.hpp"
+#include "monster_race.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
#include "spell_type.hpp"
#include "spells2.hpp"
#include "spells4.hpp"
#include "spells5.hpp"
#include "squeltch.hpp"
+#include "stats.hpp"
#include "tables.hpp"
#include "traps.hpp"
+#include "trap_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.hpp"
diff --git a/src/spells2.cc b/src/spells2.cc
index cdf2175..af30324 100644
--- a/src/spells2.cc
+++ b/src/spells2.cc
@@ -8,22 +8,31 @@
#include "spells2.hpp"
-#include "angband.h"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd1.hpp"
#include "cmd7.hpp"
+#include "dungeon_info_type.hpp"
+#include "feature_type.hpp"
#include "files.hpp"
+#include "hook_identify_in.hpp"
#include "hooks.hpp"
#include "melee2.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "notes.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "object_type.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
#include "spells1.hpp"
#include "spells3.hpp"
+#include "stats.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
diff --git a/src/spells2.hpp b/src/spells2.hpp
index 825391d..1806e6b 100644
--- a/src/spells2.hpp
+++ b/src/spells2.hpp
@@ -1,7 +1,9 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "identify_mode.hpp"
#include "object_filter.hpp"
+#include "object_type_fwd.hpp"
extern void curse_artifact(object_type * o_ptr);
extern void grow_things(s16b type, int rad);
diff --git a/src/spells3.cc b/src/spells3.cc
index 20701d0..8be13b9 100644
--- a/src/spells3.cc
+++ b/src/spells3.cc
@@ -1,21 +1,29 @@
#include "spells3.hpp"
-#include "angband.h"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd5.hpp"
+#include "feature_type.hpp"
#include "lua_bind.hpp"
#include "mimic.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "player_type.hpp"
+#include "school_book.hpp"
#include "skills.hpp"
#include "spell_type.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
#include "spells4.hpp"
#include "spells5.hpp"
+#include "stats.hpp"
#include "tables.hpp"
+#include "timer_type.hpp"
#include "util.hpp"
#include "variable.hpp"
#include "xtra2.hpp"
diff --git a/src/spells3.hpp b/src/spells3.hpp
index 7695119..3380203 100644
--- a/src/spells3.hpp
+++ b/src/spells3.hpp
@@ -2,7 +2,7 @@
#include "spell_type_fwd.hpp"
#include "h-basic.h"
-#include "types_fwd.h"
+#include "timer_type_fwd.hpp"
extern s32b NOXIOUSCLOUD;
extern s32b AIRWINGS;
diff --git a/src/spells4.cc b/src/spells4.cc
index 4d72d4a..3c877bf 100644
--- a/src/spells4.cc
+++ b/src/spells4.cc
@@ -5,6 +5,7 @@
#include "gods.hpp"
#include "lua_bind.hpp"
#include "options.hpp"
+#include "player_type.hpp"
#include "school_book.hpp"
#include "spell_type.hpp"
#include "spells3.hpp"
diff --git a/src/spells4.hpp b/src/spells4.hpp
index 2042ee5..99203ef 100644
--- a/src/spells4.hpp
+++ b/src/spells4.hpp
@@ -1,7 +1,8 @@
#pragma once
-#include "angband.h"
-#include "school_book.hpp"
+#include "h-basic.h"
+#include "object_type_fwd.hpp"
+#include "school_book_fwd.hpp"
extern s32b SCHOOL_AIR;
extern s32b SCHOOL_AULE;
diff --git a/src/spells5.cc b/src/spells5.cc
index d1e5b43..ca6351b 100644
--- a/src/spells5.cc
+++ b/src/spells5.cc
@@ -1,6 +1,5 @@
#include "spells5.hpp"
-#include "angband.h"
#include "spell_type.hpp"
#include "device_allocation.hpp"
#include "spells3.hpp"
diff --git a/src/spells6.cc b/src/spells6.cc
index c0adceb..a4564ae 100644
--- a/src/spells6.cc
+++ b/src/spells6.cc
@@ -1,10 +1,12 @@
#include "spells6.hpp"
-#include "angband.h"
#include "gods.hpp"
#include "lua_bind.hpp"
#include "object2.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
#include "skills.hpp"
+#include "skill_type.hpp"
#include "spell_type.hpp"
#include "spells4.hpp"
#include "variable.hpp"
diff --git a/src/spells6.hpp b/src/spells6.hpp
index ef5f4e3..bbd32d9 100644
--- a/src/spells6.hpp
+++ b/src/spells6.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "school_type_fwd.hpp"
void schools_init();
school_type *school_at(int index);
diff --git a/src/squelch/automatizer.cc b/src/squelch/automatizer.cc
index 0ea04da..c3c52b1 100644
--- a/src/squelch/automatizer.cc
+++ b/src/squelch/automatizer.cc
@@ -4,8 +4,8 @@
#include "tome/squelch/rule.hpp"
#include "tome/squelch/cursor.hpp"
#include "tome/squelch/tree_printer.hpp"
-#include "angband.h"
#include "util.hpp"
+#include "z-term.h"
namespace squelch {
diff --git a/src/squelch/condition.cc b/src/squelch/condition.cc
index fdc777d..0024345 100644
--- a/src/squelch/condition.cc
+++ b/src/squelch/condition.cc
@@ -5,14 +5,20 @@
#include "tome/squelch/cursor.hpp"
#include "tome/squelch/tree_printer.hpp"
-#include "ability_type.hpp"
-#include "angband.h"
-#include "object1.hpp"
-#include "object2.hpp"
-#include "skills.hpp"
-#include "quark.hpp"
-#include "util.hpp"
-#include "variable.hpp"
+#include "../ability_type.hpp"
+#include "../object1.hpp"
+#include "../object2.hpp"
+#include "../object_kind.hpp"
+#include "../object_type.hpp"
+#include "../player_race.hpp"
+#include "../player_race_mod.hpp"
+#include "../player_spec.hpp"
+#include "../player_type.hpp"
+#include "../skills.hpp"
+#include "../skill_type.hpp"
+#include "../quark.hpp"
+#include "../util.hpp"
+#include "../variable.hpp"
namespace squelch {
diff --git a/src/squelch/condition_metadata.cc b/src/squelch/condition_metadata.cc
index 187f833..62a90e5 100644
--- a/src/squelch/condition_metadata.cc
+++ b/src/squelch/condition_metadata.cc
@@ -4,11 +4,11 @@
#include <vector>
#include "tome/squelch/object_status.hpp"
-#include "angband.h"
#include "lua_bind.hpp"
#include "skills.hpp"
#include "util.hpp"
#include "util.h"
+#include "z-term.h"
namespace squelch {
diff --git a/src/squelch/object_status.cc b/src/squelch/object_status.cc
index d0293c4..075c052 100644
--- a/src/squelch/object_status.cc
+++ b/src/squelch/object_status.cc
@@ -1,10 +1,11 @@
#include "tome/squelch/object_status_fwd.hpp"
#include "tome/squelch/object_status.hpp"
-#include "angband.h"
-#include "object1.hpp"
-#include "object2.hpp"
-#include "variable.hpp"
+#include "../inventory.hpp"
+#include "../object1.hpp"
+#include "../object2.hpp"
+#include "../object_type.hpp"
+#include "../variable.hpp"
namespace squelch {
diff --git a/src/squelch/rule.cc b/src/squelch/rule.cc
index 44c110c..1c17d2f 100644
--- a/src/squelch/rule.cc
+++ b/src/squelch/rule.cc
@@ -8,6 +8,7 @@
#include "../modules.hpp"
#include "../object1.hpp"
#include "../object2.hpp"
+#include "../object_type.hpp"
#include "../quark.hpp"
#include "../tables.hpp"
#include "../util.hpp"
diff --git a/src/squelch/tree_printer.cc b/src/squelch/tree_printer.cc
index 812933a..2be098d 100644
--- a/src/squelch/tree_printer.cc
+++ b/src/squelch/tree_printer.cc
@@ -1,7 +1,7 @@
#include "tome/squelch/tree_printer_fwd.hpp"
#include "tome/squelch/tree_printer.hpp"
-#include "angband.h"
+#include "../z-term.h"
namespace squelch {
diff --git a/src/squeltch.cc b/src/squeltch.cc
index 37b0f0f..f236681 100644
--- a/src/squeltch.cc
+++ b/src/squeltch.cc
@@ -9,11 +9,15 @@
#include "squeltch.hpp"
+#include "cave_type.hpp"
#include "files.hpp"
#include "loadsave.hpp"
#include "lua_bind.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "object_type.hpp"
+#include "player_type.hpp"
#include "tome/squelch/tree_printer.hpp"
#include "tome/squelch/condition.hpp"
#include "tome/squelch/condition_metadata.hpp"
diff --git a/src/squeltch.hpp b/src/squeltch.hpp
index 7c80c11..65ddfb5 100644
--- a/src/squeltch.hpp
+++ b/src/squeltch.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "object_type_fwd.hpp"
#include <boost/filesystem.hpp>
extern void squeltch_inventory(void);
@@ -10,4 +11,3 @@ extern void automatizer_add_rule(object_type *o_ptr);
extern bool_ automatizer_create;
extern void automatizer_init();
extern bool automatizer_load(boost::filesystem::path const &path);
-
diff --git a/src/stairs_direction.hpp b/src/stairs_direction.hpp
new file mode 100644
index 0000000..b0b5f25
--- /dev/null
+++ b/src/stairs_direction.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+typedef enum { STAIRS_UP, STAIRS_DOWN } stairs_direction;
diff --git a/src/stats.hpp b/src/stats.hpp
new file mode 100644
index 0000000..e682446
--- /dev/null
+++ b/src/stats.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+/*
+ * Indexes of the various "stats" (hard-coded by savefiles, etc).
+ */
+#define A_STR 0
+#define A_INT 1
+#define A_WIS 2
+#define A_DEX 3
+#define A_CON 4
+#define A_CHR 5
diff --git a/src/status.cc b/src/status.cc
index 0c6dfd1..3fbd970 100644
--- a/src/status.cc
+++ b/src/status.cc
@@ -15,10 +15,12 @@
* there.
*/
-#include "angband.h"
#include "files.hpp"
#include "monster2.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
+#include "player_type.hpp"
+#include "stats.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
diff --git a/src/store.cc b/src/store.cc
index 4cc2303..8e9512c 100644
--- a/src/store.cc
+++ b/src/store.cc
@@ -10,19 +10,29 @@
#include "bldg.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd3.hpp"
#include "cmd4.hpp"
#include "cmd5.hpp"
#include "files.hpp"
#include "hooks.hpp"
+#include "obj_theme.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "owner_type.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
#include "spell_type.hpp"
#include "skills.hpp"
#include "spells5.hpp"
+#include "stats.hpp"
+#include "store_action_type.hpp"
+#include "store_type.hpp"
+#include "store_info_type.hpp"
#include "tables.hpp"
+#include "town_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
diff --git a/src/store.hpp b/src/store.hpp
index 20c60e1..f67d94e 100644
--- a/src/store.hpp
+++ b/src/store.hpp
@@ -1,7 +1,5 @@
#pragma once
-#include "angband.h"
-
extern void do_cmd_store();
extern void store_shuffle(int which);
extern void store_maint(int town_num, int store_num);
diff --git a/src/store_action_type.hpp b/src/store_action_type.hpp
new file mode 100644
index 0000000..048e13a
--- /dev/null
+++ b/src/store_action_type.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Store/building actions.
+ */
+struct store_action_type
+{
+ const char *name; /* Name */
+
+ s16b costs[3]; /* Costs for liked people */
+ char letter; /* Action letter */
+ char letter_aux; /* Action letter */
+ s16b action; /* Action code */
+ s16b action_restr; /* Action restriction */
+};
diff --git a/src/store_action_type_fwd.hpp b/src/store_action_type_fwd.hpp
new file mode 100644
index 0000000..e1746da
--- /dev/null
+++ b/src/store_action_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct store_action_type;
diff --git a/src/store_info_type.hpp b/src/store_info_type.hpp
new file mode 100644
index 0000000..030afe9
--- /dev/null
+++ b/src/store_info_type.hpp
@@ -0,0 +1,32 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Number of items to choose stock from
+ */
+constexpr int STORE_CHOICES = 56;
+
+/**
+ * Store descriptor.
+ */
+struct store_info_type
+{
+ const char *name; /* Name */
+
+ s16b table[STORE_CHOICES][2]; /* Table -- Legal item kinds */
+ byte table_num; /* Number of items */
+ s16b max_obj; /* Number of items this store can hold */
+
+ u16b owners[4]; /* List of owners(refers to ow_info) */
+
+ u16b actions[6]; /* Actions(refers to ba_info) */
+
+ byte d_attr; /* Default building attribute */
+ char d_char; /* Default building character */
+
+ byte x_attr; /* Desired building attribute */
+ char x_char; /* Desired building character */
+
+ u32b flags1; /* Flags */
+};
diff --git a/src/store_info_type_fwd.hpp b/src/store_info_type_fwd.hpp
new file mode 100644
index 0000000..a0dace9
--- /dev/null
+++ b/src/store_info_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct store_info_type;
diff --git a/src/store_type.hpp b/src/store_type.hpp
new file mode 100644
index 0000000..e3f917a
--- /dev/null
+++ b/src/store_type.hpp
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "h-basic.h"
+#include "object_type.hpp"
+
+/**
+ * A store, with an owner, various state flags, a current stock
+ * of items, and a table of items that are often purchased.
+ */
+struct store_type
+{
+ u16b st_idx;
+
+ /**
+ * Owner index
+ */
+ u16b owner;
+
+ /**
+ * Closed until this turn.
+ */
+ s32b store_open;
+
+ /**
+ * Last visited on this turn.
+ */
+ s32b last_visit;
+
+ /**
+ * Stock: Number of entries.
+ */
+ byte stock_num;
+
+ /**
+ * Stock: Total size of array
+ */
+ s16b stock_size;
+
+ /**
+ * Stock: Actual stock items
+ */
+ object_type *stock;
+};
diff --git a/src/store_type_fwd.hpp b/src/store_type_fwd.hpp
new file mode 100644
index 0000000..1541056
--- /dev/null
+++ b/src/store_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct store_type;
diff --git a/src/tables.cc b/src/tables.cc
index b91c1a6..53b86ae 100644
--- a/src/tables.cc
+++ b/src/tables.cc
@@ -9,7 +9,6 @@
#include "tables.hpp"
#include "tables.h"
-#include "angband.h"
#include "modules.hpp"
#include "options.hpp"
#include "q_library.hpp"
@@ -39,6 +38,7 @@
#include "q_one.hpp"
#include "q_main.hpp"
#include "q_rand.hpp"
+#include "stats.hpp"
#include "variable.hpp"
diff --git a/src/tables.hpp b/src/tables.hpp
index ac47800..4a3e33d 100644
--- a/src/tables.hpp
+++ b/src/tables.hpp
@@ -1,6 +1,26 @@
#pragma once
#include "angband.h"
+#include "activation.hpp"
+#include "between_exit.hpp"
+#include "body.hpp"
+#include "cli_comm_fwd.hpp"
+#include "flags_group.hpp"
+#include "gf_name_type.hpp"
+#include "inscription_info_type.hpp"
+#include "magic_power.hpp"
+#include "martial_arts.hpp"
+#include "module_type.hpp"
+#include "monster_power.hpp"
+#include "move_info_type.hpp"
+#include "option_type.hpp"
+#include "player_defs.hpp"
+#include "player_sex.hpp"
+#include "power_type.hpp"
+#include "powers.hpp"
+#include "quest_type.hpp"
+#include "tactic_info_type.hpp"
+#include "tval_desc.hpp"
extern s16b ddd[9];
extern s16b ddx[10];
diff --git a/src/tactic_info_type.hpp b/src/tactic_info_type.hpp
new file mode 100644
index 0000000..da94767
--- /dev/null
+++ b/src/tactic_info_type.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Tactics descriptor.
+ */
+struct tactic_info_type
+{
+ s16b to_hit;
+ s16b to_dam;
+ s16b to_ac;
+ s16b to_stealth;
+ s16b to_disarm;
+ s16b to_saving;
+ cptr name;
+};
diff --git a/src/terrain.hpp b/src/terrain.hpp
new file mode 100644
index 0000000..118a877
--- /dev/null
+++ b/src/terrain.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+/*
+ * Wilderness terrains
+ */
+#define TERRAIN_EDGE 0 /* Edge of the World */
+#define TERRAIN_TOWN 1 /* Town */
+#define TERRAIN_DEEP_WATER 2 /* Deep water */
+#define TERRAIN_SHALLOW_WATER 3 /* Shallow water */
+#define TERRAIN_SWAMP 4 /* Swamp */
+#define TERRAIN_DIRT 5 /* Dirt */
+#define TERRAIN_GRASS 6 /* Grass */
+#define TERRAIN_TREES 7 /* Trees */
+#define TERRAIN_DESERT 8 /* Desert */
+#define TERRAIN_SHALLOW_LAVA 9 /* Shallow lava */
+#define TERRAIN_DEEP_LAVA 10 /* Deep lava */
+#define TERRAIN_MOUNTAIN 11 /* Mountain */
+
+#define MAX_WILD_TERRAIN 18
diff --git a/src/timer_type.hpp b/src/timer_type.hpp
new file mode 100644
index 0000000..0ce6b09
--- /dev/null
+++ b/src/timer_type.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "h-basic.h"
+
+/*
+ * Timer descriptor and runtime data.
+ */
+struct timer_type
+{
+ timer_type *next; /* The next timer in the list */
+
+ bool_ enabled; /* Is it currently counting? */
+
+ s32b delay; /* Delay between activations */
+ s32b countdown; /* The current number of turns passed, when it reaches delay it fires */
+
+ void (*callback)(); /* The C function to call upon firing */
+};
diff --git a/src/timer_type_fwd.hpp b/src/timer_type_fwd.hpp
new file mode 100644
index 0000000..bda0371
--- /dev/null
+++ b/src/timer_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct timer_type;
diff --git a/src/town_type.hpp b/src/town_type.hpp
new file mode 100644
index 0000000..f8458c6
--- /dev/null
+++ b/src/town_type.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+#include "h-basic.h"
+#include "store_type_fwd.hpp"
+
+/**
+ * Town descriptor.
+ */
+struct town_type
+{
+ cptr name;
+ u32b seed; /* Seed for RNG */
+ store_type *store; /* The stores [max_st_idx] */
+ byte numstores;
+
+ byte flags; /* Town flags */
+ /* Left this for the sake of compatibility */
+ bool_ stocked; /* Is the town actualy stocked ? */
+
+ bool_ destroyed; /* Is the town destroyed? */
+};
diff --git a/src/town_type_fwd.hpp b/src/town_type_fwd.hpp
new file mode 100644
index 0000000..9de8c44
--- /dev/null
+++ b/src/town_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct town_type;
diff --git a/src/trap_type.hpp b/src/trap_type.hpp
new file mode 100644
index 0000000..d82c925
--- /dev/null
+++ b/src/trap_type.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Trap descriptor.
+ */
+struct trap_type
+{
+ s16b probability; /* probability of existence */
+ s16b another; /* does this trap easily combine */
+ s16b p1valinc; /* how much does this trap attribute to p1val */
+ byte difficulty; /* how difficult to disarm */
+ byte minlevel; /* what is the minimum level on which the traps should be */
+ byte color; /* what is the color on screen */
+ u32b flags; /* where can these traps go - and perhaps other flags */
+ bool_ ident; /* do we know the name */
+ s16b known; /* how well is this trap known */
+ const char *name; /* normal name like weakness */
+ s16b dd, ds; /* base damage */
+ char *text; /* longer description once you've met this trap */
+ byte g_attr; /* Overlay graphic attribute */
+ char g_char; /* Overlay graphic character */
+};
diff --git a/src/trap_type_fwd.hpp b/src/trap_type_fwd.hpp
new file mode 100644
index 0000000..480edfe
--- /dev/null
+++ b/src/trap_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct trap_type;
diff --git a/src/traps.cc b/src/traps.cc
index 6883386..ef01aec 100644
--- a/src/traps.cc
+++ b/src/traps.cc
@@ -8,17 +8,31 @@
*/
#include "traps.hpp"
+
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd1.hpp"
#include "cmd2.hpp"
+#include "dungeon_info_type.hpp"
+#include "feature_type.hpp"
#include "files.hpp"
#include "gods.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_spec.hpp"
+#include "player_type.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
+#include "stats.hpp"
#include "tables.hpp"
+#include "trap_type.hpp"
#include "util.hpp"
#include "variable.hpp"
#include "xtra1.hpp"
diff --git a/src/traps.hpp b/src/traps.hpp
index a066e1a..3df1e43 100644
--- a/src/traps.hpp
+++ b/src/traps.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "object_type_fwd.hpp"
extern bool_ player_activate_trap_type(s16b y, s16b x, object_type *i_ptr, s16b item);
extern void player_activate_door_trap(s16b y, s16b x);
diff --git a/src/tval_desc.hpp b/src/tval_desc.hpp
new file mode 100644
index 0000000..abf0b5e
--- /dev/null
+++ b/src/tval_desc.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+/**
+ * TVal description entry.
+ */
+struct tval_desc
+{
+ /**
+ * TVal
+ */
+ int tval;
+
+ /**
+ * Description
+ */
+ char const *desc;
+};
diff --git a/src/types.h b/src/types.h
deleted file mode 100644
index f630b79..0000000
--- a/src/types.h
+++ /dev/null
@@ -1,2566 +0,0 @@
-/* File: types.h */
-
-#include "types_fwd.h"
-
-/* Purpose: global type declarations */
-
-/*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
- *
- * 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.
- */
-
-
-/*
- * This file should ONLY be included by "angband.h"
- */
-
-
-/*
- * Note that "char" may or may not be signed, and that "signed char"
- * may or may not work on all machines. So always use "s16b" or "s32b"
- * for signed values. Also, note that unsigned values cause math problems
- * in many cases, so try to only use "u16b" and "u32b" for "bit flags",
- * unless you really need the extra bit of information, or you really
- * need to restrict yourself to a single byte for storage reasons.
- *
- * Also, if possible, attempt to restrict yourself to sub-fields of
- * known size (use "s16b" or "s32b" instead of "int", and "byte" instead
- * of "bool"), and attempt to align all fields along four-byte words, to
- * optimize storage issues on 32-bit machines. Also, avoid "bit flags"
- * since these increase the code size and slow down execution. When
- * you need to store bit flags, use one byte per flag, or, where space
- * is an issue, use a "byte" or "u16b" or "u32b", and add special code
- * to access the various bit flags.
- *
- * Many of these structures were developed to reduce the number of global
- * variables, facilitate structured program design, allow the use of ascii
- * template files, simplify access to indexed data, or facilitate efficient
- * clearing of many variables at once.
- *
- * Certain data is saved in multiple places for efficient access, currently,
- * this includes the tval/sval/weight fields in "object_type" and the "m_idx"
- * and "o_idx" fields in "cave_type". All of these could be removed, but
- * this would, in general, slow down the game and increase the complexity of
- * the code.
- */
-
-
-
-/*
- * "Themed" objects.
- * Probability in percent for each class of objects to be dropped.
- * This could perhaps be an array - but that wouldn't be as clear.
- */
-typedef struct obj_theme obj_theme;
-struct obj_theme
-{
- byte treasure;
- byte combat;
- byte magic;
- byte tools;
-};
-
-
-/*
- * Information about terrain "features"
- */
-
-typedef struct feature_type feature_type;
-
-struct feature_type
-{
- char *name; /* Name */
-
- const char *text; /* Text. May point to shared read-only memory, DO NOT FREE! */
- const char *tunnel; /* Text for tunneling. May point to shared read-only memory, DO NOT FREE! */
- const char *block; /* Text for blocking. May point to shared read-only memory, DO NOT FREE! */
-
- byte mimic; /* Feature to mimic */
-
- u32b flags1; /* First set of flags */
-
- byte extra; /* Extra byte (unused) */
-
- s16b unused; /* Extra bytes (unused) */
-
- byte d_attr; /* Default feature attribute */
- char d_char; /* Default feature character */
-
-
- byte x_attr; /* Desired feature attribute */
- char x_char; /* Desired feature character */
-
- byte shimmer[7]; /* Shimmer colors */
-
- int d_dice[4]; /* Number of dices */
- int d_side[4]; /* Number of sides */
- int d_frequency[4]; /* Frequency of damage (1 is the minimum) */
- int d_type[4]; /* Type of damage */
-};
-
-
-/*
- * Information about object "kinds", including player knowledge.
- *
- * Only "aware" and "tried" are saved in the savefile
- */
-
-typedef struct object_kind object_kind;
-
-struct object_kind
-{
- const char *name; /* Name */
- char *text; /* Text */
-
- byte tval; /* Object type */
- byte sval; /* Object sub type */
-
- s32b pval; /* Object extra info */
- s32b pval2; /* Object extra info */
-
- s16b to_h; /* Bonus to hit */
- s16b to_d; /* Bonus to damage */
- s16b to_a; /* Bonus to armor */
-
- s16b activate; /* Activation number */
-
- s16b ac; /* Base armor */
-
- byte dd, ds; /* Damage dice/sides */
-
- s32b weight; /* Weight */
-
- s32b cost; /* Object "base cost" */
-
- u32b flags1; /* Flags, set 1 */
- u32b flags2; /* Flags, set 2 */
- u32b flags3; /* Flags, set 3 */
- u32b flags4; /* Flags, set 4 */
- u32b flags5; /* Flags, set 5 */
-
- u32b oflags1; /* Obvious Flags, set 1 */
- u32b oflags2; /* Obvious Flags, set 2 */
- u32b oflags3; /* Obvious Flags, set 3 */
- u32b oflags4; /* Obvious Flags, set 4 */
- u32b oflags5; /* Obvious Flags, set 5 */
-
- byte locale[ALLOCATION_MAX]; /* Allocation level(s) */
- byte chance[ALLOCATION_MAX]; /* Allocation chance(s) */
-
- byte level; /* Level */
- byte extra; /* Something */
-
-
- byte d_attr; /* Default object attribute */
- char d_char; /* Default object character */
-
-
- byte x_attr; /* Desired object attribute */
- char x_char; /* Desired object character */
-
-
- byte flavor; /* Special object flavor (or zero) */
-
- bool_ easy_know; /* This object is always known (if aware) */
-
-
- bool_ aware; /* The player is "aware" of the item's effects */
-
- bool_ tried; /* The player has "tried" one of the items */
-
- bool_ know; /* extractable flag for the alchemist */
-
- u32b esp; /* ESP flags */
- u32b oesp; /* Obvious ESP flags */
-
- byte btval; /* Become Object type */
- byte bsval; /* Become Object sub type */
- bool_ artifact; /* Is it a normal artifact(already generated) */
-
- s16b power; /* Power granted(if any) */
-};
-
-
-
-/*
- * Information about "artifacts".
- *
- * Note that the save-file only writes "cur_num" to the savefile.
- *
- * Note that "max_num" is always "1" (if that artifact "exists")
- */
-
-typedef struct artifact_type artifact_type;
-
-struct artifact_type
-{
- char const *name; /* Artifact name */
- char *text; /* Artifact description */
-
- byte tval; /* Artifact type */
- byte sval; /* Artifact sub type */
-
- s16b pval; /* Artifact extra info */
-
- s16b to_h; /* Bonus to hit */
- s16b to_d; /* Bonus to damage */
- s16b to_a; /* Bonus to armor */
-
- s16b activate; /* Activation Number */
-
- s16b ac; /* Base armor */
-
- byte dd, ds; /* Damage when hits */
-
- s16b weight; /* Weight */
-
- s32b cost; /* Artifact "cost" */
-
- u32b flags1; /* Artifact Flags, set 1 */
- u32b flags2; /* Artifact Flags, set 2 */
- u32b flags3; /* Artifact Flags, set 3 */
- u32b flags4; /* Artifact Flags, set 4 */
- u32b flags5; /* Artifact Flags, set 5 */
-
- u32b oflags1; /* Obvious Flags, set 1 */
- u32b oflags2; /* Obvious Flags, set 2 */
- u32b oflags3; /* Obvious Flags, set 3 */
- u32b oflags4; /* Obvious Flags, set 4 */
- u32b oflags5; /* Obvious Flags, set 5 */
-
- byte level; /* Artifact level */
- byte rarity; /* Artifact rarity */
-
- byte cur_num; /* Number created (0 or 1) */
- byte max_num; /* Unused (should be "1") */
-
- u32b esp; /* ESP flags */
- u32b oesp; /* ESP flags */
-
- s16b power; /* Power granted(if any) */
-
- s16b set; /* Does it belongs to a set ?*/
-};
-
-
-/*
- * Information about "ego-items".
- */
-
-typedef struct ego_item_type ego_item_type;
-
-struct ego_item_type
-{
- const char *name; /* Name (offset) */
-
- bool_ before; /* Before or after the object name ? */
-
- byte tval[10];
- byte min_sval[10];
- byte max_sval[10];
-
- byte rating; /* Rating boost */
-
- byte level; /* Minimum level */
- byte rarity; /* Object rarity */
- byte mrarity; /* Object rarity */
-
- s16b max_to_h; /* Maximum to-hit bonus */
- s16b max_to_d; /* Maximum to-dam bonus */
- s16b max_to_a; /* Maximum to-ac bonus */
-
- s16b activate; /* Activation Number */
-
- s32b max_pval; /* Maximum pval */
-
- s32b cost; /* Ego-item "cost" */
-
- byte rar[FLAG_RARITY_MAX];
- u32b flags1[FLAG_RARITY_MAX]; /* Ego-Item Flags, set 1 */
- u32b flags2[FLAG_RARITY_MAX]; /* Ego-Item Flags, set 2 */
- u32b flags3[FLAG_RARITY_MAX]; /* Ego-Item Flags, set 3 */
- u32b flags4[FLAG_RARITY_MAX]; /* Ego-Item Flags, set 4 */
- u32b flags5[FLAG_RARITY_MAX]; /* Ego-Item Flags, set 5 */
- u32b esp[FLAG_RARITY_MAX]; /* ESP flags */
- u32b oflags1[FLAG_RARITY_MAX]; /* Ego-Item Obvious Flags, set 1 */
- u32b oflags2[FLAG_RARITY_MAX]; /* Ego-Item Obvious Flags, set 2 */
- u32b oflags3[FLAG_RARITY_MAX]; /* Ego-Item Obvious Flags, set 3 */
- u32b oflags4[FLAG_RARITY_MAX]; /* Ego-Item Obvious Flags, set 4 */
- u32b oflags5[FLAG_RARITY_MAX]; /* Ego-Item Obvious Flags, set 5 */
- u32b oesp[FLAG_RARITY_MAX]; /* Obvious ESP flags */
- u32b fego[FLAG_RARITY_MAX]; /* ego flags */
-
- u32b need_flags1; /* Ego-Item Flags, set 1 */
- u32b need_flags2; /* Ego-Item Flags, set 2 */
- u32b need_flags3; /* Ego-Item Flags, set 3 */
- u32b need_flags4; /* Ego-Item Flags, set 4 */
- u32b need_flags5; /* Ego-Item Flags, set 5 */
- u32b need_esp; /* ESP flags */
- u32b forbid_flags1; /* Ego-Item Flags, set 1 */
- u32b forbid_flags2; /* Ego-Item Flags, set 2 */
- u32b forbid_flags3; /* Ego-Item Flags, set 3 */
- u32b forbid_flags4; /* Ego-Item Flags, set 4 */
- u32b forbid_flags5; /* Ego-Item Flags, set 5 */
- u32b forbid_esp; /* ESP flags */
-
- s16b power; /* Power granted(if any) */
-};
-
-
-/*
- * Information about "random artifacts parts".
- */
-typedef struct randart_part_type randart_part_type;
-struct randart_part_type
-{
- byte tval[20];
- byte min_sval[20];
- byte max_sval[20];
-
- byte level; /* Minimum level */
- byte rarity; /* Object rarity */
- byte mrarity; /* Object rarity */
-
- s16b max_to_h; /* Maximum to-hit bonus */
- s16b max_to_d; /* Maximum to-dam bonus */
- s16b max_to_a; /* Maximum to-ac bonus */
-
- s32b max_pval; /* Maximum pval */
-
- s32b value; /* power value */
- s16b max; /* Number of time it can appear on a single item */
-
- u32b flags1; /* Ego-Item Flags, set 1 */
- u32b flags2; /* Ego-Item Flags, set 2 */
- u32b flags3; /* Ego-Item Flags, set 3 */
- u32b flags4; /* Ego-Item Flags, set 4 */
- u32b flags5; /* Ego-Item Flags, set 5 */
- u32b esp; /* ESP flags */
- u32b fego; /* ego flags */
-
- u32b aflags1; /* Ego-Item Flags, set 1 */
- u32b aflags2; /* Ego-Item Flags, set 2 */
- u32b aflags3; /* Ego-Item Flags, set 3 */
- u32b aflags4; /* Ego-Item Flags, set 4 */
- u32b aflags5; /* Ego-Item Flags, set 5 */
- u32b aesp; /* ESP flags */
-
- s16b power; /* Power granted(if any) */
-};
-
-typedef struct randart_gen_type randart_gen_type;
-struct randart_gen_type
-{
- int chance; /* Chance to have that number of powers */
- int dd;
- int ds;
- int plus; /* xdy+plus power */
-};
-
-
-/*
- * Monster blow structure
- *
- * - Method (RBM_*)
- * - Effect (RBE_*)
- * - Damage Dice
- * - Damage Sides
- */
-
-typedef struct monster_blow monster_blow;
-
-struct monster_blow
-{
- byte method;
- byte effect;
- byte d_dice;
- byte d_side;
-};
-
-
-
-/*
- * Monster "race" information, including racial memories
- *
- * Note that "d_attr" and "d_char" are used for MORE than "visual" stuff.
- *
- * Note that "x_attr" and "x_char" are used ONLY for "visual" stuff.
- *
- * Note that "cur_num" (and "max_num") represent the number of monsters
- * of the given race currently on (and allowed on) the current level.
- * This information yields the "dead" flag for Unique monsters.
- *
- * Note that "max_num" is reset when a new player is created.
- * Note that "cur_num" is reset when a new level is created.
- *
- * Note that several of these fields, related to "recall", can be
- * scrapped if space becomes an issue, resulting in less "complete"
- * monster recall (no knowledge of spells, etc). All of the "recall"
- * fields have a special prefix to aid in searching for them.
- */
-
-
-typedef struct monster_race monster_race;
-
-struct monster_race
-{
- const char *name; /* Name */
- char *text; /* Text */
-
- u16b hdice; /* Creatures hit dice count */
- u16b hside; /* Creatures hit dice sides */
-
- s16b ac; /* Armour Class */
-
- s16b sleep; /* Inactive counter (base) */
- byte aaf; /* Area affect radius (1-100) */
- byte speed; /* Speed (normally 110) */
-
- s32b mexp; /* Exp value for kill */
-
- s32b weight; /* Weight of the monster */
-
- byte freq_inate; /* Inate spell frequency */
- byte freq_spell; /* Other spell frequency */
-
- u32b flags1; /* Flags 1 (general) */
- u32b flags2; /* Flags 2 (abilities) */
- u32b flags3; /* Flags 3 (race/resist) */
- u32b flags4; /* Flags 4 (inate/breath) */
- u32b flags5; /* Flags 5 (normal spells) */
- u32b flags6; /* Flags 6 (special spells) */
- u32b flags7; /* Flags 7 (movement related abilities) */
- u32b flags8; /* Flags 8 (wilderness info) */
- u32b flags9; /* Flags 9 (drops info) */
-
- monster_blow blow[4]; /* Up to four blows per round */
-
- byte body_parts[BODY_MAX]; /* To help to decide what to use when body changing */
-
- byte level; /* Level of creature */
- byte rarity; /* Rarity of creature */
-
-
- byte d_attr; /* Default monster attribute */
- char d_char; /* Default monster character */
-
-
- byte x_attr; /* Desired monster attribute */
- char x_char; /* Desired monster character */
-
-
- s16b max_num; /* Maximum population allowed per level */
-
- byte cur_num; /* Monster population on current level */
-
-
- s16b r_sights; /* Count sightings of this monster */
- s16b r_deaths; /* Count deaths from this monster */
-
- s16b r_pkills; /* Count monsters killed in this life */
- s16b r_tkills; /* Count monsters killed in all lives */
-
- byte r_wake; /* Number of times woken up (?) */
- byte r_ignore; /* Number of times ignored (?) */
-
- byte r_xtra1; /* Something (unused) */
- byte r_xtra2; /* Something (unused) */
-
- byte r_drop_gold; /* Max number of gold dropped at once */
- byte r_drop_item; /* Max number of item dropped at once */
-
- byte r_cast_inate; /* Max number of inate spells seen */
- byte r_cast_spell; /* Max number of other spells seen */
-
- byte r_blows[4]; /* Number of times each blow type was seen */
-
- u32b r_flags1; /* Observed racial flags */
- u32b r_flags2; /* Observed racial flags */
- u32b r_flags3; /* Observed racial flags */
- u32b r_flags4; /* Observed racial flags */
- u32b r_flags5; /* Observed racial flags */
- u32b r_flags6; /* Observed racial flags */
- u32b r_flags7; /* Observed racial flags */
- u32b r_flags8; /* Observed racial flags */
- u32b r_flags9; /* Observed racial flags */
-
- bool_ on_saved; /* Is the (unique) on a saved level ? */
-
- byte total_visible; /* Amount of this race that are visible */
-
- obj_theme drops; /* The drops type */
-};
-
-
-typedef struct monster_ego monster_ego;
-
-struct monster_ego
-{
- const char *name; /* Name */
- bool_ before; /* Display ego before or after */
-
- monster_blow blow[4]; /* Up to four blows per round */
- byte blowm[4][2];
-
- s16b hdice; /* Creatures hit dice count */
- s16b hside; /* Creatures hit dice sides */
-
- s16b ac; /* Armour Class */
-
- s16b sleep; /* Inactive counter (base) */
- s16b aaf; /* Area affect radius (1-100) */
- s16b speed; /* Speed (normally 110) */
-
- s32b mexp; /* Exp value for kill */
-
- s32b weight; /* Weight of the monster */
-
- byte freq_inate; /* Inate spell frequency */
- byte freq_spell; /* Other spell frequency */
-
- /* Ego flags */
- u32b flags1; /* Flags 1 */
- u32b flags2; /* Flags 1 */
- u32b flags3; /* Flags 1 */
- u32b flags7; /* Flags 1 */
- u32b flags8; /* Flags 1 */
- u32b flags9; /* Flags 1 */
- u32b hflags1; /* Flags 1 */
- u32b hflags2; /* Flags 1 */
- u32b hflags3; /* Flags 1 */
- u32b hflags7; /* Flags 1 */
- u32b hflags8; /* Flags 1 */
- u32b hflags9; /* Flags 1 */
-
- /* Monster flags */
- u32b mflags1; /* Flags 1 (general) */
- u32b mflags2; /* Flags 2 (abilities) */
- u32b mflags3; /* Flags 3 (race/resist) */
- u32b mflags4; /* Flags 4 (inate/breath) */
- u32b mflags5; /* Flags 5 (normal spells) */
- u32b mflags6; /* Flags 6 (special spells) */
- u32b mflags7; /* Flags 7 (movement related abilities) */
- u32b mflags8; /* Flags 8 (wilderness info) */
- u32b mflags9; /* Flags 9 (drops info) */
-
- /* Negative Flags, to be removed from the monster flags */
- u32b nflags1; /* Flags 1 (general) */
- u32b nflags2; /* Flags 2 (abilities) */
- u32b nflags3; /* Flags 3 (race/resist) */
- u32b nflags4; /* Flags 4 (inate/breath) */
- u32b nflags5; /* Flags 5 (normal spells) */
- u32b nflags6; /* Flags 6 (special spells) */
- u32b nflags7; /* Flags 7 (movement related abilities) */
- u32b nflags8; /* Flags 8 (wilderness info) */
- u32b nflags9; /* Flags 9 (drops info) */
-
- s16b level; /* Level of creature */
- s16b rarity; /* Rarity of creature */
-
-
- byte d_attr; /* Default monster attribute */
- char d_char; /* Default monster character */
-
- byte g_attr; /* Overlay graphic attribute */
- char g_char; /* Overlay graphic character */
-
- char r_char[5]; /* Monster race allowed */
- char nr_char[5]; /* Monster race not allowed */
-};
-
-
-
-/*
- * Information about "vault generation"
- */
-
-typedef struct vault_type vault_type;
-
-struct vault_type
-{
- char *data; /* Vault data */
-
- byte typ; /* Vault type */
-
- byte rat; /* Vault rating */
-
- byte hgt; /* Vault height */
- byte wid; /* Vault width */
-
- s16b lvl; /* level of special (if any) */
- byte dun_type; /* Dungeon type where the level will show up */
-
- s16b mon[10]; /* special monster */
- int item[3]; /* number of item (usually artifact) */
-};
-
-
-/* jk */
-/* name and description are in some other arrays */
-typedef struct trap_type trap_type;
-
-struct trap_type
-{
- s16b probability; /* probability of existence */
- s16b another; /* does this trap easily combine */
- s16b p1valinc; /* how much does this trap attribute to p1val */
- byte difficulty; /* how difficult to disarm */
- byte minlevel; /* what is the minimum level on which the traps should be */
- byte color; /* what is the color on screen */
- u32b flags; /* where can these traps go - and perhaps other flags */
- bool_ ident; /* do we know the name */
- s16b known; /* how well is this trap known */
- const char *name; /* normal name like weakness */
- s16b dd, ds; /* base damage */
- char *text; /* longer description once you've met this trap */
- byte g_attr; /* Overlay graphic attribute */
- char g_char; /* Overlay graphic character */
-};
-
-
-
-/*
- * A single "grid" in a Cave
- *
- * Note that several aspects of the code restrict the actual cave
- * to a max size of 256 by 256. In partcular, locations are often
- * saved as bytes, limiting each coordinate to the 0-255 range.
- *
- * The "o_idx" and "m_idx" fields are very interesting. There are
- * many places in the code where we need quick access to the actual
- * monster or object(s) in a given cave grid. The easiest way to
- * do this is to simply keep the index of the monster and object
- * (if any) with the grid, but this takes 198*66*4 bytes of memory.
- * Several other methods come to mind, which require only half this
- * amound of memory, but they all seem rather complicated, and would
- * probably add enough code that the savings would be lost. So for
- * these reasons, we simply store an index into the "o_list" and
- * "m_list" arrays, using "zero" when no monster/object is present.
- *
- * Note that "o_idx" is the index of the top object in a stack of
- * objects, using the "next_o_idx" field of objects (see below) to
- * create the singly linked list of objects. If "o_idx" is zero
- * then there are no objects in the grid.
- */
-
-typedef struct cave_type cave_type;
-
-struct cave_type
-{
- u16b info; /* Hack -- cave flags */
-
- byte feat; /* Hack -- feature type */
-
- s16b o_idx; /* Object in this grid */
-
- s16b m_idx; /* Monster in this grid */
-
- s16b t_idx; /* trap index (in t_list) or zero */
-
- s16b special, special2; /* Special cave info */
-
- s16b inscription; /* Inscription of the grid */
-
- byte mana; /* Magical energy of the grid */
-
- byte mimic; /* Feature to mimic */
-
- byte cost; /* Hack -- cost of flowing */
- byte when; /* Hack -- when cost was computed */
-
- s16b effect; /* The lasting effects */
-};
-
-/* Lasting spell effects(clouds, ..) */
-typedef struct effect_type effect_type;
-struct effect_type
-{
- s16b time; /* For how long */
- s16b dam; /* How much damage */
- s16b type; /* Of which type */
- s16b cy; /* Center of the cast*/
- s16b cx; /* Center of the cast*/
- s16b rad; /* Radius -- if needed */
- u32b flags; /* Flags */
-};
-
-/*
- * Object information, for a specific object.
- *
- * Note that a "discount" on an item is permanent and never goes away.
- *
- * Note that inscriptions are now handled via the "quark_str()" function
- * applied to the "note" field, which will return NULL if "note" is zero.
- *
- * Note that "object" records are "copied" on a fairly regular basis,
- * and care must be taken when handling such objects.
- *
- * Note that "object flags" must now be derived from the object kind,
- * the artifact and ego-item indexes, and the two "xtra" fields.
- *
- * Each cave grid points to one (or zero) objects via the "o_idx"
- * field (above). Each object then points to one (or zero) objects
- * via the "next_o_idx" field, forming a singly linked list, which
- * in game terms, represents a "stack" of objects in the same grid.
- *
- * Each monster points to one (or zero) objects via the "hold_o_idx"
- * field (below). Each object then points to one (or zero) objects
- * via the "next_o_idx" field, forming a singly linked list, which
- * in game terms, represents a pile of objects held by the monster.
- *
- * The "held_m_idx" field is used to indicate which monster, if any,
- * is holding the object. Objects being held have "ix=0" and "iy=0".
- */
-
-typedef struct object_type object_type;
-
-struct object_type
-{
- s16b k_idx; /* Kind index (zero if "dead") */
-
- byte iy; /* Y-position on map, or zero */
- byte ix; /* X-position on map, or zero */
-
- byte tval; /* Item type (from kind) */
- byte sval; /* Item sub-type (from kind) */
-
- s32b pval; /* Item extra-parameter */
- s16b pval2; /* Item extra-parameter for some special
- items*/
- s32b pval3; /* Item extra-parameter for some special
- items*/
-
- byte discount; /* Discount (if any) */
-
- byte number; /* Number of items */
-
- s32b weight; /* Item weight */
-
- byte elevel; /* Item exp level */
- s32b exp; /* Item exp */
-
- byte name1; /* Artifact type, if any */
- s16b name2; /* Ego-Item type, if any */
- s16b name2b; /* Second Ego-Item type, if any */
-
- byte xtra1; /* Extra info type */
- s16b xtra2; /* Extra info index */
-
- s16b to_h; /* Plusses to hit */
- s16b to_d; /* Plusses to damage */
- s16b to_a; /* Plusses to AC */
-
- s16b ac; /* Normal AC */
-
- byte dd, ds; /* Damage dice/sides */
-
- s16b timeout; /* Timeout Counter */
-
- byte ident; /* Special flags */
-
- byte marked; /* Object is marked */
-
- u16b note; /* Inscription index */
- u16b art_name; /* Artifact name (random artifacts) */
-
- u32b art_flags1; /* Flags, set 1 Alas, these were necessary */
- u32b art_flags2; /* Flags, set 2 for the random artifacts of*/
- u32b art_flags3; /* Flags, set 3 Zangband */
- u32b art_flags4; /* Flags, set 4 PernAngband */
- u32b art_flags5; /* Flags, set 5 PernAngband */
- u32b art_esp; /* Flags, set esp PernAngband */
-
- u32b art_oflags1; /* Obvious Flags, set 1 */
- u32b art_oflags2; /* Obvious Flags, set 2 */
- u32b art_oflags3; /* Obvious Flags, set 3 */
- u32b art_oflags4; /* Obvious Flags, set 4 */
- u32b art_oflags5; /* Obvious Flags, set 5 */
- u32b art_oesp; /* Obvious Flags, set esp */
-
- s16b next_o_idx; /* Next object in stack (if any) */
-
- s16b held_m_idx; /* Monster holding us (if any) */
-
- byte sense; /* Pseudo-id status */
-
- byte found; /* How did we find it */
- s16b found_aux1; /* Stores info for found */
- s16b found_aux2; /* Stores info for found */
- s16b found_aux3; /* Stores info for found */
- s16b found_aux4; /* Stores info for found */
-};
-
-
-/*
- * Monster information, for a specific monster.
- *
- * Note: fy, fx constrain dungeon size to 256x256
- *
- * The "hold_o_idx" field points to the first object of a stack
- * of objects (if any) being carried by the monster (see above).
- */
-
-typedef struct monster_type monster_type;
-
-struct monster_type
-{
- s16b r_idx; /* Monster race index */
-
- u16b ego; /* Ego monster type */
-
- byte fy; /* Y location on map */
- byte fx; /* X location on map */
-
- s32b hp; /* Current Hit points */
- s32b maxhp; /* Max Hit points */
-
- monster_blow blow[4]; /* Up to four blows per round */
-
- byte speed; /* Speed (normally 110) */
- byte level; /* Level of creature */
- s16b ac; /* Armour Class */
- s32b exp; /* Experience */
-
- s16b csleep; /* Inactive counter */
-
- byte mspeed; /* Monster "speed" */
- byte energy; /* Monster "energy" */
-
- byte stunned; /* Monster is stunned */
- byte confused; /* Monster is confused */
- byte monfear; /* Monster is afraid */
-
- s16b bleeding; /* Monster is bleeding */
- s16b poisoned; /* Monster is poisoned */
-
- byte cdis; /* Current dis from player */
-
- s32b mflag; /* Extra monster flags */
-
- bool_ ml; /* Monster is "visible" */
-
- s16b hold_o_idx; /* Object being held (if any) */
-
- u32b smart; /* Field for "smart_learn" */
-
- s16b status; /* Status(friendly, pet, companion, ..) */
-
- s16b target; /* Monster target */
-
- s16b possessor; /* Is it under the control of a possessor ? */
-};
-
-
-
-
-/*
- * An entry for the object/monster allocation functions
- *
- * Pass 1 is determined from allocation information
- * Pass 2 is determined from allocation restriction
- * Pass 3 is determined from allocation calculation
- */
-
-typedef struct alloc_entry alloc_entry;
-
-struct alloc_entry
-{
- s16b index; /* The actual index */
-
- byte level; /* Base dungeon level */
- byte prob1; /* Probability, pass 1 */
- byte prob2; /* Probability, pass 2 */
- byte prob3; /* Probability, pass 3 */
-};
-
-
-
-/*
- * Available "options"
- *
- * - Address of actual option variable (or NULL)
- *
- * - Normal Value (TRUE or FALSE)
- *
- * - Option Page Number (or zero)
- *
- * - Savefile Set (or zero)
- * - Savefile Bit in that set
- *
- * - Textual name (or NULL)
- * - Textual description
- */
-
-typedef struct option_type option_type;
-
-struct option_type
-{
- bool_ *o_var;
-
- byte o_norm;
-
- byte o_page;
-
- byte o_bit;
-
- cptr o_text;
- cptr o_desc;
-};
-
-/*
- * A store owner
- */
-typedef struct owner_type owner_type;
-
-struct owner_type
-{
- const char *name; /* Name */
-
- s16b max_cost; /* Purse limit */
-
- s16b inflation; /* Inflation */
-
- u32b races[2][2]; /* Liked/hated races */
- u32b classes[2][2]; /* Liked/hated classes */
-
- s16b costs[3]; /* Costs for liked people */
-};
-
-
-
-
-/*
- * A store, with an owner, various state flags, a current stock
- * of items, and a table of items that are often purchased.
- */
-typedef struct store_type store_type;
-
-struct store_type
-{
- u16b st_idx;
-
- u16b owner; /* Owner index */
-
- s32b store_open; /* Closed until this turn */
-
- s32b last_visit; /* Last visited on this turn */
-
- byte stock_num; /* Stock -- Number of entries */
- s16b stock_size; /* Stock -- Total Size of Array */
- object_type *stock; /* Stock -- Actual stock items */
-};
-
-/*
- * A store/building type
- */
-typedef struct store_info_type store_info_type;
-
-struct store_info_type
-{
- const char *name; /* Name */
-
- s16b table[STORE_CHOICES][2]; /* Table -- Legal item kinds */
- byte table_num; /* Number of items */
- s16b max_obj; /* Number of items this store can hold */
-
- u16b owners[4]; /* List of owners(refers to ow_info) */
-
- u16b actions[6]; /* Actions(refers to ba_info) */
-
- byte d_attr; /* Default building attribute */
- char d_char; /* Default building character */
-
- byte x_attr; /* Desired building attribute */
- char x_char; /* Desired building character */
-
- u32b flags1; /* Flags */
-};
-
-/*
- * Stores/buildings actions
- */
-typedef struct store_action_type store_action_type;
-
-struct store_action_type
-{
- const char *name; /* Name */
-
- s16b costs[3]; /* Costs for liked people */
- char letter; /* Action letter */
- char letter_aux; /* Action letter */
- s16b action; /* Action code */
- s16b action_restr; /* Action restriction */
-};
-
-/*
- * Player sex info
- */
-
-typedef struct player_sex player_sex;
-
-struct player_sex
-{
- cptr title; /* Type of sex */
-
- cptr winner; /* Name of winner */
-};
-
-
-/*
- * Player racial info
- */
-
-typedef struct player_race player_race;
-
-struct player_race
-{
- const char *title; /* Type of race */
- char *desc;
-
- s16b r_adj[6]; /* Racial stat bonuses */
-
- char luck; /* Luck */
-
- s16b r_dis; /* disarming */
- s16b r_dev; /* magic devices */
- s16b r_sav; /* saving throw */
- s16b r_stl; /* stealth */
- s16b r_srh; /* search ability */
- s16b r_fos; /* search frequency */
- s16b r_thn; /* combat (normal) */
- s16b r_thb; /* combat (shooting) */
-
- byte r_mhp; /* Race hit-dice modifier */
- u16b r_exp; /* Race experience factor */
-
- byte b_age; /* base age */
- byte m_age; /* mod age */
-
- byte m_b_ht; /* base height (males) */
- byte m_m_ht; /* mod height (males) */
- byte m_b_wt; /* base weight (males) */
- byte m_m_wt; /* mod weight (males) */
-
- byte f_b_ht; /* base height (females) */
- byte f_m_ht; /* mod height (females) */
- byte f_b_wt; /* base weight (females) */
- byte f_m_wt; /* mod weight (females) */
-
- byte infra; /* Infra-vision range */
-
- u32b choice[2]; /* Legal class choices */
-
- s16b powers[4]; /* Powers of the race */
-
- byte body_parts[BODY_MAX]; /* To help to decide what to use when body changing */
-
- s16b chart; /* Chart history */
-
- u32b flags1;
- u32b flags2; /* flags */
-
- u32b oflags1[PY_MAX_LEVEL + 1];
- u32b oflags2[PY_MAX_LEVEL + 1];
- u32b oflags3[PY_MAX_LEVEL + 1];
- u32b oflags4[PY_MAX_LEVEL + 1];
- u32b oflags5[PY_MAX_LEVEL + 1];
- u32b oesp[PY_MAX_LEVEL + 1];
- s16b opval[PY_MAX_LEVEL + 1];
-
- char skill_basem[MAX_SKILLS];
- u32b skill_base[MAX_SKILLS];
- char skill_modm[MAX_SKILLS];
- s16b skill_mod[MAX_SKILLS];
-
- s16b obj_tval[5];
- s16b obj_sval[5];
- s16b obj_pval[5];
- s16b obj_dd[5];
- s16b obj_ds[5];
- s16b obj_num;
-
- struct
- {
- s16b ability;
- s16b level;
- } abilities[10]; /* Abilitiers to be gained by level(doesnt take prereqs in account) */
-};
-
-typedef struct player_race_mod player_race_mod;
-
-struct player_race_mod
-{
- char *title; /* Type of race mod */
- char *desc; /* Desc */
-
- bool_ place; /* TRUE = race race modifier, FALSE = Race modifier race */
-
- s16b r_adj[6]; /* (+) Racial stat bonuses */
-
- char luck; /* Luck */
- s16b mana; /* Mana % */
-
- s16b r_dis; /* (+) disarming */
- s16b r_dev; /* (+) magic devices */
- s16b r_sav; /* (+) saving throw */
- s16b r_stl; /* (+) stealth */
- s16b r_srh; /* (+) search ability */
- s16b r_fos; /* (+) search frequency */
- s16b r_thn; /* (+) combat (normal) */
- s16b r_thb; /* (+) combat (shooting) */
-
- char r_mhp; /* (+) Race mod hit-dice modifier */
- s16b r_exp; /* (+) Race mod experience factor */
-
- char b_age; /* (+) base age */
- char m_age; /* (+) mod age */
-
- char m_b_ht; /* (+) base height (males) */
- char m_m_ht; /* (+) mod height (males) */
- char m_b_wt; /* (+) base weight (males) */
- char m_m_wt; /* (+) mod weight (males) */
-
- char f_b_ht; /* (+) base height (females) */
- char f_m_ht; /* (+) mod height (females) */
- char f_b_wt; /* (+) base weight (females) */
- char f_m_wt; /* (+) mod weight (females) */
-
- char infra; /* (+) Infra-vision range */
-
- u32b choice[2]; /* Legal race choices */
-
- u32b pclass[2]; /* Classes allowed */
- u32b mclass[2]; /* Classes restricted */
-
- s16b powers[4]; /* Powers of the subrace */
-
- char body_parts[BODY_MAX]; /* To help to decide what to use when body changing */
-
- u32b flags1;
- u32b flags2; /* flags */
-
- u32b oflags1[PY_MAX_LEVEL + 1];
- u32b oflags2[PY_MAX_LEVEL + 1];
- u32b oflags3[PY_MAX_LEVEL + 1];
- u32b oflags4[PY_MAX_LEVEL + 1];
- u32b oflags5[PY_MAX_LEVEL + 1];
- u32b oesp[PY_MAX_LEVEL + 1];
- s16b opval[PY_MAX_LEVEL + 1];
-
- byte g_attr; /* Overlay graphic attribute */
- char g_char; /* Overlay graphic character */
-
- char skill_basem[MAX_SKILLS];
- u32b skill_base[MAX_SKILLS];
- char skill_modm[MAX_SKILLS];
- s16b skill_mod[MAX_SKILLS];
-
- s16b obj_tval[5];
- s16b obj_sval[5];
- s16b obj_pval[5];
- s16b obj_dd[5];
- s16b obj_ds[5];
- s16b obj_num;
-
- struct
- {
- s16b ability;
- s16b level;
- } abilities[10]; /* Abilitiers to be gained by level(doesnt take prereqs in account) */
-};
-
-
-/*
- * Player class info
- */
-
-typedef struct player_spec player_spec;
-
-struct player_spec
-{
- const char *title; /* Type of class spec */
- char *desc; /* Small desc of the class spec */
-
- char skill_basem[MAX_SKILLS]; /* Mod for value */
- u32b skill_base[MAX_SKILLS]; /* value */
- char skill_modm[MAX_SKILLS]; /* mod for mod */
- s16b skill_mod[MAX_SKILLS]; /* mod */
-
- u32b skill_ideal[MAX_SKILLS]; /* Ideal skill levels at level 50 */
-
- s16b obj_tval[5];
- s16b obj_sval[5];
- s16b obj_pval[5];
- s16b obj_dd[5];
- s16b obj_ds[5];
- s16b obj_num;
-
- u32b gods;
-
- u32b flags1;
- u32b flags2; /* flags */
-
- struct
- {
- s16b ability;
- s16b level;
- } abilities[10]; /* Abilitiers to be gained by level(doesnt take prereqs in account) */
-};
-
-typedef struct player_class player_class;
-
-struct player_class
-{
- const char *title; /* Type of class */
- char *desc; /* Small desc of the class */
- const char *titles[PY_MAX_LEVEL / 5];
- /* Titles */
-
- s16b c_adj[6]; /* Class stat modifier */
-
- s16b c_dis; /* class disarming */
- s16b c_dev; /* class magic devices */
- s16b c_sav; /* class saving throws */
- s16b c_stl; /* class stealth */
- s16b c_srh; /* class searching ability */
- s16b c_fos; /* class searching frequency */
- s16b c_thn; /* class to hit (normal) */
- s16b c_thb; /* class to hit (bows) */
-
- s16b x_dis; /* extra disarming */
- s16b x_dev; /* extra magic devices */
- s16b x_sav; /* extra saving throws */
- s16b x_stl; /* extra stealth */
- s16b x_srh; /* extra searching ability */
- s16b x_fos; /* extra searching frequency */
- s16b x_thn; /* extra to hit (normal) */
- s16b x_thb; /* extra to hit (bows) */
-
- s16b c_mhp; /* Class hit-dice adjustment */
- s16b c_exp; /* Class experience factor */
-
- s16b powers[4]; /* Powers of the class */
-
- s16b spell_book; /* Tval of spell books (if any) */
- s16b spell_stat; /* Stat for spells (if any) */
- s16b spell_lev; /* The higher it is the higher the spells level are */
- s16b spell_fail; /* The higher it is the higher the spells failure are */
- s16b spell_mana; /* The higher it is the higher the spells mana are */
- s16b spell_first; /* Level of first spell */
- s16b spell_weight; /* Weight that hurts spells */
- byte max_spell_level; /* Maximun spell level */
- byte magic_max_spell; /* Maximun numbner of spells one can learn by natural means */
-
- u32b flags1; /* flags */
- u32b flags2; /* flags */
-
- s16b mana;
- s16b blow_num;
- s16b blow_wgt;
- s16b blow_mul;
- s16b extra_blows;
-
- s32b sense_base;
- s32b sense_pl;
- s32b sense_plus;
- byte sense_heavy;
- byte sense_heavy_magic;
-
- s16b obj_tval[5];
- s16b obj_sval[5];
- s16b obj_pval[5];
- s16b obj_dd[5];
- s16b obj_ds[5];
- s16b obj_num;
-
- char body_parts[BODY_MAX]; /* To help to decide what to use when body changing */
-
- u32b oflags1[PY_MAX_LEVEL + 1];
- u32b oflags2[PY_MAX_LEVEL + 1];
- u32b oflags3[PY_MAX_LEVEL + 1];
- u32b oflags4[PY_MAX_LEVEL + 1];
- u32b oflags5[PY_MAX_LEVEL + 1];
- u32b oesp[PY_MAX_LEVEL + 1];
- s16b opval[PY_MAX_LEVEL + 1];
-
- char skill_basem[MAX_SKILLS];
- u32b skill_base[MAX_SKILLS];
- char skill_modm[MAX_SKILLS];
- s16b skill_mod[MAX_SKILLS];
-
- u32b gods;
-
- player_spec spec[MAX_SPEC];
-
- struct
- {
- s16b ability;
- s16b level;
- } abilities[10]; /* Abilitiers to be gained by level(doesnt take prereqs in account) */
-};
-
-typedef struct meta_class_type meta_class_type;
-struct meta_class_type
-{
- char name[80]; /* Name */
- byte color;
- s16b *classes; /* list of classes */
-};
-
-/* Help type */
-typedef struct help_info help_info;
-struct help_info
-{
- bool_ enabled; /* ingame help enabled */
- bool_ activated[HELP_MAX]; /* help item #i activated? */
-};
-
-
-/*
- * Most of the "player" information goes here.
- *
- * This stucture gives us a large collection of player variables.
- *
- * This structure contains several "blocks" of information.
- * (1) the "permanent" info
- * (2) the "variable" info
- * (3) the "transient" info
- *
- * All of the "permanent" info, and most of the "variable" info,
- * is saved in the savefile. The "transient" info is recomputed
- * whenever anything important changes.
- */
-
-typedef struct player_type player_type;
-
-struct player_type
-{
- s32b lives; /* How many times we resurected */
-
- s16b oldpy; /* Previous player location -KMW- */
- s16b oldpx; /* Previous player location -KMW- */
-
- s16b py; /* Player location */
- s16b px; /* Player location */
-
- byte psex; /* Sex index */
- byte prace; /* Race index */
- byte pracem; /* Race Mod index */
- byte pclass; /* Class index */
- byte pspec; /* Class spec index */
- byte mimic_form; /* Actualy transformation */
- s16b mimic_level; /* Level of the mimic effect */
- byte oops; /* Unused */
-
- object_type inventory[INVEN_TOTAL]; /* Player inventory */
-
- byte hitdie; /* Hit dice (sides) */
- u16b expfact; /* Experience factor */
-
- byte preserve; /* Preserve artifacts */
- byte special; /* Special levels */
- byte allow_one_death; /* Blood of life */
-
- s16b age; /* Characters age */
- s16b ht; /* Height */
- s16b wt; /* Weight */
- s16b sc; /* Social Class */
-
-
- s32b au; /* Current Gold */
-
- s32b max_exp; /* Max experience */
- s32b exp; /* Cur experience */
- u16b exp_frac; /* Cur exp frac (times 2^16) */
-
- s16b lev; /* Level */
-
- s16b town_num; /* Current town number */
- s16b inside_quest; /* Inside quest level */
-
- s32b wilderness_x; /* Coordinates in the wilderness */
- s32b wilderness_y;
- bool_ wild_mode; /* TRUE = Small map, FLASE = Big map */
- bool_ old_wild_mode; /* TRUE = Small map, FLASE = Big map */
-
- s16b mhp; /* Max hit pts */
- s16b chp; /* Cur hit pts */
- u16b chp_frac; /* Cur hit frac (times 2^16) */
- s16b hp_mod; /* A modificator(permanent) */
-
- s16b msp; /* Max mana pts */
- s16b csp; /* Cur mana pts */
- u16b csp_frac; /* Cur mana frac (times 2^16) */
-
- s16b msane; /* Max sanity */
- s16b csane; /* Cur sanity */
- u16b csane_frac; /* Cur sanity frac */
-
- s32b grace; /* Your God's appreciation factor. */
- s32b grace_delay; /* Delay factor for granting piety. */
- byte pgod; /* Your God. */
- bool_ praying; /* Praying to your god. */
- s16b melkor_sacrifice; /* How much hp has been sacrified for damage */
-
- s16b max_plv; /* Max Player Level */
-
- s16b stat_max[6]; /* Current "maximal" stat values */
- s16b stat_cur[6]; /* Current "natural" stat values */
-
- s16b luck_cur; /* Current "natural" luck value (range -30 <> 30) */
- s16b luck_max; /* Current "maximal base" luck value (range -30 <> 30) */
- s16b luck_base; /* Current "base" luck value (range -30 <> 30) */
-
- s16b speed_factor; /* Timed -- Fast */
- s16b fast; /* Timed -- Fast */
- s16b lightspeed; /* Timed -- Light Speed */
- s16b slow; /* Timed -- Slow */
- s16b blind; /* Timed -- Blindness */
- s16b paralyzed; /* Timed -- Paralysis */
- s16b confused; /* Timed -- Confusion */
- s16b afraid; /* Timed -- Fear */
- s16b image; /* Timed -- Hallucination */
- s16b poisoned; /* Timed -- Poisoned */
- s16b cut; /* Timed -- Cut */
- s16b stun; /* Timed -- Stun */
-
- s16b protevil; /* Timed -- Protection from Evil*/
- s16b protgood; /* Timed -- Protection from Good*/
- s16b protundead; /* Timed -- Protection from Undead*/
- s16b invuln; /* Timed -- Invulnerable */
- s16b hero; /* Timed -- Heroism */
- s16b shero; /* Timed -- Super Heroism */
- s16b shield; /* Timed -- Shield Spell */
- s16b shield_power; /* Timed -- Shield Spell Power */
- s16b shield_opt; /* Timed -- Shield Spell options */
- s16b shield_power_opt; /* Timed -- Shield Spell Power */
- s16b shield_power_opt2; /* Timed -- Shield Spell Power */
- s16b blessed; /* Timed -- Blessed */
- s16b tim_invis; /* Timed -- See Invisible */
- s16b tim_infra; /* Timed -- Infra Vision */
-
- s16b oppose_acid; /* Timed -- oppose acid */
- s16b oppose_elec; /* Timed -- oppose lightning */
- s16b oppose_fire; /* Timed -- oppose heat */
- s16b oppose_cold; /* Timed -- oppose cold */
- s16b oppose_pois; /* Timed -- oppose poison */
- s16b oppose_ld; /* Timed -- oppose light & dark */
- s16b oppose_cc; /* Timed -- oppose chaos & confusion */
- s16b oppose_ss; /* Timed -- oppose sound & shards */
- s16b oppose_nex; /* Timed -- oppose nexus */
-
- s16b tim_esp; /* Timed ESP */
- s16b tim_wraith; /* Timed wraithform */
- s16b tim_ffall; /* Timed Levitation */
- s16b tim_fly; /* Timed Levitation */
- s16b tim_poison; /* Timed poison hands */
- s16b tim_thunder; /* Timed thunderstorm */
- s16b tim_thunder_p1; /* Timed thunderstorm */
- s16b tim_thunder_p2; /* Timed thunderstorm */
-
- s16b tim_project; /* Timed project upon melee blow */
- s16b tim_project_dam;
- s16b tim_project_gf;
- s16b tim_project_rad;
- s16b tim_project_flag;
-
- s16b tim_roots; /* Timed roots */
- s16b tim_roots_ac;
- s16b tim_roots_dam;
-
- s16b tim_invisible; /* Timed Invisibility */
- s16b tim_inv_pow; /* Power of timed invisibility */
- s16b tim_mimic; /* Timed Mimic */
- s16b tim_lite; /* Timed Lite */
- s16b tim_regen; /* Timed extra regen */
- s16b tim_regen_pow; /* Timed extra regen power */
- s16b holy; /* Holy Aura */
- s16b strike; /* True Strike(+25 hit) */
- s16b tim_reflect; /* Timed Reflection */
- s16b tim_deadly; /* Timed deadly blow */
- s16b prob_travel; /* Timed probability travel */
- s16b disrupt_shield;/* Timed disruption shield */
- s16b parasite; /* Timed parasite */
- s16b parasite_r_idx;/* Timed parasite monster */
- s16b absorb_soul; /* Timed soul absordtion */
- s16b tim_magic_breath; /* Magical breathing -- can breath anywhere */
- s16b tim_water_breath; /* Water breathing -- can breath underwater */
- s16b tim_precognition; /* Timed precognition */
-
- s16b immov_cntr; /* Timed -- Last ``immovable'' command. */
-
- s16b recall_dungeon; /* Recall in which dungeon */
- s16b word_recall; /* Word of recall counter */
-
- s32b energy; /* Current energy */
-
- s16b food; /* Current nutrition */
-
- byte confusing; /* Glowing hands */
- byte searching; /* Currently searching */
-
- bool_ old_cumber_armor;
- bool_ old_cumber_glove;
- bool_ old_heavy_wield;
- bool_ old_heavy_shoot;
- bool_ old_icky_wield;
-
- s16b old_lite; /* Old radius of lite (if any) */
- s16b old_view; /* Old radius of view (if any) */
-
- s16b old_food_aux; /* Old value of food */
-
-
- bool_ cumber_armor; /* Mana draining armor */
- bool_ cumber_glove; /* Mana draining gloves */
- bool_ heavy_wield; /* Heavy weapon */
- bool_ heavy_shoot; /* Heavy shooter */
- bool_ icky_wield; /* Icky weapon */
- bool_ immovable; /* Immovable character */
-
- s16b cur_lite; /* Radius of lite (if any) */
-
-
- u32b notice; /* Special Updates (bit flags) */
- u32b update; /* Pending Updates (bit flags) */
- u32b redraw; /* Normal Redraws (bit flags) */
- u32b window; /* Window Redraws (bit flags) */
-
- s16b stat_use[6]; /* Current modified stats */
- s16b stat_top[6]; /* Maximal modified stats */
-
- s16b stat_add[6]; /* Modifiers to stat values */
- s16b stat_ind[6]; /* Indexes into stat tables */
- s16b stat_cnt[6]; /* Counter for temporary drains */
- s16b stat_los[6]; /* Amount of temporary drains */
-
- bool_ immune_acid; /* Immunity to acid */
- bool_ immune_elec; /* Immunity to lightning */
- bool_ immune_fire; /* Immunity to fire */
- bool_ immune_cold; /* Immunity to cold */
- bool_ immune_neth; /* Immunity to nether */
-
- bool_ resist_acid; /* Resist acid */
- bool_ resist_elec; /* Resist lightning */
- bool_ resist_fire; /* Resist fire */
- bool_ resist_cold; /* Resist cold */
- bool_ resist_pois; /* Resist poison */
-
- bool_ resist_conf; /* Resist confusion */
- bool_ resist_sound; /* Resist sound */
- bool_ resist_lite; /* Resist light */
- bool_ resist_dark; /* Resist darkness */
- bool_ resist_chaos; /* Resist chaos */
- bool_ resist_disen; /* Resist disenchant */
- bool_ resist_shard; /* Resist shards */
- bool_ resist_nexus; /* Resist nexus */
- bool_ resist_blind; /* Resist blindness */
- bool_ resist_neth; /* Resist nether */
- bool_ resist_fear; /* Resist fear */
- bool_ resist_continuum; /* Resist space-time continuum disruption */
-
- bool_ sensible_fire; /* Fire does more damage on the player */
- bool_ sensible_lite; /* Lite does more damage on the player and blinds her/him */
-
- bool_ reflect; /* Reflect 'bolt' attacks */
- bool_ sh_fire; /* Fiery 'immolation' effect */
- bool_ sh_elec; /* Electric 'immolation' effect */
- bool_ wraith_form; /* wraithform */
-
- bool_ anti_magic; /* Anti-magic */
- bool_ anti_tele; /* Prevent teleportation */
-
- bool_ sustain_str; /* Keep strength */
- bool_ sustain_int; /* Keep intelligence */
- bool_ sustain_wis; /* Keep wisdom */
- bool_ sustain_dex; /* Keep dexterity */
- bool_ sustain_con; /* Keep constitution */
- bool_ sustain_chr; /* Keep charisma */
-
- bool_ aggravate; /* Aggravate monsters */
- bool_ teleport; /* Random teleporting */
-
- bool_ exp_drain; /* Experience draining */
- byte drain_mana; /* mana draining */
- byte drain_life; /* hp draining */
-
- bool_ magical_breath; /* Magical breathing -- can breath anywhere */
- bool_ water_breath; /* Water breathing -- can breath underwater */
- bool_ climb; /* Can climb mountains */
- bool_ fly; /* Can fly over some features */
- bool_ ffall; /* No damage falling */
- bool_ lite; /* Permanent light */
- bool_ free_act; /* Never paralyzed */
- bool_ see_inv; /* Can see invisible */
- bool_ regenerate; /* Regenerate hit pts */
- bool_ hold_life; /* Resist life draining */
- u32b telepathy; /* Telepathy */
- bool_ slow_digest; /* Slower digestion */
- bool_ bless_blade; /* Blessed blade */
- byte xtra_might; /* Extra might bow */
- bool_ impact; /* Earthquake blows */
- bool_ auto_id; /* Auto id items */
-
- s16b invis; /* Invisibility */
-
- s16b dis_to_h; /* Known bonus to hit */
- s16b dis_to_d; /* Known bonus to dam */
- s16b dis_to_a; /* Known bonus to ac */
-
- s16b dis_ac; /* Known base ac */
-
- s16b to_l; /* Bonus to life */
- s16b to_m; /* Bonus to mana */
- s16b to_s; /* Bonus to spell */
- s16b to_h; /* Bonus to hit */
- s16b to_d; /* Bonus to dam */
- s16b to_h_melee; /* Bonus to hit for melee */
- s16b to_d_melee; /* Bonus to dam for melee */
- s16b to_h_ranged; /* Bonus to hit for ranged */
- s16b to_d_ranged; /* Bonus to dam for ranged */
- s16b to_a; /* Bonus to ac */
-
- s16b ac; /* Base ac */
-
- byte antimagic; /* Power of the anti magic field */
- byte antimagic_dis; /* Radius of the anti magic field */
-
- s16b see_infra; /* Infravision range */
-
- s16b skill_dis; /* Skill: Disarming */
- s16b skill_dev; /* Skill: Magic Devices */
- s16b skill_sav; /* Skill: Saving throw */
- s16b skill_stl; /* Skill: Stealth factor */
- s16b skill_srh; /* Skill: Searching ability */
- s16b skill_fos; /* Skill: Searching frequency */
- s16b skill_thn; /* Skill: To hit (normal) */
- s16b skill_thb; /* Skill: To hit (shooting) */
- s16b skill_tht; /* Skill: To hit (throwing) */
- s16b skill_dig; /* Skill: Digging */
-
- s16b num_blow; /* Number of blows */
- s16b num_fire; /* Number of shots */
- s16b xtra_crit; /* % of increased crits */
-
- byte throw_mult; /* Multiplier for throw damage */
-
- byte tval_ammo; /* Correct ammo tval */
-
- s16b pspeed; /* Current speed */
-
- u32b mimic_extra; /* Mimicry powers use that */
- u32b antimagic_extra; /* Antimagic powers */
- u32b music_extra; /* Music songs */
- u32b necro_extra; /* Necro powers */
- u32b necro_extra2; /* Necro powers */
-
- s16b dodge_chance; /* Dodging chance */
-
- u32b maintain_sum; /* Do we have partial summons */
-
- byte spellbinder_num; /* Number of spells bound */
- u32b spellbinder[4]; /* Spell bounds */
- byte spellbinder_trigger; /* Spellbinder trigger condition */
-
- cptr mimic_name;
-
- char tactic; /* from 128-4 extremely coward to */
- /* 128+4 berserker */
- char movement; /* base movement way */
-
- s16b companion_killed; /* Number of companion death */
-
- bool_ no_mortal; /* Fated to never die by the hand of a mortal being */
-
- bool_ black_breath; /* The Tolkien's Black Breath */
-
- bool_ precognition; /* Like the cheat mode */
-
- /*** Extra flags -- used for lua and easying stuff ***/
- u32b xtra_f1;
- u32b xtra_f2;
- u32b xtra_f3;
- u32b xtra_f4;
- u32b xtra_f5;
- u32b xtra_esp;
-
- /* Corruptions */
- bool_ corruptions[CORRUPTIONS_MAX];
- bool_ corrupt_anti_teleport_stopped;
-
- /*** Pet commands ***/
- byte pet_follow_distance; /* Length of the imaginary "leash" for pets */
- byte pet_open_doors; /* flag - allow pets to open doors */
- byte pet_pickup_items; /* flag - allow pets to pickup items */
-
- s16b control; /* Controlled monster */
- byte control_dir; /* Controlled monster */
-
- /*** Body changing variables ***/
- u16b body_monster; /* In which body is the player */
- bool_ disembodied; /* Is the player in a body ? */
- byte body_parts[INVEN_TOTAL - INVEN_WIELD]; /* Which body parts does he have ? */
-
- /* Astral */
- bool_ astral; /* We started at the bottom ? */
-
- /* Powers */
- bool_ powers[POWER_MAX]; /* Actual powers */
- bool_ powers_mod[POWER_MAX]; /* Intrinsinc powers */
-
- /* Skills */
- s16b skill_points;
- s16b skill_last_level; /* Prevents gaining skills by losing level and regaining them */
- s16b melee_style; /* How are */
- s16b use_piercing_shots; /* for archery */
-
- /* Dripping Tread spell timer */
- s16b dripping_tread;
-
- /* Help */
- help_info help;
-
- /* Inertia control */
- s32b inertia_controlled_spell;
-
- /* For automatic stat-gain */
- s16b last_rewarded_level;
-
- /*** Temporary fields ***/
-
- bool_ did_nothing; /* True if the last action wasnt a real action */
- bool_ leaving; /* True if player is leaving */
-};
-
-
-/* For Monk martial arts */
-
-typedef struct martial_arts martial_arts;
-
-struct martial_arts
-{
- cptr desc; /* A verbose attack description */
- int min_level; /* Minimum level to use */
- int chance; /* Chance of 'success' */
- int dd; /* Damage dice */
- int ds; /* Damage sides */
- s16b effect; /* Special effects */
- s16b power; /* Special effects power */
-};
-
-
-
-/* Powers - used by Mindcrafters and Necromancers */
-typedef struct magic_power magic_power;
-
-struct magic_power
-{
- int min_lev;
- int mana_cost;
- int fail;
- cptr name;
- cptr desc;
-};
-
-/* Border */
-typedef struct border_type border_type;
-
-struct border_type
-{
- byte north[MAX_WID];
- byte south[MAX_WID];
- byte east[MAX_HGT];
- byte west[MAX_HGT];
- byte north_west;
- byte north_east;
- byte south_west;
- byte south_east;
-};
-
-
-/*
- * A structure describing a wilderness area
- * with a terrain, a town or a dungeon entrance
- */
-typedef struct wilderness_type_info wilderness_type_info;
-
-struct wilderness_type_info
-{
- const char *name; /* Name */
- const char *text; /* Text */
-
- u16b entrance; /* Which town is there(<1000 i's a town, >=1000 it a dungeon) */
- s32b wild_x; /* Map coordinates (backed out while parsing map) */
- s32b wild_y;
- byte road; /* Flags of road */
- int level; /* Difficulty level */
- u32b flags1; /* Some flags */
- byte feat; /* The feature of f_info.txt that is used to allow passing, ... and to get a char/color/graph */
- byte terrain_idx; /* Terrain index(defined in defines.h) */
-
- byte terrain[MAX_WILD_TERRAIN];/* Feature types for the plasma generator */
-};
-
-/*
- * A structure describing a wilderness map
- */
-typedef struct wilderness_map wilderness_map;
-
-struct wilderness_map
-{
- int feat; /* Wilderness feature */
- u32b seed; /* Seed for the RNG */
- u16b entrance; /* Entrance for dungeons */
-
- bool_ known; /* Is it seen by the player ? */
-};
-
-/*
- * A structure describing a town with
- * stores and buildings
- */
-typedef struct town_type town_type;
-struct town_type
-{
- cptr name;
- u32b seed; /* Seed for RNG */
- store_type *store; /* The stores [max_st_idx] */
- byte numstores;
-
- byte flags; /* Town flags */
- /* Left this for the sake of compatibility */
- bool_ stocked; /* Is the town actualy stocked ? */
-
- bool_ destroyed; /* Is the town destroyed? */
-};
-
-
-/* Alchemists */
-
-typedef struct tval_desc2
-{
- int tval;
- cptr desc;
-} tval_desc2;
-
-typedef struct alchemist_recipe alchemist_recipe;
-struct alchemist_recipe
-{
- int sval_essence;
- byte tval;
- byte sval;
- byte qty;
-};
-
-typedef struct artifact_select_flag artifact_select_flag;
-struct artifact_select_flag {
- byte group; /* Flag group to display it in */
- int flag; /* item flag to set */
- byte level; /* Player skill level to start at */
- char *desc; /* Display this description to select flag */
- u32b xp; /* xp cost for this flag */
- bool_ pval; /* indicates this flag benifits from pval */
- char *item_desc; /* Description of required item */
- char *item_descp; /* Description of required item; plural */
- byte rtval; /* Required items' tval */
- byte rsval; /* Required items' sval */
- int rpval; /* Required items' pval (zero for no req) */
- int rflag[6]; /* Monster Race flags for required Corpses */
-};
-
-/*
- A structure for deity information.
- */
-typedef struct deity_type deity_type;
-struct deity_type
-{
- int modules[3]; /* terminated with -1 */
- cptr name;
- char desc[10][80];
-};
-
-/* A structure for tactics */
-typedef struct tactic_info_type tactic_info_type;
-
-struct tactic_info_type
-{
- s16b to_hit;
- s16b to_dam;
- s16b to_ac;
- s16b to_stealth;
- s16b to_disarm;
- s16b to_saving;
- cptr name;
-};
-
-/* A structure to describe a random artifact. */
-typedef struct random_artifact random_artifact;
-
-struct random_artifact
-{
- char name_full[80]; /* Full name for the artifact */
- char name_short[80]; /* Un-Id'd name */
- byte level; /* Level of the artifact */
- byte attr; /* Color that is used on the screen */
- u32b cost; /* Object's value */
- byte activation; /* Activation. */
- s16b timeout; /* Timeout. */
- byte generated; /* Does it exist already? */
-};
-
-/* A structure to describe an activation. */
-typedef struct activation activation;
-
-struct activation
-{
- char desc[80]; /* Desc of the activation */
- u32b cost; /* costs value */
- s16b spell; /* Spell. */
-};
-
-/* A structure to describe a music. */
-typedef struct music music;
-
-struct music
-{
- char desc[80]; /* Desc of the music */
- s16b music; /* Music. */
- s16b dur; /* Duration(if any) */
- s16b init_recharge; /* Minimal recharge time */
- s16b turn_recharge; /* Recharge time for each more turn */
- byte min_inst; /* Minimum instrument for the music */
- byte rarity; /* Rarity of the music(use 100 to unallow to be randomly generated) */
-};
-
-/* A structure to describe the random spells of the Power Mages */
-typedef struct random_spell random_spell;
-
-struct random_spell
-{
- char desc[30]; /* Desc of the spell */
- char name[30]; /* Name of the spell */
- s16b mana; /* Mana cost */
- s16b fail; /* Failure rate */
- u32b proj_flags; /* Project function flags */
- byte GF; /* Type of the projection */
- byte radius;
- byte dam_sides;
- byte dam_dice;
- byte level; /* Level needed */
- bool_ untried; /* Is the spell was tried? */
-};
-
-/* A structure to describe the fate of the player */
-typedef struct fate fate;
-
-struct fate
-{
- byte fate; /* Which fate */
- byte level; /* On which level */
- byte serious; /* Is it sure? */
- s16b o_idx; /* Object to find */
- s16b e_idx; /* Ego-Item to find */
- s16b a_idx; /* Artifact to find */
- s16b v_idx; /* Vault to find */
- s16b r_idx; /* Monster to find */
- s16b count; /* Number of things */
- s16b time; /* Turn before */
- bool_ know; /* Has it been predicted? */
- bool_ icky; /* Hackish runtime-only flag */
-};
-
-/* A structure for movements */
-typedef struct move_info_type move_info_type;
-
-struct move_info_type
-{
- s16b to_speed;
- s16b to_search;
- s16b to_stealth;
- s16b to_percep;
- cptr name;
-};
-
-/* Define monster generation rules */
-typedef struct rule_type rule_type;
-struct rule_type
-{
- byte mode; /* Mode of combination of the monster flags */
- byte percent; /* Percent of monsters affected by the rule */
-
- u32b mflags1; /* The monster flags that are allowed */
- u32b mflags2;
- u32b mflags3;
- u32b mflags4;
- u32b mflags5;
- u32b mflags6;
- u32b mflags7;
- u32b mflags8;
- u32b mflags9;
-
- char r_char[5]; /* Monster race allowed */
-};
-
-/* A structure for the != dungeon types */
-typedef struct dungeon_info_type dungeon_info_type;
-struct dungeon_info_type
-{
- const char *name; /* Name */
- char *text; /* Description */
- char short_name[3]; /* Short name */
-
- char generator[30]; /* Name of the level generator */
-
- s16b floor1; /* Floor tile 1 */
- byte floor_percent1[2]; /* Chance of type 1 */
- s16b floor2; /* Floor tile 2 */
- byte floor_percent2[2]; /* Chance of type 2 */
- s16b floor3; /* Floor tile 3 */
- byte floor_percent3[2]; /* Chance of type 3 */
- s16b outer_wall; /* Outer wall tile */
- s16b inner_wall; /* Inner wall tile */
- s16b fill_type1; /* Cave tile 1 */
- byte fill_percent1[2]; /* Chance of type 1 */
- s16b fill_type2; /* Cave tile 2 */
- byte fill_percent2[2]; /* Chance of type 2 */
- s16b fill_type3; /* Cave tile 3 */
- byte fill_percent3[2]; /* Chance of type 3 */
- byte fill_method; /* Smoothing parameter for the above */
-
- s16b mindepth; /* Minimal depth */
- s16b maxdepth; /* Maximal depth */
-
- bool_ principal; /* If it's a part of the main dungeon */
- byte next; /* The next part of the main dungeon */
- byte min_plev; /* Minimal plev needed to enter -- it's an anti-cheating mesure */
-
- int min_m_alloc_level; /* Minimal number of monsters per level */
- int max_m_alloc_chance; /* There is a 1/max_m_alloc_chance chance per round of creating a new monster */
-
- u32b flags1; /* Flags 1 */
- u32b flags2; /* Flags 1 */
-
- int size_x, size_y; /* Desired numers of panels */
-
- byte rule_percents[100]; /* Flat rule percents */
- rule_type rules[5]; /* Monster generation rules */
-
- int final_object; /* The object you'll find at the bottom */
- int final_artifact; /* The artifact you'll find at the bottom */
- int final_guardian; /* The artifact's guardian. If an artifact is specified, then it's NEEDED */
-
- int ix, iy, ox, oy; /* Wilderness coordinates of the entrance/output of the dungeon */
-
- obj_theme objs; /* The drops type */
-
- int d_dice[4]; /* Number of dices */
- int d_side[4]; /* Number of sides */
- int d_frequency[4]; /* Frequency of damage (1 is the minimum) */
- int d_type[4]; /* Type of damage */
-
- s16b t_idx[TOWN_DUNGEON]; /* The towns */
- s16b t_level[TOWN_DUNGEON]; /* The towns levels */
- s16b t_num; /* Number of towns */
-};
-
-/* A structure for inscriptions */
-typedef struct inscription_info_type inscription_info_type;
-struct inscription_info_type
-{
- char text[40]; /* The inscription itself */
- byte when; /* When it is executed */
- bool_ know; /* Is the inscription know ? */
- byte mana; /* Grid mana needed */
-};
-
-/* To hold Runecrafters prefered spells */
-typedef struct rune_spell rune_spell;
-struct rune_spell
-{
- char name[30]; /* name */
-
- s16b type; /* Type of the spell(GF) */
- s16b rune2; /* Modifiers */
- s16b mana; /* Mana involved */
-};
-
-/* For level gaining artifacts, artifact creation, ... */
-typedef struct flags_group flags_group;
-struct flags_group
-{
- char name[30]; /* Name */
- byte color; /* Color */
-
- byte price; /* Price to "buy" it */
-
- u32b flags1; /* Flags set 1 */
- u32b flags2; /* Flags set 2 */
- u32b flags3; /* Flags set 3 */
- u32b flags4; /* Flags set 4 */
- u32b esp; /* ESP flags set */
-};
-
-/* For powers(racial, class, mutation, artifacts, ... */
-typedef struct power_type power_type;
-struct power_type
-{
- const char *name; /* Name */
- const char *desc_text; /* Text describing power */
- const char *gain_text; /* Text displayed on gaining the power */
- const char *lose_text; /* Text displayed on losing the power */
-
- byte level; /* Min level */
- byte cost; /* Mana/Life cost */
- byte stat; /* Stat used */
- byte diff; /* Difficulty */
-};
-
-/* Hooks */
-typedef struct hook_move_in hook_move_in;
-struct hook_move_in {
- int y;
- int x;
-};
-
-typedef struct hook_get_in hook_get_in;
-struct hook_get_in {
- object_type *o_ptr;
- int o_idx;
-};
-
-typedef struct hook_player_level_in hook_player_level_in;
-struct hook_player_level_in {
- int gained_levels;
-};
-
-typedef enum { IDENT_NORMAL, IDENT_FULL } identify_mode;
-
-typedef struct hook_identify_in hook_identify_in;
-struct hook_identify_in {
- object_type *o_ptr;
- identify_mode mode;
-};
-
-typedef struct hook_give_in hook_give_in;
-struct hook_give_in {
- int m_idx;
- int item;
-};
-
-typedef struct hook_mon_speak_in hook_mon_speak_in;
-struct hook_mon_speak_in {
- s32b m_idx;
- cptr m_name;
-};
-
-typedef struct hook_monster_death_in hook_monster_death_in;
-struct hook_monster_death_in {
- s32b m_idx;
-};
-
-typedef struct hook_monster_ai_in hook_monster_ai_in;
-struct hook_monster_ai_in {
- s32b m_idx;
- monster_type *m_ptr;
-};
-
-typedef struct hook_monster_ai_out hook_monster_ai_out;
-struct hook_monster_ai_out {
- s32b y;
- s32b x;
-};
-
-typedef struct hook_calculate_hp_in hook_calculate_hp_in;
-struct hook_calculate_hp_in {
- s32b mhp;
-};
-
-typedef struct hook_calculate_hp_out hook_calculate_hp_out;
-struct hook_calculate_hp_out {
- s32b mhp;
-};
-
-typedef struct hook_chat_in hook_chat_in;
-struct hook_chat_in {
- s32b m_idx;
-};
-
-typedef struct hook_enter_dungeon_in hook_enter_dungeon_in;
-struct hook_enter_dungeon_in {
- s32b d_idx;
-};
-
-typedef struct hook_wild_gen_in hook_wild_gen_in;
-struct hook_wild_gen_in {
- bool_ small;
-};
-
-typedef struct hook_build_room1_in hook_build_room1_in;
-struct hook_build_room1_in {
- s32b y;
- s32b x;
-};
-
-typedef struct hook_chardump_in hook_chardump_in;
-struct hook_chardump_in {
- FILE *file;
-};
-
-typedef struct hook_wield_in hook_wield_in;
-struct hook_wield_in {
- object_type *o_ptr;
-};
-
-typedef struct hook_drop_in hook_drop_in;
-struct hook_drop_in {
- int o_idx;
-};
-
-typedef struct hook_eat_in hook_eat_in;
-struct hook_eat_in {
- object_type *o_ptr;
-};
-
-typedef struct hook_eat_out hook_eat_out;
-struct hook_eat_out {
- bool_ ident;
-};
-
-typedef struct hook_quest_fail_in hook_quest_fail_in;
-struct hook_quest_fail_in {
- s16b q_idx;
-};
-
-typedef struct hook_quest_finish_in hook_quest_finish_in;
-struct hook_quest_finish_in {
- s32b q_idx;
-};
-
-typedef enum { STAIRS_UP, STAIRS_DOWN } stairs_direction;
-
-typedef struct hook_stair_in hook_stair_in;
-struct hook_stair_in {
- stairs_direction direction;
-};
-
-typedef struct hook_stair_out hook_stair_out;
-struct hook_stair_out {
- bool_ allow;
-};
-
-typedef struct hook_init_quest_in hook_init_quest_in;
-struct hook_init_quest_in {
- int q_idx;
-};
-
-typedef struct hook_new_monster_in hook_new_monster_in;
-struct hook_new_monster_in {
- s32b r_idx;
-};
-
-typedef struct hook_new_monster_end_in hook_new_monster_end_in;
-struct hook_new_monster_end_in {
- monster_type *m_ptr;
-};
-
-/*
- * Structure for the "quests"
- */
-typedef struct quest_type quest_type;
-
-struct quest_type
-{
- bool_ silent;
-
- char name[40]; /* Quest name */
-
- char desc[10][80]; /* Quest desc */
-
- s16b status; /* Is the quest taken, completed, finished? */
-
- s16b level; /* Dungeon level */
-
- s16b *plot; /* Which plot does it belongs to? */
-
- bool_ (*init)(int q); /* Function that takes care of generating hardcoded quests */
-
- s32b data[9]; /* Various datas used by the quests */
-
- bool_ (*gen_desc)(FILE *fff); /* Function for generating description. */
-};
-typedef struct random_quest random_quest;
-struct random_quest
-{
- byte type; /* Type/number of monsters to kill(0 = no quest) */
- s16b r_idx; /* Monsters to crush */
- bool_ done; /* Done ? */
-};
-
-/* Monster powers for player uses */
-typedef struct monster_power monster_power;
-struct monster_power
-{
- u32b power; /* Power RF?_xxx */
- cptr name; /* Name of it */
- int mana; /* Mana needed */
- bool_ great; /* Need the use of great spells */
-};
-
-/* Tval descs */
-typedef struct tval_desc tval_desc;
-struct tval_desc
-{
- int tval; /* tval */
- cptr desc; /* desc */
-};
-
-/*
- * Between exit
- */
-typedef struct between_exit between_exit;
-struct between_exit
-{
- s16b corresp; /* Corresponding between gate */
- bool_ dungeon; /* Do we exit in a dungeon or in the wild ? */
-
- s16b wild_x, wild_y; /* Wilderness spot to land onto */
- s16b px, py; /* Location of the map */
-
- s16b d_idx; /* Dungeon to land onto */
- s16b level;
-};
-
-/*
- * A structure to hold "rolled" information
- */
-typedef struct birther birther;
-struct birther
-{
- s16b sex;
- s16b race;
- s16b rmod;
- s16b pclass;
- s16b spec;
-
- byte quests;
-
- byte god;
- s32b grace;
- s32b god_favor;
-
- s16b age;
- s16b wt;
- s16b ht;
- s16b sc;
-
- s32b au;
-
- s16b stat[6];
- s16b luck;
-
- char history[4][60];
-
- bool_ quick_ok;
-};
-
-/*
- * Forward declare
- */
-typedef struct hist_type hist_type;
-
-/*
- * Player background information
- */
-struct hist_type
-{
- char *info; /* Textual History */
-
- byte roll; /* Frequency of this entry */
- s16b chart; /* Chart index */
- s16b next; /* Next chart index */
- byte bonus; /* Social Class Bonus + 50 */
-};
-
-/*
- * Item sets
- */
-typedef struct set_type set_type;
-struct set_type
-{
- const char *name; /* Name */
- char *desc; /* Desc */
-
- byte num; /* Number of artifacts used */
- byte num_use; /* Number actually wore */
- struct /* the various items */
- {
- bool_ present; /* Is it actually wore ? */
- s16b a_idx; /* What artifact ? */
- s16b pval[6]; /* Pval for each combination */
- u32b flags1[6]; /* Flags */
- u32b flags2[6]; /* Flags */
- u32b flags3[6]; /* Flags */
- u32b flags4[6]; /* Flags */
- u32b flags5[6]; /* Flags */
- u32b esp[6]; /* Flags */
- } arts[6];
-};
-
-/* A structure for CLI commands. */
-typedef struct cli_comm cli_comm;
-struct cli_comm
-{
- cptr comm; /* Extended name of the command. */
- cptr descrip; /* Description of the command. */
- s16b key; /* Key to convert command to. */
-};
-
-/*
- * Skills !
- */
-typedef struct skill_type skill_type;
-struct skill_type
-{
- const char *name; /* Name */
- char *desc; /* Description */
-
- const char *action_desc; /* Action Description */
-
- s16b action_mkey; /* Action do to */
-
- s32b i_value; /* Actual value */
- s32b i_mod; /* Modifier(1 skill point = modifier skill) */
-
- s32b value; /* Actual value */
- s32b mod; /* Modifier(1 skill point = modifier skill) */
- s16b rate; /* Modifier decreasing rate */
-
- u32b uses; /* Number of times used */
-
- s16b action[MAX_SKILLS]; /* List of actions against other skills */
-
- s16b father; /* Father in the skill tree */
- bool_ dev; /* Is the branch developped ? */
- s16b order; /* Order in the tree */
- bool_ hidden; /* Innactive */
-
- byte random_gain_chance; /* random gain chance, still needs the flag */
-
- u32b flags1; /* Skill flags */
-};
-
-typedef struct school_type school_type;
-struct school_type
-{
- cptr name; /* Name */
- s16b skill; /* Skill used for that school */
- bool_ spell_power; /* Does spell power affect spells in this school? */
- bool_ sorcery; /* Does Sorcery affect this school? */
-
- int deity_idx; /* Deity; if <=0, no deity required */
- deity_type *deity; /* Direct pointer to deity */
-
- int (*bonus_levels)(); /* Calculate number of bonus levels */
-
- bool_ (*depends_satisfied)(); /* Are dependendies satisfied? */
-
- struct school_provider_list *providers; /* List of secondary providers of this school */
-};
-
-/*
- * Desc for GF_FOO
- */
-typedef struct gf_name_type gf_name_type;
-struct gf_name_type
-{
- int gf;
- cptr name;
-};
-
-/*
- * Timers
- */
-typedef struct timer_type timer_type;
-struct timer_type
-{
- timer_type *next; /* The next timer in the list */
-
- bool_ enabled; /* Is it currently counting? */
-
- s32b delay; /* Delay between activations */
- s32b countdown; /* The current number of turns passed, when it reaches delay it fires */
-
- void (*callback)(); /* The C function to call upon firing */
-};
-
-/**
- * Module metadata
- */
-typedef struct module_meta_type module_meta_type;
-struct module_meta_type
-{
- /* Module name */
- cptr name;
-
- /* Module version number */
- struct {
- s32b major;
- s32b minor;
- s32b patch;
- } version;
-
- /* Module author */
- struct {
- cptr name;
- cptr email;
- } author;
-
- /* Module description */
- cptr desc;
-
- /* Save file tag */
- cptr save_file_tag;
-
- /* Module directory */
- cptr module_dir;
-};
-
-/**
- * Modules
- */
-typedef struct module_type module_type;
-struct module_type
-{
- /* Metadata about the module: author, description, etc. */
- module_meta_type meta;
-
- /* Random artifact generation chances */
- struct {
- s32b weapon_chance;
- s32b armor_chance;
- s32b jewelry_chance;
- } randarts;
-
- /* Max player level. */
- int max_plev;
-
- /* Skills */
- struct {
- /* Skill points per level */
- s32b skill_per_level;
- /* Maximum "overage" for skill points, i.e. how many skill
- points you can go above your current level. */
- s32b max_skill_overage;
- } skills;
-
- /* Function to show introduction to module */
- void (*intro)();
-
- /* Function to compute race status, i.e. whether monsters
- are friendly/neutral towards the player. Returns NULL
- to indicate that no override happens. */
- s16b *(*race_status)(int r_idx);
-};
diff --git a/src/types_fwd.h b/src/types_fwd.h
deleted file mode 100644
index 3fa523d..0000000
--- a/src/types_fwd.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct obj_theme;
-struct feature_type;
-struct object_kind;
-struct artifact_type;
-struct ego_item_type;
-struct randart_part_type;
-struct randart_gen_type;
-struct monster_blow;
-struct monster_race;
-struct monster_ego;
-struct vault_type;
-struct trap_type;
-struct cave_type;
-struct effect_type;
-struct object_type;
-struct monster_type;
-struct alloc_entry;
-struct option_type;
-struct owner_type;
-struct store_type;
-struct store_info_type;
-struct store_action_type;
-struct player_sex;
-struct player_race;
-struct player_race_mod;
-struct player_spec;
-struct player_class;
-struct meta_class_type;
-struct help_info;
-struct player_type;
-struct martial_arts;
-struct magic_power;
-struct border_type;
-struct wilderness_type_info;
-struct wilderness_map;
-struct town_type;
-struct alchemist_recipe;
-struct artifact_select_flag;
-struct deity_type;
-struct tactic_info_type;
-struct random_artifact;
-struct activation;
-struct music;
-struct random_spell;
-struct fate;
-struct move_info_type;
-struct rule_type;
-struct dungeon_info_type;
-struct inscription_info_type;
-struct rune_spell;
-struct flags_group;
-struct power_type;
-struct quest_type;
-struct random_quest;
-struct monster_power;
-struct tval_desc;
-struct between_exit;
-struct birther;
-struct hist_type;
-struct set_type;
-struct cli_comm;
-struct skill_type;
-struct spell_type;
-struct school_provider_list;
-struct school_type;
-struct gf_name_type;
-struct timer_type;
-struct module_meta_type;
-struct module_type;
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/util.cc b/src/util.cc
index 65143e5..675a02d 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -5,15 +5,22 @@
#include "util.hpp"
#include "util.h"
-#include "angband.h"
+#include "cli_comm.hpp"
#include "cmd3.hpp"
#include "cmd4.hpp"
#include "init1.hpp"
#include "messages.hpp"
+#include "monster_ego.hpp"
+#include "monster_race.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
#include "tables.h"
#include "tables.hpp"
+#include "timer_type.hpp"
#include "variable.h"
#include "variable.hpp"
#include "xtra1.hpp"
diff --git a/src/util.hpp b/src/util.hpp
index 8b38992..5cb2f05 100644
--- a/src/util.hpp
+++ b/src/util.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "timer_type_fwd.hpp"
#include <vector>
#include <string>
diff --git a/src/variable.cc b/src/variable.cc
index 36c8539..ca4aca0 100644
--- a/src/variable.cc
+++ b/src/variable.cc
@@ -8,6 +8,10 @@
#include "variable.hpp"
#include "variable.h"
+
+#include "cli_comm_fwd.hpp"
+#include "player_type.hpp"
+#include "randart_gen_type.hpp"
#include "util.hpp"
@@ -1050,7 +1054,7 @@ const char *get_version_string()
/*
* A list of tvals and their textual names
*/
-tval_desc2 tvals[] =
+tval_desc tvals[] =
{
{ TV_SWORD, "Sword" },
{ TV_POLEARM, "Polearm" },
diff --git a/src/variable.h b/src/variable.h
index 3687ec9..90a462b 100644
--- a/src/variable.h
+++ b/src/variable.h
@@ -2,7 +2,6 @@
#include "angband.h"
-// C linkage required for these functions since main-* code uses them.
#ifdef __cplusplus
extern "C" {
#endif
@@ -28,7 +27,6 @@ extern byte angband_color_table[256][4];
extern bool_ arg_wizard;
extern bool_ arg_force_original;
extern bool_ arg_force_roguelike;
-extern hist_type *bg;
extern bool_ character_generated;
extern bool_ character_icky;
extern bool_ inkey_flag;
diff --git a/src/variable.hpp b/src/variable.hpp
index 0db33f0..74c74f7 100644
--- a/src/variable.hpp
+++ b/src/variable.hpp
@@ -2,6 +2,52 @@
#include "angband.h"
#include "ability_type_fwd.hpp"
+#include "alchemist_recipe_fwd.hpp"
+#include "alloc_entry_fwd.hpp"
+#include "artifact_select_flag_fwd.hpp"
+#include "artifact_type_fwd.hpp"
+#include "birther.hpp"
+#include "cave_type_fwd.hpp"
+#include "deity_type.hpp"
+#include "dungeon_info_type_fwd.hpp"
+#include "effect_type.hpp"
+#include "ego_item_type_fwd.hpp"
+#include "fate.hpp"
+#include "feature_type_fwd.hpp"
+#include "hist_type_fwd.hpp"
+#include "meta_class_type_fwd.hpp"
+#include "monster_ego_fwd.hpp"
+#include "monster_race_fwd.hpp"
+#include "monster_type_fwd.hpp"
+#include "object_kind_fwd.hpp"
+#include "object_type_fwd.hpp"
+#include "owner_type_fwd.hpp"
+#include "player_class_fwd.hpp"
+#include "player_defs.hpp"
+#include "player_race_fwd.hpp"
+#include "player_race_mod_fwd.hpp"
+#include "player_sex_fwd.hpp"
+#include "player_spec_fwd.hpp"
+#include "player_type_fwd.hpp"
+#include "randart_gen_type_fwd.hpp"
+#include "randart_part_type_fwd.hpp"
+#include "random_artifact.hpp"
+#include "random_quest.hpp"
+#include "random_spell.hpp"
+#include "rune_spell.hpp"
+#include "school_type.hpp"
+#include "set_type_fwd.hpp"
+#include "skill_type_fwd.hpp"
+#include "skills_defs.hpp"
+#include "store_action_type_fwd.hpp"
+#include "store_info_type_fwd.hpp"
+#include "timer_type_fwd.hpp"
+#include "town_type_fwd.hpp"
+#include "trap_type_fwd.hpp"
+#include "tval_desc.hpp"
+#include "vault_type_fwd.hpp"
+#include "wilderness_map_fwd.hpp"
+#include "wilderness_type_info_fwd.hpp"
extern int max_macrotrigger;
extern char *macro_template;
@@ -267,4 +313,5 @@ extern s32b DUNGEON_ASTRAL_WILD_Y;
extern deity_type deity_info[MAX_GODS];
extern timer_type *gl_timers;
extern const char *get_version_string();
-extern tval_desc2 tvals[];
+extern tval_desc tvals[];
+extern hist_type *bg;
diff --git a/src/vault_type.hpp b/src/vault_type.hpp
new file mode 100644
index 0000000..650599c
--- /dev/null
+++ b/src/vault_type.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * Vault descriptors.
+ */
+struct vault_type
+{
+ char *data; /* Vault data */
+
+ byte typ; /* Vault type */
+
+ byte rat; /* Vault rating */
+
+ byte hgt; /* Vault height */
+ byte wid; /* Vault width */
+
+ s16b lvl; /* level of special (if any) */
+ byte dun_type; /* Dungeon type where the level will show up */
+
+ s16b mon[10]; /* special monster */
+ int item[3]; /* number of item (usually artifact) */
+};
diff --git a/src/vault_type_fwd.hpp b/src/vault_type_fwd.hpp
new file mode 100644
index 0000000..25ffd8c
--- /dev/null
+++ b/src/vault_type_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct vault_type;
diff --git a/src/wild.cc b/src/wild.cc
index 7e42bdb..e87648c 100644
--- a/src/wild.cc
+++ b/src/wild.cc
@@ -8,15 +8,24 @@
#include "wild.hpp"
-#include "angband.h"
#include "cave.hpp"
+#include "cave_type.hpp"
+#include "feature_type.hpp"
+#include "hook_wild_gen_in.hpp"
#include "hooks.hpp"
#include "init1.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "options.hpp"
+#include "player_type.hpp"
+#include "store_info_type.hpp"
#include "tables.hpp"
+#include "town_type.hpp"
#include "util.hpp"
#include "variable.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
#include <memory>
@@ -342,7 +351,23 @@ static int generate_area(int y, int x, bool_ border, bool_ corner)
/*
* Border of the wilderness area
*/
-static border_type border;
+namespace {
+
+ struct border_type
+ {
+ byte north[MAX_WID];
+ byte south[MAX_WID];
+ byte east[MAX_HGT];
+ byte west[MAX_HGT];
+ byte north_west;
+ byte north_east;
+ byte south_west;
+ byte south_east;
+ };
+
+ border_type border;
+
+}
/*
* Build the wilderness area outside of the town.
diff --git a/src/wilderness_map.hpp b/src/wilderness_map.hpp
new file mode 100644
index 0000000..41e873b
--- /dev/null
+++ b/src/wilderness_map.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "h-basic.h"
+
+/**
+ * A structure describing a wilderness map
+ */
+struct wilderness_map
+{
+ int feat; /* Wilderness feature */
+ u32b seed; /* Seed for the RNG */
+ u16b entrance; /* Entrance for dungeons */
+
+ bool_ known; /* Is it seen by the player ? */
+};
diff --git a/src/wilderness_map_fwd.hpp b/src/wilderness_map_fwd.hpp
new file mode 100644
index 0000000..806efb1
--- /dev/null
+++ b/src/wilderness_map_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct wilderness_map;
diff --git a/src/wilderness_type_info.hpp b/src/wilderness_type_info.hpp
new file mode 100644
index 0000000..bc23c03
--- /dev/null
+++ b/src/wilderness_type_info.hpp
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "h-basic.h"
+#include "terrain.hpp"
+
+/**
+ * A structure describing a wilderness area
+ * with a terrain, a town or a dungeon entrance
+ */
+struct wilderness_type_info
+{
+ const char *name; /* Name */
+ const char *text; /* Text */
+
+ u16b entrance; /* Which town is there(<1000 i's a town, >=1000 it a dungeon) */
+ s32b wild_x; /* Map coordinates (backed out while parsing map) */
+ s32b wild_y;
+ byte road; /* Flags of road */
+ int level; /* Difficulty level */
+ u32b flags1; /* Some flags */
+ byte feat; /* The feature of f_info.txt that is used to allow passing, ... and to get a char/color/graph */
+ byte terrain_idx; /* Terrain index(defined in defines.h) */
+
+ byte terrain[MAX_WILD_TERRAIN];/* Feature types for the plasma generator */
+};
diff --git a/src/wilderness_type_info_fwd.hpp b/src/wilderness_type_info_fwd.hpp
new file mode 100644
index 0000000..a206c9e
--- /dev/null
+++ b/src/wilderness_type_info_fwd.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+struct wilderness_type_info;
diff --git a/src/wizard1.cc b/src/wizard1.cc
index c8477ba..7e13980 100644
--- a/src/wizard1.cc
+++ b/src/wizard1.cc
@@ -1,9 +1,16 @@
#include "wizard1.hpp"
-#include "angband.h"
+#include "alchemist_recipe.hpp"
+#include "artifact_select_flag.hpp"
+#include "artifact_type.hpp"
#include "cmd7.hpp"
+#include "ego_item_type.hpp"
+#include "monster_race.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "object_type.hpp"
+#include "skill_type.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
diff --git a/src/wizard2.cc b/src/wizard2.cc
index 692bacb..c4f5436 100644
--- a/src/wizard2.cc
+++ b/src/wizard2.cc
@@ -8,25 +8,34 @@
#include "wizard2.hpp"
-#include "angband.h"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "cmd4.hpp"
#include "corrupt.hpp"
+#include "dungeon_info_type.hpp"
#include "files.hpp"
#include "hooks.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
+#include "player_type.hpp"
#include "randart.hpp"
#include "status.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
+#include "stats.hpp"
#include "tables.hpp"
#include "traps.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
#include "variable.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
#include "wizard1.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/xtra1.cc b/src/xtra1.cc
index bf1dce3..caa6abd 100644
--- a/src/xtra1.cc
+++ b/src/xtra1.cc
@@ -8,29 +8,44 @@
#include "xtra1.hpp"
-#include "angband.h"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "corrupt.hpp"
#include "cmd7.hpp"
+#include "dungeon_info_type.hpp"
#include "files.hpp"
#include "gods.hpp"
+#include "hook_calculate_hp_in.hpp"
+#include "hook_calculate_hp_out.hpp"
#include "hooks.hpp"
#include "levels.hpp"
#include "messages.hpp"
#include "mimic.hpp"
#include "monster1.hpp"
#include "monster2.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_class.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_type.hpp"
+#include "skill_type.hpp"
#include "skills.hpp"
#include "spells3.hpp"
#include "spells6.hpp"
+#include "stats.hpp"
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
#include "variable.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
#include "xtra2.hpp"
#include <cassert>
diff --git a/src/xtra1.hpp b/src/xtra1.hpp
index 5cd4f9f..df2592a 100644
--- a/src/xtra1.hpp
+++ b/src/xtra1.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
extern void fix_message(void);
extern void apply_flags(u32b f1, u32b f2, u32b f3, u32b f4, u32b f5, u32b esp, s16b pval, s16b tval, s16b to_h, s16b to_d, s16b to_a);
diff --git a/src/xtra2.cc b/src/xtra2.cc
index 07a8d57..7bddc54 100644
--- a/src/xtra2.cc
+++ b/src/xtra2.cc
@@ -8,31 +8,51 @@
#include "xtra2.hpp"
-#include "angband.h"
+#include "artifact_type.hpp"
#include "cave.hpp"
+#include "cave_type.hpp"
#include "corrupt.hpp"
+#include "dungeon_info_type.hpp"
+#include "ego_item_type.hpp"
+#include "feature_type.hpp"
#include "files.hpp"
#include "gods.hpp"
+#include "hook_player_level_in.hpp"
+#include "hook_monster_death_in.hpp"
#include "hooks.hpp"
#include "melee2.hpp"
#include "mimic.hpp"
#include "monster1.hpp"
#include "monster2.hpp"
#include "monster3.hpp"
+#include "monster_ego.hpp"
+#include "monster_race.hpp"
+#include "monster_type.hpp"
#include "notes.hpp"
#include "object1.hpp"
#include "object2.hpp"
+#include "object_kind.hpp"
#include "options.hpp"
+#include "player_class.hpp"
+#include "player_race.hpp"
+#include "player_race_mod.hpp"
+#include "player_type.hpp"
#include "quark.hpp"
#include "randart.hpp"
+#include "skill_type.hpp"
#include "skills.hpp"
#include "spells1.hpp"
#include "spells2.hpp"
+#include "stats.hpp"
+#include "store_info_type.hpp"
#include "tables.hpp"
+#include "trap_type.hpp"
#include "util.hpp"
#include "util.h"
#include "variable.h"
#include "variable.hpp"
+#include "wilderness_map.hpp"
+#include "wilderness_type_info.hpp"
#include "wizard2.hpp"
#include "xtra1.hpp"
diff --git a/src/xtra2.hpp b/src/xtra2.hpp
index 14693e7..cb16f6d 100644
--- a/src/xtra2.hpp
+++ b/src/xtra2.hpp
@@ -1,6 +1,9 @@
#pragma once
-#include "angband.h"
+#include "h-basic.h"
+#include "monster_race_fwd.hpp"
+#include "object_type_fwd.hpp"
+#include "player_race_mod_fwd.hpp"
extern void do_rebirth(void);
extern void set_subrace_title(player_race_mod *rmp_ptr, cptr name);
diff --git a/src/z-term.c b/src/z-term.c
index 7d1d596..891c10f 100644
--- a/src/z-term.c
+++ b/src/z-term.c
@@ -1,5 +1,3 @@
-/* File: z-term.c */
-
/*
* Copyright (c) 1997 Ben Harrison
*
@@ -10,8 +8,6 @@
/* Purpose: a generic, efficient, terminal window package -BEN- */
-#include "angband.h"
-
#include "z-term.h"
diff --git a/src/z-term.h b/src/z-term.h
index dae3200..a52a5c2 100644
--- a/src/z-term.h
+++ b/src/z-term.h
@@ -181,8 +181,32 @@ struct term
+/*** Color constants ***/
+/*
+ * Angband "attributes" (with symbols, and base (R,G,B) codes)
+ *
+ * The "(R,G,B)" codes are given in "fourths" of the "maximal" value,
+ * and should "gamma corrected" on most (non-Macintosh) machines.
+ */
+#define TERM_DARK 0 /* 'd' */ /* 0,0,0 */
+#define TERM_WHITE 1 /* 'w' */ /* 4,4,4 */
+#define TERM_SLATE 2 /* 's' */ /* 2,2,2 */
+#define TERM_ORANGE 3 /* 'o' */ /* 4,2,0 */
+#define TERM_RED 4 /* 'r' */ /* 3,0,0 */
+#define TERM_GREEN 5 /* 'g' */ /* 0,2,1 */
+#define TERM_BLUE 6 /* 'b' */ /* 0,0,4 */
+#define TERM_UMBER 7 /* 'u' */ /* 2,1,0 */
+#define TERM_L_DARK 8 /* 'D' */ /* 1,1,1 */
+#define TERM_L_WHITE 9 /* 'W' */ /* 3,3,3 */
+#define TERM_VIOLET 10 /* 'v' */ /* 4,0,4 */
+#define TERM_YELLOW 11 /* 'y' */ /* 4,4,0 */
+#define TERM_L_RED 12 /* 'R' */ /* 4,0,0 */
+#define TERM_L_GREEN 13 /* 'G' */ /* 0,4,0 */
+#define TERM_L_BLUE 14 /* 'B' */ /* 0,4,4 */
+#define TERM_L_UMBER 15 /* 'U' */ /* 3,2,1 */
+
/**** Available Constants ****/