Fix the perpetual haste cheat.
Rogue V3 allowed the player to gain perpetual haste by quaffing a potion of haste while already hasted. This is supposed to remove the haste effect and cause temporary paralysis. Super-Rogue removed haste correctly, but gave confusing messages.
This commit is contained in:
parent
714bad8c3c
commit
c194ec3dc9
6 changed files with 13 additions and 8 deletions
|
|
@ -320,20 +320,23 @@ chg_str(int amt)
|
||||||
* add a haste to the player
|
* add a haste to the player
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
bool
|
||||||
add_haste(int potion)
|
add_haste(int potion)
|
||||||
{
|
{
|
||||||
if (on(player, ISHASTE))
|
if (on(player, ISHASTE))
|
||||||
{
|
{
|
||||||
msg("You faint from exhaustion.");
|
msg("You faint from exhaustion.");
|
||||||
no_command += rnd(8);
|
no_command += rnd(8);
|
||||||
|
player.t_flags &= ~ISHASTE;
|
||||||
extinguish(nohaste);
|
extinguish(nohaste);
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.t_flags |= ISHASTE;
|
player.t_flags |= ISHASTE;
|
||||||
if (potion)
|
if (potion)
|
||||||
fuse(nohaste, 0, rnd(4)+4, AFTER);
|
fuse(nohaste, 0, rnd(4)+4, AFTER);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -158,8 +158,8 @@ quaff()
|
||||||
p_know[P_XHEAL] = TRUE;
|
p_know[P_XHEAL] = TRUE;
|
||||||
sight();
|
sight();
|
||||||
when P_HASTE:
|
when P_HASTE:
|
||||||
add_haste(TRUE);
|
if (add_haste(TRUE))
|
||||||
msg("You feel yourself moving much faster.");
|
msg("You feel yourself moving much faster.");
|
||||||
p_know[P_HASTE] = TRUE;
|
p_know[P_HASTE] = TRUE;
|
||||||
when P_RESTORE:
|
when P_RESTORE:
|
||||||
msg("Hey, this tastes great. It make you feel warm all over.");
|
msg("Hey, this tastes great. It make you feel warm all over.");
|
||||||
|
|
|
||||||
|
|
@ -511,7 +511,7 @@ void _detach(struct linked_list **list, struct linked_list *i
|
||||||
void _free_list(struct linked_list **ptr);
|
void _free_list(struct linked_list **ptr);
|
||||||
char * _new(size_t size);
|
char * _new(size_t size);
|
||||||
int add_dam(str_t *str);
|
int add_dam(str_t *str);
|
||||||
void add_haste(int potion);
|
bool add_haste(int potion);
|
||||||
void add_pack(struct linked_list *item, int silent);
|
void add_pack(struct linked_list *item, int silent);
|
||||||
void add_pass(void);
|
void add_pass(void);
|
||||||
void addmsg(char *fmt, ...);
|
void addmsg(char *fmt, ...);
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,6 @@ quaff(void)
|
||||||
when P_HASTE:
|
when P_HASTE:
|
||||||
if (!curse) {
|
if (!curse) {
|
||||||
add_haste(TRUE);
|
add_haste(TRUE);
|
||||||
msg("You feel yourself moving much faster.");
|
|
||||||
p_know[P_HASTE] = TRUE;
|
p_know[P_HASTE] = TRUE;
|
||||||
}
|
}
|
||||||
when P_INVINC:
|
when P_INVINC:
|
||||||
|
|
|
||||||
|
|
@ -148,10 +148,14 @@ add_haste(bool potion)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.t_flags |= ISHASTE;
|
player.t_flags |= ISHASTE;
|
||||||
if (potion)
|
if (potion) {
|
||||||
fuse(nohaste, TRUE, roll(10,10));
|
fuse(nohaste, TRUE, roll(10,10));
|
||||||
else
|
msg("You feel yourself moving much faster.");
|
||||||
|
}
|
||||||
|
else {
|
||||||
fuse(nohaste, TRUE, roll(40,20));
|
fuse(nohaste, TRUE, roll(40,20));
|
||||||
|
msg("You find yourself moving much faster.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,6 @@ ring_on(void)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
add_haste(FALSE);
|
add_haste(FALSE);
|
||||||
msg("You find yourself moving must faster.");
|
|
||||||
}
|
}
|
||||||
when R_GIANT: /* to 24 */
|
when R_GIANT: /* to 24 */
|
||||||
him->s_ef.a_str = MAXSTR;
|
him->s_ef.a_str = MAXSTR;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue