summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-22 19:45:42 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-22 19:45:42 +0000
commit47386690ed83155fc660c15f19c780b9dbf4d386 (patch)
tree1610679a7d4ec6a2e0005de2f8f6c89569ba50e5 /crawl-ref
parente253274f72e6f51e8f9638f3d62152405223292a (diff)
downloadcrawl-ref-47386690ed83155fc660c15f19c780b9dbf4d386.tar.gz
crawl-ref-47386690ed83155fc660c15f19c780b9dbf4d386.zip
Fix [2701428]: TSO will no longer give piety loss and penance for
attacking and killing hostile holy beings (not counting holy beings that weren't hostile until you attacked them, of course). The warning prompt now takes this into account, as well. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9532 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/misc.cc7
-rw-r--r--crawl-ref/source/religion.cc21
2 files changed, 15 insertions, 13 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 97134dc9e3..0c78d07da5 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -3013,7 +3013,10 @@ bool stop_attack_prompt(const monsters *mon, bool beam_attack,
const bool isFriendly = mons_friendly(mon);
const bool isNeutral = mons_neutral(mon);
const bool isUnchivalric = is_unchivalric_attack(&you, mon);
- const bool isHoly = mons_is_holy(mon);
+ const bool isHoly = mons_is_holy(mon)
+ && (mon->attitude != ATT_HOSTILE
+ || testbits(mon->flags, MF_CREATED_FRIENDLY)
+ || testbits(mon->flags, MF_WAS_NEUTRAL));
if (isFriendly)
{
@@ -3033,8 +3036,6 @@ bool stop_attack_prompt(const monsters *mon, bool beam_attack,
&& you.religion == GOD_SHINING_ONE
&& !tso_unchivalric_attack_safe_monster(mon))
{
- // "Really fire through the helpless neutral holy Daeva?"
- // was: "Really fire through this helpless neutral holy creature?"
snprintf(info, INFO_SIZE, "Really %s the %s%s%s%s%s?",
(beam_attack) ? (beam_target) ? "fire at"
: "fire through"
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index b701b4a786..ca46da5962 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -2446,10 +2446,12 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
"just this once.");
break;
}
- piety_change = -level;
- if (known || thing_done == DID_ATTACK_HOLY
- && victim->attitude != ATT_HOSTILE)
+ if (thing_done == DID_ATTACK_HOLY
+ && (victim->attitude != ATT_HOSTILE
+ || testbits(victim->flags, MF_CREATED_FRIENDLY)
+ || testbits(victim->flags, MF_WAS_NEUTRAL)))
{
+ piety_change = -level;
penance = level * ((you.religion == GOD_SHINING_ONE) ? 2
: 1);
}
@@ -2731,13 +2733,13 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
case GOD_ZIN:
case GOD_SHINING_ONE:
case GOD_ELYVILON:
- if (testbits(victim->flags, MF_CREATED_FRIENDLY)
+ if (victim->attitude != ATT_HOSTILE
+ || testbits(victim->flags, MF_CREATED_FRIENDLY)
|| testbits(victim->flags, MF_WAS_NEUTRAL))
{
- level *= 3;
- penance = level;
+ penance = level * 3;
+ piety_change = -level * 3;
}
- piety_change = -level;
retval = true;
break;
@@ -2800,10 +2802,9 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
if (testbits(victim->flags, MF_CREATED_FRIENDLY)
|| testbits(victim->flags, MF_WAS_NEUTRAL))
{
- level *= 3;
- penance = level;
+ penance = level * 3;
+ piety_change = -level * 3;
}
- piety_change = -level;
retval = true;
break;