summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/angband.h13
-rw-r--r--src/birth.cc1
-rw-r--r--src/bldg.cc1
-rw-r--r--src/cmd1.cc4
-rw-r--r--src/cmd6.cc3
-rw-r--r--src/cmd7.cc4
-rw-r--r--src/externs.h10
-rw-r--r--src/files.cc2
-rw-r--r--src/melee1.cc1
-rw-r--r--src/mimic.cc30
-rw-r--r--src/mimic.hpp10
-rw-r--r--src/monster2.cc1
-rw-r--r--src/object1.cc1
-rw-r--r--src/object2.cc1
-rw-r--r--src/powers.cc2
-rw-r--r--src/randart.cc2
-rw-r--r--src/spells3.cc1
-rw-r--r--src/types.h26
-rw-r--r--src/types_fwd.h2
-rw-r--r--src/xtra1.cc1
-rw-r--r--src/xtra2.cc7
21 files changed, 59 insertions, 64 deletions
diff --git a/src/angband.h b/src/angband.h
index 3284dd9a..73aad517 100644
--- a/src/angband.h
+++ b/src/angband.h
@@ -1,9 +1,4 @@
-/* File: angband.h */
-
-/* Main "Angband" header file */
-
-#ifndef INCLUDED_ANGBAND_H
-#define INCLUDED_ANGBAND_H
+#pragma once
/*
* Copyright (c) 1989 James E. Wilson
@@ -13,7 +8,6 @@
* included in all such copies.
*/
-
/*
* C++ guard.
*/
@@ -101,8 +95,3 @@ extern "C" {
#ifdef __cplusplus
} /* extern "C" */
#endif
-
-#endif
-
-
-
diff --git a/src/birth.cc b/src/birth.cc
index 3ed99a8a..cf0e1ce5 100644
--- a/src/birth.cc
+++ b/src/birth.cc
@@ -14,6 +14,7 @@
#include "messages.h"
#include "hooks.h"
+#include "mimic.hpp"
#include "q_rand.h"
#include "spells3.hpp"
diff --git a/src/bldg.cc b/src/bldg.cc
index ac9ab5e6..f82e1ef2 100644
--- a/src/bldg.cc
+++ b/src/bldg.cc
@@ -15,6 +15,7 @@
#include "angband.h"
#include "hooks.h"
+#include "mimic.hpp"
#include "q_library.h"
#include "q_fireprof.h"
#include "q_bounty.h"
diff --git a/src/cmd1.cc b/src/cmd1.cc
index 3f7b6ad9..0d65b69a 100644
--- a/src/cmd1.cc
+++ b/src/cmd1.cc
@@ -11,9 +11,9 @@
*/
#include "angband.h"
-
-#include "quark.h"
#include "hooks.h"
+#include "mimic.hpp"
+#include "quark.h"
#include "spells3.hpp"
#define MAX_VAMPIRIC_DRAIN 100
diff --git a/src/cmd6.cc b/src/cmd6.cc
index 12e8d53d..9d5759b2 100644
--- a/src/cmd6.cc
+++ b/src/cmd6.cc
@@ -11,10 +11,11 @@
*/
#include "angband.h"
+#include "hooks.h"
#include "lua_bind.hpp"
+#include "mimic.hpp"
#include "spell_type.hpp"
#include "spells5.hpp"
-#include "hooks.h"
#include <cassert>
diff --git a/src/cmd7.cc b/src/cmd7.cc
index ab152bd2..e593e5f0 100644
--- a/src/cmd7.cc
+++ b/src/cmd7.cc
@@ -12,9 +12,9 @@
#include "angband.h"
-
-#include "quark.h"
#include "hooks.h"
+#include "mimic.hpp"
+#include "quark.h"
/*
* Describe class powers of Mindcrafters
diff --git a/src/externs.h b/src/externs.h
index a986ded0..7d46a6b2 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -1394,16 +1394,6 @@ extern int get_keymap_mode();
/* main.c */
extern bool_ private_check_user_directory(cptr dirpath);
-/* mimic.c */
-extern s16b resolve_mimic_name(cptr name);
-extern s16b find_random_mimic_shape(byte level, bool_ limit);
-extern cptr get_mimic_name(s16b mf_idx);
-extern cptr get_mimic_object_name(s16b mf_idx);
-extern byte get_mimic_level(s16b mf_idx);
-extern s32b get_mimic_random_duration(s16b mf_idx);
-extern byte calc_mimic();
-extern void calc_mimic_power();
-
/* xtra1.c */
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/files.cc b/src/files.cc
index 8e7354f9..69c90cb7 100644
--- a/src/files.cc
+++ b/src/files.cc
@@ -11,9 +11,9 @@
*/
#include "angband.h"
-
#include "hiscore.h"
#include "hooks.h"
+#include "mimic.hpp"
#include <memory>
#include <unordered_set>
diff --git a/src/melee1.cc b/src/melee1.cc
index 09caa4aa..7ebc0574 100644
--- a/src/melee1.cc
+++ b/src/melee1.cc
@@ -11,6 +11,7 @@
*/
#include "angband.h"
+#include "mimic.hpp"
#include <boost/algorithm/string/predicate.hpp>
diff --git a/src/mimic.cc b/src/mimic.cc
index 90c8a62a..873ff55a 100644
--- a/src/mimic.cc
+++ b/src/mimic.cc
@@ -1,6 +1,32 @@
-#include "angband.h"
+#include "mimic.hpp"
#include <assert.h>
+/**
+ * Mimicry forms
+ */
+typedef struct mimic_duration_type mimic_duration_type;
+struct mimic_duration_type
+{
+ s16b min;
+ s16b max;
+};
+
+typedef struct mimic_form_type mimic_form_type;
+struct mimic_form_type
+{
+ int modules[3]; /* Modules where this mimicry form is available; terminated with a -1 entry */
+ cptr name; /* Name of mimicry form */
+ cptr obj_name; /* Object mimicry form name */
+ cptr desc; /* Description */
+ cptr realm; /* Realm of mimicry */
+ bool_ limit; /* If true, the form is not available except through special means */
+ byte level;
+ byte rarity;
+ mimic_duration_type duration;
+ s32b (*calc)(); /* Callback to calculate bonuses; return number of blows to add */
+ void (*power)(); /* Callback to calculate powers */
+};
+
static s32b abomination_calc()
{
apply_flags(TR1_SPEED + TR1_STR + TR1_INT + TR1_WIS + TR1_DEX + TR1_CON + TR1_CHR, 0, 0, 0, 0, 0, -10, 0, 0, 0, 0);
@@ -371,7 +397,7 @@ static s32b fire_elemental_calc()
/*
* Mimicry forms
*/
-mimic_form_type mimic_forms[MIMIC_FORMS_MAX] =
+static mimic_form_type mimic_forms[MIMIC_FORMS_MAX] =
{
{ /* 0 */
{ MODULE_TOME, MODULE_THEME, -1 },
diff --git a/src/mimic.hpp b/src/mimic.hpp
new file mode 100644
index 00000000..ca11f2a3
--- /dev/null
+++ b/src/mimic.hpp
@@ -0,0 +1,10 @@
+#include "angband.h"
+
+extern s16b resolve_mimic_name(cptr name);
+extern s16b find_random_mimic_shape(byte level, bool_ limit);
+extern cptr get_mimic_name(s16b mf_idx);
+extern cptr get_mimic_object_name(s16b mf_idx);
+extern byte get_mimic_level(s16b mf_idx);
+extern s32b get_mimic_random_duration(s16b mf_idx);
+extern byte calc_mimic();
+extern void calc_mimic_power();
diff --git a/src/monster2.cc b/src/monster2.cc
index 0ea4b473..807998e3 100644
--- a/src/monster2.cc
+++ b/src/monster2.cc
@@ -12,6 +12,7 @@
#include "angband.h"
#include "hooks.h"
+#include "mimic.hpp"
#include <algorithm>
#include <string>
diff --git a/src/object1.cc b/src/object1.cc
index d704272c..5248bda4 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -16,6 +16,7 @@
#include "spell_type.hpp"
#include "hooks.h"
#include "spells5.hpp"
+#include "mimic.hpp"
#include <cassert>
diff --git a/src/object2.cc b/src/object2.cc
index 06451c53..51ba908d 100644
--- a/src/object2.cc
+++ b/src/object2.cc
@@ -16,6 +16,7 @@
#include "hooks.h"
#include "spells3.hpp"
#include "spells5.hpp"
+#include "mimic.hpp"
#include <cassert>
#include <vector>
diff --git a/src/powers.cc b/src/powers.cc
index ae7afbcd..7d8280ec 100644
--- a/src/powers.cc
+++ b/src/powers.cc
@@ -11,9 +11,9 @@
*/
#include "angband.h"
-
#include "quark.h"
#include "hooks.h"
+#include "mimic.hpp"
/*
* Note: return value indicates the amount of mana to use
diff --git a/src/randart.cc b/src/randart.cc
index 2acba543..57e7a536 100644
--- a/src/randart.cc
+++ b/src/randart.cc
@@ -11,7 +11,7 @@
*/
#include "angband.h"
-
+#include "mimic.hpp"
#include "quark.h"
#include <memory>
diff --git a/src/spells3.cc b/src/spells3.cc
index 83f7d97b..93a958d4 100644
--- a/src/spells3.cc
+++ b/src/spells3.cc
@@ -6,6 +6,7 @@
#include "spell_type.hpp"
#include "spell_idx_list.hpp"
+#include "mimic.hpp"
#include <vector>
diff --git a/src/types.h b/src/types.h
index 16bd5b04..72461208 100644
--- a/src/types.h
+++ b/src/types.h
@@ -2617,29 +2617,3 @@ struct corruption_type
void (*gain_callback)(); /* callback to invoke when gained */
s16b power; /* index of granted power if >= 0, ignored otherwise */
};
-
-/**
- * Mimicry forms
- */
-typedef struct mimic_duration_type mimic_duration_type;
-struct mimic_duration_type
-{
- s16b min;
- s16b max;
-};
-
-typedef struct mimic_form_type mimic_form_type;
-struct mimic_form_type
-{
- int modules[3]; /* Modules where this mimicry form is available; terminated with a -1 entry */
- cptr name; /* Name of mimicry form */
- cptr obj_name; /* Object mimicry form name */
- cptr desc; /* Description */
- cptr realm; /* Realm of mimicry */
- bool_ limit; /* If true, the form is not available except through special means */
- byte level;
- byte rarity;
- mimic_duration_type duration;
- s32b (*calc)(); /* Callback to calculate bonuses; return number of blows to add */
- void (*power)(); /* Callback to calculate powers */
-};
diff --git a/src/types_fwd.h b/src/types_fwd.h
index a959073c..a80ae4dd 100644
--- a/src/types_fwd.h
+++ b/src/types_fwd.h
@@ -76,8 +76,6 @@ struct ability_type;
struct module_meta_type;
struct module_type;
struct corruption_type;
-struct mimic_duration_type;
-struct mimic_form_type;
#ifdef __cplusplus
}
diff --git a/src/xtra1.cc b/src/xtra1.cc
index 718d2569..ba821ed3 100644
--- a/src/xtra1.cc
+++ b/src/xtra1.cc
@@ -14,6 +14,7 @@
#include "messages.h"
#include "hooks.h"
#include "spells3.hpp"
+#include "mimic.hpp"
#include <cassert>
diff --git a/src/xtra2.cc b/src/xtra2.cc
index 4d0750c5..081493c0 100644
--- a/src/xtra2.cc
+++ b/src/xtra2.cc
@@ -12,13 +12,12 @@
*/
#include "angband.h"
-
-#include <assert.h>
-
-#include "quark.h"
#include "hooks.h"
+#include "mimic.hpp"
+#include "quark.h"
#include <type_traits>
+#include <cassert>
#include <boost/algorithm/string/predicate.hpp>