summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-24 19:23:36 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-24 19:23:36 +0000
commit918389a0cf54b7b6adf6505a1321f8b414d0effe (patch)
tree5e6aa0bd6ad5cff3d4bbd71d42a38191a8c8e7ac /crawl-ref/source/beam.cc
parent779fa77b12bdb33d3be215297da1daabf96f5af7 (diff)
downloadcrawl-ref-918389a0cf54b7b6adf6505a1321f8b414d0effe.tar.gz
crawl-ref-918389a0cf54b7b6adf6505a1321f8b414d0effe.zip
Update change log once again.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5216 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc39
1 files changed, 25 insertions, 14 deletions
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)