]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - battlestar/extern.h
1 /* $NetBSD: extern.h,v 1.8 1998/03/29 04:49:06 mrg 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. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * @(#)externs.h 8.1 (Berkeley) 5/31/93
49 #define BITS (8 * sizeof (int))
51 #define OUTSIDE (position > 68 && position < 246 && position != 218)
52 #define rnd(x) (rand() % (x))
53 #define max(a,b) ((a) < (b) ? (b) : (a))
54 #define testbit(array, index) (array[index/BITS] & (1 << (index % BITS)))
55 #define setbit(array, index) (array[index/BITS] |= (1 << (index % BITS)))
56 #define clearbit(array, index) (array[index/BITS] &= ~(1 << (index % BITS)))
58 /* well known rooms */
129 #define DEADNATIVE 57
136 #define NUMOFOBJECTS 64
137 /* non-objects below */
160 #define EVERYTHING 1022
193 #define ARM 6 /* broken arm */
194 #define RIBS 7 /* broken ribs */
195 #define SPINE 9 /* broken back */
196 #define SKULL 11 /* fractured skull */
197 #define INCISE 10 /* deep incisions */
198 #define NECK 12 /* broken NECK */
199 #define NUMOFINJURIES 13
210 /* fundamental constants */
211 #define NUMOFROOMS 275
212 #define NUMOFWORDS ((NUMOFOBJECTS + BITS - 1) / BITS)
213 #define LINELENGTH 81
219 /* initial variable values */
228 #define north link[0]
229 #define south link[1]
233 #define access link[5]
235 #define flyhere link[7]
237 unsigned int objects
[NUMOFWORDS
];
239 extern struct room dayfile
[];
240 extern struct room nightfile
[];
241 struct room
*location
;
243 /* object characteristics */
244 char *objdes
[NUMOFOBJECTS
];
245 char *objsht
[NUMOFOBJECTS
];
246 char *ouch
[NUMOFINJURIES
];
247 int objwt
[NUMOFOBJECTS
];
248 int objcumber
[NUMOFOBJECTS
];
250 /* current input line */
251 #define NWORD 20 /* words per line */
252 char words
[NWORD
][15];
253 int wordvalue
[NWORD
];
255 int wordcount
, wordnumber
;
257 /* state of the game */
261 int left
, right
, ahead
, back
;
262 int ourclock
, fuel
, torps
;
263 int carrying
, encumber
;
275 int matchlight
, matchcount
;
277 int pleasure
, power
, ego
;
280 int notes
[NUMOFNOTES
];
281 unsigned int inven
[NUMOFWORDS
];
282 unsigned int wear
[NUMOFWORDS
];
283 char beenthere
[NUMOFROOMS
+ 1];
284 char injuries
[NUMOFINJURIES
];
295 #define HASHMASK (HASHSIZE - 1)
296 struct wlist
*hashtab
[HASHSIZE
];
297 extern struct wlist wlist
[];
303 extern struct objs dayobjs
[];
304 extern struct objs nightobjs
[];
306 void blast
__P((void));
307 void bury
__P((void));
308 int card
__P((char *, int));
309 int checkout
__P((char *));
310 void chime
__P((void));
311 void convert
__P((int));
312 void crash
__P((void));
313 int cypher
__P((void));
314 void die
__P((void));
315 void diesig
__P((int));
316 void dig
__P((void));
317 int draw
__P((void));
318 void drink
__P((void));
319 int drive
__P((void));
320 int drop
__P((char *));
322 void endfly
__P((void));
323 int fight
__P((int, int));
324 int follow
__P((void));
325 void getutmp
__P((char *));
326 int give
__P((void));
327 int hash
__P((char *));
328 void initialize
__P((char));
329 void install
__P((struct wlist
*));
330 int jump
__P((void));
331 void kiss
__P((void));
332 int land
__P((void));
333 int launch
__P((void));
334 void light
__P((void));
335 void live
__P((void));
336 void love
__P((void));
337 int move
__P((int, int));
338 void moveenemy
__P((int));
339 void murder
__P((void));
340 void news
__P((void));
341 void newway
__P((int));
342 void notarget
__P((void));
343 void parse
__P((void));
344 void post
__P((char));
345 void printobjs
__P((void));
347 int puton
__P((void));
348 void ravage
__P((void));
349 void restore
__P((void));
350 int ride
__P((void));
351 void save
__P((void));
352 void screen
__P((void));
353 int shoot
__P((void));
354 void succumb
__P((int));
355 int take
__P((unsigned int[]));
356 int takeoff
__P((void));
357 void target
__P((void));
358 int throw __P((char *));
359 int ucard
__P((unsigned int *));
361 int visual
__P((void));
362 int wearit
__P((void));
363 void whichway
__P((struct room
));
364 int wizard
__P((char *));
365 void wordinit
__P((void));
366 void writedes
__P((void));
368 char *getcom
__P((char *, int, char *, char *));
369 char *getword
__P((char *, char *, int));
370 char *rate
__P((void));
371 char *truedirec
__P((int, char));
372 struct wlist
*lookup
__P((char *));