From df0686dc843b95138a388d2d1edeb16a96e6ca80 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 10 Mar 2007 11:23:32 +0000 Subject: Good gods' passive piety gain now fixes penance and gift timeouts even if piety >= 150 (Erik). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1010 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/religion.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/religion.cc') diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index f8b7bd12ac..a8a0aff55f 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1621,9 +1621,9 @@ void gain_piety(char pgn) } else { - // Sif Muna has a gentler taper off because training because + // Sif Muna has a gentler taper off because training becomes // naturally slower as the player gains in spell skills. - if ((you.piety > 220) || + if ((you.piety > 199) || (you.piety > 150 && one_chance_in(5))) return; } @@ -2585,6 +2585,12 @@ void offer_corpse(int corpse) did_god_conduct(DID_DEDICATED_BUTCHERY, 10); } // end offer_corpse() +// Returns true if the player can use the good gods' passive piety gain. +static bool need_free_piety() +{ + return (you.piety < 150 || you.gift_timeout || you.penance[you.religion]); +} + //jmf: moved stuff from items::handle_time() void handle_god_time(void) { @@ -2645,12 +2651,12 @@ void handle_god_time(void) case GOD_ZIN: // These gods like long-standing worshippers case GOD_ELYVILON: - if (you.piety < 150 && one_chance_in(20)) + if (need_free_piety() && one_chance_in(20)) gain_piety(1); break; case GOD_SHINING_ONE: - if (you.piety < 150 && one_chance_in(15)) + if (need_free_piety() && one_chance_in(15)) gain_piety(1); break; -- cgit v1.2.3-54-g00ecf