summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-22 04:05:26 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-22 04:05:26 +0000
commitc37a9398ab2850d920de9cef57d1ca44d0e7e257 (patch)
treec8bce7639273b36f107a64a522e85c08f75edd4b /crawl-ref/source/ouch.cc
parentbea44e6c4331e7ff932eab4c7d96f61c1d2d3fe6 (diff)
downloadcrawl-ref-c37a9398ab2850d920de9cef57d1ca44d0e7e257.tar.gz
crawl-ref-c37a9398ab2850d920de9cef57d1ca44d0e7e257.zip
Add minor cleanups of divine protection from harm:
* move the list of gods that do it into the function god_protects_from_harm(), instead of hardcoding the list in two places * update the description of it, both in the code and the surrounding comments, since it no longer depends on prayer, and since it can now happen with piety less than 30 git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2892 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc10
1 files changed, 1 insertions, 9 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 19403209ec..6e6e35dffd 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -785,24 +785,16 @@ void ouch( int dam, int death_source, kill_method_type death_type,
if (dam > -9000) // that is, a "death" caused by hp loss {dlb}
{
- switch (you.religion)
+ if (god_protects_from_harm(you.religion))
{
- case GOD_ZIN:
- case GOD_SHINING_ONE:
- case GOD_ELYVILON:
- case GOD_YREDELEMNUL:
if (dam >= you.hp
&& (one_chance_in(10) || you.piety > random2(1000)))
{
simple_god_message( " protects you from harm!" );
return;
}
- break;
- default:
- break;
}
-
dec_hp( dam, true );
// Even if we have low HP messages off, we'll still give a