From f34f77252eb84407a4216766d4492468b3ce46bb Mon Sep 17 00:00:00 2001 From: dolorous Date: Fri, 3 Oct 2008 05:21:30 +0000 Subject: Make handling of undead versus demonic abominations consistent. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7096 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/enum.h | 6 +++++- crawl-ref/source/mon-util.cc | 11 +---------- crawl-ref/source/spells3.cc | 3 +++ 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 4e0a609b8b..dca549073d 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1974,7 +1974,11 @@ enum monster_flag_type // and orcs (Beogh worshippers -> friendly) MF_WAS_IN_VIEW = 0x1000, // Was in view during previous turn MF_BAND_MEMBER = 0x2000, // Created as a member of a band - MF_GOT_HALF_XP = 0x4000 // Player already got half xp value earlier + MF_GOT_HALF_XP = 0x4000, // Player already got half xp value earlier + MF_HONORARY_UNDEAD = 0x8000 // Consider this monster to have MH_UNDEAD + // holiness, regardless of its actual type; + // currently used for abominations created + // via Twisted Resurrection }; // Adding slots breaks saves. YHBW. diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 3a51ce879c..2ca6d2addc 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -359,18 +359,9 @@ static int _scan_mon_inv_randarts( const monsters *mon, return (ret); } -// Returns true if a given monster is an abomination created by -// Twisted Resurrection. -static bool _mons_your_abomination(const monsters *mon) -{ - return ((mon->type == MONS_ABOMINATION_SMALL - || mon->type == MONS_ABOMINATION_LARGE) - && testbits(mon->flags, MF_CREATED_FRIENDLY)); -} - mon_holy_type mons_holiness(const monsters *mon) { - if (_mons_your_abomination(mon)) + if (testbits(mon->flags, MF_HONORARY_UNDEAD)) return (MH_UNDEAD); return (mons_class_holiness(mon->type)); diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 85add52f2d..8d1f5d8410 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -1106,6 +1106,9 @@ bool cast_twisted_resurrection(int pow, god_type god) return (false); } + // Mark this abomination as undead. + menv[monster].flags |= MF_HONORARY_UNDEAD; + mpr("The heap of corpses melds into an agglomeration of writhing flesh!"); if (mon == MONS_ABOMINATION_LARGE) -- cgit v1.2.3-54-g00ecf