1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2 /* hack.h - version 1.0.3 */
12 #define Null(type) ((struct type *) 0)
14 #include "def.objclass.h"
20 #include "def.monst.h" /* uses coord */
26 #define plur(x) (((x) == 1) ? "" : "s")
28 #define BUFSZ 256 /* for getlin buffers */
29 #define PL_NSIZ 32 /* name of player, ghost, shopkeeper */
32 #include "def.permonst.h"
36 extern xchar xdnstair, ydnstair, xupstair, yupstair; /* stairs up and down. */
39 #define newstring(x) (char *) alloc((unsigned)(x))
40 #include "hack.onames.h"
45 extern struct obj *invent, *uwep, *uarm, *uarm2, *uarmh, *uarms, *uarmg,
46 *uleft, *uright, *fcobj;
47 extern struct obj *uchain; /* defined iff PUNISHED */
48 extern struct obj *uball; /* defined if PUNISHED */
49 struct obj *o_at(), *getobj(), *sobj_at();
52 #define TIMEOUT 007777 /* mask */
53 #define LEFT_RING W_RINGL /* 010000L */
54 #define RIGHT_RING W_RINGR /* 020000L */
55 #define INTRINSIC 040000L
56 #define LEFT_SIDE LEFT_RING
57 #define RIGHT_SIDE RIGHT_RING
58 #define BOTH_SIDES (LEFT_SIDE | RIGHT_SIDE)
60 int (*p_tofn)(); /* called after timeout */
65 schar dx, dy, dz; /* direction of move (or zap or ... ) */
67 schar di; /* direction of FF */
68 xchar ux0, uy0; /* initial position FF */
70 xchar udisx, udisy; /* last display pos */
71 char usym; /* usually '@' */
73 #define LUCKMAX 10 /* on moonlit nights 11 */
75 int last_str_turn:3; /* 0: none, 1: half turn, 2: full turn */
76 /* +: turn right, -: turn left */
77 unsigned udispl:1; /* @ on display */
78 unsigned ulevel:4; /* 1 - 14 */
82 unsigned utrap:3; /* trap timeout */
83 unsigned utraptype:1; /* defined if utrap nonzero */
86 unsigned uinshop:6; /* used only in shk.c - (roomno+1) of shop */
89 /* perhaps these #define's should also be generated by makedefs */
90 #define TELEPAT LAST_RING /* not a ring */
91 #define Telepat u.uprops[TELEPAT].p_flgs
92 #define FAST (LAST_RING+1) /* not a ring */
93 #define Fast u.uprops[FAST].p_flgs
94 #define CONFUSION (LAST_RING+2) /* not a ring */
95 #define Confusion u.uprops[CONFUSION].p_flgs
96 #define INVIS (LAST_RING+3) /* not a ring */
97 #define Invis u.uprops[INVIS].p_flgs
98 #define Invisible (Invis && !See_invisible)
99 #define GLIB (LAST_RING+4) /* not a ring */
100 #define Glib u.uprops[GLIB].p_flgs
101 #define PUNISHED (LAST_RING+5) /* not a ring */
102 #define Punished u.uprops[PUNISHED].p_flgs
103 #define SICK (LAST_RING+6) /* not a ring */
104 #define Sick u.uprops[SICK].p_flgs
105 #define BLIND (LAST_RING+7) /* not a ring */
106 #define Blind u.uprops[BLIND].p_flgs
107 #define WOUNDED_LEGS (LAST_RING+8) /* not a ring */
108 #define Wounded_legs u.uprops[WOUNDED_LEGS].p_flgs
109 #define STONED (LAST_RING+9) /* not a ring */
110 #define Stoned u.uprops[STONED].p_flgs
111 #define PROP(x) (x-RIN_ADORNMENT) /* convert ring to index in uprops */
114 struct prop uprops[LAST_RING+10];
116 unsigned uswallow:1; /* set if swallowed by a monster */
117 unsigned uswldtim:4; /* time you have been swallowed */
118 unsigned uhs:3; /* hunger state - see hack.eat.c */
123 long int ugold,ugold0,uexp,urexp;
124 int uhunger; /* refd only in eat.c and shk.c */
126 struct monst *ustuck;
127 int nr_killed[CMNUM+2]; /* used for experience bookkeeping */
132 extern char *traps[];
133 extern char *monnam(), *Monnam(), *amonnam(), *Amonnam(),
134 *doname(), *aobjnam();
135 extern char readchar();
136 extern char vowels[];
138 extern xchar curx,cury; /* cursor location on screen */
140 extern coord bhitpos; /* place where thrown weapon falls to the ground */
142 extern xchar seehx,seelx,seehy,seely; /* where to see*/
143 extern char *save_cm,*killer;
145 extern xchar dlevel, maxdlevel; /* dungeon level */
155 #define DIST(x1,y1,x2,y2) (((x1)-(x2))*((x1)-(x2)) + ((y1)-(y2))*((y1)-(y2)))
157 #define PL_CSIZ 20 /* sizeof pl_character */
158 #define MAX_CARR_CAP 120 /* so that boulders can be heavier */
160 #define FAR (COLNO+2) /* position outside screen */