summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--crawl-ref/source/godwrath.cc10
-rw-r--r--crawl-ref/source/main.cc8
-rw-r--r--crawl-ref/source/misc.cc14
-rw-r--r--crawl-ref/source/mon-stuff.cc17
-rw-r--r--crawl-ref/source/player.cc26
-rw-r--r--crawl-ref/source/player.h4
6 files changed, 50 insertions, 29 deletions
diff --git a/crawl-ref/source/godwrath.cc b/crawl-ref/source/godwrath.cc
index 2cea687761..7e0dceee62 100644
--- a/crawl-ref/source/godwrath.cc
+++ b/crawl-ref/source/godwrath.cc
@@ -377,11 +377,11 @@ static bool _cheibriados_retribution()
break;
case 4:
- if (you.duration[DUR_SLOW] < 90 * BASELINE_DELAY)
+ if (you.duration[DUR_SLOW] < 180 * BASELINE_DELAY)
{
dec_penance(god, 1);
mpr("You feel the world leave you behind!", MSGCH_WARN);
- you.set_duration(DUR_EXHAUSTED, 100);
+ you.set_duration(DUR_EXHAUSTED, 200);
slow_player(100);
}
break;
@@ -595,11 +595,11 @@ static bool _trog_retribution()
case 4:
case 5:
- if (you.duration[DUR_SLOW] < 90 * BASELINE_DELAY)
+ if (you.duration[DUR_SLOW] < 180 * BASELINE_DELAY)
{
dec_penance(god, 1);
mpr( "You suddenly feel exhausted!", MSGCH_WARN );
- you.set_duration(DUR_EXHAUSTED, 100);
+ you.set_duration(DUR_EXHAUSTED, 200);
slow_player(100);
}
break;
@@ -1186,7 +1186,7 @@ bool divine_retribution(god_type god, bool no_bonus)
}
else
{
- if (you.duration[DUR_SLOW] < 90 * BASELINE_DELAY)
+ if (you.duration[DUR_SLOW] < 180 * BASELINE_DELAY)
{
mpr( "The divine experience leaves you feeling exhausted!",
MSGCH_WARN );
diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc
index 9e9cc6fb82..40b5154ba6 100644
--- a/crawl-ref/source/main.cc
+++ b/crawl-ref/source/main.cc
@@ -2503,7 +2503,9 @@ static void _decrement_durations()
you.berserk_penalty = 0;
int dur = 12 + roll_dice(2, 12);
- you.increase_duration(DUR_EXHAUSTED, dur);
+ // For consistency with slow give exhaustion 2 times the nominal
+ // duration.
+ you.increase_duration(DUR_EXHAUSTED, dur * 2);
// Don't trigger too many tutorial messages.
const bool tut_slow = Options.tutorial_events[TUT_YOU_ENCHANTED];
@@ -2519,9 +2521,9 @@ static void _decrement_durations()
{
if (wearing_amulet(AMU_RESIST_SLOW))
{
- if (you.duration[DUR_HASTE] > 6 * BASELINE_DELAY)
+ if (you.duration[DUR_HASTE] > 3 * BASELINE_DELAY)
{
- you.set_duration(DUR_HASTE, 2 + coinflip());
+ you.set_duration(DUR_HASTE, div_rand_round(2 + coinflip(), 2));
mpr("Your extra speed is starting to run out.",
MSGCH_DURATION);
}
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index ad256dbec2..e78751def9 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2708,7 +2708,12 @@ bool go_berserk(bool intentional)
mpr("You feel yourself moving faster!");
mpr("You feel mighty!");
- you.duration[DUR_BERSERKER] += 20 + random2avg(19, 2);
+ // Cutting the duration in half since berserk causes haste and hasted
+ // actions have half the usual delay. This keeps player turns
+ // approximately consistent withe previous versions. -cao
+ int berserk_duration = (20 + random2avg(19,2)) / 2;
+
+ you.increase_duration(DUR_BERSERKER, berserk_duration);
calc_hp();
you.hp *= 2;
@@ -2718,8 +2723,11 @@ bool go_berserk(bool intentional)
if (!you.duration[DUR_MIGHT])
modify_stat(STAT_STRENGTH, 5, true, "going berserk");
- you.duration[DUR_MIGHT] += you.duration[DUR_BERSERKER];
- haste_player(you.duration[DUR_BERSERKER]);
+ you.increase_duration(DUR_MIGHT, berserk_duration);
+ /// doubling the duration here since haste_player already cuts input
+ // durations in half
+ haste_player(berserk_duration * 2);
+
did_god_conduct(DID_HASTY, 8, intentional);
if (you.berserk_penalty != NO_BERSERK_PENALTY)
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index 49b407ebe6..86398d9d33 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -1488,22 +1488,23 @@ int monster_die(monsters *monster, killer_type killer,
if (you.religion == GOD_TROG
&& !player_under_penance() && you.piety > random2(1000))
{
- const int bonus = 3 + random2avg( 10, 2 );
+ const int bonus = (3 + random2avg( 10, 2 )) / 2;
- you.duration[DUR_BERSERKER] += bonus;
- you.duration[DUR_MIGHT] += bonus;
- haste_player(bonus);
+ you.increase_duration(DUR_BERSERKER, bonus);
+ you.increase_duration(DUR_MIGHT, bonus);
+ haste_player(bonus * 2);
mpr("You feel the power of Trog in you as your rage grows.",
MSGCH_GOD, GOD_TROG);
}
else if (wearing_amulet(AMU_RAGE) && one_chance_in(30))
{
- const int bonus = 2 + random2(4);
+ const int bonus = (2 + random2(4)) / 2;;
- you.duration[DUR_BERSERKER] += bonus;
- you.duration[DUR_MIGHT] += bonus;
- haste_player(bonus);
+
+ you.increase_duration(DUR_BERSERKER, bonus);
+ you.increase_duration(DUR_MIGHT, bonus);
+ haste_player(bonus * 2);
mpr("Your amulet glows a violent red.");
}
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));
}
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index 9d7d09cc3a..9725ba39b5 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -750,10 +750,10 @@ bool miasma_player();
bool napalm_player(int amount);
void dec_napalm_player(int delay);
-bool slow_player(int amount);
+bool slow_player(int turns);
void dec_slow_player(int delay);
-void haste_player(int amount);
+void haste_player(int turns);
void dec_haste_player(int delay);
bool disease_player(int amount);