summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/decks.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-08 01:25:37 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-08 01:25:37 +0000
commit20a096b93dc52950e35ff6d5323f0c00e0ac701b (patch)
tree7fc4eadcf49954e9a44539daaad24a2b6a84bba4 /crawl-ref/source/decks.cc
parent11ac9d188a1203a9f62e01a1c87be26961fa8fcb (diff)
downloadcrawl-ref-20a096b93dc52950e35ff6d5323f0c00e0ac701b.tar.gz
crawl-ref-20a096b93dc52950e35ff6d5323f0c00e0ac701b.zip
Tweak the mass draining card effect to more closely match
monsters::drain_exp(). They should eventually be consolidated, as soon as I figure out how to scale the power. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8971 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/decks.cc')
-rw-r--r--crawl-ref/source/decks.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index b338bb7fcc..ec604db006 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -1750,14 +1750,19 @@ static int _drain_monsters(coord_def where, int pow, int, actor *)
{
simple_monster_message(&mon, " is drained!");
- if (x_chance_in_y(pow / 60, 20))
+ mon.hurt(&you, 2 + random2(50), BEAM_NEG);
+
+ if (mon.alive())
{
- mon.hit_dice--;
- mon.experience = 0;
- }
+ if (x_chance_in_y(pow / 60, 20))
+ {
+ mon.hit_dice--;
+ mon.experience = 0;
+ }
- mon.max_hit_points -= 2 + random2(pow/50);
- mon.hurt(&you, 2 + random2(50), BEAM_NEG);
+ mon.max_hit_points -= 2 + random2(pow/50);
+ mon.hit_points = std::min(mon.max_hit_points, mon.hit_points);
+ }
}
}