Stoning management (trunk only)

Make petrification initiation or termination go through a new routine,
make_stoned(), instead of manipulating its countdown timer and delayed
killer directly.  No change in behavior.

     There's no reason in terms of bug risk or game play or saved data why
this shouldn't be done in the branch too, but so much of the surrounding
context has already diverged between trunk and branch that it's trunk only.
This commit is contained in:
nethack.rankin
2005-06-19 04:38:30 +00:00
parent 254b521add
commit bd1af39997
8 changed files with 47 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
/* 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. */
@@ -153,6 +153,25 @@ const char *msg;
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;