2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 static char sccsid[] = "@(#)com3.c 8.1 (Berkeley) 5/31/93";
38 static const char rcsid[] =
47 if (testbit(inven,SHOVEL)){
51 case 144: /* copse near beach */
53 setbit(location[position].objects,DEADWOOD);
54 setbit(location[position].objects,COMPASS);
55 setbit(location[position].objects,KNIFE);
56 setbit(location[position].objects,MACE);
62 puts("Nothing happens.");
66 puts("You don't have a shovel.");
76 puts("Nothing happens.");
98 injuries[12] = injuries[8] = injuries[7] = injuries[6] = 1;
99 for (n=0; n < NUMOFOBJECTS; n++)
100 if (testbit(inven,n)){
102 setbit(location[position].objects,n);
114 if (testbit(inven,SHOVEL)){
115 while(wordtype[++wordnumber] != OBJECT && wordtype[wordnumber] != NOUNS && wordnumber < wordcount);
116 value = wordvalue[wordnumber];
117 if (wordtype[wordnumber] == NOUNS && (testbit(location[position].objects,value) || value == BODY))
120 wordtype[wordnumber] = OBJECT;
121 if (testbit(inven,MAID) || testbit(location[position].objects,MAID))
123 if (testbit(inven,DEADWOOD) || testbit(location[position].objects,DEADWOOD))
125 if (testbit(inven,DEADGOD) || testbit(location[position].objects,DEADGOD))
127 if (testbit(inven,DEADTIME) || testbit(location[position].objects,DEADTIME))
129 if (testbit(inven,DEADNATIVE) || testbit(location[position].objects,DEADNATIVE))
135 puts("She screams as you wrestle her into the hole.");
142 wordtype[wordnumber] = OBJECT;
148 if (wordtype[wordnumber] == OBJECT && position > 88 && (testbit(inven,value) || testbit(location[position].objects,value))){
150 if (testbit(inven,value)){
151 clearbit(inven,value);
152 carrying -= objwt[value];
153 encumber -= objcumber[value];
155 clearbit(location[position].objects,value);
163 printf("The %s should rest easier now.\n",objsht[value]);
167 puts("It doesn't seem to work.");
170 puts("You aren't holding a shovel.");
178 if (testbit(inven,POTION)){
179 puts("The cool liquid runs down your throat but turns to fire and you choke.");
180 puts("The heat reaches your limbs and tingles your spirit. You feel like falling");
182 clearbit(inven, POTION);
185 for (n=0; n < NUMOFINJURIES; n++)
191 puts("I'm not thirsty.");
197 int firstnumber, value;
200 firstnumber = wordnumber;
201 if (!testbit(inven,LASER))
202 puts("You aren't holding a blaster.");
204 while(wordtype[++wordnumber] == ADJS);
205 while(wordnumber<=wordcount && wordtype[wordnumber] == OBJECT){
206 value = wordvalue[wordnumber];
207 printf("%s:\n", objsht[value]);
208 for (n=0; objsht[value][n]; n++);
209 if (testbit(location[position].objects,value)){
210 clearbit(location[position].objects,value);
212 printf("The %s explode%s\n",objsht[value],(objsht[value][n-1]=='s' ? (objsht[value][n-2]=='s' ? "s." : ".") : "s."));
217 printf("I dont see any %s around here.\n", objsht[value]);
218 if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND)
223 /* special cases with their own return()'s */
225 if (wordnumber <= wordcount && wordtype[wordnumber] == NOUNS){
227 switch(wordvalue[wordnumber]){
233 puts("The door is unhinged.");
234 location[189].north = 231;
235 location[231].south = 189;
236 whichway(location[position]);
239 puts("The wooden door splinters.");
240 location[30].west = 25;
241 whichway(location[position]);
244 puts("The laser blast has no effect on the door.");
247 puts("The blast hits the door and it explodes into flame. The magnesium burns");
248 puts("so rapidly that we have no chance to escape.");
251 puts("Nothing happens.");
256 if (testbit(location[position].objects,BATHGOD)){
257 puts("The goddess is hit in the chest and splashes back against the rocks.");
258 puts("Dark blood oozes from the charred blast hole. Her naked body floats in the");
259 puts("pools and then off downstream.");
260 clearbit(location[position].objects,BATHGOD);
261 setbit(location[180].objects,DEADGOD);
265 } else if (testbit(location[position].objects,NORMGOD)){
266 puts("The blast catches the goddess in the stomach, knocking her to the ground.");
267 puts("She writhes in the dirt as the agony of death taunts her.");
268 puts("She has stopped moving.");
269 clearbit(location[position].objects,NORMGOD);
270 setbit(location[position].objects,DEADGOD);
278 puts("I don't see any goddess around here.");
282 if (testbit(location[position].objects,TIMER)){
283 puts("The old man slumps over the bar.");
287 clearbit(location[position].objects,TIMER);
288 setbit(location[position].objects,DEADTIME);
290 else puts("What old timer?");
293 if (testbit(location[position].objects,MAN)){
294 puts("The man falls to the ground with blood pouring all over his white suit.");
295 puts("Your fantasy is over.");
298 else puts("What man?");
301 if (testbit(location[position].objects,NATIVE)){
302 puts("The girl is blown backwards several feet and lies in a pool of blood.");
303 clearbit(location[position].objects,NATIVE);
304 setbit(location[position].objects,DEADNATIVE);
308 } else puts("There is no girl here.");
315 printf("You can't shoot the %s.\n",objsht[wordvalue[wordnumber]]);
318 else puts("You must be a looney.");