summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-11-15 17:19:26 -0500
committerCharles Otto <ottochar@gmail.com>2009-11-15 23:46:50 -0500
commit13d70d82c4c9875a414c4c29f709c12f2c5d2c9d (patch)
treee6305d0ede77c47b222b1ed458b26daa5c3b3899 /crawl-ref/source/player.cc
parentb0b6e9bc525e05d682f33311086d506b941a0b3f (diff)
downloadcrawl-ref-13d70d82c4c9875a414c4c29f709c12f2c5d2c9d.tar.gz
crawl-ref-13d70d82c4c9875a414c4c29f709c12f2c5d2c9d.zip
Adjust slow and haste durations
Attempt to keep the number of slowed/hasted turns a player gets constant by doubling/halving the total amount of delay needed for the effects to wear off. Also adjust durations for berserk.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 7a367af2ad..05ccf42770 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -4939,13 +4939,18 @@ void dec_napalm_player(int delay)
you.duration[DUR_LIQUID_FLAMES] = 0;
}
-bool slow_player(int amount)
+bool slow_player(int turns)
{
ASSERT(!crawl_state.arena);
- if (amount <= 0)
+ if (turns <= 0)
return (false);
+ // Doubling these values because moving while slowed takes twice the
+ // usual delay.
+ turns *= 2;
+ int threshold = 100 * 2;
+
if (wearing_amulet(AMU_RESIST_SLOW))
{
mpr("You feel momentarily lethargic.");
@@ -4958,7 +4963,7 @@ bool slow_player(int amount)
return (false);
}
- else if (you.duration[DUR_SLOW] >= 100 * BASELINE_DELAY)
+ else if (you.duration[DUR_SLOW] >= threshold * BASELINE_DELAY)
mpr("You already are as slow as you could be.");
else
{
@@ -4967,7 +4972,7 @@ bool slow_player(int amount)
else
mpr("You feel as though you will be slow longer.");
- you.increase_duration(DUR_SLOW, amount, 100);
+ you.increase_duration(DUR_SLOW, turns, threshold);
learned_something_new(TUT_YOU_ENCHANTED);
}
@@ -4994,11 +4999,11 @@ void dec_slow_player(int delay)
}
}
-void haste_player(int amount)
+void haste_player(int turns)
{
ASSERT(!crawl_state.arena);
- if (amount <= 0)
+ if (turns <= 0)
return;
bool amu_eff = wearing_amulet(AMU_RESIST_SLOW);
@@ -5011,9 +5016,14 @@ void haste_player(int amount)
set_ident_type(*amulet, ID_KNOWN_TYPE);
}
+ // Cutting the nominal turns in half since hasted actions take half the
+ // usual delay.
+ turns /= 2;
+ int threshold = (80 + 20 * amu_eff) / 2;
+
if (you.duration[DUR_HASTE] == 0)
mpr("You feel yourself speed up.");
- else if (you.duration[DUR_HASTE] > (80 + 20 * amu_eff) * BASELINE_DELAY)
+ else if (you.duration[DUR_HASTE] > threshold * BASELINE_DELAY)
mpr("You already have as much speed as you can handle.");
else
{
@@ -5021,7 +5031,7 @@ void haste_player(int amount)
contaminate_player(1, true); // always deliberate
}
- you.increase_duration(DUR_HASTE, amount, 80 + 20 * amu_eff);
+ you.increase_duration(DUR_HASTE, turns, threshold);
did_god_conduct(DID_STIMULANTS, 4 + random2(4));
}