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