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