Merge from vendor branch FILE:
[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         if(Stoned) stoned_dialogue();
15         for(upp = u.uprops; upp < u.uprops+SIZE(u.uprops); upp++)
16             if((upp->p_flgs & TIMEOUT) && !--upp->p_flgs) {
17                 if(upp->p_tofn) (*upp->p_tofn)();
18                 else switch(upp - u.uprops){
19                 case STONED:
20                         killer = "cockatrice";
21                         done("died");
22                         break;
23                 case SICK:
24                         pline("You die because of food poisoning.");
25                         killer = u.usick_cause;
26                         done("died");
27                         break;
28                 case FAST:
29                         pline("You feel yourself slowing down.");
30                         break;
31                 case CONFUSION:
32                         pline("You feel less confused now.");
33                         break;
34                 case BLIND:
35                         pline("You can see again.");
36                         setsee();
37                         break;
38                 case INVIS:
39                         on_scr(u.ux,u.uy);
40                         pline("You are no longer invisible.");
41                         break;
42                 case WOUNDED_LEGS:
43                         heal_legs();
44                         break;
45                 }
46         }
47 }
48
49 /* He is being petrified - dialogue by inmet!tower */
50 static const char *stoned_texts[] = {
51         "You are slowing down.",                /* 5 */
52         "Your limbs are stiffening.",           /* 4 */
53         "Your limbs have turned to stone.",     /* 3 */
54         "You have turned to stone.",            /* 2 */
55         "You are a statue."                     /* 1 */
56 };
57
58 static void
59 stoned_dialogue(void)
60 {
61         long i = (Stoned & TIMEOUT);
62
63         if(i > 0 && i <= SIZE(stoned_texts))
64                 pline(stoned_texts[SIZE(stoned_texts) - i]);
65         if(i == 5)
66                 Fast = 0;
67         if(i == 3)
68                 nomul(-3);
69 }