From 8dbcc4dbe18b959b2eab5a2c20aac3f97c6179f9 Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 6 Feb 2009 14:32:02 +0000 Subject: Restore a monster's attitude from the beginning of the attack if it changes during the attack and the monster is about to die, so that you don't get Okawaru piety for killing an ally just before you receive the penance. Fixes [2436051]. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8925 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/monstuff.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/monstuff.cc') diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index e15e4bf1eb..b987a9d0c2 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1120,22 +1120,22 @@ int monster_die(monsters *monster, killer_type killer, if (you.religion == GOD_TROG && !player_under_penance() && you.piety > random2(1000)) { - int bonus = 3 + random2avg( 10, 2 ); + const int bonus = 3 + random2avg( 10, 2 ); you.duration[DUR_BERSERKER] += bonus; you.duration[DUR_MIGHT] += bonus; - haste_player( bonus ); + haste_player(bonus); mpr("You feel the power of Trog in you as your rage grows.", MSGCH_GOD, GOD_TROG); } - else if (wearing_amulet( AMU_RAGE ) && one_chance_in(30)) + else if (wearing_amulet(AMU_RAGE) && one_chance_in(30)) { - int bonus = 2 + random2(4); + const int bonus = 2 + random2(4); you.duration[DUR_BERSERKER] += bonus; you.duration[DUR_MIGHT] += bonus; - haste_player( bonus ); + haste_player(bonus); mpr("Your amulet glows a violent red."); } -- cgit v1.2.3-54-g00ecf