From e2d64de47db5a383b9ed863954bcb2296baa957e Mon Sep 17 00:00:00 2001 From: zelgadis Date: Fri, 27 Jun 2008 04:59:40 +0000 Subject: 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 --- crawl-ref/source/beam.cc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'crawl-ref') 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. -- cgit v1.2.3-54-g00ecf