From b8044fd336d74ebc40d688f25df37c203aa4e10b Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 7 Apr 2008 01:53:07 +0000 Subject: Neutral monster adjustments: monsters made permanently neutral by Zin's Recite will give half XP, a la Elyvilon; neutral monsters that have given half XP will not attack the player; and holy beings converted on sight by the player's piety will have the half XP flag set, even though they don't actually give it (on the grounds that they shouldn't be good kills if they turn hostile). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4086 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index e5b8d4c830..6d128a61ec 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -3907,12 +3907,19 @@ static void mons_lose_attack_energy(monsters *attacker, int wpn_speed, bool monster_attack(int monster_attacking) { monsters *attacker = &menv[monster_attacking]; - - if (mons_friendly(attacker) && !mons_is_confused(attacker)) + + // Friendly monsters and neutral monsters that you got half XP from + // won't attack unless confused. + if ((mons_friendly(attacker) + || (mons_neutral(attacker) + && testbits(attacker->flags, MF_GOT_HALF_XP))) + && !mons_is_confused(attacker)) + { return false; + } - // in case the monster hasn't noticed you - // bumping into will change that + // In case the monster hasn't noticed you, bumping into it will + // change that. behaviour_event( attacker, ME_ALERT, MHITYOU ); melee_attack attk(attacker, &you); attk.attack(); -- cgit v1.2.3-54-g00ecf