give correct message when a spellcasting monster summons other monsters
correct experience calculation for monsters that cause nonphysical damage
monsters evading a kick on noteleport levels would cause a "teleports" message
+interrupt current activity during certain stages of petrification or vomiting
Platform- and/or Interface-Specific Fixes
E boolean FDECL(maybe_finished_meal, (BOOLEAN_P));
E void FDECL(set_tin_variety, (struct obj *,int));
E int FDECL(tin_variety_txt, (char *,int *));
+E boolean FDECL(Popeye, (int));
/* ### end.c ### */
return FALSE;
}
+/* Tin of <something> to the rescue? Decide whether current occupation
+ is an attempt to eat a tin of something capable of saving hero's life.
+ We don't care about consumption of non-tinned food here because special
+ effects there take place on first bite rather than at end of occupation.
+ [Popeye the Sailor gets out of trouble by eating tins of spinach. :-] */
+boolean
+Popeye(threat)
+int threat;
+{
+ struct obj *otin;
+ int mndx;
+
+ if (occupation != opentin) return FALSE;
+ otin = context.tin.tin;
+ /* make sure hero still has access to tin */
+ if (!carried(otin) && !obj_here(otin, u.ux, u.uy)) return FALSE;
+ /* unknown tin is assumed to be helpful */
+ if (!otin->known) return TRUE;
+ /* known tin is helpful if it will stop life-threatening problem */
+ mndx = otin->corpsenm;
+ switch (threat) {
+ /* note: not used; hunger code bypasses stop_occupation() when eating */
+ case HUNGER:
+ return (mndx != NON_PM || otin->spe == 1);
+ /* flesh from lizards and acidic critters stops petrification */
+ case STONED:
+ return (mndx >= LOW_PM && (mndx == PM_LIZARD || acidic(&mons[mndx])));
+ /* no tins can cure these (yet?) */
+ case SLIMED:
+ case SICK:
+ case VOMITING:
+ break;
+ default:
+ break;
+ }
+ return FALSE;
+}
+
/*eat.c*/
-/* SCCS Id: @(#)timeout.c 3.5 2003/11/18 */
+/* SCCS Id: @(#)timeout.c 3.5 2005/01/31 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if (i > 0L && i <= SIZE(stoned_texts))
pline(stoned_texts[SIZE(stoned_texts) - i]);
- if (i == 5L)
+ switch ((int) i) {
+ case 5: /* slowing down */
HFast = 0L;
- if (i == 3L)
- nomul(-3);
+ if (multi > 0) nomul(0);
+ break;
+ case 4: /* limbs stiffening */
+ /* just one move left to save oneself so quit fiddling around;
+ don't stop attempt to eat tin--might be lizard or acidic */
+ if (!Popeye(STONED)) stop_occupation();
+ if (multi > 0) nomul(0);
+ break;
+ case 3: /* limbs turned to stone */
+ stop_occupation();
+ nomul(-3); /* can't move anymore */
+ break;
+ default:
+ break;
+ }
exercise(A_DEX, FALSE);
}
case 0:
vomit();
morehungry(20);
+ stop_occupation();
+ if (multi > 0) nomul(0);
break;
case 2:
make_stunned(HStun + d(2,4), FALSE);
+ if (!Popeye(VOMITING)) stop_occupation();
/* fall through */
case 3:
make_confused(HConfusion + d(2,4), FALSE);
+ if (multi > 0) nomul(0);
break;
}
exercise(A_CON, FALSE);
}
if (i == 3L) { /* limbs becoming oozy */
HFast = 0L; /* lose intrinsic speed */
- stop_occupation();
+ if (!Popeye(SLIMED)) stop_occupation();
if (multi > 0) nomul(0);
}
exercise(A_DEX, FALSE);