aboutsummaryrefslogtreecommitdiff
path: root/hack/hack.timeout.c
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2015-05-07 16:32:32 -0400
committerB. Watson <yalhcru@gmail.com>2015-05-07 16:32:32 -0400
commit013ac7742311556022304e8b30ca170d48b3a016 (patch)
tree53faa33e75991363f1a6dcc7edc83a66b70e6995 /hack/hack.timeout.c
downloadbsd-games-extra-013ac7742311556022304e8b30ca170d48b3a016.tar.gz
initial commit
Diffstat (limited to 'hack/hack.timeout.c')
-rw-r--r--hack/hack.timeout.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/hack/hack.timeout.c b/hack/hack.timeout.c
new file mode 100644
index 0000000..005e000
--- /dev/null
+++ b/hack/hack.timeout.c
@@ -0,0 +1,72 @@
+/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
+/* hack.timeout.c - version 1.0.3 */
+/* $FreeBSD: src/games/hack/hack.timeout.c,v 1.3 1999/11/16 02:57:12 billf Exp $ */
+
+#include "hack.h"
+
+static void stoned_dialogue(void);
+
+void
+p_timeout(void)
+{
+ 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 */
+static const 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 */
+};
+
+static void
+stoned_dialogue(void)
+{
+ long i = (Stoned & TIMEOUT);
+
+ if (i > 0 && i <= SIZE(stoned_texts))
+ pline("%s", stoned_texts[SIZE(stoned_texts) - i]);
+ if (i == 5)
+ Fast = 0;
+ if (i == 3)
+ nomul(-3);
+}