summaryrefslogtreecommitdiffstats
path: root/hack/hack.timeout.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>1997-10-19 16:56:41 +0000
committerchristos <christos@NetBSD.org>1997-10-19 16:56:41 +0000
commit84e7d0704483ce39bbdeacd5e676168db6fa664f (patch)
treef9ffeffa1a4342e749494bc3f5618552435839af /hack/hack.timeout.c
parentf73f1009084e75624e3bc00fef9cf4749de80dcc (diff)
downloadbsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.tar.gz
bsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.tar.zst
bsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.zip
WARNsify...
Diffstat (limited to 'hack/hack.timeout.c')
-rw-r--r--hack/hack.timeout.c102
1 files changed, 56 insertions, 46 deletions
diff --git a/hack/hack.timeout.c b/hack/hack.timeout.c
index fa431368..c84312e7 100644
--- a/hack/hack.timeout.c
+++ b/hack/hack.timeout.c
@@ -1,67 +1,77 @@
+/* $NetBSD: hack.timeout.c,v 1.4 1997/10/19 16:59:08 christos Exp $ */
+
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static char rcsid[] = "$NetBSD: hack.timeout.c,v 1.3 1995/03/23 08:31:37 cgd Exp $";
-#endif /* not lint */
+__RCSID("$NetBSD: hack.timeout.c,v 1.4 1997/10/19 16:59:08 christos Exp $");
+#endif /* not lint */
-#include "hack.h"
+#include "hack.h"
+#include "extern.h"
-timeout(){
-register 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;
+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;
+ }
}
- }
}
/* He is being petrified - dialogue by inmet!tower */
-char *stoned_texts[] = {
- "You are slowing down.", /* 5 */
- "Your limbs are stiffening.", /* 4 */
+char *stoned_texts[] = {
+ "You are slowing down.",/* 5 */
+ "Your limbs are stiffening.", /* 4 */
"Your limbs have turned to stone.", /* 3 */
- "You have turned to stone.", /* 2 */
- "You are a statue." /* 1 */
+ "You have turned to stone.", /* 2 */
+ "You are a statue." /* 1 */
};
+void
stoned_dialogue()
{
- register long i = (Stoned & TIMEOUT);
+ long i = (Stoned & TIMEOUT);
- if(i > 0 && i <= SIZE(stoned_texts))
+ if (i > 0 && i <= SIZE(stoned_texts))
pline(stoned_texts[SIZE(stoned_texts) - i]);
- if(i == 5)
+ if (i == 5)
Fast = 0;
- if(i == 3)
+ if (i == 3)
nomul(-3);
}