summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/decks.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-03 00:28:09 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-03 00:28:09 +0000
commit8e5c98fdea2404a741f67eca776616ba32fe04cc (patch)
treef4eefd958fd093ef26843981be8d32f835f1ddb3 /crawl-ref/source/decks.cc
parent229273780df2b6cd56ba0675538a9ae4307f9804 (diff)
downloadcrawl-ref-8e5c98fdea2404a741f67eca776616ba32fe04cc.tar.gz
crawl-ref-8e5c98fdea2404a741f67eca776616ba32fe04cc.zip
When drawing a damaging card, set the beam range to LOS_RADIUS.
Remove unused function hurt_monster(). In monsters::hurt() if, after hurting the monster, hit_points > max_hit_points, then hurt the monster some more until hit_points == max_hit_points. Use monsers::hurt() instead of directly descreasing the hit_points member. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8145 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/decks.cc')
-rw-r--r--crawl-ref/source/decks.cc15
1 files changed, 4 insertions, 11 deletions
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 080c029e77..5527be10ec 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -1731,16 +1731,7 @@ static int _drain_monsters(coord_def where, int pow, int garbage)
}
mon.max_hit_points -= 2 + random2(pow/50);
- mon.hit_points -= 2 + random2(50);
-
- if (mon.hit_points >= mon.max_hit_points)
- mon.hit_points = mon.max_hit_points;
-
- if (mon.hit_dice < 1)
- mon.hit_points = 0;
-
- if (mon.hit_points <= 0)
- monster_die(&mon, KILL_YOU, NON_MONSTER);
+ mon.hurt(&you, 2 + random2(50), BEAM_NEG);
}
}
return 1;
@@ -1759,7 +1750,6 @@ static bool _damaging_card(card_type card, int power, deck_rarity_type rarity)
const int power_level = get_power_level(power, rarity);
dist target;
- bolt beam;
zap_type ztype = ZAP_DEBUGGING_RAY;
const zap_type firezaps[3] = { ZAP_FLAME, ZAP_STICKY_FLAME, ZAP_FIRE };
const zap_type frostzaps[3] = { ZAP_FROST, ZAP_ICE_BOLT, ZAP_COLD };
@@ -1815,6 +1805,9 @@ static bool _damaging_card(card_type card, int power, deck_rarity_type rarity)
snprintf(info, INFO_SIZE, "You have drawn %s. Aim where? ",
card_name(card));
+
+ bolt beam;
+ beam.range = LOS_RADIUS;
if (spell_direction(target, beam, DIR_NONE, TARG_ENEMY,
LOS_RADIUS, true, true, false, info)
&& player_tracer(ZAP_DEBUGGING_RAY, power/4, beam))