diff options
author | Charles Otto <ottochar@gmail.com> | 2009-11-15 20:33:39 -0500 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2009-11-15 23:46:56 -0500 |
commit | af7a73027bddcff39a6ba1b08398a5310e5797ac (patch) | |
tree | 4b9b62221f97c36729f10a5abe92b6a55c9aa0e1 /crawl-ref/source/main.cc | |
parent | 59fc71976324c4f9153bedeac1fb0f788043b692 (diff) | |
download | crawl-ref-af7a73027bddcff39a6ba1b08398a5310e5797ac.tar.gz crawl-ref-af7a73027bddcff39a6ba1b08398a5310e5797ac.zip |
Make per turn hunger proportional to time_taken
This is somewhat sloppy numerically since the per turn hunger values
are rather small and scaling them can easily take the value to zero.
I'm assuming using div_rand_round is good enough.
Also doubling the hunger increase from haste to keep parity now that
hasted turns cause half the hunger of unhasted turns.
Diffstat (limited to 'crawl-ref/source/main.cc')
-rw-r--r-- | crawl-ref/source/main.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index bfb63c82a6..559d377f74 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -2829,7 +2829,9 @@ void world_reacts() _decrement_durations(); - const int food_use = player_hunger_rate(); + int food_use = player_hunger_rate(); + food_use = div_rand_round(food_use * you.time_taken, BASELINE_DELAY); + if (food_use > 0 && you.hunger >= 40) make_hungry(food_use, true); |