summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-14 13:34:33 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-14 13:34:33 +0000
commit3d3d03f771d2161b20986726a05d680c5771c8f1 (patch)
tree503d9b7470f88be08f395a92397736cf33e54519 /crawl-ref/source/ouch.cc
parent4bd5cef214da1bb0553ef69e9b6d09ea37bf31bd (diff)
downloadcrawl-ref-3d3d03f771d2161b20986726a05d680c5771c8f1.tar.gz
crawl-ref-3d3d03f771d2161b20986726a05d680c5771c8f1.zip
Partial implementation of FR #2011386: Xom shouldn't directly kill the player
unless he's being nasty (the player is under penance from Xom or Xom is bored). I've put checks into _xom_is_good() and _xom_is_bad() to avoid this as much as possible, and as a safety-net changed ouch() to return early if the player dies from a Xom effect when Xom wasn't being nasty so that xom_acts() can then fix things up (this causes Xom to give a message from "Xom accidental homicide" in dat/database/godspeak.txt) Next up will be an addition to mutate() so you can request random mutations be non-lethal, which should take care of all known situations where ouch() returns early due to Xom making a mistake. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7833 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 50b2dbb25f..be12b7db79 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -896,6 +896,22 @@ void ouch(int dam, int death_source, kill_method_type death_type,
} // else hp <= 0
}
+ 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 is bored.
+ if (!you.penance[GOD_XOM]
+ && !(you.religion == GOD_XOM && you.gift_timeout == 0))
+ {
+ return;
+ }
+ }
+
// Construct scorefile entry.
scorefile_entry se(dam, death_source, death_type, aux);