1 /* $NetBSD: globals.c,v 1.18 2000/09/25 14:45:01 jsm Exp $ */
4 * Copyright (c) 1983, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 #include <sys/cdefs.h>
35 static char sccsid
[] = "@(#)globals.c 8.2 (Berkeley) 4/28/95";
37 __RCSID("$NetBSD: globals.c,v 1.18 2000/09/25 14:45:01 jsm Exp $");
43 int WEIGHT
= MAXWEIGHT
;
44 int CUMBER
= MAXCUMBER
;
46 const char *const objdes
[NUMOFOBJECTS
] = {
47 "There is a knife here.",
48 "There are an exquisitely crafted sword and scabbard here.",
49 NULL
, /* Can land from here. */
50 "There is a fierce woodsman here brandishing a heavy mallet.",
51 "There is an unwieldy two-handed sword here.",
52 "There is a bloody meat cleaver here.",
53 "A rusty broadsword is lying here.",
54 "There is an ancient coat of finely woven mail here.",
55 "There is a old dented helmet with an ostrich plume here.",
56 "There is a shield of some native tribe here.",
57 "The maid's body is lying here. She was murdered!",
58 "There is a Viper ready for launch here.",
59 "A kerosene lantern is burning luridly here.",
60 "An old pair of shoes has been discarded here.",
62 "There is a pair of pajamas here.",
63 "A kingly robe of royal purple and spun gold is draped here.",
64 "There is a strange golden amulet on the floor here.",
65 "A medallion of solid gold shimmers on the ground nearby.",
66 "A talisman of gold is lying here.",
67 "A dead woodsman has fallen here. He was savagely murdered.",
68 "A heavy wooden mallet lies nearby.",
69 "There is a laser pistol here.",
70 "A flower-like young goddess is bathing in the hot mineral pools. She is \nwatching you, but continues to steep and sing softly.",
71 "The goddess is reclining on a bed of ferns and studying you intently.",
72 "There is a grenade here.",
73 "There is a length of heavy chain here.",
74 "There is a stout rope here.",
75 "There is a pair of Levi's here.",
76 "A bloody mace is lying on the ground here.",
77 "There is a shovel here.",
78 "A long, sharp halberd is propped up here.",
79 "There is a compass here.",
80 "Wreckage and smoldering debris from a crash litter the ground here.",
81 "A woodland Elf armed with a shield and deadly halberd lunges toward you!",
82 "I think I hear footsteps behind us.",
83 "There are a few coins here.",
84 "There are some matches here.",
85 "An unctuous man in a white suit and a dwarf are standing here.",
86 "There are some ripe papayas here.",
87 "There is a ripe pineapple here.",
88 "There are some kiwi fruit here.",
89 "There are some coconuts here.",
90 "There is a ripe mango here.",
91 "There is a sparkling diamond ring here.",
92 "There is a colorful pink potion in a small crystal vial here.",
93 "A gold bracelet is on the ground here.",
94 "A swarthy woman with stern features pulls you aside from the crowd,\n'I must talk to you -- but not here. Meet me at midnight in the gardens.'",
95 "The swarthy woman has been awaiting you anxiously. 'I must warn you that the\nIsland has anticipated your Quest. You will not be welcomed. The Darkness is\nstrong where you must search. Seek not the shadows save only at night, for\nthen are they the weakest. In the mountains far from here a canyon winds\nwith ferns and streams and forgotten vines. There you must go. Take this\nrope.'",
96 "Out from the shadows a figure leaps! His black cape swirls around, and he\nholds a laser sword at your chest. 'So, you have come to fulfill the Quest.\nHa! Your weapons are no match for me!'",
97 "An old-timer with one eye missing and no money for a drink sits at the bar.",
98 "You are flying through an asteroid field!",
99 "A planet is nearby.",
100 "The ground is charred here.",
101 "There is a thermonuclear warhead here.",
102 "The fragile, beautiful young goddess lies here. You murdered her horribly.",
103 "The old-timer is lying here. He is dead.",
104 "The native girl's body is lying here.",
105 "A native girl is sitting here.",
106 "A gorgeous white stallion is standing here.",
107 "The keys are in the ignition.",
108 "A pot of pearls and jewels is sitting here.",
109 "A bar of solid gold is here.",
110 "There is a 10 kilogram diamond block here."
114 const char *const objsht
[NUMOFOBJECTS
] = {
117 NULL
, /* Can land from here. */
138 NULL
, /* Bathing goddess. */
148 NULL
, /* Crash debris. */
150 NULL
, /* Footsteps. */
153 NULL
, /* Man and dwarf. */
162 NULL
, /* Swarthy woman. */
163 NULL
, /* Swarthy woman (with message). */
165 NULL
, /* Old-timer. */
166 NULL
, /* Asteroid field. */
167 NULL
, /* Planet nearby. */
168 NULL
, /* Charred ground. */
173 NULL
, /* Native girl. */
181 const char *const ouch
[NUMOFINJURIES
] = {
182 "some minor abrasions",
183 "some minor lacerations",
184 "a minor puncture wound",
185 "a minor amputation",
187 "a fractured ankle and shattered kneecap",
188 "a broken arm and dislocated shoulder",
190 "a broken leg and torn ligaments",
191 "a broken back and ruptured spleen",
192 "some deep incisions and a loss of blood",
193 "a fractured skull and mashed face",
197 const int objwt
[NUMOFOBJECTS
] = {
198 1, 5, 0, 10, 15, 2, 10, 10,
199 3, 5, 50, 2500, 2, 1, 100, 1,
200 2, 1, 1, 1, 60, 10, 5, 0,
201 50, 5, 15, 5, 1, 20, 10, 10,
202 0, 0, 0, 0, 1, 0, 0, 1,
203 1, 1, 2, 1, 0, 0, 0, 0,
204 0, 0, 100, 0, 0, 0, 55, 47,
205 50, 45, 45, 100, 2000, 30, 20, 10
208 const int objcumber
[NUMOFOBJECTS
] = {
209 1, 5, 0, 150, 10, 1, 5, 2,
210 2, 1, 5, 10, 1, 1, 10, 1,
211 1, 1, 1, 1, 7, 5, 4, 0,
212 0, 1, 1, 1, 1, 5, 4, 4,
213 1, 0, 0, 0, 1, 0, 0, 1,
214 1, 1, 3, 1, 0, 0, 1, 0,
215 0, 0, 10, 0, 0, 0, 7, 8,
216 10, 8, 8, 10, 10, 3, 1, 2
219 const int objflags
[NUMOFOBJECTS
] = {
220 0, 0, OBJ_NONOBJ
, OBJ_PERSON
,
223 0, OBJ_PLURAL
, OBJ_NONOBJ
, OBJ_PLURAL
,
228 0, 0, OBJ_AN
|OBJ_PERSON
, OBJ_NONOBJ
,
229 OBJ_PLURAL
, 0, OBJ_PERSON
, OBJ_PLURAL
,
232 OBJ_PERSON
, OBJ_PERSON
, OBJ_PERSON
, OBJ_NONOBJ
,
233 OBJ_NONOBJ
, OBJ_NONOBJ
, 0, 0,
234 OBJ_AN
, 0, OBJ_PERSON
, 0,
241 int followfight
= -1;
243 struct room
*location
;
245 /* current input line */
246 char words
[NWORD
][WORDLEN
];
247 int wordvalue
[NWORD
];
249 int wordcount
, wordnumber
;
251 /* state of the game */
255 int left
, right
, ahead
, back
;
257 int carrying
, encumber
;
268 int pleasure
, power
, ego
;
269 int notes
[NUMOFNOTES
];
270 unsigned int inven
[NUMOFWORDS
];
271 unsigned int wear
[NUMOFWORDS
];
272 char beenthere
[NUMOFROOMS
+ 1];
273 char injuries
[NUMOFINJURIES
];
276 const char *username
;