summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 522dadc077..39f84206ad 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3518,22 +3518,18 @@ static int affect_monster(struct bolt &beam, struct monsters *mon)
hurt_final = 0;
}
-#if DEBUG_DIAGNOSTICS
- const int old_hurt = hurt_final;
-#endif
+ const int raw_damage = hurt_final;
// check monster resists, _without_ side effects (since the
// beam/missile might yet miss!)
- hurt_final = mons_adjust_flavoured( mon, beam, hurt_final, false );
+ hurt_final = mons_adjust_flavoured( mon, beam, raw_damage, false );
#if DEBUG_DIAGNOSTICS
if (!beam.is_tracer)
{
- snprintf( info, INFO_SIZE,
- "Monster: %s; Damage: pre-AC: %d; post-AC: %d; post-resist: %d",
- ptr_monam( mon, DESC_PLAIN ), hurt, old_hurt, hurt_final );
-
- mpr( info, MSGCH_DIAGNOSTICS );
+ mprf(MSGCH_DIAGNOSTICS,
+ "Monster: %s; Damage: pre-AC: %d; post-AC: %d; post-resist: %d",
+ ptr_monam( mon, DESC_PLAIN ), hurt, raw_damage, hurt_final );
}
#endif
@@ -3567,14 +3563,15 @@ static int affect_monster(struct bolt &beam, struct monsters *mon)
// BEGIN real non-enchantment beam
- // player beams which hit friendly MIGHT annoy them and be considered
- // naughty if they do much damage (this is so as not to penalize
- // players that fling fireballs into a melee with fire elementals
- // on their side - the elementals won't give a sh*t, after all)
+ // player beams which hit friendly will annoy them and be
+ // considered naughty if they do damage (this is so as not to
+ // penalize players that fling fireballs into a melee with fire
+ // elementals on their side - the elementals won't give a sh*t,
+ // after all)
if (nasty_beam(mon, beam))
{
- if (YOU_KILL(beam.thrower))
+ if (YOU_KILL(beam.thrower) && hurt_final > 0)
{
if (mons_friendly(mon))
did_god_conduct( DID_ATTACK_FRIEND, 5 );
@@ -3583,7 +3580,10 @@ static int affect_monster(struct bolt &beam, struct monsters *mon)
did_god_conduct( DID_ATTACK_HOLY, mon->hit_dice );
}
- behaviour_event(mon, ME_ANNOY, beam_source(beam) );
+ // Don't annoy friendlies if the player's beam did no damage.
+ // Hostiles will still take umbrage.
+ if (hurt_final > 0 || !mons_friendly(mon) || !YOU_KILL(beam.thrower))
+ behaviour_event(mon, ME_ANNOY, beam_source(beam) );
}
// explosions always 'hit'
@@ -3623,7 +3623,7 @@ static int affect_monster(struct bolt &beam, struct monsters *mon)
// note that hurt_final was calculated above, so we don't need it again.
// just need to apply flavoured specials (since we called with
// doFlavouredEffects = false above)
- hurt_final = mons_adjust_flavoured(mon, beam, hurt_final);
+ hurt_final = mons_adjust_flavoured(mon, beam, raw_damage);
// now hurt monster
hurt_monster( mon, hurt_final );