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