diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-20 04:14:33 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-20 04:14:33 +0000 |
commit | abd9b56c169f6e1249ed9f69ba8f94f0a83e092b (patch) | |
tree | aaf2d0f35cbb37ce1831c5122e3a5440cc5755b2 /crawl-ref/source/religion.cc | |
parent | b70aeb65309558b4b83dd5a5f913cbb127f5bf97 (diff) | |
download | crawl-ref-abd9b56c169f6e1249ed9f69ba8f94f0a83e092b.tar.gz crawl-ref-abd9b56c169f6e1249ed9f69ba8f94f0a83e092b.zip |
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
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 10 |
1 files changed, 5 insertions, 5 deletions
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, |