From 5b2d84c8b54933fc18bc5358c77d0beb63d5e99c Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 25 Feb 2009 05:58:54 +0000 Subject: 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 --- crawl-ref/source/effects.cc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/effects.cc') 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); -- cgit v1.2.3-54-g00ecf