summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/abl-show.cc8
-rw-r--r--crawl-ref/source/dat/descript/gods.txt2
-rw-r--r--crawl-ref/source/describe.cc31
-rw-r--r--crawl-ref/source/enum.h4
-rw-r--r--crawl-ref/source/ouch.cc16
-rw-r--r--crawl-ref/source/religion.cc15
-rw-r--r--crawl-ref/source/religion.h1
7 files changed, 62 insertions, 15 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 4dcc799daf..06ec8a3515 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -301,6 +301,9 @@ static const ability_def Ability_List[] =
{ ABIL_ROTTING, "Rotting", 4, 4, 0, 2, ABFLAG_NONE },
{ ABIL_TORMENT_II, "Call Torment", 9, 0, 0, 3, ABFLAG_PAIN },
+ { ABIL_HARM_PROTECTION, "Protection From Harm", 0, 0, 0, 0, ABFLAG_NONE },
+ { ABIL_HARM_PROTECTION_II, "Reliable Protection From Harm", 0, 0, 0, 0, ABFLAG_PIETY },
+
{ ABIL_RENOUNCE_RELIGION, "Renounce Religion", 0, 0, 0, 0, ABFLAG_NONE },
};
@@ -1879,6 +1882,11 @@ static bool _do_ability(const ability_def& abil)
}
break;
+ case ABIL_HARM_PROTECTION:
+ case ABIL_HARM_PROTECTION_II:
+ // Activated via prayer elsewhere.
+ break;
+
case ABIL_RENOUNCE_RELIGION:
if (yesno("Really renounce your faith, foregoing its fabulous benefits?",
false, 'n')
diff --git a/crawl-ref/source/dat/descript/gods.txt b/crawl-ref/source/dat/descript/gods.txt
index 660eb00bd8..0d982277a3 100644
--- a/crawl-ref/source/dat/descript/gods.txt
+++ b/crawl-ref/source/dat/descript/gods.txt
@@ -114,7 +114,7 @@ The Trickster's followers gain various ways to influence fate when playing cards
%%%%
Elyvilon powers
-The healer god offers followers various means to heal themselves and others, including ones to rid their body from effects surpassing those of simple damage. Elyvilon will occasionally directly intervene to save a follower's life, and is almost certain to do so during prayer.
+The healer god offers followers various means to heal themselves and others, including ones to rid their body from effects surpassing those of simple damage. Elyvilon will occasionally directly intervene to save a follower's life, and is almost certain to do so during prayer. At high enough piety, the latter becomes certain, but at a cost of piety.
%%%%
Lugonu powers
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)
{
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index a1b7e7d27d..d19abd8e92 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -107,7 +107,9 @@ enum ability_type
ABIL_ROTTING,
ABIL_TORMENT_II,
ABIL_TRAN_BAT,
- ABIL_RENOUNCE_RELIGION = 250 // 250
+ ABIL_HARM_PROTECTION,
+ ABIL_HARM_PROTECTION_II,
+ ABIL_RENOUNCE_RELIGION = 250 // 250
};
enum activity_interrupt_type
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 2779920550..2bdda4bf10 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -850,10 +850,20 @@ void ouch(int dam, int death_source, kill_method_type death_type,
if (dam != INSTANT_DEATH) // that is, a "death" caused by hp loss {dlb}
{
- if (dam >= you.hp && god_protects_from_harm(you.religion))
+ if (dam >= you.hp)
{
- simple_god_message(" protects you from harm!");
- return;
+ if (harm_protection_type hpt = god_protects_from_harm(you.religion))
+ {
+ simple_god_message(" protects you from harm!");
+
+ if (you.duration[DUR_PRAYER]
+ && hpt == HPT_RELIABLE_PRAYING_PLUS_ANYTIME)
+ {
+ lose_piety(21 + random2(20));
+ }
+
+ return;
+ }
}
dec_hp(dam, true);
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index a5ee305e0f..e3d854c031 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -2068,8 +2068,11 @@ static bool _god_accepts_prayer(god_type god)
{
harm_protection_type hpt = god_protects_from_harm(god, false);
- if (hpt == HPT_PRAYING || hpt == HPT_PRAYING_PLUS_ANYTIME)
+ if (hpt == HPT_PRAYING || hpt == HPT_PRAYING_PLUS_ANYTIME
+ || hpt == HPT_RELIABLE_PRAYING_PLUS_ANYTIME)
+ {
return (true);
+ }
if (god_likes_butchery(god))
return (true);
@@ -6380,6 +6383,7 @@ harm_protection_type god_protects_from_harm(god_type god, bool actual)
const int min_piety = piety_breakpoint(0);
bool praying = (you.duration[DUR_PRAYER]
&& random2(you.piety) >= min_piety);
+ bool reliable = (you.piety > 130);
bool anytime = (one_chance_in(10) || x_chance_in_y(you.piety, 1000));
bool penance = (you.penance[god] > 0);
@@ -6399,8 +6403,13 @@ harm_protection_type god_protects_from_harm(god_type god, bool actual)
case GOD_ELYVILON:
if (!actual || praying || anytime)
{
- return (you.piety >= min_piety) ? HPT_PRAYING_PLUS_ANYTIME
- : HPT_ANYTIME;
+ if (you.piety >= min_piety)
+ {
+ return (reliable) ? HPT_RELIABLE_PRAYING_PLUS_ANYTIME
+ : HPT_PRAYING_PLUS_ANYTIME;
+ }
+ else
+ return (HPT_ANYTIME);
}
break;
default:
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index 7390fdad73..406d3dbb31 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -23,6 +23,7 @@ enum harm_protection_type
HPT_PRAYING,
HPT_ANYTIME,
HPT_PRAYING_PLUS_ANYTIME,
+ HPT_RELIABLE_PRAYING_PLUS_ANYTIME,
NUM_HPTS
};