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[] = "@(#)com2.c 8.1 (Berkeley) 5/31/93";
38 static const char rcsid[] =
45 wearit() /* synonyms = {sheathe, sheath} */
48 int firstnumber, value;
50 firstnumber = wordnumber;
51 while(wordtype[++wordnumber] == ADJS);
52 while(wordnumber <= wordcount){
53 value = wordvalue[wordnumber];
54 for (n=0; objsht[value][n]; n++);
62 printf("You can't wear%s%s!\n",(objsht[value][n-1] == 's' ? " " : " a "),objsht[value]);
68 case LEVIS: /* wearable things */
84 if (testbit(inven,value)){
85 clearbit(inven,value);
87 carrying -= objwt[value];
88 encumber -= objcumber[value];
90 printf("You are now wearing %s %s.\n",(objsht[value][n-1] == 's' ? "the" : "a"), objsht[value]);
92 else if (testbit(wear,value))
93 printf("You are already wearing the %s.\n", objsht[value]);
95 printf("You aren't holding the %s.\n", objsht[value]);
96 if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND)
102 puts("Don't be ridiculous.");
107 put() /* synonyms = {buckle, strap, tie} */
109 if (wordvalue[wordnumber + 1] == ON){
110 wordvalue[++wordnumber] = PUTON;
113 if (wordvalue[wordnumber + 1] == DOWN){
114 wordvalue[++wordnumber] = DROP;
117 puts("I don't understand what you want to put.");
123 draw() /* synonyms = {pull, carry} */
131 while (wordtype[++wordnumber] == ADJS && wordnumber < wordcount);
132 if (wordvalue[wordnumber] == AMULET && testbit(inven,AMULET) && position != FINAL){
133 puts("The amulet begins to glow.");
134 if (testbit(inven,MEDALION)){
135 puts("The medallion comes to life too.");
136 if (position == 114){
137 location[position].down = 160;
138 whichway(location[position]);
139 puts("The waves subside and it is possible to descend to the sea cave now.");
144 puts("A light mist falls over your eyes and the sound of purling water trickles in");
145 puts("your ears. When the mist lifts you are standing beside a cool stream.");
154 else if (position == FINAL)
155 puts("The amulet won't work in here.");
156 else if (wordvalue[wordnumber] == COMPASS && testbit(inven,COMPASS))
157 printf("Your compass points %s.\n",truedirec(NORTH,'-'));
158 else if (wordvalue[wordnumber] == COMPASS)
159 puts("You aren't holding the compass.");
160 else if (wordvalue[wordnumber] == AMULET)
161 puts("You aren't holding the amulet.");
163 puts("There is no apparent use.");
172 for (n=0; !((n == SWORD || n == KNIFE || n == TWO_HANDED || n == MACE || n == CLEAVER || n == BROAD || n == CHAIN || n == SHOVEL || n == HALBERD) && testbit(inven,n)) && n < NUMOFOBJECTS; n++);
173 if (n == NUMOFOBJECTS)
174 puts("You don't have suitable weapons to kill.");
176 printf("Your %s should do the trick.\n",objsht[n]);
177 while (wordtype[++wordnumber] == ADJS);
178 switch(wordvalue[wordnumber]){
181 if (testbit(location[position].objects,BATHGOD)){
182 puts("The goddess's head slices off. Her corpse floats in the water.");
183 clearbit(location[position].objects,BATHGOD);
184 setbit(location[position].objects,DEADGOD);
187 } else if (testbit(location[position].objects,NORMGOD)){
188 puts("The goddess pleads but you strike her mercilessly. Her broken body lies in a\npool of blood.");
189 clearbit(location[position].objects,NORMGOD);
190 setbit(location[position].objects,DEADGOD);
195 } else puts("I dont see her anywhere.");
198 if (testbit(location[position].objects,TIMER)){
199 puts("The old man offers no resistance.");
200 clearbit(location[position].objects,TIMER);
201 setbit(location[position].objects,DEADTIME);
207 if (testbit(location[position].objects,NATIVE)){
208 puts("The girl screams as you cut her body to shreds. She is dead.");
209 clearbit(location[position].objects,NATIVE);
210 setbit(location[position].objects,DEADNATIVE);
213 } else puts("What girl?");
216 if (testbit(location[position].objects,MAN)){
217 puts("You strike him to the ground, and he coughs up blood.");
218 puts("Your fantasy is over.");
226 if (wordtype[wordnumber] != NOUNS)
229 printf("You can't kill the %s!\n",objsht[wordvalue[wordnumber]]);
237 while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount);
238 if (wordtype[wordnumber] == NOUNS && testbit(location[position].objects,wordvalue[wordnumber])){
240 switch(wordvalue[wordnumber]){
242 puts("You attack the goddess, and she screams as you beat her. She falls down");
243 puts("crying and tries to hold her torn and bloodied dress around her.");
253 puts("The girl tries to run, but you catch her and throw her down. Her face is");
254 puts("bleeding, and she screams as you tear off her clothes.");
261 puts("Her screams have attracted attention. I think we are surrounded.");
262 setbit(location[ahead].objects,WOODSMAN);
263 setbit(location[ahead].objects,DEADWOOD);
264 setbit(location[ahead].objects,MALLET);
265 setbit(location[back].objects,WOODSMAN);
266 setbit(location[back].objects,DEADWOOD);
267 setbit(location[back].objects,MALLET);
268 setbit(location[left].objects,WOODSMAN);
269 setbit(location[left].objects,DEADWOOD);
270 setbit(location[left].objects,MALLET);
271 setbit(location[right].objects,WOODSMAN);
272 setbit(location[right].objects,DEADWOOD);
273 setbit(location[right].objects,MALLET);
277 puts("You are perverted.");
287 if (followfight == gtime){
288 puts("The Dark Lord leaps away and runs down secret tunnels and corridors.");
289 puts("You chase him through the darkness and splash in pools of water.");
290 puts("You have cornered him. His laser sword extends as he steps forward.");
293 setbit(location[position].objects,TALISMAN);
294 setbit(location[position].objects,AMULET);
297 else if (followgod == gtime){
298 puts("The goddess leads you down a steamy tunnel and into a high, wide chamber.");
299 puts("She sits down on a throne.");
301 setbit(location[position].objects,NORMGOD);
306 puts("There is no one to follow.");