summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:12:00 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:12:00 +0100
commitfe6ebd4af16244a02e16eb095181c0d8d5c56858 (patch)
treebe3fdab4a373834bfa8af75f2fe9591b96bafd76
parent0d1cf29b266e5df8394ca21f97e17ed3d937a4f7 (diff)
Move cave.cc function declarations to separate header
-rw-r--r--src/cave.cc47
-rw-r--r--src/cave.hpp39
-rw-r--r--src/cmd1.cc1
-rw-r--r--src/cmd2.cc1
-rw-r--r--src/cmd3.cc6
-rw-r--r--src/cmd5.cc1
-rw-r--r--src/cmd6.cc1
-rw-r--r--src/cmd7.cc6
-rw-r--r--src/dungeon.cc1
-rw-r--r--src/externs.h38
-rw-r--r--src/files.cc1
-rw-r--r--src/gen_evol.cc2
-rw-r--r--src/gen_maze.cc2
-rw-r--r--src/generate.cc5
-rw-r--r--src/init1.cc1
-rw-r--r--src/init2.cc5
-rw-r--r--src/melee1.cc1
-rw-r--r--src/melee2.cc17
-rw-r--r--src/monster2.cc1
-rw-r--r--src/object1.cc5
-rw-r--r--src/object2.cc5
-rw-r--r--src/powers.cc5
-rw-r--r--src/q_betwen.cc2
-rw-r--r--src/q_dragons.cc2
-rw-r--r--src/q_eol.cc3
-rw-r--r--src/q_evil.cc2
-rw-r--r--src/q_haunted.cc2
-rw-r--r--src/q_hobbit.cc3
-rw-r--r--src/q_invas.cc2
-rw-r--r--src/q_nazgul.cc3
-rw-r--r--src/q_nirna.cc2
-rw-r--r--src/q_poison.cc2
-rw-r--r--src/q_rand.cc3
-rw-r--r--src/q_shroom.cc3
-rw-r--r--src/q_spider.cc1
-rw-r--r--src/q_thief.cc2
-rw-r--r--src/q_thrain.cc1
-rw-r--r--src/q_troll.cc3
-rw-r--r--src/q_ultrag.cc2
-rw-r--r--src/q_wight.cc3
-rw-r--r--src/q_wolves.cc2
-rw-r--r--src/spells1.cc1
-rw-r--r--src/spells2.cc1
-rw-r--r--src/spells3.cc11
-rw-r--r--src/spells4.cc7
-rw-r--r--src/store.cc3
-rw-r--r--src/traps.cc1
-rw-r--r--src/wild.cc5
-rw-r--r--src/wizard2.cc1
-rw-r--r--src/xtra1.cc1
-rw-r--r--src/xtra2.cc1
51 files changed, 149 insertions, 117 deletions
diff --git a/src/cave.cc b/src/cave.cc
index 8d78a75..7136e06 100644
--- a/src/cave.cc
+++ b/src/cave.cc
@@ -1,7 +1,4 @@
-/* File: cave.c */
-
-/* Purpose: low level dungeon routines -BEN- */
-
+#include "cave.hpp"
#include "angband.h"
#include "q_rand.h"
@@ -4502,33 +4499,16 @@ void disturb(int stop_search)
}
-/*
- * Hack -- Check if a level is a "quest" level
- */
-int is_quest(int level)
-{
- int i = random_quest_number();
-
- /* Check quests */
- if (p_ptr->inside_quest)
- return (p_ptr->inside_quest);
-
- if (i) return (QUEST_RANDOM);
-
- /* Nope */
- return (0);
-}
-
/*
* Return the index of the random quest on this level
* (or zero)
*/
-int random_quest_number()
+static int random_quest_number()
{
if ((dun_level >= 1) && (dun_level < MAX_RANDOM_QUEST) &&
- (dungeon_flags1 & DF1_PRINCIPAL) &&
- (random_quests[dun_level].type) &&
+ (dungeon_flags1 & DF1_PRINCIPAL) &&
+ (random_quests[dun_level].type) &&
(!random_quests[dun_level].done) &&
(!is_randhero(dun_level)))
{
@@ -4540,6 +4520,25 @@ int random_quest_number()
}
+
+/*
+ * Hack -- Check if a level is a "quest" level
+ */
+int is_quest(int level)
+{
+ int i = random_quest_number();
+
+ /* Check quests */
+ if (p_ptr->inside_quest)
+ return (p_ptr->inside_quest);
+
+ if (i) return (QUEST_RANDOM);
+
+ /* Nope */
+ return (0);
+}
+
+
/*
* handle spell effects
*/
diff --git a/src/cave.hpp b/src/cave.hpp
new file mode 100644
index 0000000..612d93b
--- /dev/null
+++ b/src/cave.hpp
@@ -0,0 +1,39 @@
+#pragma once
+
+#include "angband.h"
+
+extern int distance(int y1, int x1, int y2, int x2);
+extern bool_ los(int y1, int x1, int y2, int x2);
+extern bool_ cave_valid_bold(int y, int x);
+extern bool_ no_lite(void);
+extern void map_info_default(int y, int x, byte *ap, char *cp);
+extern void move_cursor_relative(int row, int col);
+extern void print_rel(char c, byte a, int y, int x);
+extern void note_spot(int y, int x);
+extern void lite_spot(int y, int x);
+extern void prt_map(void);
+extern void display_map(int *cy, int *cx);
+extern void do_cmd_view_map(void);
+extern errr vinfo_init(void);
+extern void forget_view(void);
+extern void update_view(void);
+extern void forget_mon_lite(void);
+extern void update_mon_lite(void);
+extern void update_flow(void);
+extern void map_area(void);
+extern void wiz_lite(void);
+extern void wiz_lite_extra(void);
+extern void wiz_dark(void);
+extern void cave_set_feat(int y, int x, int feat);
+extern void place_floor(int y, int x);
+extern void place_floor_convert_glass(int y, int x);
+extern void place_filler(int y, int x);
+extern void mmove2(int *y, int *x, int y1, int x1, int y2, int x2);
+extern bool_ projectable(int y1, int x1, int y2, int x2);
+extern void scatter(int *yp, int *xp, int y, int x, int d);
+extern void health_track(int m_idx);
+extern void monster_race_track(int r_idx, int ego);
+extern void object_track(object_type *o_ptr);
+extern void disturb(int stop_search);
+extern int is_quest(int level);
+extern int new_effect(int type, int dam, int time, int cy, int cx, int rad, s32b flags);
diff --git a/src/cmd1.cc b/src/cmd1.cc
index 46effe4..bd351d0 100644
--- a/src/cmd1.cc
+++ b/src/cmd1.cc
@@ -7,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "gods.hpp"
#include "hooks.h"
#include "mimic.hpp"
diff --git a/src/cmd2.cc b/src/cmd2.cc
index 939624a..f637178 100644
--- a/src/cmd2.cc
+++ b/src/cmd2.cc
@@ -8,6 +8,7 @@
#include "angband.h"
#include "bldg.hpp"
+#include "cave.hpp"
#include "gods.hpp"
#include "hooks.h"
#include "skills.hpp"
diff --git a/src/cmd3.cc b/src/cmd3.cc
index 2d1a6f3..9084907 100644
--- a/src/cmd3.cc
+++ b/src/cmd3.cc
@@ -1,7 +1,3 @@
-/* File: cmd3.c */
-
-/* Purpose: Inventory commands */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -11,7 +7,7 @@
*/
#include "angband.h"
-
+#include "cave.hpp"
#include "gods.hpp"
#include "hooks.h"
#include "quark.h"
diff --git a/src/cmd5.cc b/src/cmd5.cc
index 97e972d..c5cbedc 100644
--- a/src/cmd5.cc
+++ b/src/cmd5.cc
@@ -8,6 +8,7 @@
#include "angband.h"
#include "birth.hpp"
+#include "cave.hpp"
#include "corrupt.hpp"
#include "skills.hpp"
#include "spell_type.hpp"
diff --git a/src/cmd6.cc b/src/cmd6.cc
index 5205a0f..834ac97 100644
--- a/src/cmd6.cc
+++ b/src/cmd6.cc
@@ -7,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "corrupt.hpp"
#include "hooks.h"
#include "lua_bind.hpp"
diff --git a/src/cmd7.cc b/src/cmd7.cc
index 86cef67..e13373c 100644
--- a/src/cmd7.cc
+++ b/src/cmd7.cc
@@ -1,7 +1,3 @@
-/* File: cmd7.c */
-
-/* Purpose: More Class commands */
-
/*
* Copyright (c) 1999 Dark God
*
@@ -10,8 +6,8 @@
* included in all such copies.
*/
-
#include "angband.h"
+#include "cave.hpp"
#include "hooks.h"
#include "mimic.hpp"
#include "quark.h"
diff --git a/src/dungeon.cc b/src/dungeon.cc
index 5a669aa..a561c9a 100644
--- a/src/dungeon.cc
+++ b/src/dungeon.cc
@@ -8,6 +8,7 @@
#include "angband.h"
#include "birth.hpp"
+#include "cave.hpp"
#include "corrupt.hpp"
#include "gods.hpp"
#include "hooks.h"
diff --git a/src/externs.h b/src/externs.h
index 8c5e707..ba005a2 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -471,44 +471,6 @@ extern void help_ability(cptr ability);
/* birth.c */
extern bool_ no_begin_screen;
-/* cave.c */
-extern int distance(int y1, int x1, int y2, int x2);
-extern bool_ los(int y1, int x1, int y2, int x2);
-extern bool_ cave_valid_bold(int y, int x);
-extern bool_ no_lite(void);
-extern void map_info_default(int y, int x, byte *ap, char *cp);
-extern void move_cursor_relative(int row, int col);
-extern void print_rel(char c, byte a, int y, int x);
-extern void note_spot(int y, int x);
-extern void lite_spot(int y, int x);
-extern void prt_map(void);
-extern void display_map(int *cy, int *cx);
-extern void do_cmd_view_map(void);
-extern errr vinfo_init(void);
-extern void forget_view(void);
-extern void update_view(void);
-extern void forget_mon_lite(void);
-extern void update_mon_lite(void);
-extern void update_flow(void);
-extern void map_area(void);
-extern void wiz_lite(void);
-extern void wiz_lite_extra(void);
-extern void wiz_dark(void);
-extern void cave_set_feat(int y, int x, int feat);
-extern void place_floor(int y, int x);
-extern void place_floor_convert_glass(int y, int x);
-extern void place_filler(int y, int x);
-extern void mmove2(int *y, int *x, int y1, int x1, int y2, int x2);
-extern bool_ projectable(int y1, int x1, int y2, int x2);
-extern void scatter(int *yp, int *xp, int y, int x, int d);
-extern void health_track(int m_idx);
-extern void monster_race_track(int r_idx, int ego);
-extern void object_track(object_type *o_ptr);
-extern void disturb(int stop_search);
-extern int is_quest(int level);
-extern int random_quest_number(void);
-extern int new_effect(int type, int dam, int time, int cy, int cx, int rad, s32b flags);
-
/* cmd1.c */
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/files.cc b/src/files.cc
index 77188e8..0c32794 100644
--- a/src/files.cc
+++ b/src/files.cc
@@ -7,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "corrupt.hpp"
#include "hiscore.h"
#include "hooks.h"
diff --git a/src/gen_evol.cc b/src/gen_evol.cc
index bfdfbd6..802a4a8 100644
--- a/src/gen_evol.cc
+++ b/src/gen_evol.cc
@@ -11,7 +11,7 @@
*/
#include "angband.h"
-
+#include "cave.hpp"
/*
* Generate a game of life level :) and make it evolve
diff --git a/src/gen_maze.cc b/src/gen_maze.cc
index 86f6d86..9fca14e 100644
--- a/src/gen_maze.cc
+++ b/src/gen_maze.cc
@@ -12,7 +12,7 @@
*/
#include "angband.h"
-
+#include "cave.hpp"
#include <memory>
/*
diff --git a/src/generate.cc b/src/generate.cc
index acaf5c1..8121666 100644
--- a/src/generate.cc
+++ b/src/generate.cc
@@ -1,7 +1,3 @@
-/* File: generate.c */
-
-/* Purpose: Dungeon generation */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -11,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "hooks.h"
#include "randart.hpp"
diff --git a/src/init1.cc b/src/init1.cc
index 0828768..25e933e 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -1,4 +1,5 @@
#include "angband.h"
+#include "cave.hpp"
#include "gods.hpp"
#include "skills.hpp"
diff --git a/src/init2.cc b/src/init2.cc
index 3842351..b6ce889 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -1,8 +1,5 @@
-/* File: init2.c */
-
-/* Purpose: Initialisation (part 2) -BEN- */
-
#include "angband.h"
+#include "cave.hpp"
#include "modules.hpp"
#include "messages.h"
#include "quark.h"
diff --git a/src/melee1.cc b/src/melee1.cc
index 4e6111b..946cde6 100644
--- a/src/melee1.cc
+++ b/src/melee1.cc
@@ -7,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "mimic.hpp"
#include "skills.hpp"
#include "store.hpp"
diff --git a/src/melee2.cc b/src/melee2.cc
index 6832eb3..bf294b9 100644
--- a/src/melee2.cc
+++ b/src/melee2.cc
@@ -1,14 +1,10 @@
-/* File: melee2.c */
-
-/* Purpose: Monster spells and movement */
-
/*
-* 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.
-*/
+ * 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 has several additions to it by Keldon Jones (keldon@umr.edu)
@@ -17,6 +13,7 @@
#include "angband.h"
+#include "cave.hpp"
#include "hooks.h"
#include "messages.h"
#include "quark.h"
diff --git a/src/monster2.cc b/src/monster2.cc
index d6c75f9..13f8654 100644
--- a/src/monster2.cc
+++ b/src/monster2.cc
@@ -6,6 +6,7 @@
* included in all such copies.
*/
#include "angband.h"
+#include "cave.hpp"
#include "hooks.h"
#include "mimic.hpp"
#include "randart.hpp"
diff --git a/src/object1.cc b/src/object1.cc
index fec6f1b..492cd9d 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -1,7 +1,3 @@
-/* File: object1.c */
-
-/* Purpose: Object code, part 1 */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -11,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "hooks.h"
#include "lua_bind.hpp"
#include "mimic.hpp"
diff --git a/src/object2.cc b/src/object2.cc
index 9c08ce9..5b46708 100644
--- a/src/object2.cc
+++ b/src/object2.cc
@@ -1,7 +1,3 @@
-/* File: object2.c */
-
-/* Purpose: Object code, part 2 */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -11,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "spell_type.hpp"
#include "device_allocation.h"
#include "hooks.h"
diff --git a/src/powers.cc b/src/powers.cc
index e62e2f1..2d4eda3 100644
--- a/src/powers.cc
+++ b/src/powers.cc
@@ -1,7 +1,3 @@
-/* File: powers.c */
-
-/* Purpose: Powers */
-
/*
* Copyright (c) 2001 James E. Wilson, Robert A. Koeneke, DarkGod
*
@@ -11,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "quark.h"
#include "hooks.h"
#include "mimic.hpp"
diff --git a/src/q_betwen.cc b/src/q_betwen.cc
index 117edeb..98d1557 100644
--- a/src/q_betwen.cc
+++ b/src/q_betwen.cc
@@ -1,4 +1,6 @@
#include "q_betwen.h"
+
+#include "cave.hpp"
#include "hooks.h"
#define cquest (quest[QUEST_BETWEEN])
diff --git a/src/q_dragons.cc b/src/q_dragons.cc
index 2ee537d..0ea831b 100644
--- a/src/q_dragons.cc
+++ b/src/q_dragons.cc
@@ -1,4 +1,6 @@
#include "q_dragons.h"
+
+#include "cave.hpp"
#include "hooks.h"
#define cquest (quest[QUEST_DRAGONS])
diff --git a/src/q_eol.cc b/src/q_eol.cc
index b00d433..1e7b6f0 100644
--- a/src/q_eol.cc
+++ b/src/q_eol.cc
@@ -1,5 +1,8 @@
#include "q_eol.h"
+
+#include "cave.hpp"
#include "hooks.h"
+
#include <cassert>
#define cquest (quest[QUEST_EOL])
diff --git a/src/q_evil.cc b/src/q_evil.cc
index da0816a..73972c9 100644
--- a/src/q_evil.cc
+++ b/src/q_evil.cc
@@ -1,4 +1,6 @@
#include "q_evil.h"
+
+#include "cave.hpp"
#include "hooks.h"
#define cquest (quest[QUEST_EVIL])
diff --git a/src/q_haunted.cc b/src/q_haunted.cc
index 7b6d7f1..ff3b69d 100644
--- a/src/q_haunted.cc
+++ b/src/q_haunted.cc
@@ -1,4 +1,6 @@
#include "q_haunted.h"
+
+#include "cave.hpp"
#include "hooks.h"
#define cquest (quest[QUEST_HAUNTED])
diff --git a/src/q_hobbit.cc b/src/q_hobbit.cc
index 10e6717..4d8085d 100644
--- a/src/q_hobbit.cc
+++ b/src/q_hobbit.cc
@@ -1,6 +1,9 @@
#include "q_hobbit.h"
+
+#include "cave.hpp"
#include "messages.h"
#include "hooks.h"
+
#include <cassert>
#define cquest (quest[QUEST_HOBBIT])
diff --git a/src/q_invas.cc b/src/q_invas.cc
index 983e84f..0a8c41b 100644
--- a/src/q_invas.cc
+++ b/src/q_invas.cc
@@ -1,4 +1,6 @@
#include "q_invas.h"
+
+#include "cave.hpp"
#include "hooks.h"
#define cquest (quest[QUEST_INVASION])
diff --git a/src/q_nazgul.cc b/src/q_nazgul.cc
index 32449f1..9e528ec 100644
--- a/src/q_nazgul.cc
+++ b/src/q_nazgul.cc
@@ -1,5 +1,8 @@
#include "q_nazgul.h"
+
+#include "cave.hpp"
#include "hooks.h"
+
#include <cassert>
#define cquest (quest[QUEST_NAZGUL])
diff --git a/src/q_nirna.cc b/src/q_nirna.cc
index 145c995..8f5678c 100644
--- a/src/q_nirna.cc
+++ b/src/q_nirna.cc
@@ -1,4 +1,6 @@
#include "q_nirna.h"
+
+#include "cave.hpp"
#include "hooks.h"
#define cquest (quest[QUEST_NIRNAETH])
diff --git a/src/q_poison.cc b/src/q_poison.cc
index 29993ff..98d29d7 100644
--- a/src/q_poison.cc
+++ b/src/q_poison.cc
@@ -1,4 +1,6 @@
#include "q_poison.h"
+
+#include "cave.hpp"
#include "quark.h"
#include "messages.h"
#include "hooks.h"
diff --git a/src/q_rand.cc b/src/q_rand.cc
index fd4f8ef..57c0c4d 100644
--- a/src/q_rand.cc
+++ b/src/q_rand.cc
@@ -1,8 +1,11 @@
#include "q_rand.h"
+
+#include "cave.hpp"
#include "hooks.h"
#include "skills.hpp"
#include "util.hpp"
#include "messages.h"
+
#include <cassert>
static int randquest_hero[] = { 20, 13, 15, 16, 9, 17, 18, 8, -1 };
diff --git a/src/q_shroom.cc b/src/q_shroom.cc
index 97d7627..b512484 100644
--- a/src/q_shroom.cc
+++ b/src/q_shroom.cc
@@ -1,6 +1,9 @@
#include "q_shroom.h"
+
+#include "cave.hpp"
#include "messages.h"
#include "hooks.h"
+
#include <cassert>
#define cquest (quest[QUEST_SHROOM])
diff --git a/src/q_spider.cc b/src/q_spider.cc
index 63f21fe..dbee425 100644
--- a/src/q_spider.cc
+++ b/src/q_spider.cc
@@ -1,5 +1,6 @@
#include "q_spider.h"
+#include "cave.hpp"
#include "gods.hpp"
#include "hooks.h"
diff --git a/src/q_thief.cc b/src/q_thief.cc
index cc4bd5a..425c8e9 100644
--- a/src/q_thief.cc
+++ b/src/q_thief.cc
@@ -1,4 +1,6 @@
#include "q_thief.h"
+
+#include "cave.hpp"
#include "hooks.h"
#define cquest (quest[QUEST_THIEVES])
diff --git a/src/q_thrain.cc b/src/q_thrain.cc
index ba5ba56..1590304 100644
--- a/src/q_thrain.cc
+++ b/src/q_thrain.cc
@@ -1,5 +1,6 @@
#include "q_thrain.h"
+#include "cave.hpp"
#include "hooks.h"
#include "quark.h"
#include "randart.hpp"
diff --git a/src/q_troll.cc b/src/q_troll.cc
index 39e4a28..5d547b1 100644
--- a/src/q_troll.cc
+++ b/src/q_troll.cc
@@ -1,5 +1,8 @@
#include "q_troll.h"
+
+#include "cave.hpp"
#include "hooks.h"
+
#include <cassert>
#define cquest (quest[QUEST_TROLL])
diff --git a/src/q_ultrag.cc b/src/q_ultrag.cc
index 28cce00..90f90e6 100644
--- a/src/q_ultrag.cc
+++ b/src/q_ultrag.cc
@@ -1,4 +1,6 @@
#include "q_ultrag.h"
+
+#include "cave.hpp"
#include "hooks.h"
#define cquest (quest[QUEST_ULTRA_GOOD])
diff --git a/src/q_wight.cc b/src/q_wight.cc
index 68794ea..a07c617 100644
--- a/src/q_wight.cc
+++ b/src/q_wight.cc
@@ -1,6 +1,9 @@
#include "q_wight.h"
+
+#include "cave.hpp"
#include "quark.h"
#include "hooks.h"
+
#include <cassert>
#define cquest (quest[QUEST_WIGHT])
diff --git a/src/q_wolves.cc b/src/q_wolves.cc
index 1afa0fb..9a68c7c 100644
--- a/src/q_wolves.cc
+++ b/src/q_wolves.cc
@@ -1,4 +1,6 @@
#include "q_wolves.h"
+
+#include "cave.hpp"
#include "hooks.h"
#define cquest (quest[QUEST_WOLVES])
diff --git a/src/spells1.cc b/src/spells1.cc
index 7cf56ac..90c728c 100644
--- a/src/spells1.cc
+++ b/src/spells1.cc
@@ -7,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "gods.hpp"
#include "skills.hpp"
#include "spell_type.hpp"
diff --git a/src/spells2.cc b/src/spells2.cc
index 9cbeb33..c03123f 100644
--- a/src/spells2.cc
+++ b/src/spells2.cc
@@ -7,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "hooks.h"
#include "notes.hpp"
#include "skills.hpp"
diff --git a/src/spells3.cc b/src/spells3.cc
index 4cd65c0..531e5c6 100644
--- a/src/spells3.cc
+++ b/src/spells3.cc
@@ -1,15 +1,16 @@
#include "spells3.hpp"
-#include "spells5.hpp"
-#include "angband.h"
-
-#include <assert.h>
+#include "angband.h"
+#include "cave.hpp"
+#include "skills.hpp"
#include "spell_type.hpp"
#include "spell_idx_list.hpp"
-#include "skills.hpp"
+#include "spells5.hpp"
#include "mimic.hpp"
#include "xtra2.hpp"
+#include <algorithm>
+#include <cassert>
#include <vector>
s32b NOXIOUSCLOUD = -1; /* Identifier */
diff --git a/src/spells4.cc b/src/spells4.cc
index c0e3e9a..34b39c5 100644
--- a/src/spells4.cc
+++ b/src/spells4.cc
@@ -1,8 +1,6 @@
#include "angband.h"
-#include <assert.h>
-#include <sstream>
-
+#include "cave.hpp"
#include "gods.hpp"
#include "lua_bind.hpp"
#include "spell_type.hpp"
@@ -11,6 +9,9 @@
#include "spells5.hpp"
#include <algorithm>
+#include <cassert>
+#include <sstream>
+
school_book_type school_books[SCHOOL_BOOKS_SIZE];
s32b SCHOOL_AIR;
diff --git a/src/store.cc b/src/store.cc
index 9bb5023..7f7bef8 100644
--- a/src/store.cc
+++ b/src/store.cc
@@ -9,9 +9,10 @@
#include "store.hpp"
#include "bldg.hpp"
+#include "cave.hpp"
#include "hooks.h"
-#include "spell_type.hpp"
#include "quark.h"
+#include "spell_type.hpp"
#include "skills.hpp"
#include "spells5.hpp"
#include "xtra1.hpp"
diff --git a/src/traps.cc b/src/traps.cc
index d9056f8..ba78a3c 100644
--- a/src/traps.cc
+++ b/src/traps.cc
@@ -8,6 +8,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "gods.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/wild.cc b/src/wild.cc
index 35d526d..c9e64bc 100644
--- a/src/wild.cc
+++ b/src/wild.cc
@@ -1,7 +1,3 @@
-/* File: generate.c */
-
-/* Purpose: Wilderness & Town related things */
-
/*
* Copyright (c) 2001 James E. Wilson, Robert A. Koeneke, DarkGod
*
@@ -11,6 +7,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "hooks.h"
#include <memory>
diff --git a/src/wizard2.cc b/src/wizard2.cc
index b98b713..3f99726 100644
--- a/src/wizard2.cc
+++ b/src/wizard2.cc
@@ -11,6 +11,7 @@
*/
#include "angband.h"
+#include "cave.hpp"
#include "corrupt.hpp"
#include "hooks.h"
#include "randart.hpp"
diff --git a/src/xtra1.cc b/src/xtra1.cc
index 10e35c6..24381af 100644
--- a/src/xtra1.cc
+++ b/src/xtra1.cc
@@ -9,6 +9,7 @@
#include "xtra1.hpp"
#include "angband.h"
+#include "cave.hpp"
#include "corrupt.hpp"
#include "gods.hpp"
#include "hooks.h"
diff --git a/src/xtra2.cc b/src/xtra2.cc
index 63e2f45..75624c5 100644
--- a/src/xtra2.cc
+++ b/src/xtra2.cc
@@ -9,6 +9,7 @@
#include "xtra2.hpp"
#include "angband.h"
+#include "cave.hpp"
#include "corrupt.hpp"
#include "gods.hpp"
#include "hooks.h"