summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-11-15 19:00:18 -0500
committerCharles Otto <ottochar@gmail.com>2009-11-15 23:46:54 -0500
commite2e53f867209b1ae9d9923b9e042796d91677363 (patch)
tree126873d4aad5dcff299719c42b9462ee1c6d807e /crawl-ref/source/player.cc
parentec62dd87b6bbe338aa50dc503db2f999c2d352c3 (diff)
downloadcrawl-ref-e2e53f867209b1ae9d9923b9e042796d91677363.tar.gz
crawl-ref-e2e53f867209b1ae9d9923b9e042796d91677363.zip
Delay adjustment for sickness
Store total time to recovery instead of turns in you.disease, change you.disease to an integer, update tags and bump TAG_MINOR_VERSION accordingly.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 1fcafdd60f..6593e683ef 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -3684,9 +3684,11 @@ void display_char_status()
if (you.disease)
{
+ int high = 120 * BASELINE_DELAY;
+ int low = 40 * BASELINE_DELAY;
mprf("You are %sdiseased.",
- (you.disease > 120) ? "badly " :
- (you.disease > 40) ? ""
+ (you.disease > high) ? "badly " :
+ (you.disease > low) ? ""
: "mildly ");
}
@@ -5070,7 +5072,7 @@ bool disease_player(int amount)
return you.sicken(amount);
}
-void dec_disease_player()
+void dec_disease_player(int delay)
{
if (you.disease > 0)
{
@@ -5083,15 +5085,17 @@ void dec_disease_player()
return;
}
- you.disease--;
+ you.disease -= delay;
+ if(you.disease < 0)
+ you.disease = 0;
// kobolds and regenerators recuperate quickly
- if (you.disease > 5
+ if (you.disease > 5 * BASELINE_DELAY
&& (you.species == SP_KOBOLD
|| you.duration[DUR_REGENERATION]
|| player_mutation_level(MUT_REGENERATION) == 3))
{
- you.disease -= 2;
+ you.disease -= 2 * BASELINE_DELAY;
}
if (you.disease == 0)
@@ -6799,10 +6803,11 @@ bool player::sicken(int amount)
mpr( "You feel ill." );
- const int tmp = disease + amount;
- disease = (tmp > 210) ? 210 : tmp;
- learned_something_new(TUT_YOU_SICK);
+ disease += amount * BASELINE_DELAY;
+ if(disease > 210 * BASELINE_DELAY)
+ disease = 210 * BASELINE_DELAY;
+ learned_something_new(TUT_YOU_SICK);
return (true);
}