summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-09 21:31:02 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-09 21:31:02 +0100
commitb8f3c183df87ee55833ab561fa12ed324da5a913 (patch)
tree2be4120a6fc0053dc049ba066e68b1ebfe701a01 /crawl-ref/source/ouch.cc
parentf4efe0a7c1422dede865ea5f9d8e2d96978b2f9f (diff)
downloadcrawl-ref-b8f3c183df87ee55833ab561fa12ed324da5a913.tar.gz
crawl-ref-b8f3c183df87ee55833ab561fa12ed324da5a913.zip
Make Xom sometimes (< 5% chance) revive the player after death.
The chance of this happening depends strongly on tension and mood, as well as type of death. I also tried the normal protection from harm but I figure it's more interesting this way. :D
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 432cc7b440..93eaacd48b 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -1130,7 +1130,7 @@ void ouch(int dam, int death_source, kill_method_type death_type,
// Okay, you *didn't* escape death.
you.reset_escaped_death();
- // Ensure some minimal information about Xom's involvment.
+ // Ensure some minimal information about Xom's involvement.
if (aux == NULL || strlen(aux) == 0)
{
if (death_type != KILLED_BY_XOM)
@@ -1139,6 +1139,12 @@ void ouch(int dam, int death_source, kill_method_type death_type,
else if (strstr(aux, "Xom") == NULL)
death_type = KILLED_BY_XOM;
}
+ // Xom may still try to save your life.
+ else if (xom_saves_your_life(dam, death_source, death_type, aux,
+ see_source))
+ {
+ return;
+ }
#if WIZARD || DEBUG
if (you.never_die)