NetBSD/games/hack/hack.timeout.c

78 lines
1.6 KiB
C
Raw Normal View History

1997-10-19 20:56:41 +04:00
/* $NetBSD: hack.timeout.c,v 1.4 1997/10/19 16:59:08 christos Exp $ */
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*/
1997-10-19 20:56:41 +04:00
#include <sys/cdefs.h>
#ifndef lint
1997-10-19 20:56:41 +04:00
__RCSID("$NetBSD: hack.timeout.c,v 1.4 1997/10/19 16:59:08 christos Exp $");
#endif /* not lint */
1993-03-21 12:45:37 +03:00
1997-10-19 20:56:41 +04:00
#include "hack.h"
#include "extern.h"
1993-03-21 12:45:37 +03:00
1997-10-19 20:56:41 +04:00
void
timeout()
{
struct prop *upp;
if (Stoned)
stoned_dialogue();
for (upp = u.uprops; upp < u.uprops + SIZE(u.uprops); upp++)
if ((upp->p_flgs & TIMEOUT) && !--upp->p_flgs) {
if (upp->p_tofn)
(*upp->p_tofn) ();
else
switch (upp - u.uprops) {
case STONED:
killer = "cockatrice";
done("died");
break;
case SICK:
pline("You die because of food poisoning.");
killer = u.usick_cause;
done("died");
break;
case FAST:
pline("You feel yourself slowing down.");
break;
case CONFUSION:
pline("You feel less confused now.");
break;
case BLIND:
pline("You can see again.");
setsee();
break;
case INVIS:
on_scr(u.ux, u.uy);
pline("You are no longer invisible.");
break;
case WOUNDED_LEGS:
heal_legs();
break;
}
1993-03-21 12:45:37 +03:00
}
}
/* He is being petrified - dialogue by inmet!tower */
1997-10-19 20:56:41 +04:00
char *stoned_texts[] = {
"You are slowing down.",/* 5 */
"Your limbs are stiffening.", /* 4 */
1993-03-21 12:45:37 +03:00
"Your limbs have turned to stone.", /* 3 */
1997-10-19 20:56:41 +04:00
"You have turned to stone.", /* 2 */
"You are a statue." /* 1 */
1993-03-21 12:45:37 +03:00
};
1997-10-19 20:56:41 +04:00
void
1993-03-21 12:45:37 +03:00
stoned_dialogue()
{
1997-10-19 20:56:41 +04:00
long i = (Stoned & TIMEOUT);
1993-03-21 12:45:37 +03:00
1997-10-19 20:56:41 +04:00
if (i > 0 && i <= SIZE(stoned_texts))
1993-03-21 12:45:37 +03:00
pline(stoned_texts[SIZE(stoned_texts) - i]);
1997-10-19 20:56:41 +04:00
if (i == 5)
1993-03-21 12:45:37 +03:00
Fast = 0;
1997-10-19 20:56:41 +04:00
if (i == 3)
1993-03-21 12:45:37 +03:00
nomul(-3);
}