E void FDECL(make_stunned, (long,BOOLEAN_P));
E void FDECL(make_blinded, (long,BOOLEAN_P));
E void FDECL(make_sick, (long, const char *, BOOLEAN_P,int));
-E void FDECL(make_slimed, (long,const char*));
+E void FDECL(make_slimed, (long,const char *));
+E void FDECL(make_stoned, (long,const char *,int,const char *));
E void FDECL(make_vomiting, (long,BOOLEAN_P));
E boolean FDECL(make_hallucinated, (long,BOOLEAN_P,long));
E int NDECL(dodrink);
-/* SCCS Id: @(#)eat.c 3.5 2005/06/02 */
+/* SCCS Id: @(#)eat.c 3.5 2005/06/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
void
fix_petrification()
{
- Stoned = 0;
- dealloc_killer(find_delayed_killer(STONED));
- if (Hallucination)
- pline("What a pity - you just ruined a future piece of %sart!",
- ACURR(A_CHA) > 15 ? "fine " : "");
- else
- You_feel("limber!");
+ char buf[BUFSZ];
+
+ if (Hallucination)
+ Sprintf(buf, "What a pity--you just ruined a future piece of %sart!",
+ ACURR(A_CHA) > 15 ? "fine " : "");
+ else
+ Strcpy(buf, "You feel limber!");
+ make_stoned(0L, buf, 0, (char *)0);
}
/*
!(poly_when_stoned(youmonst.data) &&
polymon(PM_STONE_GOLEM))) {
if (!Stoned) {
- Stoned = 5;
Sprintf(killer.name,
"%s egg", mons[otmp->corpsenm].mname);
- delayed_killer(STONED, KILLED_BY_AN, killer.name);
+ make_stoned(5L, (char *)0,
+ KILLED_BY_AN, killer.name);
}
}
/* note: no "tastes like chicken" message for eggs */
-/* SCCS Id: @(#)mhitu.c 3.5 2005/04/15 */
+/* SCCS Id: @(#)mhitu.c 3.5 2005/06/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
int kformat = KILLED_BY_AN;
const char *kname = mtmp->data->mname;
- Stoned = 5;
if (mtmp->data->geno & G_UNIQ) {
if (!type_is_pname(mtmp->data))
kname = the(kname);
kformat = KILLED_BY;
}
- delayed_killer(STONED, kformat, kname);
+ make_stoned(5L, (char *)0, kformat, kname);
return(1);
/* You("turn to stone..."); */
/* done_in_by(mtmp); */
-/* SCCS Id: @(#)mthrowu.c 3.5 2004/08/16 */
+/* SCCS Id: @(#)mthrowu.c 3.5 2005/06/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if (!Stoned && !Stone_resistance
&& !(poly_when_stoned(youmonst.data) &&
polymon(PM_STONE_GOLEM))) {
- Stoned = 5;
- delayed_killer(STONED, KILLED_BY, nul);
+ make_stoned(5L, (char *)0, KILLED_BY, nul);
}
}
stop_occupation();
-/* SCCS Id: @(#)polyself.c 3.5 2005/04/13 */
+/* SCCS Id: @(#)polyself.c 3.5 2005/06/21 */
/* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
redist_attr();
u.uhunger = rn1(500,500);
if (Sick) make_sick(0L, (char *) 0, FALSE, SICK_ALL);
- Stoned = 0;
- dealloc_killer(find_delayed_killer(STONED));
+ if (Stoned) make_stoned(0L, (char *)0, 0, (char *)0);
if (u.uhp <= 0 || u.uhpmax <= 0) {
if (Polymorph_control) {
if (u.uhp <= 0) u.uhp = 1;
}
if (Stoned && poly_when_stoned(&mons[mntmp])) {
/* poly_when_stoned already checked stone golem genocide */
- You("turn to stone!");
mntmp = PM_STONE_GOLEM;
- Stoned = 0;
- dealloc_killer(find_delayed_killer(STONED));
+ make_stoned(0L, "You turn to stone!", 0, (char *)0);
}
u.mtimedone = rn1(500, 500);
if(strongmonst(&mons[mntmp])) ABASE(A_STR) = AMAX(A_STR) = STR18(100);
if (Stone_resistance && Stoned) { /* parnes@eniac.seas.upenn.edu */
- Stoned = 0;
- dealloc_killer(find_delayed_killer(STONED));
- You("no longer seem to be petrifying.");
+ make_stoned(0L, "You no longer seem to be petrifying.",
+ 0, (char *)0);
}
if (Sick_resistance && Sick) {
make_sick(0L, (char *) 0, FALSE, SICK_ALL);
-/* SCCS Id: @(#)potion.c 3.5 2005/06/02 */
+/* SCCS Id: @(#)potion.c 3.5 2005/06/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if (!Slimed) dealloc_killer(find_delayed_killer(SLIMED));
}
+/* start or stop petrification */
+void
+make_stoned(xtime, msg, killedby, killername)
+long xtime;
+const char *msg;
+int killedby;
+const char *killername;
+{
+ long old = Stoned;
+
+ if ((!xtime && old) || (xtime && !old)) {
+ if (msg) pline("%s", msg);
+ /* context.botl = 1; --- Stoned is not a status line item */
+ }
+ set_itimeout(&Stoned, xtime);
+ if (!Stoned) dealloc_killer(find_delayed_killer(STONED));
+ else if (!old) delayed_killer(STONED, killedby, killername);
+}
+
void
make_vomiting(xtime, talk)
long xtime;
-/* SCCS Id: @(#)pray.c 3.5 2004/06/12 */
+/* SCCS Id: @(#)pray.c 3.5 2005/06/21 */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
switch (trouble) {
case TROUBLE_STONED:
- You_feel("more limber.");
- Stoned = 0;
- context.botl = 1;
- dealloc_killer(find_delayed_killer(STONED));
+ make_stoned(0L, "You feel more limber.", 0, (char *)0);
break;
case TROUBLE_SLIMED:
make_slimed(0L, "The slime disappears.");
-/* SCCS Id: @(#)uhitm.c 3.5 2004/12/21 */
+/* SCCS Id: @(#)uhitm.c 3.5 2005/06/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
You("eat %s brain!", s_suffix(mon_nam(mdef)));
u.uconduct.food++;
if (touch_petrifies(mdef->data) && !Stone_resistance && !Stoned) {
- Stoned = 5;
- delayed_killer(STONED, KILLED_BY_AN, mdef->data->mname);
+ make_stoned(5L, (char *)0,
+ KILLED_BY_AN, mdef->data->mname);
}
if (!vegan(mdef->data))
u.uconduct.unvegan++;