1 /* $NetBSD: header.h,v 1.21 2008/02/03 20:11:05 dholland 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 existence */
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 */
42 char intelligence
; /* monsters intelligence -- used to
46 unsigned long experience
;
49 /* this is the structure definition for the items in the dnd store */
57 /* 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 */
68 struct sphere
*p
; /* pointer to next structure */
69 char x
, y
, lev
; /* location of the sphere */
70 char dir
; /* direction sphere is going in */
71 short lifetime
; /* duration of the sphere */
74 /* defines for the character attribute array c[] */
75 #define STRENGTH 0 /* characters physical strength not due to
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
154 #define TMP 77 /* misc scratch space */
155 #define LIFEPROT 78 /* life protection counter */
157 /* defines for the objects in the game */
164 #define OELEVATORUP 6
167 #define OTELEPORTER 9
171 #define OSTAIRSDOWN 13
172 #define OELEVATORDOWN 14
175 #define ODEADFOUNTAIN 17
179 #define OCLOSEDDOOR 20
181 #define OTRAPARROW 66
182 #define OTRAPARROWIV 67
190 #define OSTUDLEATHER 61
192 #define OPLATEARMOR 63
195 #define OELVENCHAIN 92
197 #define OSWORDofSLASHING 26
203 #define OBATTLEAXE 57
204 #define OLONGSWORD 58
210 #define ORINGOFEXTRA 32
211 #define OREGENRING 33
213 #define OENERGYRING 35
216 #define OCLEVERRING 38
227 #define OORBOFDRAGON 46
228 #define OSPIRITSCARAB 47
229 #define OCUBEofUNDEAD 48
244 #define OIVDARTRAP 73
247 #define OIVTRAPDOOR 76
248 #define OTRADEPOST 77
249 #define OIVTELETRAP 78
250 #define ODEADTHRONE 79
251 #define OANNIHILATION 80 /* sphere of annihilation */
253 #define OLRS 82 /* Larn Revenue Service */
256 #define OBRASSLAMP 85
257 #define OHANDofFEAR 86 /* hand of fear */
258 #define OSPHTAILSMAN 87 /* tailsman of the sphere */
259 #define OWWAND 88 /* wand of wonder */
260 #define OPSTAFF 89 /* staff of power */
263 /* defines for the monsters as objects */
274 #define TROGLODYTE 10
277 #define LEPRECHAUN 13
280 #define RUSTMONSTER 16
282 #define ASSASSINBUG 18
289 #define WHITEDRAGON 25
295 #define VIOLETFUNGI 31
303 #define INVISIBLESTALKER 39
304 #define POLTERGEIST 40
305 #define DISENCHANTRESS 41
306 #define SHAMBLINGMOUND 42
307 #define YELLOWMOLD 43
312 #define BRONZEDRAGON 48
313 #define GREENDRAGON 49
314 #define PURPLEWORM 50
316 #define SPIRITNAGA 52
317 #define SILVERDRAGON 53
318 #define PLATINUMDRAGON 54
319 #define GREENURCHIN 55
322 #define DEMONPRINCE 64
327 #define BUFBIG 4096 /* size of the output buffer */
328 #define MAXIBUF 4096 /* size of the input buffer */
329 #define LOGNAMESIZE 40 /* max size of the players name */
330 #define PSNAMESIZE 40 /* max size of the process name */
333 extern char VERSION
, SUBVERSION
;
334 extern u_char beenhere
[], boldon
, cheat
, ckpflag
;
335 extern const char *class[];
336 extern u_char course
[];
337 extern char diagfile
[], helpfile
[], ckpfile
[], larnlevels
[],
338 playerids
[], optsfile
[1024], psname
[], savefilename
[],
340 extern u_char
*inbuffer
;
341 extern u_char item
[MAXX
][MAXY
], iven
[], know
[MAXX
][MAXY
];
342 extern const char *levelname
[];
343 extern char logfile
[], loginname
[], logname
[], lastmonst
[];
344 extern u_char
*lpbuf
, *lpend
;
345 extern u_char
*lpnt
, moved
[MAXX
][MAXY
], mitem
[MAXX
][MAXY
], monstlevel
[];
346 extern char monstnamelist
[], objnamelist
[];
347 extern u_char nch
[], ndgg
[], nlpts
[], nomove
, nosignal
, nowelcome
;
348 extern u_char nplt
[], nsw
[];
349 extern const char *objectname
[];
350 extern const char *potionhide
[], *potionname
[];
351 extern const char *spelcode
[], *spelname
[], *spelmes
[];
352 extern char aborted
[], spelweird
[MAXMONST
+ 8][SPNUM
];
353 extern u_char potprob
[];
354 extern u_char predostuff
, restorflag
, scprob
[];
355 extern u_char screen
[MAXX
][MAXY
], sex
;
356 extern const char *speldescript
[];
357 extern const char *scrollhide
[], *scrollname
[];
358 extern u_char spelknow
[];
359 extern u_char splev
[], stealth
[MAXX
][MAXY
], wizard
;
360 extern short diroffx
[], diroffy
[], hitflag
, hit2flag
, hit3flag
, hitp
[MAXX
][MAXY
];
361 extern short iarg
[MAXX
][MAXY
], ivenarg
[], lasthx
, lasthy
, lastnum
, lastpx
,
363 extern short nobeep
, oldx
, oldy
, playerx
, playery
, level
;
364 extern int enable_scroll
, srcount
, yrepcount
, userid
, wisid
,
366 extern gid_t gid
, egid
;
367 extern long outstanding_taxes
, skill
[], gltime
, c
[], cbak
[];
368 extern time_t initialtime
;
369 extern unsigned long randx
;
370 extern struct cel
*cell
;
371 extern struct monst monster
[];
372 extern struct sphere
*spheres
;
373 extern struct _itm itm
[];
374 extern int rmst
, lasttime
;
376 /* macro to create scroll #'s with probability of occurrence */
377 #define newscroll() (scprob[rund(81)])
378 /* macro to return a potion # created with probability of occurrence */
379 #define newpotion() (potprob[rund(41)])
380 /* macro to return the + points on created leather armor */
381 #define newleather() (nlpts[rund(c[HARDGAME]?13:15)])
382 /* macro to return the + points on chain armor */
383 #define newchain() (nch[rund(10)])
384 /* macro to return + points on plate armor */
385 #define newplate() (nplt[rund(c[HARDGAME]?4:12)])
386 /* macro to return + points on new daggers */
387 #define newdagger() (ndgg[rund(13)])
388 /* macro to return + points on new swords */
389 #define newsword() (nsw[rund(c[HARDGAME]?6:13)])
390 /* macro to destroy object at present location */
391 #define forget() (item[playerx][playery]=know[playerx][playery]=0)
392 /* macro to wipe out a monster at a location */
393 #define disappear(x,y) (mitem[x][y]=know[x][y]=0)
396 /* macro to turn on bold display for the terminal */
397 #define setbold() (lprcat(boldon?"\33[1m":"\33[7m"))
398 /* macro to turn off bold display for the terminal */
399 #define resetbold() (lprcat("\33[m"))
400 /* macro to setup the scrolling region for the terminal */
401 #define setscroll() (lprcat("\33[20;24r"))
402 /* macro to clear the scrolling region for the terminal */
403 #define resetscroll() (lprcat("\33[;24r"))
404 /* macro to clear the screen and home the cursor */
405 #define clear() (lprcat("\33[2J\33[f"), cbak[SPELLS]= -50)
406 #define cltoeoln() lprcat("\33[K")
408 /* defines below are for use in the termcap mode only */
417 /* macro to turn on bold display for the terminal */
418 #define setbold() (*lpnt++ = ST_START)
419 /* macro to turn off bold display for the terminal */
420 #define resetbold() (*lpnt++ = ST_END)
421 /* macro to setup the scrolling region for the terminal */
422 #define setscroll() enable_scroll=1
423 /* macro to clear the scrolling region for the terminal */
424 #define resetscroll() enable_scroll=0
425 /* macro to clear the screen and home the cursor */
426 #define clear() (*lpnt++ =CLEAR, cbak[SPELLS]= -50)
427 /* macro to clear to end of line */
428 #define cltoeoln() (*lpnt++ = CL_LINE)
431 /* macro to output one byte to the output buffer */
432 #define lprc(ch) ((lpnt>=lpend)?(void)(*lpnt++ = (ch), lflush()):(void)(*lpnt++ = (ch)))
434 /* macro to seed the random number generator */
435 #define seedrand(x) (randx=x)
437 /* macros to generate random numbers 1<=rnd(N)<=N 0<=rund(N)<=N-1 */
438 #define rnd(x) ((((randx=randx*1103515245+12345)>>7)%(x))+1)
439 #define rund(x) ((((randx=randx*1103515245+12345)>>7)%(x)) )
440 #endif /* MACRORND */
441 /* macros for miscellaneous data conversion */
442 #define min(x,y) (((x)>(y))?(y):(x))
443 #define max(x,y) (((x)>(y))?(x):(y))