xref: /openbsd-src/games/hack/hack.timeout.c (revision b2ea75c1b17e1a9a339660e7ed45cd24946b230e)
1 /*	$OpenBSD: hack.timeout.c,v 1.2 2001/01/28 23:41:45 niklas Exp $	*/
2 
3 /*
4  * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
5  */
6 
7 #ifndef lint
8 static char rcsid[] = "$OpenBSD: hack.timeout.c,v 1.2 2001/01/28 23:41:45 niklas Exp $";
9 #endif /* not lint */
10 
11 #include	"hack.h"
12 
13 timeout(){
14 register struct prop *upp;
15 	if(Stoned) 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) (*upp->p_tofn)();
19 		else switch(upp - u.uprops){
20 		case STONED:
21 			killer = "cockatrice";
22 			done("died");
23 			break;
24 		case SICK:
25 			pline("You die because of food poisoning.");
26 			killer = u.usick_cause;
27 			done("died");
28 			break;
29 		case FAST:
30 			pline("You feel yourself slowing down.");
31 			break;
32 		case CONFUSION:
33 			pline("You feel less confused now.");
34 			break;
35 		case BLIND:
36 			pline("You can see again.");
37 			setsee();
38 			break;
39 		case INVIS:
40 			on_scr(u.ux,u.uy);
41 			pline("You are no longer invisible.");
42 			break;
43 		case WOUNDED_LEGS:
44 			heal_legs();
45 			break;
46 		}
47 	}
48 }
49 
50 /* He is being petrified - dialogue by inmet!tower */
51 char *stoned_texts[] = {
52 	"You are slowing down.",		/* 5 */
53 	"Your limbs are stiffening.",		/* 4 */
54 	"Your limbs have turned to stone.",	/* 3 */
55 	"You have turned to stone.",		/* 2 */
56 	"You are a statue."			/* 1 */
57 };
58 
59 stoned_dialogue()
60 {
61 	register 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 }
70