From 918389a0cf54b7b6adf6505a1321f8b414d0effe Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 24 May 2008 19:23:36 +0000 Subject: Update change log once again. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5216 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index e0540d38f7..d851158db9 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -4173,7 +4173,7 @@ static bool _beam_is_harmless(bolt &beam, monsters *mon) } } -static bool _stop_unchivalric_attack(monsters *mon) +static bool _stop_unchivalric_attack(monsters *mon, bool target) { const bool wontAttack = mons_wont_attack(mon); const bool isFriendly = mons_friendly(mon); @@ -4184,7 +4184,8 @@ static bool _stop_unchivalric_attack(monsters *mon) if (isFriendly) { // listed in the form: "your rat", "Blork" - snprintf(info, INFO_SIZE, "Really fire through %s?", + snprintf(info, INFO_SIZE, "Really fire %s %s?", + (target ? "at" : "through"), mon->name(DESC_NOCAP_THE).c_str()); if (!yesno(info, true, 'n')) @@ -4196,8 +4197,8 @@ static bool _stop_unchivalric_attack(monsters *mon) { // "Really fire through the helpless neutral holy Daeva?" // was: "Really fire through this helpless neutral holy creature?" - snprintf(info, INFO_SIZE, "Really fire through the " - "%s%s%s%s?", + snprintf(info, INFO_SIZE, "Really fire %s the %s%s%s%s?", + (target ? "at" : "through"), (isUnchivalric) ? "helpless " : "", (isFriendly) ? "friendly " : @@ -4280,11 +4281,16 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item) { if (beam.thrower == KILL_YOU_MISSILE) { - if (!_beam_is_harmless(beam, mon) - && _stop_unchivalric_attack(mon)) + if (!_beam_is_harmless(beam, mon)) { - beam.fr_count = 1; - return (BEAM_STOP); + const bool target = (beam.target_x == mon->x + && beam.target_y == mon->y); + + if (_stop_unchivalric_attack(mon, target)) + { + beam.fr_count = 1; + return (BEAM_STOP); + } } } // Enchant case -- enchantments always hit, so update target immed. @@ -4454,12 +4460,17 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item) { if (beam.thrower == KILL_YOU_MISSILE) { - if (!_beam_is_harmless(beam, mon) - && _stop_unchivalric_attack(mon)) - { - beam.fr_count = 1; - return (BEAM_STOP); - } + if (!_beam_is_harmless(beam, mon)) + { + const bool target = (beam.target_x == mon->x + && beam.target_y == mon->y); + + if (_stop_unchivalric_attack(mon, target)) + { + beam.fr_count = 1; + return (BEAM_STOP); + } + } } // Check only if actual damage. else if (hurt_final > 0) -- cgit v1.2.3-54-g00ecf