]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - larn/header.h
1 /* $NetBSD: header.h,v 1.6 1995/04/22 07:34:05 cgd Exp $ */
3 /* header.h Larn is copyrighted 1986 by Noah Morgan. */
6 /* max # levels in the dungeon */
8 /* max # of levels in the temple of the luran */
13 /* this is the number of people on a scoreboard max */
15 /* maximum player level allowed */
17 /* maximum # monsters in the dungeon */
19 /* maximum number of spells in existance */
21 /* maximum number of scrolls that are possible */
23 /* maximum number of potions that are possible */
24 #define TIMELIMIT 30000
25 /* the maximum number of moves before the game is called */
27 /* the tax rate for the LRS */
29 /* the maximum number of objects n < MAXOBJ */
31 /* this is the structure definition of the monster data */
41 char intelligence
; /* monsters intelligence -- used to choose movement */
44 unsigned long experience
;
47 /* this is the structure definition for the items in the dnd store */
56 /* this is the structure that holds the entire dungeon specifications */
59 short hitp
; /* monster's hit points */
60 char mitem
; /* the monster ID */
61 char item
; /* the object's ID */
62 short iarg
; /* the object's argument */
63 char know
; /* have we been here before*/
66 /* this is the structure for maintaining & moving the spheres of annihilation */
69 struct sphere
*p
; /* pointer to next structure */
70 char x
,y
,lev
; /* location of the sphere */
71 char dir
; /* direction sphere is going in */
72 char lifetime
; /* duration of the sphere */
75 /* defines for the character attribute array c[] */
76 #define STRENGTH 0 /* characters physical strength not due to objects */
77 #define INTELLIGENCE 1
79 #define CONSTITUTION 3
90 #define BANKACCOUNT 14
95 #define MOREDEFENSES 19
97 #define PROTECTIONTIME 21
100 #define REGENCOUNTER 24
104 #define BLINDCOUNT 28
109 #define CHARMCOUNT 33
110 #define INVISIBILITY 34
111 #define CANCELLATION 35
118 #define NEGATESPIRIT 42
119 #define SCAREMONST 43
123 #define HASTEMONST 47
124 #define CUBEofUNDEAD 48
126 #define FIRERESISTANCE 50
134 #define MONSTKILLED 58
135 #define SPELLSCAST 59
136 #define LANCEDEATH 60
143 #define DRAINSTRENGTH 67
144 #define CLUMSINESS 68
145 #define INFEEBLEMENT 69
147 #define SEEINVISIBLE 71
149 #define RANDOMWALK 73
150 #define SPHCAST 74 /* nz if an active sphere of annihilation */
151 #define WTW 75 /* walk through walls */
152 #define STREXTRA 76 /* character strength due to objects or enchantments */
153 #define TMP 77 /* misc scratch space */
154 #define LIFEPROT 78 /* life protection counter */
156 /* defines for the objects in the game */
163 #define OELEVATORUP 6
166 #define OTELEPORTER 9
170 #define OSTAIRSDOWN 13
171 #define OELEVATORDOWN 14
174 #define ODEADFOUNTAIN 17
178 #define OCLOSEDDOOR 20
180 #define OTRAPARROW 66
181 #define OTRAPARROWIV 67
189 #define OSTUDLEATHER 61
191 #define OPLATEARMOR 63
194 #define OELVENCHAIN 92
196 #define OSWORDofSLASHING 26
202 #define OBATTLEAXE 57
203 #define OLONGSWORD 58
209 #define ORINGOFEXTRA 32
210 #define OREGENRING 33
212 #define OENERGYRING 35
215 #define OCLEVERRING 38
226 #define OORBOFDRAGON 46
227 #define OSPIRITSCARAB 47
228 #define OCUBEofUNDEAD 48
243 #define OIVDARTRAP 73
246 #define OIVTRAPDOOR 76
247 #define OTRADEPOST 77
248 #define OIVTELETRAP 78
249 #define ODEADTHRONE 79
250 #define OANNIHILATION 80 /* sphere of annihilation */
252 #define OLRS 82 /* Larn Revenue Service */
255 #define OBRASSLAMP 85
256 #define OHANDofFEAR 86 /* hand of fear */
257 #define OSPHTAILSMAN 87 /* tailsman of the sphere */
258 #define OWWAND 88 /* wand of wonder */
259 #define OPSTAFF 89 /* staff of power */
262 /* defines for the monsters as objects */
273 #define TROGLODYTE 10
276 #define LEPRECHAUN 13
279 #define RUSTMONSTER 16
281 #define ASSASSINBUG 18
288 #define WHITEDRAGON 25
294 #define VIOLETFUNGI 31
302 #define INVISIBLESTALKER 39
303 #define POLTERGEIST 40
304 #define DISENCHANTRESS 41
305 #define SHAMBLINGMOUND 42
306 #define YELLOWMOLD 43
311 #define BRONZEDRAGON 48
312 #define GREENDRAGON 49
313 #define PURPLEWORM 50
315 #define SPIRITNAGA 52
316 #define SILVERDRAGON 53
317 #define PLATINUMDRAGON 54
318 #define GREENURCHIN 55
321 #define DEMONPRINCE 64
324 #define BUFBIG 4096 /* size of the output buffer */
325 #define MAXIBUF 4096 /* size of the input buffer */
326 #define LOGNAMESIZE 40 /* max size of the players name */
327 #define PSNAMESIZE 40 /* max size of the process name */
330 extern char VERSION
,SUBVERSION
;
331 extern char aborted
[],alpha
[],beenhere
[],boldon
,cheat
,ckpfile
[],ckpflag
;
332 extern char *class[],course
[],diagfile
[],helpfile
[];
333 extern char *inbuffer
,is_alpha
[],is_digit
[];
334 extern char item
[MAXX
][MAXY
],iven
[],know
[MAXX
][MAXY
],larnlevels
[],lastmonst
[];
335 extern char level
,*levelname
[],logfile
[],loginname
[],logname
[],*lpbuf
,*lpend
;
336 extern char *lpnt
,moved
[MAXX
][MAXY
],mitem
[MAXX
][MAXY
],monstlevel
[];
337 extern char monstnamelist
[],nch
[],ndgg
[],nlpts
[],nomove
,nosignal
,nowelcome
;
338 extern char nplt
[],nsw
[],*objectname
[],objnamelist
[],optsfile
[];
339 extern char *potionhide
[],*potionname
[],playerids
[],potprob
[];
340 extern char predostuff
,psname
[],restorflag
,savefilename
[],scorefile
[],scprob
[];
341 extern char screen
[MAXX
][MAXY
],*scrollhide
[],*scrollname
[],sex
,*spelcode
[];
342 extern char *speldescript
[];
343 extern char spelknow
[],*spelname
[],*spelmes
[],spelweird
[MAXMONST
+8][SPNUM
];
344 extern char splev
[],stealth
[MAXX
][MAXY
],to_lower
[],to_upper
[],wizard
;
345 extern short diroffx
[],diroffy
[],hitflag
,hit2flag
,hit3flag
,hitp
[MAXX
][MAXY
];
346 extern short iarg
[MAXX
][MAXY
],ivenarg
[],lasthx
,lasthy
,lastnum
,lastpx
,lastpy
;
347 extern short nobeep
,oldx
,oldy
,playerx
,playery
;
348 extern int dayplay
,enable_scroll
,srcount
,yrepcount
,userid
,wisid
,lfd
,fd
;
349 extern long initialtime
,outstanding_taxes
,skill
[],gtime
,c
[],cbak
[];
350 extern unsigned long randx
;
351 extern struct cel
*cell
;
352 extern struct monst monster
[];
353 extern struct sphere
*spheres
;
354 extern struct _itm itm
[];
356 char *fortune(),*getenv(),*getlogin(),*lgetw(),*lgetl(),*ctime();
357 char *tmcapcnv(),*tgetstr(),*tgoto();
358 long paytaxes(),lgetc(),lrint(),time();
359 unsigned long readnum();
362 /* macro to create scroll #'s with probability of occurrence */
363 #define newscroll() (scprob[rund(81)])
364 /* macro to return a potion # created with probability of occurrence */
365 #define newpotion() (potprob[rund(41)])
366 /* macro to return the + points on created leather armor */
367 #define newleather() (nlpts[rund(c[HARDGAME]?13:15)])
368 /* macro to return the + points on chain armor */
369 #define newchain() (nch[rund(10)])
370 /* macro to return + points on plate armor */
371 #define newplate() (nplt[rund(c[HARDGAME]?4:12)])
372 /* macro to return + points on new daggers */
373 #define newdagger() (ndgg[rund(13)])
374 /* macro to return + points on new swords */
375 #define newsword() (nsw[rund(c[HARDGAME]?6:13)])
376 /* macro to destroy object at present location */
377 #define forget() (item[playerx][playery]=know[playerx][playery]=0)
378 /* macro to wipe out a monster at a location */
379 #define disappear(x,y) (mitem[x][y]=know[x][y]=0)
382 /* macro to turn on bold display for the terminal */
383 #define setbold() (lprcat(boldon?"\33[1m":"\33[7m"))
384 /* macro to turn off bold display for the terminal */
385 #define resetbold() (lprcat("\33[m"))
386 /* macro to setup the scrolling region for the terminal */
387 #define setscroll() (lprcat("\33[20;24r"))
388 /* macro to clear the scrolling region for the terminal */
389 #define resetscroll() (lprcat("\33[;24r"))
390 /* macro to clear the screen and home the cursor */
391 #define clear() (lprcat("\33[2J\33[f"), cbak[SPELLS]= -50)
392 #define cltoeoln() lprcat("\33[K")
394 /* defines below are for use in the termcap mode only */
403 /* macro to turn on bold display for the terminal */
404 #define setbold() (*lpnt++ = ST_START)
405 /* macro to turn off bold display for the terminal */
406 #define resetbold() (*lpnt++ = ST_END)
407 /* macro to setup the scrolling region for the terminal */
408 #define setscroll() enable_scroll=1
409 /* macro to clear the scrolling region for the terminal */
410 #define resetscroll() enable_scroll=0
411 /* macro to clear the screen and home the cursor */
412 #define clear() (*lpnt++ =CLEAR, cbak[SPELLS]= -50)
413 /* macro to clear to end of line */
414 #define cltoeoln() (*lpnt++ = CL_LINE)
417 /* macro to output one byte to the output buffer */
418 #define lprc(ch) ((lpnt>=lpend)?(*lpnt++ =(ch), lflush()):(*lpnt++ =(ch)))
420 /* macro to seed the random number generator */
421 #define srand(x) (randx=x)
423 /* macros to generate random numbers 1<=rnd(N)<=N 0<=rund(N)<=N-1 */
424 #define rnd(x) ((((randx=randx*1103515245+12345)>>7)%(x))+1)
425 #define rund(x) ((((randx=randx*1103515245+12345)>>7)%(x)) )
427 /* macros for miscellaneous data conversion */
428 #define min(x,y) (((x)>(y))?(y):(x))
429 #define max(x,y) (((x)>(y))?(x):(y))
430 #define isalpha(x) (is_alpha[x])
431 #define isdigit(x) (is_digit[x])
432 #define tolower(x) (to_lower[x])
433 #define toupper(x) (to_upper[x])
434 #define lcc(x) (to_lower[x])
435 #define ucc(x) (to_upper[x])