summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorevktalo <evktalo@users.sourceforge.net>2009-10-02 00:13:21 +0300
committerevktalo <evktalo@users.sourceforge.net>2009-10-02 00:13:21 +0300
commit2a56957bec723bd5a9b842b503ba3c6e7e0f0ec0 (patch)
tree4800abc6358fd2a683820abd7ec3455f8671f936 /crawl-ref/source/effects.cc
parent60c100224a47bad1faaecaf1dba27f9562e23256 (diff)
downloadcrawl-ref-2a56957bec723bd5a9b842b503ba3c6e7e0f0ec0.tar.gz
crawl-ref-2a56957bec723bd5a9b842b503ba3c6e7e0f0ec0.zip
Applying Kiku patch by Alex MacDonald (timecircuits). Kiku now has an invocation to provide corpses, provides (partial) torment resistance, provides torment when butchering while praying, and gifts Necromancy books. As the final gift, the player can choose between blessing the wielded weapon with Pain brand, or Necronomicon.
Flavour and help texts haven't been altered yet. Signed-off-by: evktalo <evktalo@users.sourceforge.net>
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 9aac28b298..0a677af6a2 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -203,6 +203,30 @@ int torment_player(int pow, int caster)
hploss = std::max(0, you.hp * (50 - player_prot_life() * 5) / 100 - 1);
}
+ // Kiku protects you from torment to a degree.
+ bool kiku_shielding_player =
+ (you.religion == GOD_KIKUBAAQUDGHA
+ && !player_res_torment()
+ && !player_under_penance()
+ && you.piety > 80
+ && you.gift_timeout == 0); // no protection during pain branding weapon
+
+ if (kiku_shielding_player)
+ {
+ if(!player_res_torment())
+ {
+ if (random2(600) < you.piety) // 13.33% to 33.33% chance
+ {
+ hploss = 0;
+ simple_god_message(" shields you entirely from torment!");
+ } else if (random2(250) < you.piety) { // 24% to 80% chance
+ hploss -= random2(hploss - 1);
+ simple_god_message(" shields you from torment!");
+ }
+ }
+ }
+
+
if (!hploss)
{
mpr("You feel a surge of unholy energy.");