diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-24 20:06:23 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-24 20:06:23 +0000 |
commit | b8850fdc437f685e22adcebf5a81ed5d5e3f05c4 (patch) | |
tree | ec3e85e860956d2fc634c43c9ce500343f965657 /crawl-ref/source/beam.cc | |
parent | 74e2141a845bc9aaa3caa08b9e0de1562173b557 (diff) | |
download | crawl-ref-b8850fdc437f685e22adcebf5a81ed5d5e3f05c4.tar.gz crawl-ref-b8850fdc437f685e22adcebf5a81ed5d5e3f05c4.zip |
And put it back in, in the proper place.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5220 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index d851158db9..cec3294896 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -4175,6 +4175,8 @@ static bool _beam_is_harmless(bolt &beam, monsters *mon) static bool _stop_unchivalric_attack(monsters *mon, bool target) { + const bool inSanctuary = (is_sanctuary(you.x_pos, you.y_pos) + || is_sanctuary(mon->x, mon->y)); const bool wontAttack = mons_wont_attack(mon); const bool isFriendly = mons_friendly(mon); const bool isNeutral = mons_neutral(mon); @@ -4184,21 +4186,25 @@ static bool _stop_unchivalric_attack(monsters *mon, bool target) if (isFriendly) { // listed in the form: "your rat", "Blork" - snprintf(info, INFO_SIZE, "Really fire %s %s?", - (target ? "at" : "through"), - mon->name(DESC_NOCAP_THE).c_str()); + snprintf(info, INFO_SIZE, "Really fire %s %s%s?", + (target) ? "at" + : "through", + mon->name(DESC_NOCAP_THE).c_str(), + (inSanctuary) ? ", despite your sanctuary" + : ""); if (!yesno(info, true, 'n')) return (true); } - else if (wontAttack + else if (inSanctuary || wontAttack || is_good_god(you.religion) && (isNeutral || isHoly) || you.religion == GOD_SHINING_ONE && isUnchivalric) { // "Really fire through the helpless neutral holy Daeva?" // was: "Really fire through this helpless neutral holy creature?" - snprintf(info, INFO_SIZE, "Really fire %s the %s%s%s%s?", - (target ? "at" : "through"), + snprintf(info, INFO_SIZE, "Really fire %s the %s%s%s%s%s?", + (target) ? "at" + : "through", (isUnchivalric) ? "helpless " : "", (isFriendly) ? "friendly " : @@ -4207,7 +4213,9 @@ static bool _stop_unchivalric_attack(monsters *mon, bool target) : "", (isHoly) ? "holy " : "", - mon->name(DESC_PLAIN).c_str()); + mon->name(DESC_PLAIN).c_str(), + (inSanctuary) ? ", despite your sanctuary" + : ""); if (!yesno(info, true, 'n')) return (true); |