summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-06 14:32:02 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-06 14:32:02 +0000
commit8dbcc4dbe18b959b2eab5a2c20aac3f97c6179f9 (patch)
tree43dcc1b16a420b31b645bbafc938c0c0a3d1b03d /crawl-ref/source/monstuff.cc
parent31fb4f573fea4f4ebcceb1f4fcfc478daa0897dc (diff)
downloadcrawl-ref-8dbcc4dbe18b959b2eab5a2c20aac3f97c6179f9.tar.gz
crawl-ref-8dbcc4dbe18b959b2eab5a2c20aac3f97c6179f9.zip
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
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc10
1 files changed, 5 insertions, 5 deletions
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.");
}