diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-21 17:26:20 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-21 17:26:20 +0000 |
commit | 164413a87b0544768389c91b9ae6e833ecabb6ef (patch) | |
tree | 7e0435a9cdefba5d6e2526feffb8d0296eccf570 /crawl-ref/source/religion.cc | |
parent | 33652ed46d6663adcc4b4c5233dc7083746431d0 (diff) | |
download | crawl-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/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 15 |
1 files changed, 12 insertions, 3 deletions
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: |