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
35 static char sccsid[] = "@(#)com6.c 8.1 (Berkeley) 5/31/93";
39 #include "pathnames.h"
43 if (testbit(location[position].objects,VIPER) && !notes[CANTLAUNCH]){
45 clearbit(location[position].objects,VIPER);
46 position = location[position].up;
50 puts("You climb into the viper and prepare for launch.");
51 puts("With a touch of your thumb the turbo engines ignite, thrusting you back into\nyour seat.");
55 puts("Not enough fuel to launch.");
58 puts("Can't launch.");
64 if (notes[LAUNCHED] && testbit(location[position].objects,LAND) && location[position].down){
66 position = location[position].down;
67 setbit(location[position].objects,VIPER);
70 puts("You are down.");
74 puts("You can't land here.");
80 printf("bye.\nYour rating was %s.\n", rate());
94 static FILE *score_fp;
98 if ((score_fp = fopen(_PATH_SCORE,"a")) == NULL)
108 int s = sigblock(sigmask(SIGINT));
110 gettimeofday(&tv, (struct timezone *)0); /* can't call time */
111 tvsec = (time_t) tv.tv_sec;
112 date = ctime(&tvsec);
115 fprintf(score_fp, "%s %8s %c%20s", date, uname, ch, rate());
117 fprintf(score_fp, " wizard\n");
119 fprintf(score_fp, " WIZARD!\n");
121 fprintf(score_fp, "\n");
131 score = max(max(pleasure,power),ego);
132 if (score == pleasure){
136 return("junior voyeur");
139 else return("Marquis De Sade");
141 else if (score == power){
149 return("Darth Vader");
150 else return("Sauron the Great");
156 return("philanthropist");
159 else return("Mr. Roarke");
165 if (testbit(location[position].objects,CAR)){
166 puts("You hop in the car and turn the key. There is a perceptible grating noise,");
167 puts("and an explosion knocks you unconscious...");
168 clearbit(location[position].objects,CAR);
169 setbit(location[position].objects,CRASH);
170 injuries[5] = injuries[6] = injuries[7] = injuries[8] = 1;
176 puts("There is nothing to drive here.");
182 if (testbit(location[position].objects,HORSE)){
183 puts("You climb onto the stallion and kick it in the guts. The stupid steed launches");
184 puts("forward through bush and fern. You are thrown and the horse gallups off.");
185 clearbit(location[position].objects,HORSE);
186 while (!(position = rnd(NUMOFROOMS+1)) || !OUTSIDE || !beenthere[position] || location[position].flyhere);
187 setbit(location[position].objects,HORSE);
188 if (location[position].north)
189 position = location[position].north;
190 else if (location[position].south)
191 position = location[position].south;
192 else if (location[position].east)
193 position = location[position].east;
195 position = location[position].west;
198 else puts("There is no horse here.");
202 light() /* synonyms = {strike, smoke} */
203 { /* for matches, cigars */
204 if (testbit(inven,MATCHES) && matchcount){
205 puts("Your match splutters to life.");
209 if (position == 217){
210 puts("The whole bungalow explodes with an intense blast.");
214 else puts("You're out of matches.");