summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-15 05:37:57 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-15 05:37:57 +0000
commit4140d2abd9dfcd9cdda476fc4722067beefe0426 (patch)
tree0adc2bf2b5a801825204c284e0dec85cb8faa077 /crawl-ref/source/ouch.cc
parent5599c20eb6b2cd02103958bc53b61714de350960 (diff)
downloadcrawl-ref-4140d2abd9dfcd9cdda476fc4722067beefe0426.tar.gz
crawl-ref-4140d2abd9dfcd9cdda476fc4722067beefe0426.zip
FR #2011386:
When giving or deleting a random mutation you can now request that the mutation picked doesn't instantly kill the player. Xom code now uses this option, except for when the player is under penance from Xom or Xom is bored. Improvements to the code that prevents Xom from accidently killing the player. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7835 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index be12b7db79..2779920550 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -896,20 +896,31 @@ void ouch(int dam, int death_source, kill_method_type death_type,
} // else hp <= 0
}
+ // Is the player being killed by a direct act of Xom?
if (crawl_state.is_god_acting()
&& crawl_state.which_god_acting() == GOD_XOM
&& crawl_state.other_gods_acting().size() == 0)
{
- if (aux == NULL || strstr(aux, "Xom") == NULL)
- death_type = KILLED_BY_XOM;
-
- // Xom should only cause death if the player is under penance or
+ // Xom should only kill his worhsippers if they're under penance or
// Xom is bored.
- if (!you.penance[GOD_XOM]
- && !(you.religion == GOD_XOM && you.gift_timeout == 0))
+ if (you.religion == GOD_XOM && !you.penance[GOD_XOM]
+ && you.gift_timeout > 0)
{
return;
}
+
+ // Also don't kill wizards testing Xom acts.
+ if (crawl_state.prev_cmd == CMD_WIZARD)
+ return;
+
+ // Ensure some minimal informfullness about Xom's involvment.
+ if (aux == NULL)
+ {
+ if (death_type != KILLED_BY_XOM)
+ aux = "Xom";
+ }
+ else if(strstr(aux, "Xom") == NULL)
+ death_type = KILLED_BY_XOM;
}
// Construct scorefile entry.