fix github issue 221 - unfixable troubles
Fixes #221 Routine unfixeable_trouble_count() is used for both applying a unicorn horn (possibly internally via #monster if poly'd into a unicorn) and drinking a blessed potion of restore ability. For the latter case, it always gave the wrong answer (unless the hero happened to be all of Sick and Stunned and Confused and Hallucinating and Vomiting and Deaf). Since the actual count wasn't used to decide whether hero felt "great" or just "good", having any of those conditions would hide the problem.
This commit is contained in:
29
src/apply.c
29
src/apply.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 apply.c $NHDT-Date: 1559670602 2019/06/04 17:50:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.274 $ */
|
||||
/* NetHack 3.6 apply.c $NHDT-Date: 1568831822 2019/09/18 18:37:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.276 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -3738,25 +3738,34 @@ boolean is_horn;
|
||||
|
||||
if (Stoned)
|
||||
unfixable_trbl++;
|
||||
if (Slimed)
|
||||
unfixable_trbl++;
|
||||
if (Strangled)
|
||||
unfixable_trbl++;
|
||||
if (Wounded_legs && !u.usteed)
|
||||
unfixable_trbl++;
|
||||
if (Slimed)
|
||||
unfixable_trbl++;
|
||||
/* lycanthropy is undesirable, but it doesn't actually make you feel bad */
|
||||
/* lycanthropy is undesirable, but it doesn't actually make you feel bad
|
||||
so don't count it as a trouble which can't be fixed */
|
||||
|
||||
if (!is_horn || (Confusion & ~TIMEOUT))
|
||||
/*
|
||||
* Unicorn horn can fix these when they're timed but not when
|
||||
* they aren't. Potion of restore ability doesn't touch them,
|
||||
* so they're always unfixable for the not-unihorn case.
|
||||
* [Most of these are timed only, so always curable via horn.
|
||||
* An exception is Stunned, which can be forced On by certain
|
||||
* polymorph forms (stalker, bats).]
|
||||
*/
|
||||
if (Sick && (!is_horn || (Sick & ~TIMEOUT) != 0L))
|
||||
unfixable_trbl++;
|
||||
if (!is_horn || (Sick & ~TIMEOUT))
|
||||
if (Stunned && (!is_horn || (HStun & ~TIMEOUT) != 0L))
|
||||
unfixable_trbl++;
|
||||
if (!is_horn || (HHallucination & ~TIMEOUT))
|
||||
if (Confusion && (!is_horn || (HConfusion & ~TIMEOUT) != 0L))
|
||||
unfixable_trbl++;
|
||||
if (!is_horn || (Vomiting & ~TIMEOUT))
|
||||
if (Hallucination && (!is_horn || (HHallucination & ~TIMEOUT) != 0L))
|
||||
unfixable_trbl++;
|
||||
if (!is_horn || (HStun & ~TIMEOUT))
|
||||
if (Vomiting && (!is_horn || (Vomiting & ~TIMEOUT) != 0L))
|
||||
unfixable_trbl++;
|
||||
if (!is_horn || (HDeaf & ~TIMEOUT))
|
||||
if (Deaf && (!is_horn || (HDeaf & ~TIMEOUT) != 0L))
|
||||
unfixable_trbl++;
|
||||
|
||||
return unfixable_trbl;
|
||||
|
||||
Reference in New Issue
Block a user