summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
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);