summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-21 17:26:20 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-21 17:26:20 +0000
commit164413a87b0544768389c91b9ae6e833ecabb6ef (patch)
tree7e0435a9cdefba5d6e2526feffb8d0296eccf570 /crawl-ref/source/describe.cc
parent33652ed46d6663adcc4b4c5233dc7083746431d0 (diff)
downloadcrawl-ref-164413a87b0544768389c91b9ae6e833ecabb6ef.tar.gz
crawl-ref-164413a87b0544768389c91b9ae6e833ecabb6ef.zip
Implement reliable protection from harm for Elyvilon (available under
prayer at high enough piety, but with a significant piety cost). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7898 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r--crawl-ref/source/describe.cc31
1 files changed, 24 insertions, 7 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 5b7460b743..81e6c96234 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -3121,10 +3121,15 @@ void describe_god( god_type which_god, bool give_title )
if (harm_protection_type hpt =
god_protects_from_harm(which_god, false))
{
+ have_any = true;
+
int prayer_prot = 0;
- if (hpt == HPT_PRAYING || hpt == HPT_PRAYING_PLUS_ANYTIME)
+ if (hpt == HPT_PRAYING || hpt == HPT_PRAYING_PLUS_ANYTIME
+ || hpt == HPT_RELIABLE_PRAYING_PLUS_ANYTIME)
+ {
prayer_prot = 100 - 3000/you.piety;
+ }
int prot_chance = 10 + you.piety/10 + prayer_prot; // chance * 100
@@ -3134,12 +3139,21 @@ void describe_god( god_type which_god, bool give_title )
: "occasionally";
const char *when =
(hpt == HPT_PRAYING) ? " during prayer" :
- (hpt == HPT_PRAYING_PLUS_ANYTIME) ? ", especially during prayer"
+ (hpt == HPT_PRAYING_PLUS_ANYTIME) ? ", especially during prayer" :
+ (hpt == HPT_RELIABLE_PRAYING_PLUS_ANYTIME)
+ ? ", and always does so during prayer"
: "";
- have_any = true;
- cprintf("%s %s watches over you%s." EOL,
- god_name(which_god).c_str(), how, when);
+ std::string buf = god_name(which_god);
+ buf += " ";
+ buf += how;
+ buf += " watches over you";
+ buf += when;
+ buf += ".";
+
+ _print_final_god_abil_desc(which_god, buf,
+ (hpt == HPT_RELIABLE_PRAYING_PLUS_ANYTIME) ?
+ ABIL_HARM_PROTECTION_II : ABIL_HARM_PROTECTION);
}
if (which_god == GOD_ZIN)
@@ -3184,8 +3198,11 @@ void describe_god( god_type which_god, bool give_title )
else if (which_god == GOD_ELYVILON)
{
have_any = true;
- cprintf("You can call upon %s to destroy weapons lying on the "
- "ground." EOL, god_name(which_god).c_str());
+ std::string buf = "You can call upon ";
+ buf += god_name(which_god);
+ buf += " to destroy weapons lying on the ground.";
+ _print_final_god_abil_desc(which_god, buf,
+ ABIL_ELYVILON_DESTROY_WEAPONS);
}
else if (which_god == GOD_YREDELEMNUL)
{