]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - battlestar/extern.h
1 /* $NetBSD: extern.h,v 1.6 1997/10/11 02:07:18 lukem 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
47 #define BITS (8 * sizeof (int))
49 #define OUTSIDE (position > 68 && position < 246 && position != 218)
50 #define rnd(x) (rand() % (x))
51 #define max(a,b) ((a) < (b) ? (b) : (a))
52 #define testbit(array, index) (array[index/BITS] & (1 << (index % BITS)))
53 #define setbit(array, index) (array[index/BITS] |= (1 << (index % BITS)))
54 #define clearbit(array, index) (array[index/BITS] &= ~(1 << (index % BITS)))
56 /* well known rooms */
127 #define DEADNATIVE 57
134 #define NUMOFOBJECTS 64
135 /* non-objects below */
158 #define EVERYTHING 1022
191 #define ARM 6 /* broken arm */
192 #define RIBS 7 /* broken ribs */
193 #define SPINE 9 /* broken back */
194 #define SKULL 11 /* fractured skull */
195 #define INCISE 10 /* deep incisions */
196 #define NECK 12 /* broken NECK */
197 #define NUMOFINJURIES 13
208 /* fundamental constants */
209 #define NUMOFROOMS 275
210 #define NUMOFWORDS ((NUMOFOBJECTS + BITS - 1) / BITS)
211 #define LINELENGTH 81
217 /* initial variable values */
226 #define north link[0]
227 #define south link[1]
231 #define access link[5]
233 #define flyhere link[7]
235 unsigned int objects
[NUMOFWORDS
];
237 struct room dayfile
[];
238 struct room nightfile
[];
239 struct room
*location
;
241 /* object characteristics */
242 char *objdes
[NUMOFOBJECTS
];
243 char *objsht
[NUMOFOBJECTS
];
244 char *ouch
[NUMOFINJURIES
];
245 int objwt
[NUMOFOBJECTS
];
246 int objcumber
[NUMOFOBJECTS
];
248 /* current input line */
249 #define NWORD 20 /* words per line */
250 char words
[NWORD
][15];
251 int wordvalue
[NWORD
];
253 int wordcount
, wordnumber
;
255 /* state of the game */
259 int left
, right
, ahead
, back
;
260 int ourclock
, fuel
, torps
;
261 int carrying
, encumber
;
273 int matchlight
, matchcount
;
275 int pleasure
, power
, ego
;
278 int notes
[NUMOFNOTES
];
279 unsigned int inven
[NUMOFWORDS
];
280 unsigned int wear
[NUMOFWORDS
];
281 char beenthere
[NUMOFROOMS
+ 1];
282 char injuries
[NUMOFINJURIES
];
293 #define HASHMASK (HASHSIZE - 1)
294 struct wlist
*hashtab
[HASHSIZE
];
295 struct wlist wlist
[];
301 struct objs dayobjs
[];
302 struct objs nightobjs
[];
304 void blast
__P((void));
305 void bury
__P((void));
306 int card
__P((char *, int));
307 int checkout
__P((char *));
308 void chime
__P((void));
309 void convert
__P((int));
310 void crash
__P((void));
311 int cypher
__P((void));
312 void die
__P((void));
313 void diesig
__P((int));
314 void dig
__P((void));
315 int draw
__P((void));
316 void drink
__P((void));
317 int drive
__P((void));
318 int drop
__P((char *));
320 void endfly
__P((void));
321 int fight
__P((int, int));
322 int follow
__P((void));
323 void getutmp
__P((char *));
324 int give
__P((void));
325 int hash
__P((char *));
326 void initialize
__P((char));
327 void install
__P((struct wlist
*));
328 int jump
__P((void));
329 void kiss
__P((void));
330 int land
__P((void));
331 int launch
__P((void));
332 void light
__P((void));
333 void live
__P((void));
334 void love
__P((void));
335 int move
__P((int, int));
336 void moveenemy
__P((int));
337 void murder
__P((void));
338 void news
__P((void));
339 void newway
__P((int));
340 void notarget
__P((void));
341 void parse
__P((void));
342 void post
__P((char));
343 void printobjs
__P((void));
345 int puton
__P((void));
346 void ravage
__P((void));
347 void restore
__P((void));
348 int ride
__P((void));
349 void save
__P((void));
350 void screen
__P((void));
351 int shoot
__P((void));
352 void succumb
__P((int));
353 int take
__P((unsigned int[]));
354 int takeoff
__P((void));
355 void target
__P((void));
356 int throw __P((char *));
357 int ucard
__P((unsigned int *));
359 int visual
__P((void));
360 int wearit
__P((void));
361 void whichway
__P((struct room
));
362 int wizard
__P((char *));
363 void wordinit
__P((void));
364 void writedes
__P((void));
366 char *getcom
__P((char *, int, char *, char *));
367 char *getword
__P((char *, char *, int));
368 char *rate
__P((void));
369 char *truedirec
__P((int, char));
370 struct wlist
*lookup
__P((char *));