From 95972d714742dff9d43a64f047a4b9146e77f863 Mon Sep 17 00:00:00 2001 From: copperwater Date: Tue, 28 Nov 2017 00:41:55 -0500 Subject: [PATCH] Wand of speed gives player temporary speed and potion gives intrinsic This aims to fix the issue in which there are way more wands of speed monster in the game than the player has any use for. Usually, one is enough for the whole game (unless a player has a lot of pets they want to speed up) but since they're an item monsters can generate with, it's typical to see eight to twelve of them, useless for anything besides polypiling into other wands since they just grant an intrinsic that's usually obtained early in the game. By making the wand effect (on the player) temporary very fast speed, it becomes desirable to keep the wand around again. By adding a lightweight source of very fast speed, it also helps diversify character builds away from always relying on speed boots. And importantly, it becomes an item the player can use situationally early in the game to enhance their odds in a fight or run away from danger. Meanwhile, the speed-intrinsic-granting has been moved to the potion, and the potion is still superior to the wand in the duration of very fast speed it grants (100 + d10 turns for an uncursed potion or 160 + d10 turns for a blessed one, versus 50 + d25 turns for the wand). Since monsters don't have a concept of very fast speed, this doesn't change the wand or potion effects on them. They will still gain permanent intrinsic speed by either method. --- include/extern.h | 1 + src/potion.c | 26 +++++++++++++++++++------- src/zap.c | 12 +++--------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/include/extern.h b/include/extern.h index b5758eef7..e12f290a2 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2249,6 +2249,7 @@ extern void mongrantswish(struct monst **); extern void djinni_from_bottle(struct obj *); extern struct monst *split_mon(struct monst *, struct monst *); extern const char *bottlename(void); +extern void speed_up(long); /* ### pray.c ### */ diff --git a/src/potion.c b/src/potion.c index 668068dc4..91aa6c825 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1036,14 +1036,13 @@ peffect_speed(struct obj *otmp) return; } - if (!Very_fast) { /* wwf@doe.carleton.ca */ - You("are suddenly moving %sfaster.", Fast ? "" : "much "); - } else { - Your("%s get new energy.", makeplural(body_part(LEG))); - gp.potion_unkn++; + speed_up(rn1(10, 100 + 60 * bcsign(otmp))); + + /* non-cursed potion grants intrinsic speed */ + if (is_speed && !otmp->cursed && !(HFast & INTRINSIC)) { + Your("quickness feels very natural."); + HFast |= FROMOUTSIDE; } - exercise(A_DEX, TRUE); - incr_itimeout(&HFast, rn1(10, 100 + 60 * bcsign(otmp))); } static void @@ -2787,4 +2786,17 @@ split_mon( return mtmp2; } +/* Character becomes very fast temporarily. */ +void +speed_up(long duration) +{ + if (!Very_fast) + You("are suddenly moving %sfaster.", Fast ? "" : "much "); + else + Your("%s get new energy.", makeplural(body_part(LEG))); + + exercise(A_DEX, TRUE); + incr_itimeout(&HFast, duration); +} + /*potion.c*/ diff --git a/src/zap.c b/src/zap.c index b9327a89e..16b6b4bf6 100644 --- a/src/zap.c +++ b/src/zap.c @@ -2698,15 +2698,9 @@ zapyourself(struct obj *obj, boolean ordinary) } case WAN_SPEED_MONSTER: - if (!(HFast & INTRINSIC)) { - learn_it = TRUE; - if (!Fast) - You("speed up."); - else - Your("quickness feels more natural."); - exercise(A_DEX, TRUE); - } - HFast |= FROMOUTSIDE; + /* no longer gives intrinsic, but gives very fast speed instead */ + speed_up(rn1(25, 50)); + learn_it = TRUE; break; case WAN_SLEEP: