summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monplace.h
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-12 03:57:11 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-12 03:57:11 +0000
commita6b399eae4cd72f6bc2f077a694ecf5ef6b75ffc (patch)
tree5f9ce43c244881192bede86434a5e8382c85fb15 /crawl-ref/source/monplace.h
parent662e3cb4688c794cfb3294772cc49b96e5311bb8 (diff)
downloadcrawl-ref-a6b399eae4cd72f6bc2f077a694ecf5ef6b75ffc.tar.gz
crawl-ref-a6b399eae4cd72f6bc2f077a694ecf5ef6b75ffc.zip
Overhaul god gift handling again so that we can tell which god sent
which gift. There was an unused god parameter in the monsters struct, which was probably intended to hold which god a monster worshipped. I've used it as an indicator of which god sent the monster, under the assumption that gods would send their own worshippers as gifts. (I hope this isn't an abuse of it.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5748 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monplace.h')
-rw-r--r--crawl-ref/source/monplace.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/crawl-ref/source/monplace.h b/crawl-ref/source/monplace.h
index ddc2d01458..9a8cbbf33d 100644
--- a/crawl-ref/source/monplace.h
+++ b/crawl-ref/source/monplace.h
@@ -101,12 +101,11 @@ enum proximity_type // proximity to player to create monster
enum mgen_flag_type
{
- MG_GOD_GIFT = 0x01,
- MG_PERMIT_BANDS = 0x02,
- MG_FORCE_PLACE = 0x04,
- MG_FORCE_BEH = 0x08,
- MG_PLAYER_MADE = 0x10,
- MG_PATROLLING = 0x20
+ MG_PERMIT_BANDS = 0x01,
+ MG_FORCE_PLACE = 0x02,
+ MG_FORCE_BEH = 0x04,
+ MG_PLAYER_MADE = 0x08,
+ MG_PATROLLING = 0x10
};
// A structure with all the data needed to whip up a new monster.
@@ -144,11 +143,16 @@ struct mgen_data
// Generation flags from mgen_flag_type.
unsigned flags;
+ // What god the monster worships, if any. This is currently only
+ // used for monsters that are god gifts, to indicate which god sent
+ // them.
+ god_type god;
+
// The number of hydra heads or manticore attack volleys. Note:
// in older version this field was used for both this and for base_type.
int number;
- // The colour of the monster
+ // The colour of the monster.
int colour;
// A measure of how powerful the generated monster should be (for
@@ -179,6 +183,7 @@ struct mgen_data
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_PROGRAM_BUG,
int monnumber = 0,
int moncolour = BLACK,
@@ -188,8 +193,8 @@ struct mgen_data
: cls(mt), base_type(base), behaviour(beh),
abjuration_duration(abj), pos(p), foe(mfoe), flags(monflags),
- number(monnumber), colour(moncolour), power(monpower),
- proximity(prox), level_type(ltype), map_mask(0)
+ god(which_god), number(monnumber), colour(moncolour),
+ power(monpower), proximity(prox), level_type(ltype), map_mask(0)
{
}
@@ -219,9 +224,11 @@ struct mgen_data
static mgen_data alert_hostile_at(monster_type what,
const coord_def &where,
int abj_deg = 0,
- unsigned flags = 0)
+ unsigned flags = 0,
+ god_type god = GOD_NO_GOD)
{
- return mgen_data(what, BEH_HOSTILE, abj_deg, where, MHITYOU, flags);
+ return mgen_data(what, BEH_HOSTILE, abj_deg, where, MHITYOU, flags,
+ god);
}
};