]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - battlestar/globals.c
1 /* $NetBSD: globals.c,v 1.20 2020/12/06 11:35:27 dholland 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.20 2020/12/06 11:35:27 dholland 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 "
71 "is \nwatching you, but continues to steep and sing softly.",
72 "The goddess is reclining on a bed of ferns and studying you intently.",
73 "There is a grenade here.",
74 "There is a length of heavy chain here.",
75 "There is a stout rope here.",
76 "There is a pair of Levi's here.",
77 "A bloody mace is lying on the ground here.",
78 "There is a shovel here.",
79 "A long, sharp halberd is propped up here.",
80 "There is a compass here.",
81 "Wreckage and smoldering debris from a crash litter the ground here.",
82 "A woodland Elf armed with a shield and deadly halberd lunges toward "
84 "I think I hear footsteps behind us.",
85 "There are a few coins here.",
86 "There are some matches here.",
87 "An unctuous man in a white suit and a dwarf are standing here.",
88 "There are some ripe papayas here.",
89 "There is a ripe pineapple here.",
90 "There are some kiwi fruit here.",
91 "There are some coconuts here.",
92 "There is a ripe mango here.",
93 "There is a sparkling diamond ring here.",
94 "There is a colorful pink potion in a small crystal vial here.",
95 "A gold bracelet is on the ground here.",
96 "A swarthy woman with stern features pulls you aside from the crowd,\n"
97 "'I must talk to you -- but not here. "
98 "Meet me at midnight in the gardens.'",
99 "The swarthy woman has been awaiting you anxiously. 'I must warn you "
100 "that the\nIsland has anticipated your Quest. You will not be "
101 "welcomed. The Darkness is\nstrong where you must search. Seek"
102 " not the shadows save only at night, for\nthen are they the "
103 "weakest. In the mountains far from here a canyon winds\nwith "
104 "ferns and streams and forgotten vines. There you must go. "
106 "Out from the shadows a figure leaps! His black cape swirls around,"
107 " and he\nholds a laser sword at your chest. 'So, you have"
108 " come to fulfill the Quest.\nHa! Your weapons are no match for"
110 "An old-timer with one eye missing and no money for a drink sits at the"
112 "You are flying through an asteroid field!",
113 "A planet is nearby.",
114 "The ground is charred here.",
115 "There is a thermonuclear warhead here.",
116 "The fragile, beautiful young goddess lies here. You murdered her "
118 "The old-timer is lying here. He is dead.",
119 "The native girl's body is lying here.",
120 "A native girl is sitting here.",
121 "A gorgeous white stallion is standing here.",
122 "The keys are in the ignition.",
123 "A pot of pearls and jewels is sitting here.",
124 "A bar of solid gold is here.",
125 "There is a 10 kilogram diamond block here."
129 const char *const objsht
[NUMOFOBJECTS
] = {
132 NULL
, /* Can land from here. */
153 NULL
, /* Bathing goddess. */
163 NULL
, /* Crash debris. */
165 NULL
, /* Footsteps. */
168 NULL
, /* Man and dwarf. */
177 NULL
, /* Swarthy woman. */
178 NULL
, /* Swarthy woman (with message). */
180 NULL
, /* Old-timer. */
181 NULL
, /* Asteroid field. */
182 NULL
, /* Planet nearby. */
183 NULL
, /* Charred ground. */
188 NULL
, /* Native girl. */
196 const char *const ouch
[NUMOFINJURIES
] = {
197 "some minor abrasions",
198 "some minor lacerations",
199 "a minor puncture wound",
200 "a minor amputation",
202 "a fractured ankle and shattered kneecap",
203 "a broken arm and dislocated shoulder",
205 "a broken leg and torn ligaments",
206 "a broken back and ruptured spleen",
207 "some deep incisions and a loss of blood",
208 "a fractured skull and mashed face",
212 const int objwt
[NUMOFOBJECTS
] = {
213 1, 5, 0, 10, 15, 2, 10, 10,
214 3, 5, 50, 2500, 2, 1, 100, 1,
215 2, 1, 1, 1, 60, 10, 5, 0,
216 50, 5, 15, 5, 1, 20, 10, 10,
217 0, 0, 0, 0, 1, 0, 0, 1,
218 1, 1, 2, 1, 0, 0, 0, 0,
219 0, 0, 100, 0, 0, 0, 55, 47,
220 50, 45, 45, 100, 2000, 30, 20, 10
223 const int objcumber
[NUMOFOBJECTS
] = {
224 1, 5, 0, 150, 10, 1, 5, 2,
225 2, 1, 5, 10, 1, 1, 10, 1,
226 1, 1, 1, 1, 7, 5, 4, 0,
227 0, 1, 1, 1, 1, 5, 4, 4,
228 1, 0, 0, 0, 1, 0, 0, 1,
229 1, 1, 3, 1, 0, 0, 1, 0,
230 0, 0, 10, 0, 0, 0, 7, 8,
231 10, 8, 8, 10, 10, 3, 1, 2
234 const int objflags
[NUMOFOBJECTS
] = {
235 0, 0, OBJ_NONOBJ
, OBJ_PERSON
,
238 0, OBJ_PLURAL
, OBJ_NONOBJ
, OBJ_PLURAL
,
243 0, 0, OBJ_AN
|OBJ_PERSON
, OBJ_NONOBJ
,
244 OBJ_PLURAL
, 0, OBJ_PERSON
, OBJ_PLURAL
,
247 OBJ_PERSON
, OBJ_PERSON
, OBJ_PERSON
, OBJ_NONOBJ
,
248 OBJ_NONOBJ
, OBJ_NONOBJ
, 0, 0,
249 OBJ_AN
, 0, OBJ_PERSON
, 0,
256 int followfight
= -1;
258 struct room
*location
;
260 /* current input line */
261 char words
[NWORD
][WORDLEN
];
262 int wordvalue
[NWORD
];
264 int wordcount
, wordnumber
;
266 /* state of the game */
270 int left
, right
, ahead
, back
;
272 int carrying
, encumber
;
283 int pleasure
, power
, ego
;
284 int notes
[NUMOFNOTES
];
285 unsigned int inven
[NUMOFWORDS
];
286 unsigned int wear
[NUMOFWORDS
];
287 char beenthere
[NUMOFROOMS
+ 1];
288 char injuries
[NUMOFINJURIES
];
291 const char *username
;