summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-27 04:59:40 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-27 04:59:40 +0000
commite2d64de47db5a383b9ed863954bcb2296baa957e (patch)
tree459f837c2649577f4a8ec74e22f2e1e86063555e /crawl-ref/source/beam.cc
parentd3ae981761ae3d805364cf14e418b878422d8247 (diff)
downloadcrawl-ref-e2d64de47db5a383b9ed863954bcb2296baa957e.tar.gz
crawl-ref-e2d64de47db5a383b9ed863954bcb2296baa957e.zip
Update beam.fr_count and beam.foe_count for beams fired by the player
as well as beams fired by monsters. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6166 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 370b0bb7ad..b1a3c9d533 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3613,9 +3613,13 @@ static int _affect_player( bolt &beam, item_def *item )
if (beam.is_tracer)
{
// Check whether thrower can see player, unless thrower == player.
- if (beam.thrower != KILL_YOU_MISSILE && beam.thrower != KILL_YOU
- && (beam.can_see_invis || !you.invisible()
- || _fuzz_invis_tracer(beam)))
+ if (YOU_KILL(beam.thrower))
+ {
+ beam.fr_count += 1;
+ beam.fr_power += you.experience_level;
+ }
+ else if (beam.can_see_invis || !you.invisible()
+ || _fuzz_invis_tracer(beam))
{
if (mons_att_wont_attack(beam.attitude))
{
@@ -3624,11 +3628,8 @@ static int _affect_player( bolt &beam, item_def *item )
}
else
{
- if (beam.thrower != KILL_YOU_MISSILE)
- {
- beam.foe_count++;
- beam.foe_power += you.experience_level;
- }
+ beam.foe_count++;
+ beam.foe_power += you.experience_level;
}
}
return (_range_used_on_hit(beam));
@@ -4291,9 +4292,7 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item)
return 0;
}
- if (thrower == KILL_YOU_MISSILE)
- ;
- else if (!mons_atts_aligned(beam.attitude, mons_attitude(mon)))
+ if (!mons_atts_aligned(beam.attitude, mons_attitude(mon)))
{
beam.foe_count += 1;
beam.foe_power += mons_power(mons_type);
@@ -4349,8 +4348,9 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item)
}
}
}
+
// Enchant case -- enchantments always hit, so update target immed.
- else if (!mons_atts_aligned(beam.attitude, mons_attitude(mon)))
+ if (!mons_atts_aligned(beam.attitude, mons_attitude(mon)))
{
beam.foe_count += 1;
beam.foe_power += mons_power(mons_type);
@@ -4516,8 +4516,9 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item)
}
}
}
+
// Check only if actual damage.
- else if (hurt_final > 0)
+ if (hurt_final > 0)
{
// Monster could be hurt somewhat, but only apply the
// monster's power based on how badly it is affected.