summaryrefslogtreecommitdiffstats
path: root/larn/header.h
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>1997-10-18 20:03:05 +0000
committerchristos <christos@NetBSD.org>1997-10-18 20:03:05 +0000
commitf73f1009084e75624e3bc00fef9cf4749de80dcc (patch)
tree10cc39737f667f056c5537c3fba7cf4d2a832c9d /larn/header.h
parent39d5db4411fe42946cd3d94eb7d275f3f453d6aa (diff)
downloadbsdgames-darwin-f73f1009084e75624e3bc00fef9cf4749de80dcc.tar.gz
bsdgames-darwin-f73f1009084e75624e3bc00fef9cf4749de80dcc.tar.zst
bsdgames-darwin-f73f1009084e75624e3bc00fef9cf4749de80dcc.zip
Tons of changes; re-indent, use termios, fix warnings, add prototypes...
Games is almost clean; only hack is left...
Diffstat (limited to 'larn/header.h')
-rw-r--r--larn/header.h337
1 files changed, 171 insertions, 166 deletions
diff --git a/larn/header.h b/larn/header.h
index c3b8e392..0f033070 100644
--- a/larn/header.h
+++ b/larn/header.h
@@ -1,81 +1,79 @@
-/* $NetBSD: header.h,v 1.10 1997/07/13 20:21:35 christos Exp $ */
+/* $NetBSD: header.h,v 1.11 1997/10/18 20:03:22 christos Exp $ */
-/* header.h Larn is copyrighted 1986 by Noah Morgan. */
+/* header.h Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/types.h>
#define MAXLEVEL 11
- /* max # levels in the dungeon */
+/* max # levels in the dungeon */
#define MAXVLEVEL 3
- /* max # of levels in the temple of the luran */
+/* max # of levels in the temple of the luran */
#define MAXX 67
#define MAXY 17
#define SCORESIZE 10
- /* this is the number of people on a scoreboard max */
+/* this is the number of people on a scoreboard max */
#define MAXPLEVEL 100
- /* maximum player level allowed */
+/* maximum player level allowed */
#define MAXMONST 56
- /* maximum # monsters in the dungeon */
+/* maximum # monsters in the dungeon */
#define SPNUM 38
- /* maximum number of spells in existance */
+/* maximum number of spells in existance */
#define MAXSCROLL 28
- /* maximum number of scrolls that are possible */
+/* maximum number of scrolls that are possible */
#define MAXPOTION 35
- /* maximum number of potions that are possible */
+/* maximum number of potions that are possible */
#define TIMELIMIT 30000
- /* the maximum number of moves before the game is called */
+/* the maximum number of moves before the game is called */
#define TAXRATE 1/20
- /* the tax rate for the LRS */
+/* the tax rate for the LRS */
#define MAXOBJ 93
- /* the maximum number of objects n < MAXOBJ */
+/* the maximum number of objects n < MAXOBJ */
-/* this is the structure definition of the monster data */
-struct monst
- {
- char *name;
- char level;
- short armorclass;
- char damage;
- char attack;
- char defense;
- char genocided;
- char intelligence; /* monsters intelligence -- used to choose movement */
- short gold;
- short hitpoints;
- unsigned long experience;
- };
+/* this is the structure definition of the monster data */
+struct monst {
+ char *name;
+ char level;
+ short armorclass;
+ char damage;
+ char attack;
+ char defense;
+ char genocided;
+ char intelligence; /* monsters intelligence -- used to
+ * choose movement */
+ short gold;
+ short hitpoints;
+ unsigned long experience;
+};
-/* this is the structure definition for the items in the dnd store */
-struct _itm
- {
- short price;
- char obj;
- char arg;
- char qty;
- };
+/* this is the structure definition for the items in the dnd store */
+struct _itm {
+ short price;
+ u_char obj;
+ u_char arg;
+ char qty;
+};
-/* this is the structure that holds the entire dungeon specifications */
-struct cel
- {
- short hitp; /* monster's hit points */
- char mitem; /* the monster ID */
- char item; /* the object's ID */
- short iarg; /* the object's argument */
- char know; /* have we been here before*/
- };
+/* this is the structure that holds the entire dungeon specifications */
+struct cel {
+ short hitp; /* monster's hit points */
+ char mitem; /* the monster ID */
+ char item; /* the object's ID */
+ short iarg; /* the object's argument */
+ char know; /* have we been here before */
+};
/* this is the structure for maintaining & moving the spheres of annihilation */
-struct sphere
- {
- struct sphere *p; /* pointer to next structure */
- char x,y,lev; /* location of the sphere */
- char dir; /* direction sphere is going in */
- short lifetime; /* duration of the sphere */
- };
+struct sphere {
+ struct sphere *p; /* pointer to next structure */
+ char x, y, lev; /* location of the sphere */
+ char dir; /* direction sphere is going in */
+ short lifetime; /* duration of the sphere */
+};
-/* defines for the character attribute array c[] */
-#define STRENGTH 0 /* characters physical strength not due to objects */
+/* defines for the character attribute array c[] */
+#define STRENGTH 0 /* characters physical strength not due to
+ * objects */
#define INTELLIGENCE 1
#define WISDOM 2
#define CONSTITUTION 3
@@ -149,13 +147,14 @@ struct sphere
#define SEEINVISIBLE 71
#define FILLROOM 72
#define RANDOMWALK 73
-#define SPHCAST 74 /* nz if an active sphere of annihilation */
-#define WTW 75 /* walk through walls */
-#define STREXTRA 76 /* character strength due to objects or enchantments */
-#define TMP 77 /* misc scratch space */
-#define LIFEPROT 78 /* life protection counter */
+#define SPHCAST 74 /* nz if an active sphere of annihilation */
+#define WTW 75 /* walk through walls */
+#define STREXTRA 76 /* character strength due to objects or
+ * enchantments */
+#define TMP 77 /* misc scratch space */
+#define LIFEPROT 78 /* life protection counter */
-/* defines for the objects in the game */
+/* defines for the objects in the game */
#define OALTAR 1
#define OTHRONE 2
@@ -222,7 +221,7 @@ struct sphere
#define OSCROLL 41
#define OPOTION 42
#define OBOOK 43
-#define OCHEST 44
+#define OCHEST 44
#define OAMULET 45
#define OORBOFDRAGON 46
@@ -249,62 +248,62 @@ struct sphere
#define OTRADEPOST 77
#define OIVTELETRAP 78
#define ODEADTHRONE 79
-#define OANNIHILATION 80 /* sphere of annihilation */
+#define OANNIHILATION 80 /* sphere of annihilation */
#define OTHRONE2 81
-#define OLRS 82 /* Larn Revenue Service */
+#define OLRS 82 /* Larn Revenue Service */
#define OCOOKIE 83
#define OURN 84
#define OBRASSLAMP 85
#define OHANDofFEAR 86 /* hand of fear */
#define OSPHTAILSMAN 87 /* tailsman of the sphere */
-#define OWWAND 88 /* wand of wonder */
-#define OPSTAFF 89 /* staff of power */
+#define OWWAND 88 /* wand of wonder */
+#define OPSTAFF 89 /* staff of power */
/* used up to 92 */
-/* defines for the monsters as objects */
+/* defines for the monsters as objects */
-#define BAT 1
-#define GNOME 2
-#define HOBGOBLIN 3
-#define JACKAL 4
-#define KOBOLD 5
-#define ORC 6
+#define BAT 1
+#define GNOME 2
+#define HOBGOBLIN 3
+#define JACKAL 4
+#define KOBOLD 5
+#define ORC 6
#define SNAKE 7
#define CENTIPEDE 8
-#define JACULI 9
-#define TROGLODYTE 10
-#define ANT 11
-#define EYE 12
+#define JACULI 9
+#define TROGLODYTE 10
+#define ANT 11
+#define EYE 12
#define LEPRECHAUN 13
-#define NYMPH 14
-#define QUASIT 15
-#define RUSTMONSTER 16
-#define ZOMBIE 17
-#define ASSASSINBUG 18
-#define BUGBEAR 19
-#define HELLHOUND 20
-#define ICELIZARD 21
-#define CENTAUR 22
-#define TROLL 23
-#define YETI 24
-#define WHITEDRAGON 25
-#define ELF 26
-#define CUBE 27
-#define METAMORPH 28
-#define VORTEX 29
-#define ZILLER 30
-#define VIOLETFUNGI 31
-#define WRAITH 32
-#define FORVALAKA 33
-#define LAMANOBE 34
-#define OSEQUIP 35
-#define ROTHE 36
-#define XORN 37
-#define VAMPIRE 38
-#define INVISIBLESTALKER 39
-#define POLTERGEIST 40
-#define DISENCHANTRESS 41
-#define SHAMBLINGMOUND 42
+#define NYMPH 14
+#define QUASIT 15
+#define RUSTMONSTER 16
+#define ZOMBIE 17
+#define ASSASSINBUG 18
+#define BUGBEAR 19
+#define HELLHOUND 20
+#define ICELIZARD 21
+#define CENTAUR 22
+#define TROLL 23
+#define YETI 24
+#define WHITEDRAGON 25
+#define ELF 26
+#define CUBE 27
+#define METAMORPH 28
+#define VORTEX 29
+#define ZILLER 30
+#define VIOLETFUNGI 31
+#define WRAITH 32
+#define FORVALAKA 33
+#define LAMANOBE 34
+#define OSEQUIP 35
+#define ROTHE 36
+#define XORN 37
+#define VAMPIRE 38
+#define INVISIBLESTALKER 39
+#define POLTERGEIST 40
+#define DISENCHANTRESS 41
+#define SHAMBLINGMOUND 42
#define YELLOWMOLD 43
#define UMBERHULK 44
#define GNOMEKING 45
@@ -323,78 +322,85 @@ struct sphere
#define DEMONPRINCE 64
#define NULL 0
-#define BUFBIG 4096 /* size of the output buffer */
-#define MAXIBUF 4096 /* size of the input buffer */
-#define LOGNAMESIZE 40 /* max size of the players name */
-#define PSNAMESIZE 40 /* max size of the process name */
+#define BUFBIG 4096 /* size of the output buffer */
+#define MAXIBUF 4096 /* size of the input buffer */
+#define LOGNAMESIZE 40 /* max size of the players name */
+#define PSNAMESIZE 40 /* max size of the process name */
#ifndef NODEFS
-extern char VERSION,SUBVERSION;
-extern char aborted[],alpha[],beenhere[],boldon,cheat,ckpfile[],ckpflag;
-extern char *class[],course[],diagfile[],helpfile[];
-extern char *inbuffer,is_alpha[],is_digit[];
-extern char item[MAXX][MAXY],iven[],know[MAXX][MAXY],larnlevels[],lastmonst[];
-extern char *levelname[],logfile[],loginname[],logname[],*lpbuf,*lpend;
-extern char *lpnt,moved[MAXX][MAXY],mitem[MAXX][MAXY],monstlevel[];
-extern char monstnamelist[],nch[],ndgg[],nlpts[],nomove,nosignal,nowelcome;
-extern char nplt[],nsw[],*objectname[],objnamelist[],optsfile[];
-extern char *potionhide[],*potionname[],playerids[],potprob[];
-extern char predostuff,psname[],restorflag,savefilename[],scorefile[],scprob[];
-extern char screen[MAXX][MAXY],*scrollhide[],*scrollname[],sex,*spelcode[];
-extern char *speldescript[];
-extern char spelknow[],*spelname[],*spelmes[],spelweird[MAXMONST+8][SPNUM];
-extern char splev[],stealth[MAXX][MAXY],to_lower[],to_upper[],wizard;
-extern short diroffx[],diroffy[],hitflag,hit2flag,hit3flag,hitp[MAXX][MAXY];
-extern short iarg[MAXX][MAXY],ivenarg[],lasthx,lasthy,lastnum,lastpx,lastpy;
-extern short nobeep,oldx,oldy,playerx,playery,level;
-extern int dayplay,enable_scroll,srcount,yrepcount,userid,wisid,lfd,fd;
-extern uid_t uid, euid;
-extern long initialtime,outstanding_taxes,skill[],gltime,c[],cbak[];
+extern char VERSION, SUBVERSION;
+extern u_char alpha[], beenhere[], boldon, cheat, ckpflag;
+extern u_char *class[], course[];
+extern char diagfile[], helpfile[], ckpfile[], larnlevels[],
+ playerids[], optsfile[], psname[], savefilename[],
+ scorefile[];
+extern u_char *inbuffer, is_alpha[], is_digit[];
+extern u_char item[MAXX][MAXY], iven[], know[MAXX][MAXY];
+extern char *levelname[], logfile[], loginname[], logname[],
+ lastmonst[];
+extern u_char *lpbuf, *lpend;
+extern u_char *lpnt, moved[MAXX][MAXY], mitem[MAXX][MAXY], monstlevel[];
+extern char monstnamelist[], objnamelist[];
+extern u_char nch[], ndgg[], nlpts[], nomove, nosignal, nowelcome;
+extern u_char nplt[], nsw[];
+extern char *objectname[], *potionhide[], *potionname[],
+ *spelcode[], *spelname[], *spelmes[], aborted[],
+ spelweird[MAXMONST + 8][SPNUM];
+extern u_char potprob[];
+extern u_char predostuff, restorflag, scprob[];
+extern u_char screen[MAXX][MAXY], sex;
+extern char *speldescript[], *scrollhide[], *scrollname[];
+extern u_char spelknow[];
+extern u_char splev[], stealth[MAXX][MAXY], to_lower[], to_upper[], wizard;
+extern short diroffx[], diroffy[], hitflag, hit2flag, hit3flag, hitp[MAXX][MAXY];
+extern short iarg[MAXX][MAXY], ivenarg[], lasthx, lasthy, lastnum, lastpx,
+ lastpy;
+extern short nobeep, oldx, oldy, playerx, playery, level;
+extern int dayplay, enable_scroll, srcount, yrepcount, userid, wisid,
+ lfd, fd;
+extern uid_t uid, euid;
+extern long initialtime, outstanding_taxes, skill[], gltime, c[], cbak[];
extern unsigned long randx;
extern struct cel *cell;
extern struct monst monster[];
extern struct sphere *spheres;
extern struct _itm itm[];
+extern long initialtime;
+extern int rmst, maxitm, lasttime;
-char *fortune(),*getenv(),*getlogin(),*lgetw(),*lgetl(),*ctime();
-char *tmcapcnv(),*tgetstr(),*tgoto();
-long paytaxes(),lgetc(),lrint();
-unsigned long readnum();
-void *malloc();
-
- /* macro to create scroll #'s with probability of occurrence */
+/* macro to create scroll #'s with probability of occurrence */
#define newscroll() (scprob[rund(81)])
- /* macro to return a potion # created with probability of occurrence */
+/* macro to return a potion # created with probability of occurrence */
#define newpotion() (potprob[rund(41)])
- /* macro to return the + points on created leather armor */
+/* macro to return the + points on created leather armor */
#define newleather() (nlpts[rund(c[HARDGAME]?13:15)])
- /* macro to return the + points on chain armor */
+/* macro to return the + points on chain armor */
#define newchain() (nch[rund(10)])
- /* macro to return + points on plate armor */
+/* macro to return + points on plate armor */
#define newplate() (nplt[rund(c[HARDGAME]?4:12)])
- /* macro to return + points on new daggers */
+/* macro to return + points on new daggers */
#define newdagger() (ndgg[rund(13)])
- /* macro to return + points on new swords */
+/* macro to return + points on new swords */
#define newsword() (nsw[rund(c[HARDGAME]?6:13)])
- /* macro to destroy object at present location */
+/* macro to destroy object at present location */
#define forget() (item[playerx][playery]=know[playerx][playery]=0)
- /* macro to wipe out a monster at a location */
+/* macro to wipe out a monster at a location */
#define disappear(x,y) (mitem[x][y]=know[x][y]=0)
#ifdef VT100
- /* macro to turn on bold display for the terminal */
+/* macro to turn on bold display for the terminal */
#define setbold() (lprcat(boldon?"\33[1m":"\33[7m"))
- /* macro to turn off bold display for the terminal */
+/* macro to turn off bold display for the terminal */
#define resetbold() (lprcat("\33[m"))
- /* macro to setup the scrolling region for the terminal */
+/* macro to setup the scrolling region for the terminal */
#define setscroll() (lprcat("\33[20;24r"))
- /* macro to clear the scrolling region for the terminal */
+/* macro to clear the scrolling region for the terminal */
#define resetscroll() (lprcat("\33[;24r"))
- /* macro to clear the screen and home the cursor */
+/* macro to clear the screen and home the cursor */
#define clear() (lprcat("\33[2J\33[f"), cbak[SPELLS]= -50)
#define cltoeoln() lprcat("\33[K")
-#else VT100
- /* defines below are for use in the termcap mode only */
+#else /* VT100 */
+/* defines below are for use in the termcap mode only */
#define ST_START 1
#define ST_END 2
#define BOLD 3
@@ -403,31 +409,31 @@ void *malloc();
#define CL_LINE 6
#define CL_DOWN 14
#define CURSOR 15
- /* macro to turn on bold display for the terminal */
+/* macro to turn on bold display for the terminal */
#define setbold() (*lpnt++ = ST_START)
- /* macro to turn off bold display for the terminal */
+/* macro to turn off bold display for the terminal */
#define resetbold() (*lpnt++ = ST_END)
- /* macro to setup the scrolling region for the terminal */
+/* macro to setup the scrolling region for the terminal */
#define setscroll() enable_scroll=1
- /* macro to clear the scrolling region for the terminal */
+/* macro to clear the scrolling region for the terminal */
#define resetscroll() enable_scroll=0
- /* macro to clear the screen and home the cursor */
+/* macro to clear the screen and home the cursor */
#define clear() (*lpnt++ =CLEAR, cbak[SPELLS]= -50)
- /* macro to clear to end of line */
+/* macro to clear to end of line */
#define cltoeoln() (*lpnt++ = CL_LINE)
-#endif VT100
+#endif /* VT100 */
- /* macro to output one byte to the output buffer */
+/* macro to output one byte to the output buffer */
#define lprc(ch) ((lpnt>=lpend)?(*lpnt++ =(ch), lflush()):(*lpnt++ =(ch)))
- /* macro to seed the random number generator */
+/* macro to seed the random number generator */
#define srand(x) (randx=x)
#ifdef MACRORND
- /* macros to generate random numbers 1<=rnd(N)<=N 0<=rund(N)<=N-1 */
+/* macros to generate random numbers 1<=rnd(N)<=N 0<=rund(N)<=N-1 */
#define rnd(x) ((((randx=randx*1103515245+12345)>>7)%(x))+1)
#define rund(x) ((((randx=randx*1103515245+12345)>>7)%(x)) )
-#endif MACRORND
- /* macros for miscellaneous data conversion */
+#endif /* MACRORND */
+/* macros for miscellaneous data conversion */
#define min(x,y) (((x)>(y))?(y):(x))
#define max(x,y) (((x)>(y))?(x):(y))
#define isalpha(x) (is_alpha[x])
@@ -436,5 +442,4 @@ void *malloc();
#define toupper(x) (to_upper[x])
#define lcc(x) (to_lower[x])
#define ucc(x) (to_upper[x])
-#endif NODEFS
-
+#endif /* NODEFS */