diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-17 09:16:56 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-17 09:16:56 +0000 |
commit | c2864252f1c893a9ce7422e9b1fbe43073d6dac9 (patch) | |
tree | 78e8159399c849cb039e3aad597c3a4f47331eb7 /crawl-ref/source/religion.cc | |
parent | 85b49e81682b73aaaf9c2a6706ed108b87d8611f (diff) | |
download | crawl-ref-c2864252f1c893a9ce7422e9b1fbe43073d6dac9.tar.gz crawl-ref-c2864252f1c893a9ce7422e9b1fbe43073d6dac9.zip |
Adjust Zin's donation routines to only take half your money at once, to
preserve the piety pool when it would cause an overflow, and to increase
the maximum value such that donations won't be lost in a normal game.
I'm not sure what upper limit to set, especially considering that this
is supposed to support DOS and possibly 16-bit values, so, seeing as
durations are signed ints, I've set it to 32767, which you can only get
all at once with a donation of a little less than 500000 gold.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8501 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 9708298c5f..d79f0a1c67 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -6260,20 +6260,22 @@ void offer_items() return; } - if (!yesno("Do you wish to part with all of your money?", true, 'n')) + if (!yesno("Do you wish to part with half of your money?", true, 'n')) return; - const int donation = _gold_to_donation(you.gold); + const int donation_cost = (you.gold / 2) + 1; + const int donation = _gold_to_donation(donation_cost); #if DEBUG_DIAGNOSTICS || DEBUG_SACRIFICE || DEBUG_PIETY mprf(MSGCH_DIAGNOSTICS, "A donation of $%d amounts to an " - "increase of piety by %d.", you.gold, donation); + "increase of piety by %d.", donation_cost, donation); #endif // Take a note of the donation. - take_note(Note(NOTE_DONATE_MONEY, you.gold)); + take_note(Note(NOTE_DONATE_MONEY, donation_cost)); - you.attribute[ATTR_DONATIONS] += you.gold; - you.gold = 0; + you.attribute[ATTR_DONATIONS] += donation_cost; + + you.gold -= donation_cost; you.redraw_gold = true; if (donation < 1) @@ -6283,8 +6285,8 @@ void offer_items() } you.duration[DUR_PIETY_POOL] += donation; - if (you.duration[DUR_PIETY_POOL] > 500) - you.duration[DUR_PIETY_POOL] = 500; + if (you.duration[DUR_PIETY_POOL] > 32767) + you.duration[DUR_PIETY_POOL] = 32767; const int estimated_piety = std::min(MAX_PENANCE + MAX_PIETY, |