conflicting countdowns again

Use the make_foo() intrinsic set/reset routines instead of trying
to manipulate the intrinsics directly.  Previous patch left Dex
down by 1 if stoning caused wounded legs to be fixed, and left
delayed killer allocated if stoning cured sliming or vice versa.
This commit is contained in:
PatR
2018-11-12 11:02:40 -08:00
parent 53a6ce2c2a
commit 1295e7ee28
8 changed files with 40 additions and 33 deletions

View File

@@ -106,6 +106,9 @@ boolean talk;
set_itimeout(&HStun, xtime);
}
/* Sick is overloaded with both fatal illness and food poisoning (via
u.usick_type bit mask), but delayed killer can only support one or
the other at a time. They should become separate intrinsics.... */
void
make_sick(xtime, cause, talk, type)
long xtime;
@@ -116,7 +119,7 @@ int type;
struct kinfo *kptr;
long old = Sick;
#if 0
#if 0 /* tell player even if hero is unconscious */
if (Unaware)
talk = FALSE;
#endif
@@ -152,7 +155,10 @@ int type;
kptr = find_delayed_killer(SICK);
if (Sick) {
exercise(A_CON, FALSE);
if (!old || !kptr) {
/* setting delayed_killer used to be unconditional, but that's
not right when make_sick(0) is called to cure food poisoning
if hero was also fatally ill; this is only approximate */
if (xtime || !old || !kptr) {
int kpfx = ((cause && !strcmp(cause, "#wizintrinsic"))
? KILLED_BY : KILLED_BY_AN);
@@ -169,7 +175,7 @@ const char *msg;
{
long old = Slimed;
#if 0
#if 0 /* tell player even if hero is unconscious */
if (Unaware)
msg = 0;
#endif
@@ -177,7 +183,7 @@ const char *msg;
if ((xtime != 0L) ^ (old != 0L)) {
context.botl = TRUE;
if (msg)
pline1(msg);
pline("%s", msg);
}
if (!Slimed)
dealloc_killer(find_delayed_killer(SLIMED));
@@ -193,7 +199,7 @@ const char *killername;
{
long old = Stoned;
#if 0
#if 0 /* tell player even if hero is unconscious */
if (Unaware)
msg = 0;
#endif
@@ -201,7 +207,7 @@ const char *killername;
if ((xtime != 0L) ^ (old != 0L)) {
context.botl = TRUE;
if (msg)
pline1(msg);
pline("%s", msg);
}
if (!Stoned)
dealloc_killer(find_delayed_killer(STONED));
@@ -899,9 +905,9 @@ register struct obj *otmp;
}
break;
case POT_SPEED:
/* skip when mounted; heal_legs() would heal steeds legs */
if (Wounded_legs && !otmp->cursed && !u.usteed) {
/* heal_legs() would heal steeds legs */
heal_legs();
heal_legs(0);
unkn++;
break;
}