pc-hack

PC HACK 3.61 source code (archival)
git clone http://frotz.net/git/pc-hack.git
Log | Files | Refs

timeout.c (1409B)


      1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
      2 /* timeout.c - version 1.0.3 */
      3 
      4 #include	"hack.h"
      5 
      6 timeout(){
      7 register struct prop *upp;
      8 	if(Stoned) stoned_dialogue();
      9 	for(upp = u.uprops; upp < u.uprops+SIZE(u.uprops); upp++)
     10  	    if((upp->p_flgs & TIMEOUT) && !(--upp->p_flgs & TIMEOUT)) {
     11 		if(upp->p_tofn) (*upp->p_tofn)();
     12 		else switch(upp - u.uprops){
     13 		case STONED:
     14 			killer = "cockatrice";
     15 			done("died");
     16 			break;
     17 		case SICK:
     18 			pline("You die because of food poisoning.");
     19 			killer = u.usick_cause;
     20 			done("died");
     21 			break;
     22 		case FAST:
     23 			pline("You feel yourself slowing down.");
     24 			break;
     25 		case CONFUSION:
     26 			pline("You feel less confused now.");
     27 			break;
     28 		case BLIND:
     29 			pline("You can see again.");
     30 			setsee();
     31 			break;
     32 		case INVIS:
     33 			on_scr(u.ux,u.uy);
     34 			if (!See_invisible)
     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 	register 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 }