From 164413a87b0544768389c91b9ae6e833ecabb6ef Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 21 Dec 2008 17:26:20 +0000 Subject: 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 --- crawl-ref/source/describe.cc | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/describe.cc') 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) { -- cgit v1.2.3-54-g00ecf