From abd9b56c169f6e1249ed9f69ba8f94f0a83e092b Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 20 Nov 2008 04:14:33 +0000 Subject: Clean up the piety pool and donation routines one last time. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7518 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 6 ++---- crawl-ref/source/religion.cc | 10 +++++----- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index a6da753096..9af300e238 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -2849,11 +2849,9 @@ static void _decrement_durations() // (killing monsters, offering items, ...) might be confusing for characters // of other religions. // For now, though, keep information about what happened hidden. - if (you.duration[DUR_PIETY_POOL] > 0 - && (you.penance[you.religion] > 0 || you.piety < MAX_PIETY) - && one_chance_in(5)) + if (you.duration[DUR_PIETY_POOL] > 0 && one_chance_in(5)) { - you.duration[DUR_PIETY_POOL]--; + you.duration[DUR_PIETY_POOL]--; // Decrease even if piety at maximum. gain_piety(1); #if DEBUG_DIAGNOSTICS || DEBUG_SACRIFICE || DEBUG_PIETY diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 6178e59e48..a302cdadd8 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -5694,9 +5694,9 @@ static piety_gain_t _sacrifice_one_item_noncount( const item_def& item) return (relative_piety_gain); } -static int _donation_value(int value) +static int _gold_to_donation(int gold) { - return ((value * log((double)value)) / MAX_PIETY); + return ((gold * log((double)gold)) / MAX_PIETY); } void offer_items() @@ -5727,7 +5727,7 @@ void offer_items() if (!yesno("Do you wish to part with all of your money?", true, 'n')) return; - const int donation = _donation_value(you.gold); + const int donation = _gold_to_donation(you.gold); #if DEBUG_DIAGNOSTICS || DEBUG_SACRIFICE || DEBUG_PIETY mprf(MSGCH_DIAGNOSTICS, "A donation of $%d amounts to an " @@ -5746,8 +5746,8 @@ void offer_items() } you.duration[DUR_PIETY_POOL] += donation; - if (you.duration[DUR_PIETY_POOL] > (MAX_PENANCE + MAX_PIETY) * 2) - you.duration[DUR_PIETY_POOL] = (MAX_PENANCE + MAX_PIETY) * 2; + if (you.duration[DUR_PIETY_POOL] > 500) + you.duration[DUR_PIETY_POOL] = 500; const int estimated_piety = std::min(MAX_PENANCE + MAX_PIETY, -- cgit v1.2.3-54-g00ecf