games: Massive style(9) cleanup commit. Reduces differences to NetBSD.
[dragonfly.git] / games / hack / hack.timeout.c
1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2 /* hack.timeout.c - version 1.0.3 */
3 /* $FreeBSD: src/games/hack/hack.timeout.c,v 1.3 1999/11/16 02:57:12 billf Exp $ */
4 /* $DragonFly: src/games/hack/hack.timeout.c,v 1.4 2006/08/21 19:45:32 pavalos Exp $ */
5
6 #include "hack.h"
7
8 static void stoned_dialogue(void);
9
10 void
11 p_timeout(void)
12 {
13         struct prop *upp;
14
15         if (Stoned)
16                 stoned_dialogue();
17         for (upp = u.uprops; upp < u.uprops + SIZE(u.uprops); upp++)
18                 if ((upp->p_flgs & TIMEOUT) && !--upp->p_flgs) {
19                         if (upp->p_tofn)
20                                 (*upp->p_tofn)();
21                         else
22                                 switch (upp - u.uprops) {
23                                 case STONED:
24                                         killer = "cockatrice";
25                                         done("died");
26                                         break;
27                                 case SICK:
28                                         pline("You die because of food poisoning.");
29                                         killer = u.usick_cause;
30                                         done("died");
31                                         break;
32                                 case FAST:
33                                         pline("You feel yourself slowing down.");
34                                         break;
35                                 case CONFUSION:
36                                         pline("You feel less confused now.");
37                                         break;
38                                 case BLIND:
39                                         pline("You can see again.");
40                                         setsee();
41                                         break;
42                                 case INVIS:
43                                         on_scr(u.ux, u.uy);
44                                         pline("You are no longer invisible.");
45                                         break;
46                                 case WOUNDED_LEGS:
47                                         heal_legs();
48                                         break;
49                                 }
50                 }
51 }
52
53 /* He is being petrified - dialogue by inmet!tower */
54 static const char *stoned_texts[] = {
55         "You are slowing down.",                /* 5 */
56         "Your limbs are stiffening.",           /* 4 */
57         "Your limbs have turned to stone.",     /* 3 */
58         "You have turned to stone.",            /* 2 */
59         "You are a statue."                     /* 1 */
60 };
61
62 static void
63 stoned_dialogue(void)
64 {
65         long i = (Stoned & TIMEOUT);
66
67         if (i > 0 && i <= SIZE(stoned_texts))
68                 pline(stoned_texts[SIZE(stoned_texts) - i]);
69         if (i == 5)
70                 Fast = 0;
71         if (i == 3)
72                 nomul(-3);
73 }