summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:59 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:59 +0100
commit3577729037709acd5d2105665134ec27a64bc4c3 (patch)
tree29a8c3beef42e302174d44895e0dfff1e066ae5e
parent9670b948b8d1974ae3ec8212eec1773908c345c5 (diff)
Move corrupt.cc function declarations to separate header
-rw-r--r--src/birth.cc2
-rw-r--r--src/cmd4.cc1
-rw-r--r--src/cmd5.cc8
-rw-r--r--src/cmd6.cc1
-rw-r--r--src/corrupt.cc19
-rw-r--r--src/corrupt.hpp8
-rw-r--r--src/dungeon.cc5
-rw-r--r--src/externs.h8
-rw-r--r--src/files.cc1
-rw-r--r--src/lua_bind.cc8
-rw-r--r--src/modules.cc1
-rw-r--r--src/types.h19
-rw-r--r--src/types_fwd.h1
-rw-r--r--src/wizard2.cc1
-rw-r--r--src/xtra1.cc1
-rw-r--r--src/xtra2.cc1
16 files changed, 46 insertions, 39 deletions
diff --git a/src/birth.cc b/src/birth.cc
index cf0e1ce5..c95d0188 100644
--- a/src/birth.cc
+++ b/src/birth.cc
@@ -11,7 +11,7 @@
*/
#include "angband.h"
-
+#include "corrupt.hpp"
#include "messages.h"
#include "hooks.h"
#include "mimic.hpp"
diff --git a/src/cmd4.cc b/src/cmd4.cc
index 2eb40fae..35809154 100644
--- a/src/cmd4.cc
+++ b/src/cmd4.cc
@@ -11,6 +11,7 @@
*/
#include "angband.h"
+#include "corrupt.hpp"
#include "messages.h"
#include "hooks.h"
diff --git a/src/cmd5.cc b/src/cmd5.cc
index 8ecf67dc..25752331 100644
--- a/src/cmd5.cc
+++ b/src/cmd5.cc
@@ -12,12 +12,12 @@
#include "angband.h"
-
-#include <assert.h>
-
+#include "corrupt.hpp"
#include "spell_type.hpp"
-#include "quark.h"
#include "spells5.hpp"
+#include "quark.h"
+
+#include <cassert>
/* Maximum number of tries for teleporting */
#define MAX_TRIES 300
diff --git a/src/cmd6.cc b/src/cmd6.cc
index 9d5759b2..5e5dff2c 100644
--- a/src/cmd6.cc
+++ b/src/cmd6.cc
@@ -11,6 +11,7 @@
*/
#include "angband.h"
+#include "corrupt.hpp"
#include "hooks.h"
#include "lua_bind.hpp"
#include "mimic.hpp"
diff --git a/src/corrupt.cc b/src/corrupt.cc
index e9f8ced5..a1b4af18 100644
--- a/src/corrupt.cc
+++ b/src/corrupt.cc
@@ -2,6 +2,25 @@
#include <assert.h>
/**
+ * Corruptions
+ */
+typedef struct corruption_type corruption_type;
+struct corruption_type
+{
+ int modules[3]; /* Modules where this corruption is available; terminated with -1 entry */
+ byte color;
+ cptr group;
+ cptr name;
+ cptr get_text;
+ cptr lose_text; /* If NULL, the corruption is NOT removable by any means */
+ cptr desc;
+ s16b depends[5]; /* terminated by a -1 entry */
+ s16b opposes[5]; /* terminated by a -1 entry */
+ void (*gain_callback)(); /* callback to invoke when gained */
+ s16b power; /* index of granted power if >= 0, ignored otherwise */
+};
+
+/**
* Vampire corruption helpers
*/
diff --git a/src/corrupt.hpp b/src/corrupt.hpp
new file mode 100644
index 00000000..d5568f2f
--- /dev/null
+++ b/src/corrupt.hpp
@@ -0,0 +1,8 @@
+#include "angband.h"
+
+extern void gain_random_corruption();
+extern void dump_corruptions(FILE *OutFile, bool_ color, bool_ header);
+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);
diff --git a/src/dungeon.cc b/src/dungeon.cc
index 06ac76ce..6a95361a 100644
--- a/src/dungeon.cc
+++ b/src/dungeon.cc
@@ -12,14 +12,15 @@
#include "angband.h"
-#include <assert.h>
-
+#include "corrupt.hpp"
#include "quest.h"
#include "quark.h"
#include "hooks.h"
#include "spell_type.hpp"
#include "spells5.hpp"
+#include <cassert>
+
#define TY_CURSE_CHANCE 100
#define DG_CURSE_CHANCE 50
#define AUTO_CURSE_CHANCE 15
diff --git a/src/externs.h b/src/externs.h
index 7d46a6b2..50eb2d39 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -707,14 +707,6 @@ extern void do_cmd_symbiotic(void);
extern s32b sroot(s32b n);
extern int clamp_failure_chance(int chance, int minfail);
-/* corrupt.c */
-extern void gain_random_corruption();
-extern void dump_corruptions(FILE *OutFile, bool_ color, bool_ header);
-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);
-
/* dungeon.c */
extern byte value_check_aux1(object_type *o_ptr);
extern byte value_check_aux1_magic(object_type *o_ptr);
diff --git a/src/files.cc b/src/files.cc
index 69c90cb7..b4810548 100644
--- a/src/files.cc
+++ b/src/files.cc
@@ -11,6 +11,7 @@
*/
#include "angband.h"
+#include "corrupt.hpp"
#include "hiscore.h"
#include "hooks.h"
#include "mimic.hpp"
diff --git a/src/lua_bind.cc b/src/lua_bind.cc
index e0c6b05a..e2fe9c9e 100644
--- a/src/lua_bind.cc
+++ b/src/lua_bind.cc
@@ -12,14 +12,14 @@
#include "lua_bind.hpp"
#include "angband.h"
-
-#include <assert.h>
-#include <functional>
-
+#include "corrupt.hpp"
#include "spell_type.hpp"
#include "spells5.hpp"
#include "range.h"
+#include <assert.h>
+#include <functional>
+
/*
* Misc
*/
diff --git a/src/modules.cc b/src/modules.cc
index 842d6c41..c1408f0f 100644
--- a/src/modules.cc
+++ b/src/modules.cc
@@ -7,6 +7,7 @@
*/
#include "angband.h"
+#include "corrupt.hpp"
#include "hooks.h"
#include <cassert>
diff --git a/src/types.h b/src/types.h
index 72461208..ab62c208 100644
--- a/src/types.h
+++ b/src/types.h
@@ -2598,22 +2598,3 @@ struct module_type
to indicate that no override happens. */
s16b *(*race_status)(int r_idx);
};
-
-/**
- * Corruptions
- */
-typedef struct corruption_type corruption_type;
-struct corruption_type
-{
- int modules[3]; /* Modules where this corruption is available; terminated with -1 entry */
- byte color;
- cptr group;
- cptr name;
- cptr get_text;
- cptr lose_text; /* If NULL, the corruption is NOT removable by any means */
- cptr desc;
- s16b depends[5]; /* terminated by a -1 entry */
- s16b opposes[5]; /* terminated by a -1 entry */
- void (*gain_callback)(); /* callback to invoke when gained */
- s16b power; /* index of granted power if >= 0, ignored otherwise */
-};
diff --git a/src/types_fwd.h b/src/types_fwd.h
index a80ae4dd..3a07d419 100644
--- a/src/types_fwd.h
+++ b/src/types_fwd.h
@@ -75,7 +75,6 @@ struct timer_type;
struct ability_type;
struct module_meta_type;
struct module_type;
-struct corruption_type;
#ifdef __cplusplus
}
diff --git a/src/wizard2.cc b/src/wizard2.cc
index 5adcd26a..cf0edb9b 100644
--- a/src/wizard2.cc
+++ b/src/wizard2.cc
@@ -11,6 +11,7 @@
*/
#include "angband.h"
+#include "corrupt.hpp"
#include "hooks.h"
/*
diff --git a/src/xtra1.cc b/src/xtra1.cc
index ba821ed3..7bce7e8c 100644
--- a/src/xtra1.cc
+++ b/src/xtra1.cc
@@ -11,6 +11,7 @@
*/
#include "angband.h"
+#include "corrupt.hpp"
#include "messages.h"
#include "hooks.h"
#include "spells3.hpp"
diff --git a/src/xtra2.cc b/src/xtra2.cc
index 081493c0..675864ca 100644
--- a/src/xtra2.cc
+++ b/src/xtra2.cc
@@ -12,6 +12,7 @@
*/
#include "angband.h"
+#include "corrupt.hpp"
#include "hooks.h"
#include "mimic.hpp"
#include "quark.h"