diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-08 01:25:37 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-08 01:25:37 +0000 |
commit | 20a096b93dc52950e35ff6d5323f0c00e0ac701b (patch) | |
tree | 7fc4eadcf49954e9a44539daaad24a2b6a84bba4 /crawl-ref/source/decks.cc | |
parent | 11ac9d188a1203a9f62e01a1c87be26961fa8fcb (diff) | |
download | crawl-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.cc | 17 |
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); + } } } |