diff options
author | pauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-09 22:40:12 +0000 |
---|---|---|
committer | pauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-09 22:40:12 +0000 |
commit | 9a3546dd1876ad7ebd4f503fe74d6b502eb41c7f (patch) | |
tree | e9bbb373c86d11c9cb3c330edc1087ca05c840ee /crawl-ref/source/tags.cc | |
parent | 2f9171efc49235f06e2b49ecee51f0ca46867a19 (diff) | |
download | crawl-ref-9a3546dd1876ad7ebd4f503fe74d6b502eb41c7f.tar.gz crawl-ref-9a3546dd1876ad7ebd4f503fe74d6b502eb41c7f.zip |
Apply 1895318, with some cleanup.
This patch implements dploog's suggestion of hysteresis on piety.
gain/lose_piety() adjust you.piety_hysteresis first; you.piety is
modified with the leftovers (if any) once the hysteresis reaches its
limit.
Players start out at the upper end of the hysteresis region, meaning
there is no lag on piety increase, but a lag on piety decrease.
Hysteresis value set by "#define PIETY_HYSTERESIS_LIMIT 1"
Does not break old saves.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3562 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r-- | crawl-ref/source/tags.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 7e54a35bef..3ab4284782 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -1004,6 +1004,9 @@ static void tag_construct_you(tagHeader &th) marshallByte(th, you.beheld_by.size()); for (unsigned int k = 0; k < you.beheld_by.size(); k++) marshallByte(th, you.beheld_by[k]); + + // minorVersion 2 starts here + marshallByte(th, you.piety_hysteresis); } static void tag_construct_you_items(tagHeader &th) @@ -1380,6 +1383,9 @@ static void tag_read_you(tagHeader &th, char minorVersion) count_c = unmarshallByte(th); for (i = 0; i < count_c; i++) you.beheld_by.push_back(unmarshallByte(th)); + + if (minorVersion >= 2) + you.piety_hysteresis = unmarshallByte(th); } static void tag_read_you_items(tagHeader &th, char minorVersion) |