diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-02-12 14:48:27 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-02-12 14:48:27 +0000 |
commit | b77d175f750cbcc9cd886718386524640a30b4ce (patch) | |
tree | 77999e98b15b9dc006938d7cf3740f39c206766d /crawl-ref/source/monstuff.cc | |
parent | e8e7c9ee54157097b03cf40bce5c4860b411f91a (diff) | |
download | crawl-ref-b77d175f750cbcc9cd886718386524640a30b4ce.tar.gz crawl-ref-b77d175f750cbcc9cd886718386524640a30b4ce.zip |
Tweak DID_KILL_HOLY handling to allow for killing hostile angels
without being put under penance by the good gods. Also add a
flag MF_WAS_NEUTRAL, so that previously neutral monsters can be
handled differently from always hostile ones.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3432 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 92a0f8c514..85e7250b04 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -403,9 +403,10 @@ static void give_adjusted_experience(monsters *monster, killer_type killer, const bool created_friendly = testbits(monster->flags, MF_CREATED_FRIENDLY); + const bool was_neutral = testbits(monster->flags, MF_WAS_NEUTRAL); const bool no_xp = monster->has_ench(ENCH_ABJ); - if (created_friendly || no_xp) + if (created_friendly || was_neutral || no_xp) ; // No experience if monster was created friendly or summoned. else if (YOU_KILL(killer)) { @@ -642,6 +643,8 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) { const bool created_friendly = testbits(monster->flags, MF_CREATED_FRIENDLY); + const bool was_neutral = + testbits(monster->flags, MF_WAS_NEUTRAL); if (death_message) { @@ -650,7 +653,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) monster->name(DESC_NOCAP_THE).c_str()); } - if (created_friendly && gives_xp && death_message) + if ((created_friendly || was_neutral) && gives_xp && death_message) mpr("That felt strangely unrewarding."); // killing triggers tutorial lesson @@ -695,6 +698,10 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) if (mons_holiness(monster) == MH_HOLY) did_god_conduct(DID_KILL_ANGEL, monster->hit_dice, true, monster); + + if (created_friendly) + did_god_conduct(DID_KILL_NEUTRAL, monster->hit_dice, + true, monster); } // Divine health and mp restoration doesn't happen when killing |