diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-01 18:30:23 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-01 18:30:23 +0000 |
commit | 37ffd29a84d48b08c2ef799a271f3ab83202a03a (patch) | |
tree | b38cd8507f2b67cb339ce0879e9a1fc1e58e44f0 /crawl-ref/source/describe.cc | |
parent | ae715f40ef49bd3e81a59847cb642bf7b328d3de (diff) | |
download | crawl-ref-37ffd29a84d48b08c2ef799a271f3ab83202a03a.tar.gz crawl-ref-37ffd29a84d48b08c2ef799a271f3ab83202a03a.zip |
Add one more cleanup of protection from harm. Since there's more than
one type of it now, expand god_protects_from_harm() to include the logic
for when certain gods do it. Also, as brought up on crawl-ref-discuss,
make Elyvilon do it both casually and during prayer.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2959 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r-- | crawl-ref/source/describe.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 87e2f4991b..c3b3a9f301 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -4276,23 +4276,27 @@ void describe_god( god_type which_god, bool give_title ) textcolor(colour); // 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). + // 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? bool have_any = false; - if (god_protects_from_harm(which_god)) + if (harm_protection_type hpt = + god_protects_from_harm(which_god, false)) { + const char *how = (you.piety >= 150) ? "carefully" : + (you.piety >= 90) ? "often" : + (you.piety >= 30) ? "sometimes" : + "occasionally"; + const char *when = + (hpt == HPT_PRAYING) ? " during prayer" : + (hpt == HPT_PRAYING_PLUS_ANYTIME) ? ", especially during prayer" : + ""; + have_any = true; - cprintf( "%s %s watches over you." EOL, god_name(which_god), - (you.piety >= 150) ? "carefully": - (you.piety >= 90) ? "often" : - (you.piety >= 30) ? "sometimes" : - "occasionally"); + cprintf( "%s %s watches over you%s." EOL, god_name(which_god), + how, when ); } if (which_god == GOD_ZIN && you.piety >= 30) |