summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.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/describe.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/describe.cc')
-rw-r--r--crawl-ref/source/describe.cc35
1 files changed, 17 insertions, 18 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 365336611c..3d608592df 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -4281,32 +4281,31 @@ void describe_god( god_type which_god, bool give_title )
cprintf(EOL EOL "Granted powers: (Cost)" EOL);
textcolor(colour);
- // mv: these gods protects you during your prayer (not mentioning XOM)
- // chance for doing so is (random2(you.piety) >= 30)
+ // mv: some gods can protect you from harm
+ // The chance for doing so is:
+ // one_chance_in(10) || you.piety > random2(1000)
// Note that it's not depending on penance.
// Btw. I'm not sure how to explain such divine protection
// because god isn't really protecting player - he only sometimes
// saves his life (probably it shouldn't be displayed at all).
- // What about this ?
+ // What about this?
bool have_any = false;
- if ((which_god == GOD_ZIN
- || which_god == GOD_SHINING_ONE
- || which_god == GOD_ELYVILON
- || which_god == GOD_YREDELEMNUL)
- && you.piety >= 30)
+
+ if (god_protects_from_harm(which_god))
{
have_any = true;
- cprintf( "%s %s watches over you during prayer." EOL,
- god_name(which_god),
- (you.piety >= 150) ? "carefully": // > 4/5
- (you.piety >= 90) ? "often" : // > 2/3
- "sometimes"); // less than 2:3
+ cprintf( "%s %s watches over you." EOL, god_name(which_god),
+ (you.piety >= 150) ? "carefully":
+ (you.piety >= 90) ? "often" :
+ (you.piety >= 30) ? "sometimes" :
+ "occasionally");
+ }
- if (which_god == GOD_ZIN)
- {
- cprintf("Praying to %s will provide sustenance if starving."
- EOL, god_name(which_god));
- }
+ if (which_god == GOD_ZIN && you.piety >= 30)
+ {
+ have_any = true;
+ cprintf("Praying to %s will provide sustenance if starving."
+ EOL, god_name(which_god));
}
if (which_god == GOD_TROG)