summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-27 17:57:40 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-27 17:57:40 +0100
commit9368f57866c8d62ed9927410e2a2230e0a1c3b54 (patch)
tree25df4e8d7de1d8fdd68e29d28612b7871de1c890 /crawl-ref
parent21e5d28ecd75a26f2f3aa6ba871bdcf0ad61870b (diff)
downloadcrawl-ref-9368f57866c8d62ed9927410e2a2230e0a1c3b54.tar.gz
crawl-ref-9368f57866c8d62ed9927410e2a2230e0a1c3b54.zip
Remove header includes from mon-place.h.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/abl-show.cc2
-rw-r--r--crawl-ref/source/abyss.cc2
-rw-r--r--crawl-ref/source/arena.cc2
-rw-r--r--crawl-ref/source/art-func.h2
-rw-r--r--crawl-ref/source/artefact.cc1
-rw-r--r--crawl-ref/source/beam.cc2
-rw-r--r--crawl-ref/source/decks.cc2
-rw-r--r--crawl-ref/source/dungeon.cc2
-rw-r--r--crawl-ref/source/effects.cc3
-rw-r--r--crawl-ref/source/fight.cc4
-rw-r--r--crawl-ref/source/files.cc1
-rw-r--r--crawl-ref/source/godabil.cc1
-rw-r--r--crawl-ref/source/godwrath.cc4
-rw-r--r--crawl-ref/source/it_use3.cc2
-rw-r--r--crawl-ref/source/item_use.cc3
-rw-r--r--crawl-ref/source/items.cc1
-rw-r--r--crawl-ref/source/l_dgnmon.cc1
-rw-r--r--crawl-ref/source/lev-pand.cc2
-rw-r--r--crawl-ref/source/main.cc5
-rw-r--r--crawl-ref/source/makefile.obj1
-rw-r--r--crawl-ref/source/maps.cc1
-rw-r--r--crawl-ref/source/mgen_data.cc10
-rw-r--r--crawl-ref/source/mgen_data.h165
-rw-r--r--crawl-ref/source/mgen_enum.h102
-rw-r--r--crawl-ref/source/misc.cc1
-rw-r--r--crawl-ref/source/mon-abil.cc3
-rw-r--r--crawl-ref/source/mon-act.cc3
-rw-r--r--crawl-ref/source/mon-cast.cc3
-rw-r--r--crawl-ref/source/mon-place.cc3
-rw-r--r--crawl-ref/source/mon-place.h260
-rw-r--r--crawl-ref/source/mon-stuff.cc4
-rw-r--r--crawl-ref/source/mon-transit.cc1
-rw-r--r--crawl-ref/source/mon-util.cc1
-rw-r--r--crawl-ref/source/monster.cc5
-rw-r--r--crawl-ref/source/ouch.cc2
-rw-r--r--crawl-ref/source/religion.cc5
-rw-r--r--crawl-ref/source/spells2.cc2
-rw-r--r--crawl-ref/source/spells3.cc3
-rw-r--r--crawl-ref/source/spells4.cc1
-rw-r--r--crawl-ref/source/spl-mis.cc2
-rw-r--r--crawl-ref/source/stuff.cc11
-rw-r--r--crawl-ref/source/terrain.cc1
-rw-r--r--crawl-ref/source/wiz-fsim.cc2
-rw-r--r--crawl-ref/source/wiz-mon.cc5
-rw-r--r--crawl-ref/source/xom.cc2
45 files changed, 378 insertions, 263 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index fe6ba4577b..bb69c1b8d8 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -36,6 +36,8 @@
#include "menu.h"
#include "misc.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mutation.h"
#include "notes.h"
#include "ouch.h"
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index 279f559382..5d5bb9a627 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -23,6 +23,8 @@
#include "mon-iter.h"
#include "mon-util.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-transit.h"
#include "player.h"
#include "dungeon.h"
diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc
index 7da2a1288c..d00ab4aa6c 100644
--- a/crawl-ref/source/arena.cc
+++ b/crawl-ref/source/arena.cc
@@ -27,6 +27,8 @@
#include "mon-pick.h"
#include "mon-util.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "spl-mis.h"
#include "spl-util.h"
diff --git a/crawl-ref/source/art-func.h b/crawl-ref/source/art-func.h
index 442004a220..9c75324e20 100644
--- a/crawl-ref/source/art-func.h
+++ b/crawl-ref/source/art-func.h
@@ -25,11 +25,13 @@
#include "effects.h" // For Sceptre of Torment tormenting
#include "env.h" // For storm bow env.cgrid
#include "food.h" // For evokes
+#include "mgen_data.h" // For Sceptre of Asmodeus evoke
#include "mon-place.h" // For Sceptre of Asmodeus evoke
#include "mon-stuff.h" // For Scythe of Curses cursing items
#include "spells3.h" // For Zonguldrok animating dead
#include "spl-cast.h" // For evokes
#include "spl-mis.h" // For Staff of Wucad Mu miscasts
+#include "terrain.h" // For storm bow.
/*******************
* Helper functions.
diff --git a/crawl-ref/source/artefact.cc b/crawl-ref/source/artefact.cc
index 7fae71a38e..9ba3507056 100644
--- a/crawl-ref/source/artefact.cc
+++ b/crawl-ref/source/artefact.cc
@@ -25,6 +25,7 @@
#include "itemname.h"
#include "itemprop.h"
#include "items.h"
+#include "makeitem.h"
#include "place.h"
#include "player.h"
#include "random.h"
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 9ed9b32c3d..f0a8a7cf81 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -25,6 +25,7 @@
#include "cio.h"
#include "cloud.h"
#include "colour.h"
+#include "coord.h"
#include "coordit.h"
#include "delay.h"
#include "dgnevent.h"
@@ -45,6 +46,7 @@
#include "mon-behv.h"
#include "mon-iter.h"
#include "mon-place.h"
+#include "mgen_data.h"
#include "mon-stuff.h"
#include "mon-util.h"
#include "mutation.h"
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 5b09bae904..bf52b877a7 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -34,6 +34,8 @@
#include "misc.h"
#include "mon-iter.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mutation.h"
#include "options.h"
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index e4ed388ab1..05bd1b9fdd 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -20,6 +20,7 @@
#include "chardump.h"
#include "cloud.h"
#include "colour.h"
+#include "coord.h"
#include "coordit.h"
#include "defines.h"
#include "effects.h"
@@ -45,6 +46,7 @@
#include "misc.h"
#include "mon-util.h"
#include "mon-place.h"
+#include "mgen_data.h"
#include "mon-pathfind.h"
#include "notes.h"
#include "place.h"
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 3d4a11103a..c8d7f6545a 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -27,6 +27,7 @@
#include "coordit.h"
#include "decks.h"
#include "delay.h"
+#include "dungeon.h"
#include "directn.h"
#include "dgnevent.h"
#include "env.h"
@@ -47,6 +48,8 @@
#include "mon-cast.h"
#include "mon-iter.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-pathfind.h"
#include "mon-stuff.h"
#include "mon-util.h"
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index eb09539c01..e726c234a8 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -39,11 +39,15 @@
#include "item_use.h"
#include "kills.h"
#include "macro.h"
+#include "makeitem.h"
#include "message.h"
#include "misc.h"
#include "mon-behv.h"
#include "mon-cast.h"
#include "mon-place.h"
+#include "terrain.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mon-util.h"
#include "mutation.h"
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 37755a4623..da1444d2a9 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -9,6 +9,7 @@
#include "delay.h"
#include "files.h"
#include "mon-place.h"
+#include "coord.h"
#include <errno.h>
#include <string.h>
diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc
index ce2aab0002..520f12f32b 100644
--- a/crawl-ref/source/godabil.cc
+++ b/crawl-ref/source/godabil.cc
@@ -28,6 +28,7 @@
#include "mon-behv.h"
#include "mon-iter.h"
#include "mon-place.h"
+#include "mgen_data.h"
#include "mon-stuff.h"
#include "mon-util.h"
#include "mutation.h"
diff --git a/crawl-ref/source/godwrath.cc b/crawl-ref/source/godwrath.cc
index c828ae59ec..44dd4d230b 100644
--- a/crawl-ref/source/godwrath.cc
+++ b/crawl-ref/source/godwrath.cc
@@ -24,6 +24,10 @@
#include "misc.h"
#include "mon-util.h"
#include "mon-place.h"
+#include "terrain.h"
+#include "mgen_data.h"
+#include "coord.h"
+#include "makeitem.h"
#include "mon-stuff.h"
#include "mutation.h"
#include "ouch.h"
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc
index 94c4f541d5..295b5d24e6 100644
--- a/crawl-ref/source/it_use3.cc
+++ b/crawl-ref/source/it_use3.cc
@@ -33,6 +33,8 @@
#include "mapmark.h"
#include "message.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "misc.h"
#include "player.h"
#include "religion.h"
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 897836e718..5570b17bc3 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -48,6 +48,9 @@
#include "mon-behv.h"
#include "mon-util.h"
#include "mon-place.h"
+#include "terrain.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "notes.h"
#include "options.h"
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 279717663a..a76d92ffc3 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -21,6 +21,7 @@
#include "artefact.h"
#include "beam.h"
#include "branch.h"
+#include "coord.h"
#include "coordit.h"
#include "dbg-util.h"
#include "debug.h"
diff --git a/crawl-ref/source/l_dgnmon.cc b/crawl-ref/source/l_dgnmon.cc
index 772c600409..9ff04bd74d 100644
--- a/crawl-ref/source/l_dgnmon.cc
+++ b/crawl-ref/source/l_dgnmon.cc
@@ -13,6 +13,7 @@
#include "mapdef.h"
#include "mon-util.h"
#include "mon-place.h"
+#include "coord.h"
#include "mon-stuff.h"
#define MONSLIST_METATABLE "crawldgn.monster_list"
diff --git a/crawl-ref/source/lev-pand.cc b/crawl-ref/source/lev-pand.cc
index ef8491f500..ab2075910e 100644
--- a/crawl-ref/source/lev-pand.cc
+++ b/crawl-ref/source/lev-pand.cc
@@ -14,6 +14,8 @@
#include "dungeon.h"
#include "env.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-pick.h"
#include "random.h"
diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc
index 3298e96ea7..68f5440389 100644
--- a/crawl-ref/source/main.cc
+++ b/crawl-ref/source/main.cc
@@ -33,8 +33,6 @@
#endif
#include "externs.h"
-#include "options.h"
-#include "species.h"
#include "abl-show.h"
#include "abyss.h"
@@ -47,6 +45,7 @@
#include "cloud.h"
#include "clua.h"
#include "command.h"
+#include "coord.h"
#include "coordit.h"
#include "ctest.h"
#include "crash.h"
@@ -94,6 +93,7 @@
#include "newgame.h"
#include "ng-init.h"
#include "notes.h"
+#include "options.h"
#include "ouch.h"
#include "output.h"
#include "overmap.h"
@@ -104,6 +104,7 @@
#include "shopping.h"
#include "skills.h"
#include "skills2.h"
+#include "species.h"
#include "spells1.h"
#include "spells2.h"
#include "spells3.h"
diff --git a/crawl-ref/source/makefile.obj b/crawl-ref/source/makefile.obj
index 82f1126892..c888263332 100644
--- a/crawl-ref/source/makefile.obj
+++ b/crawl-ref/source/makefile.obj
@@ -97,6 +97,7 @@ mapmark.o \
maps.o \
menu.o \
message.o \
+mgen_data.o \
misc.o \
mon-abil.o \
mon-act.o \
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc
index c90c99552d..7c45a239bd 100644
--- a/crawl-ref/source/maps.cc
+++ b/crawl-ref/source/maps.cc
@@ -26,6 +26,7 @@
#include "mapdef.h"
#include "mon-util.h"
#include "mon-place.h"
+#include "coord.h"
#include "random.h"
#include "state.h"
#include "tags.h"
diff --git a/crawl-ref/source/mgen_data.cc b/crawl-ref/source/mgen_data.cc
new file mode 100644
index 0000000000..23553f056d
--- /dev/null
+++ b/crawl-ref/source/mgen_data.cc
@@ -0,0 +1,10 @@
+#include "AppHdr.h"
+
+#include "mgen_data.h"
+
+#include "coord.h"
+
+bool mgen_data::use_position() const
+{
+ return (in_bounds(pos));
+}
diff --git a/crawl-ref/source/mgen_data.h b/crawl-ref/source/mgen_data.h
new file mode 100644
index 0000000000..2719b71b94
--- /dev/null
+++ b/crawl-ref/source/mgen_data.h
@@ -0,0 +1,165 @@
+#ifndef MGEN_DATA_H
+#define MGEN_DATA_H
+
+#include "mgen_enum.h"
+#include "player.h"
+
+// A structure with all the data needed to whip up a new monster.
+struct mgen_data
+{
+ // Monster type.
+ monster_type cls;
+
+ // If the monster is zombie-like, or a specialised draconian, this
+ // is the base monster that the monster is based on - should be
+ // set to MONS_NO_MONSTER when not used.
+ monster_type base_type;
+
+ // Determines the behaviour of the monster after it is generated. This
+ // behaviour is an unholy combination of monster attitude
+ // (friendly, hostile) and monster initial state (asleep, wandering).
+ // XXX: Could use splitting up these aspects.
+ beh_type behaviour;
+
+ // Who summoned this monster? Important to know for death accounting
+ // and the summon cap, if and when it goes in. NULL is no summoner.
+ actor* summoner;
+
+ // For summoned monsters, this is a measure of how long the summon will
+ // hang around, on a scale of 1-6, 6 being longest. Use 0 for monsters
+ // that aren't summoned.
+ int abjuration_duration;
+
+ // For summoned monsters this is their type of summoning, either the
+ // spell which summoned them or one of the values of the enumeration
+ // mon_summon_type in mon-util.h.
+ int summon_type;
+
+ // Where the monster will be created.
+ coord_def pos;
+
+ // The monster's foe, i.e. which monster it will want to attack. foe
+ // may be an index into the monster array (0 - (MAX_MONSTERS-1)), or
+ // it may be MHITYOU to indicate that the monster wants to attack the
+ // player, or MHITNOT, to indicate that the monster has no foe and is
+ // just wandering around.
+ unsigned short foe;
+
+ // Generation flags from mgen_flag_type.
+ unsigned flags;
+
+ // What god the monster worships, if any. Used for monsters that
+ // are god gifts, to indicate which god sent them, and by priest
+ // monsters, to indicate whose priest they are.
+ god_type god;
+
+ // The number of hydra heads, the number of manticore attack volleys,
+ // the number of merged slime creatures, or the indicator for when
+ // Khufu is entombed.
+ //
+ // Note: in older versions this field was used for both this and for
+ // base_type.
+ int number;
+
+ // The colour of the monster.
+ int colour;
+
+ // A measure of how powerful the generated monster should be (for
+ // randomly chosen monsters), usually equal to the absolute depth
+ // that the player is in the dungeon.
+ int power;
+
+ // How close to or far from the player the monster should be created.
+ // Is usually used only when the initial position (pos) is unspecified.
+ proximity_type proximity;
+
+ // What place we're in, or pretending to be in, usually the place
+ // the player is actually in.
+ level_area_type level_type;
+
+ // Some predefined vaults (aka maps) include flags to suppress random
+ // generation of monsters. When generating monsters, this is a mask of
+ // map flags to honour (such as MMT_NO_MONS to specify that we shouldn't
+ // randomly generate a monster inside a map that doesn't want it). These
+ // map flags are usually respected only when a dungeon level is being
+ // constructed, since at future points vault information may no longer
+ // be available (vault metadata is not preserved across game saves).
+ unsigned map_mask;
+
+ // XXX: Also rather hackish.
+ int hd;
+ int hp;
+
+ // XXX: Rather hackish.
+ std::string mname;
+
+ // This is used to account for non-actor summoners. Blasted by an Ice
+ // Fiend ... summoned by the effects of Hell.
+ std::string non_actor_summoner;
+
+ mgen_data(monster_type mt = RANDOM_MONSTER,
+ beh_type beh = BEH_HOSTILE,
+ actor* sner = 0,
+ int abj = 0,
+ int st = 0,
+ const coord_def &p = coord_def(-1, -1),
+ unsigned short mfoe = MHITNOT,
+ unsigned monflags = 0,
+ god_type which_god = GOD_NO_GOD,
+ monster_type base = MONS_NO_MONSTER,
+ int monnumber = 0,
+ int moncolour = BLACK,
+ int monpower = you.your_level,
+ proximity_type prox = PROX_ANYWHERE,
+ level_area_type ltype = you.level_type,
+ int mhd = 0, int mhp = 0,
+ std::string monname = "",
+ std::string nas = "")
+
+ : cls(mt), base_type(base), behaviour(beh), summoner(sner),
+ abjuration_duration(abj), summon_type(st), pos(p), foe(mfoe),
+ flags(monflags), god(which_god), number(monnumber), colour(moncolour),
+ power(monpower), proximity(prox), level_type(ltype), map_mask(0),
+ hd(mhd), hp(mhp), mname(monname), non_actor_summoner(nas)
+ {
+ ASSERT(summon_type == 0 || (abj >= 1 && abj <= 6)
+ || mt == MONS_BALL_LIGHTNING);
+ }
+
+ bool permit_bands() const { return (flags & MG_PERMIT_BANDS); }
+ bool force_place() const { return (flags & MG_FORCE_PLACE); }
+ bool needs_patrol_point() const { return (flags & MG_PATROLLING); }
+
+ // Is there a valid position set on this struct that we want to use
+ // when placing the monster?
+ bool use_position() const;
+
+ bool summoned() const { return (abjuration_duration > 0); }
+
+ static mgen_data sleeper_at(monster_type what,
+ const coord_def &where,
+ unsigned flags = 0)
+ {
+ return mgen_data(what, BEH_SLEEP, 0, 0, 0, where, MHITNOT, flags);
+ }
+
+ static mgen_data hostile_at(monster_type mt,
+ std::string summoner,
+ bool alert = false,
+ int abj = 0,
+ int st = 0,
+ const coord_def &p = coord_def(-1, -1),
+ unsigned monflags = 0,
+ god_type god = GOD_NO_GOD,
+ monster_type base = MONS_NO_MONSTER)
+
+ {
+ return mgen_data(mt, BEH_HOSTILE, 0, abj, st, p,
+ alert ? MHITYOU : MHITNOT,
+ monflags, god, base, 0, BLACK, you.your_level,
+ PROX_ANYWHERE, you.level_type, 0, 0, "", summoner);
+ }
+};
+
+#endif
+
diff --git a/crawl-ref/source/mgen_enum.h b/crawl-ref/source/mgen_enum.h
new file mode 100644
index 0000000000..0927e9ae65
--- /dev/null
+++ b/crawl-ref/source/mgen_enum.h
@@ -0,0 +1,102 @@
+#ifndef MGEN_ENUM_H
+#define MGEN_ENUM_H
+
+enum band_type
+{
+ BAND_NO_BAND = 0,
+ BAND_KOBOLDS,
+ BAND_ORCS,
+ BAND_ORC_WARRIOR,
+ BAND_ORC_KNIGHT,
+ BAND_KILLER_BEES, // 5
+ BAND_FLYING_SKULLS,
+ BAND_SLIME_CREATURES,
+ BAND_YAKS,
+ BAND_UGLY_THINGS,
+ BAND_HELL_HOUNDS, // 10
+ BAND_JACKALS,
+ BAND_HELL_KNIGHTS,
+ BAND_ORC_HIGH_PRIEST,
+ BAND_GNOLLS, // 14
+ // 15
+ BAND_BUMBLEBEES = 16,
+ BAND_CENTAURS,
+ BAND_YAKTAURS,
+ BAND_INSUBSTANTIAL_WISPS,
+ BAND_OGRE_MAGE, // 20
+ BAND_DEATH_YAKS,
+ BAND_NECROMANCER,
+ BAND_BALRUG,
+ BAND_CACODEMON,
+ BAND_EXECUTIONER, // 25
+ BAND_HELLWING,
+ BAND_DEEP_ELF_FIGHTER,
+ BAND_DEEP_ELF_KNIGHT,
+ BAND_DEEP_ELF_HIGH_PRIEST,
+ BAND_KOBOLD_DEMONOLOGIST, // 30
+ BAND_NAGAS,
+ BAND_WAR_DOGS,
+ BAND_GREY_RATS,
+ BAND_GREEN_RATS,
+ BAND_ORANGE_RATS, // 35
+ BAND_SHEEP,
+ BAND_GHOULS,
+ BAND_DEEP_TROLLS,
+ BAND_HOGS,
+ BAND_HELL_HOGS, // 40
+ BAND_GIANT_MOSQUITOES,
+ BAND_BOGGARTS,
+ BAND_BLINK_FROGS,
+ BAND_SKELETAL_WARRIORS,
+ BAND_DRACONIAN, // 45
+ BAND_PANDEMONIUM_DEMON,
+ BAND_HARPIES,
+ BAND_ILSUIW,
+ BAND_AZRAEL,
+ BAND_DUVESSA, // 50
+ BAND_KHUFU,
+ BAND_GOLDEN_EYE,
+ BAND_PIKEL,
+ NUM_BANDS // always last
+};
+
+enum demon_class_type
+{
+ DEMON_LESSER, // 0: Class V
+ DEMON_COMMON, // 1: Class II-IV
+ DEMON_GREATER, // 2: Class I
+ DEMON_RANDOM // any of the above
+};
+
+enum holy_being_class_type
+{
+ HOLY_BEING_WARRIOR // 0: Daeva or Angel
+};
+
+enum dragon_class_type
+{
+ DRAGON_LIZARD,
+ DRAGON_DRACONIAN,
+ DRAGON_DRAGON
+};
+
+enum proximity_type // proximity to player to create monster
+{
+ PROX_ANYWHERE,
+ PROX_CLOSE_TO_PLAYER,
+ PROX_AWAY_FROM_PLAYER,
+ PROX_NEAR_STAIRS
+};
+
+enum mgen_flag_type
+{
+ MG_PERMIT_BANDS = 0x01,
+ MG_FORCE_PLACE = 0x02,
+ MG_FORCE_BEH = 0x04,
+ MG_PLAYER_MADE = 0x08,
+ MG_PATROLLING = 0x10,
+ MG_BAND_MINION = 0x20
+};
+
+#endif
+
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 9b3ee6eb03..09f79618cc 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -53,6 +53,7 @@
#include "mapmark.h"
#include "message.h"
#include "mon-place.h"
+#include "coord.h"
#include "mon-pathfind.h"
#include "mon-iter.h"
#include "mon-util.h"
diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc
index 1a1f8b8b44..ccb23fc38b 100644
--- a/crawl-ref/source/mon-abil.cc
+++ b/crawl-ref/source/mon-abil.cc
@@ -23,6 +23,9 @@
#include "mon-cast.h"
#include "mon-iter.h"
#include "mon-place.h"
+#include "terrain.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-speak.h"
#include "mon-stuff.h"
#include "random.h"
diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc
index c580992fc0..4e866cec38 100644
--- a/crawl-ref/source/mon-act.cc
+++ b/crawl-ref/source/mon-act.cc
@@ -33,6 +33,8 @@
#include "mon-cast.h"
#include "mon-iter.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mutation.h"
#include "notes.h"
@@ -42,6 +44,7 @@
#include "religion.h"
#include "shopping.h" // for item values
#include "state.h"
+#include "stuff.h"
#include "terrain.h"
#include "traps.h"
#include "tutorial.h"
diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc
index a2a1cb2e6d..f4100c91ca 100644
--- a/crawl-ref/source/mon-cast.cc
+++ b/crawl-ref/source/mon-cast.cc
@@ -20,6 +20,9 @@
#include "mon-behv.h"
#include "mon-iter.h"
#include "mon-place.h"
+#include "terrain.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-speak.h"
#include "mon-stuff.h"
#include "mon-util.h"
diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc
index a76f864080..95d2c6897e 100644
--- a/crawl-ref/source/mon-place.cc
+++ b/crawl-ref/source/mon-place.cc
@@ -9,11 +9,14 @@
#include <algorithm>
#include "mon-place.h"
+#include "mgen_data.h"
#include "arena.h"
#include "branch.h"
+#include "coord.h"
#include "coordit.h"
#include "directn.h"
+#include "dungeon.h"
#include "fprop.h"
#include "externs.h"
#include "options.h"
diff --git a/crawl-ref/source/mon-place.h b/crawl-ref/source/mon-place.h
index 709a88045b..3512639462 100644
--- a/crawl-ref/source/mon-place.h
+++ b/crawl-ref/source/mon-place.h
@@ -8,264 +8,10 @@
#ifndef MONPLACE_H
#define MONPLACE_H
-#include "coord.h"
-#include "enum.h"
-#include "dungeon.h"
-#include "player.h"
+#include "mgen_enum.h"
-enum band_type
-{
- BAND_NO_BAND = 0,
- BAND_KOBOLDS,
- BAND_ORCS,
- BAND_ORC_WARRIOR,
- BAND_ORC_KNIGHT,
- BAND_KILLER_BEES, // 5
- BAND_FLYING_SKULLS,
- BAND_SLIME_CREATURES,
- BAND_YAKS,
- BAND_UGLY_THINGS,
- BAND_HELL_HOUNDS, // 10
- BAND_JACKALS,
- BAND_HELL_KNIGHTS,
- BAND_ORC_HIGH_PRIEST,
- BAND_GNOLLS, // 14
- // 15
- BAND_BUMBLEBEES = 16,
- BAND_CENTAURS,
- BAND_YAKTAURS,
- BAND_INSUBSTANTIAL_WISPS,
- BAND_OGRE_MAGE, // 20
- BAND_DEATH_YAKS,
- BAND_NECROMANCER,
- BAND_BALRUG,
- BAND_CACODEMON,
- BAND_EXECUTIONER, // 25
- BAND_HELLWING,
- BAND_DEEP_ELF_FIGHTER,
- BAND_DEEP_ELF_KNIGHT,
- BAND_DEEP_ELF_HIGH_PRIEST,
- BAND_KOBOLD_DEMONOLOGIST, // 30
- BAND_NAGAS,
- BAND_WAR_DOGS,
- BAND_GREY_RATS,
- BAND_GREEN_RATS,
- BAND_ORANGE_RATS, // 35
- BAND_SHEEP,
- BAND_GHOULS,
- BAND_DEEP_TROLLS,
- BAND_HOGS,
- BAND_HELL_HOGS, // 40
- BAND_GIANT_MOSQUITOES,
- BAND_BOGGARTS,
- BAND_BLINK_FROGS,
- BAND_SKELETAL_WARRIORS,
- BAND_DRACONIAN, // 45
- BAND_PANDEMONIUM_DEMON,
- BAND_HARPIES,
- BAND_ILSUIW,
- BAND_AZRAEL,
- BAND_DUVESSA, // 50
- BAND_KHUFU,
- BAND_GOLDEN_EYE,
- BAND_PIKEL,
- NUM_BANDS // always last
-};
-
-enum demon_class_type
-{
- DEMON_LESSER, // 0: Class V
- DEMON_COMMON, // 1: Class II-IV
- DEMON_GREATER, // 2: Class I
- DEMON_RANDOM // any of the above
-};
-
-enum holy_being_class_type
-{
- HOLY_BEING_WARRIOR // 0: Daeva or Angel
-};
-
-enum dragon_class_type
-{
- DRAGON_LIZARD,
- DRAGON_DRACONIAN,
- DRAGON_DRAGON
-};
-
-enum proximity_type // proximity to player to create monster
-{
- PROX_ANYWHERE,
- PROX_CLOSE_TO_PLAYER,
- PROX_AWAY_FROM_PLAYER,
- PROX_NEAR_STAIRS
-};
-
-enum mgen_flag_type
-{
- MG_PERMIT_BANDS = 0x01,
- MG_FORCE_PLACE = 0x02,
- MG_FORCE_BEH = 0x04,
- MG_PLAYER_MADE = 0x08,
- MG_PATROLLING = 0x10,
- MG_BAND_MINION = 0x20
-};
-
-// A structure with all the data needed to whip up a new monster.
-struct mgen_data
-{
- // Monster type.
- monster_type cls;
-
- // If the monster is zombie-like, or a specialised draconian, this
- // is the base monster that the monster is based on - should be
- // set to MONS_NO_MONSTER when not used.
- monster_type base_type;
-
- // Determines the behaviour of the monster after it is generated. This
- // behaviour is an unholy combination of monster attitude
- // (friendly, hostile) and monster initial state (asleep, wandering).
- // XXX: Could use splitting up these aspects.
- beh_type behaviour;
-
- // Who summoned this monster? Important to know for death accounting
- // and the summon cap, if and when it goes in. NULL is no summoner.
- actor* summoner;
-
- // For summoned monsters, this is a measure of how long the summon will
- // hang around, on a scale of 1-6, 6 being longest. Use 0 for monsters
- // that aren't summoned.
- int abjuration_duration;
-
- // For summoned monsters this is their type of summoning, either the
- // spell which summoned them or one of the values of the enumeration
- // mon_summon_type in mon-util.h.
- int summon_type;
-
- // Where the monster will be created.
- coord_def pos;
-
- // The monster's foe, i.e. which monster it will want to attack. foe
- // may be an index into the monster array (0 - (MAX_MONSTERS-1)), or
- // it may be MHITYOU to indicate that the monster wants to attack the
- // player, or MHITNOT, to indicate that the monster has no foe and is
- // just wandering around.
- unsigned short foe;
-
- // Generation flags from mgen_flag_type.
- unsigned flags;
-
- // What god the monster worships, if any. Used for monsters that
- // are god gifts, to indicate which god sent them, and by priest
- // monsters, to indicate whose priest they are.
- god_type god;
-
- // The number of hydra heads, the number of manticore attack volleys,
- // the number of merged slime creatures, or the indicator for when
- // Khufu is entombed.
- //
- // Note: in older versions this field was used for both this and for
- // base_type.
- int number;
-
- // The colour of the monster.
- int colour;
-
- // A measure of how powerful the generated monster should be (for
- // randomly chosen monsters), usually equal to the absolute depth
- // that the player is in the dungeon.
- int power;
-
- // How close to or far from the player the monster should be created.
- // Is usually used only when the initial position (pos) is unspecified.
- proximity_type proximity;
-
- // What place we're in, or pretending to be in, usually the place
- // the player is actually in.
- level_area_type level_type;
-
- // Some predefined vaults (aka maps) include flags to suppress random
- // generation of monsters. When generating monsters, this is a mask of
- // map flags to honour (such as MMT_NO_MONS to specify that we shouldn't
- // randomly generate a monster inside a map that doesn't want it). These
- // map flags are usually respected only when a dungeon level is being
- // constructed, since at future points vault information may no longer
- // be available (vault metadata is not preserved across game saves).
- unsigned map_mask;
-
- // XXX: Also rather hackish.
- int hd;
- int hp;
-
- // XXX: Rather hackish.
- std::string mname;
-
- // This is used to account for non-actor summoners. Blasted by an Ice
- // Fiend ... summoned by the effects of Hell.
- std::string non_actor_summoner;
-
- mgen_data(monster_type mt = RANDOM_MONSTER,
- beh_type beh = BEH_HOSTILE,
- actor* sner = 0,
- int abj = 0,
- int st = 0,
- const coord_def &p = coord_def(-1, -1),
- unsigned short mfoe = MHITNOT,
- unsigned monflags = 0,
- god_type which_god = GOD_NO_GOD,
- monster_type base = MONS_NO_MONSTER,
- int monnumber = 0,
- int moncolour = BLACK,
- int monpower = you.your_level,
- proximity_type prox = PROX_ANYWHERE,
- level_area_type ltype = you.level_type,
- int mhd = 0, int mhp = 0,
- std::string monname = "",
- std::string nas = "")
-
- : cls(mt), base_type(base), behaviour(beh), summoner(sner),
- abjuration_duration(abj), summon_type(st), pos(p), foe(mfoe),
- flags(monflags), god(which_god), number(monnumber), colour(moncolour),
- power(monpower), proximity(prox), level_type(ltype), map_mask(0),
- hd(mhd), hp(mhp), mname(monname), non_actor_summoner(nas)
- {
- ASSERT(summon_type == 0 || (abj >= 1 && abj <= 6)
- || mt == MONS_BALL_LIGHTNING);
- }
-
- bool permit_bands() const { return (flags & MG_PERMIT_BANDS); }
- bool force_place() const { return (flags & MG_FORCE_PLACE); }
- bool needs_patrol_point() const { return (flags & MG_PATROLLING); }
-
- // Is there a valid position set on this struct that we want to use
- // when placing the monster?
- bool use_position() const { return in_bounds(pos); }
-
- bool summoned() const { return (abjuration_duration > 0); }
-
- static mgen_data sleeper_at(monster_type what,
- const coord_def &where,
- unsigned flags = 0)
- {
- return mgen_data(what, BEH_SLEEP, 0, 0, 0, where, MHITNOT, flags);
- }
-
- static mgen_data hostile_at(monster_type mt,
- std::string summoner,
- bool alert = false,
- int abj = 0,
- int st = 0,
- const coord_def &p = coord_def(-1, -1),
- unsigned monflags = 0,
- god_type god = GOD_NO_GOD,
- monster_type base = MONS_NO_MONSTER)
-
- {
- return mgen_data(mt, BEH_HOSTILE, 0, abj, st, p,
- alert ? MHITYOU : MHITNOT,
- monflags, god, base, 0, BLACK, you.your_level,
- PROX_ANYWHERE, you.level_type, 0, 0, "", summoner);
- }
-};
+class mons_spec;
+struct mgen_data;
/* ***********************************************************************
* Creates a monster near the place specified in the mgen_data, producing
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index 06a88530f4..75dda5ad8b 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -17,6 +17,7 @@
#include "delay.h"
#include "dgnevent.h"
#include "directn.h"
+#include "dlua.h"
#include "fprop.h"
#include "files.h"
#include "food.h"
@@ -26,12 +27,15 @@
#include "itemprop.h"
#include "items.h"
#include "kills.h"
+#include "makeitem.h"
#include "message.h"
#include "misc.h"
#include "mon-abil.h"
#include "mon-behv.h"
#include "mon-iter.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-speak.h"
#include "notes.h"
#include "options.h"
diff --git a/crawl-ref/source/mon-transit.cc b/crawl-ref/source/mon-transit.cc
index 685a4c0d09..49a1e37ba0 100644
--- a/crawl-ref/source/mon-transit.cc
+++ b/crawl-ref/source/mon-transit.cc
@@ -15,6 +15,7 @@
#include "env.h"
#include "items.h"
#include "mon-place.h"
+#include "coord.h"
#include "mon-util.h"
#include "random.h"
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index bd0820f4bb..d5b4a54201 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -23,6 +23,7 @@
#include "kills.h"
#include "mon-behv.h"
#include "mon-place.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "options.h"
#include "random.h"
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 9fec154f91..938ff0e2a9 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -15,6 +15,7 @@
#include "directn.h"
#include "env.h"
#include "fight.h"
+#include "fprop.h"
#include "ghost.h"
#include "goditem.h"
#include "itemname.h"
@@ -24,6 +25,9 @@
#include "mon-abil.h"
#include "mon-behv.h"
#include "mon-place.h"
+#include "terrain.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mon-transit.h"
#include "random.h"
@@ -31,6 +35,7 @@
#include "shopping.h"
#include "spl-util.h"
#include "state.h"
+#include "stuff.h"
#include "traps.h"
#include "tutorial.h"
#include "view.h"
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 8a1cd211a4..a08bb2368f 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -51,6 +51,8 @@
#include "misc.h"
#include "mon-util.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "notes.h"
#include "output.h"
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 366cada82e..3aa2db88ff 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -20,7 +20,6 @@
#endif
#include "externs.h"
-#include "options.h"
#include "abl-show.h"
#include "areas.h"
@@ -35,6 +34,7 @@
#include "delay.h"
#include "describe.h"
#include "dgnevent.h"
+#include "dlua.h"
#include "effects.h"
#include "env.h"
#include "enum.h"
@@ -59,10 +59,13 @@
#include "mon-iter.h"
#include "mon-util.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mutation.h"
#include "newgame.h"
#include "notes.h"
+#include "options.h"
#include "ouch.h"
#include "output.h"
#include "player.h"
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 468f8f4151..d421b80f9d 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -38,6 +38,8 @@
#include "mon-behv.h"
#include "mon-iter.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mon-util.h"
#include "ouch.h"
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index f7b60e1ab9..eeadeeb25f 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -38,6 +38,9 @@
#include "mon-behv.h"
#include "mon-iter.h"
#include "mon-place.h"
+#include "terrain.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mon-util.h"
#include "player.h"
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index f1b2e6228b..7abd8ebfaf 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -36,6 +36,7 @@
#include "misc.h"
#include "mon-behv.h"
#include "mon-place.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mon-util.h"
#include "ouch.h"
diff --git a/crawl-ref/source/spl-mis.cc b/crawl-ref/source/spl-mis.cc
index ebc876cf8c..81b14c7bf6 100644
--- a/crawl-ref/source/spl-mis.cc
+++ b/crawl-ref/source/spl-mis.cc
@@ -21,6 +21,8 @@
#include "kills.h"
#include "misc.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mon-util.h"
#include "mutation.h"
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index 2dc5c220b1..9fed32693f 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -6,19 +6,24 @@
#include "AppHdr.h"
+#include "stuff.h"
+
+#include "areas.h"
#include "beam.h"
#include "cio.h"
+#include "coord.h"
#include "coordit.h"
#include "database.h"
#include "directn.h"
+#include "env.h"
#include "los.h"
#include "message.h"
#include "misc.h"
#include "mon-place.h"
+#include "terrain.h"
+#include "mgen_data.h"
#include "state.h"
-#include "stuff.h"
-#include "env.h"
-#include "areas.h"
+#include "travel.h"
#include "view.h"
#include "viewchar.h"
#include "viewgeom.h"
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index 5e60478a3f..ea4649b2b3 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -24,6 +24,7 @@
#include "message.h"
#include "misc.h"
#include "mon-place.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mon-util.h"
#include "ouch.h"
diff --git a/crawl-ref/source/wiz-fsim.cc b/crawl-ref/source/wiz-fsim.cc
index 24bf25117c..05ea5703dc 100644
--- a/crawl-ref/source/wiz-fsim.cc
+++ b/crawl-ref/source/wiz-fsim.cc
@@ -20,6 +20,8 @@
#include "it_use2.h"
#include "message.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "monster.h"
#include "mon-stuff.h"
#include "options.h"
diff --git a/crawl-ref/source/wiz-mon.cc b/crawl-ref/source/wiz-mon.cc
index a7ba5fa190..d7270d082a 100644
--- a/crawl-ref/source/wiz-mon.cc
+++ b/crawl-ref/source/wiz-mon.cc
@@ -12,6 +12,7 @@
#include "colour.h"
#include "dbg-util.h"
#include "delay.h"
+#include "dungeon.h"
#include "files.h"
#include "ghost.h"
#include "goditem.h"
@@ -22,6 +23,10 @@
#include "map_knowledge.h"
#include "message.h"
#include "mon-place.h"
+#include "terrain.h"
+#include "mgen_data.h"
+#include "coord.h"
+#include "mapdef.h"
#include "mon-pathfind.h"
#include "mon-speak.h"
#include "mon-stuff.h"
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index ad5133df4d..6c3074b621 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -32,6 +32,8 @@
#include "mon-iter.h"
#include "mon-util.h"
#include "mon-place.h"
+#include "mgen_data.h"
+#include "coord.h"
#include "mon-stuff.h"
#include "mutation.h"
#include "notes.h"