Mercurial > hg > early-roguelike
comparison srogue/misc.c @ 36:2128c7dc8a40
Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
| author | elwin |
|---|---|
| date | Thu, 25 Nov 2010 12:21:41 +0000 |
| parents | |
| children | 94a0d9dd5ce1 |
comparison
equal
deleted
inserted
replaced
| 35:05018c63a721 | 36:2128c7dc8a40 |
|---|---|
| 1 /* | |
| 2 * all sorts of miscellaneous routines | |
| 3 * | |
| 4 * @(#)misc.c 9.0 (rdk) 7/17/84 | |
| 5 * | |
| 6 * Super-Rogue | |
| 7 * Copyright (C) 1984 Robert D. Kindelberger | |
| 8 * All rights reserved. | |
| 9 * | |
| 10 * Based on "Rogue: Exploring the Dungeons of Doom" | |
| 11 * Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman | |
| 12 * All rights reserved. | |
| 13 * | |
| 14 * See the file LICENSE.TXT for full copyright and licensing information. | |
| 15 */ | |
| 16 | |
| 17 #include "rogue.h" | |
| 18 #include <ctype.h> | |
| 19 #include "rogue.ext" | |
| 20 | |
| 21 /* | |
| 22 * waste_time: | |
| 23 * Do nothing but let other things happen | |
| 24 */ | |
| 25 waste_time() | |
| 26 { | |
| 27 if (inwhgt) /* if from wghtchk, then done */ | |
| 28 return; | |
| 29 do_daemons(BEFORE); | |
| 30 do_daemons(AFTER); | |
| 31 do_fuses(); | |
| 32 } | |
| 33 | |
| 34 /* | |
| 35 * getindex: | |
| 36 * Convert a type into an index for the things structures | |
| 37 */ | |
| 38 getindex(what) | |
| 39 char what; | |
| 40 { | |
| 41 int index = -1; | |
| 42 | |
| 43 switch (what) { | |
| 44 case POTION: index = TYP_POTION; | |
| 45 when SCROLL: index = TYP_SCROLL; | |
| 46 when FOOD: index = TYP_FOOD; | |
| 47 when RING: index = TYP_RING; | |
| 48 when AMULET: index = TYP_AMULET; | |
| 49 when ARMOR: index = TYP_ARMOR; | |
| 50 when WEAPON: index = TYP_WEAPON; | |
| 51 when STICK: index = TYP_STICK; | |
| 52 } | |
| 53 return index; | |
| 54 } | |
| 55 | |
| 56 /* | |
| 57 * tr_name: | |
| 58 * print the name of a trap | |
| 59 */ | |
| 60 char * | |
| 61 tr_name(ch) | |
| 62 char ch; | |
| 63 { | |
| 64 reg char *s; | |
| 65 | |
| 66 switch (ch) { | |
| 67 case TRAPDOOR: | |
| 68 s = "A trapdoor."; | |
| 69 when BEARTRAP: | |
| 70 s = "A beartrap."; | |
| 71 when SLEEPTRAP: | |
| 72 s = "A sleeping gas trap."; | |
| 73 when ARROWTRAP: | |
| 74 s = "An arrow trap."; | |
| 75 when TELTRAP: | |
| 76 s = "A teleport trap."; | |
| 77 when DARTTRAP: | |
| 78 s = "A dart trap."; | |
| 79 when POOL: | |
