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