summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-25 05:58:54 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-25 05:58:54 +0000
commit5b2d84c8b54933fc18bc5358c77d0beb63d5e99c (patch)
tree03b9f946e85d9a9f2af0c66a69b56421befafd26 /crawl-ref/source/effects.cc
parent55cecf35a312f8fd15744e8cfe85512c194beb8a (diff)
downloadcrawl-ref-5b2d84c8b54933fc18bc5358c77d0beb63d5e99c.tar.gz
crawl-ref-5b2d84c8b54933fc18bc5358c77d0beb63d5e99c.zip
Simplify healing rate calculation for vampires, and make vampires'
hunger level affect their stat recovery rate similarly to how it affects their healing rate. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9206 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 021e4b08f7..3d32b3fcbd 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -3105,8 +3105,28 @@ void handle_time(long time_delta)
// Adjust the player's stats if s/he's diseased (or recovering).
if (!you.disease)
{
- // With slow healing 3, you have no stat recovery.
- if (x_chance_in_y(3 - player_mutation_level(MUT_SLOW_HEALING), 3))
+ bool recovery = true;
+
+ // The better-fed you are, the faster your stat recovery.
+ if (you.species == SP_VAMPIRE)
+ {
+ if (you.hunger_state == HS_STARVING)
+ // No stat recovery for starving vampires.
+ recovery = false;
+ else if (you.hunger_state <= HS_HUNGRY)
+ // Halved stat recovery for hungry vampires.
+ recovery = coinflip();
+ }
+
+ // Slow heal mutation. Applied last.
+ // Each level reduces your stat recovery by one third.
+ if (recovery)
+ {
+ recovery =
+ x_chance_in_y(3 - player_mutation_level(MUT_SLOW_HEALING), 3);
+ }
+
+ if (recovery)
{
if (you.strength < you.max_strength && one_chance_in(100))
restore_stat(STAT_STRENGTH, 0, false, true);