]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/hack.h
1 /* $NetBSD: hack.h,v 1.8 2001/03/25 20:44:00 jsm Exp $ */
4 * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
15 #define rindex strrchr
18 #define Null(type) ((struct type *) 0)
20 #include "def.objclass.h"
26 #include "def.monst.h" /* uses coord */
32 #define plur(x) (((x) == 1) ? "" : "s")
34 #define BUFSZ 256 /* for getlin buffers */
35 #define PL_NSIZ 32 /* name of player, ghost, shopkeeper */
38 #include "def.permonst.h"
40 #define newstring(x) (char *) alloc((unsigned)(x))
41 #include "hack.onames.h"
47 #define TIMEOUT 007777 /* mask */
48 #define LEFT_RING W_RINGL /* 010000L */
49 #define RIGHT_RING W_RINGR /* 020000L */
50 #define INTRINSIC 040000L
51 #define LEFT_SIDE LEFT_RING
52 #define RIGHT_SIDE RIGHT_RING
53 #define BOTH_SIDES (LEFT_SIDE | RIGHT_SIDE)
55 void (*p_tofn
) __P((void)); /* called after timeout */
60 schar dx
, dy
, dz
; /* direction of move (or zap or ... ) */
62 schar di
; /* direction of FF */
63 xchar ux0
, uy0
; /* initial position FF */
65 xchar udisx
, udisy
; /* last display pos */
66 char usym
; /* usually '@' */
68 #define LUCKMAX 10 /* on moonlit nights 11 */
70 int last_str_turn
:3; /* 0: none, 1: half turn, 2: full turn */
71 /* +: turn right, -: turn left */
72 unsigned udispl
:1; /* @ on display */
73 unsigned ulevel
:4; /* 1 - 14 */
77 unsigned utrap
:3; /* trap timeout */
78 unsigned utraptype
:1; /* defined if utrap nonzero */
81 unsigned uinshop
:6; /* used only in shk.c - (roomno+1) of shop */
84 /* perhaps these #define's should also be generated by makedefs */
85 #define TELEPAT LAST_RING /* not a ring */
86 #define Telepat u.uprops[TELEPAT].p_flgs
87 #define FAST (LAST_RING+1) /* not a ring */
88 #define Fast u.uprops[FAST].p_flgs
89 #define CONFUSION (LAST_RING+2) /* not a ring */
90 #define Confusion u.uprops[CONFUSION].p_flgs
91 #define INVIS (LAST_RING+3) /* not a ring */
92 #define Invis u.uprops[INVIS].p_flgs
93 #define Invisible (Invis && !See_invisible)
94 #define GLIB (LAST_RING+4) /* not a ring */
95 #define Glib u.uprops[GLIB].p_flgs
96 #define PUNISHED (LAST_RING+5) /* not a ring */
97 #define Punished u.uprops[PUNISHED].p_flgs
98 #define SICK (LAST_RING+6) /* not a ring */
99 #define Sick u.uprops[SICK].p_flgs
100 #define BLIND (LAST_RING+7) /* not a ring */
101 #define Blind u.uprops[BLIND].p_flgs
102 #define WOUNDED_LEGS (LAST_RING+8) /* not a ring */
103 #define Wounded_legs u.uprops[WOUNDED_LEGS].p_flgs
104 #define STONED (LAST_RING+9) /* not a ring */
105 #define Stoned u.uprops[STONED].p_flgs
106 #define PROP(x) (x-RIN_ADORNMENT) /* convert ring to index in uprops */
108 const char *usick_cause
;
109 struct prop uprops
[LAST_RING
+10];
111 unsigned uswallow
:1; /* set if swallowed by a monster */
112 unsigned uswldtim
:4; /* time you have been swallowed */
113 unsigned uhs
:3; /* hunger state - see hack.eat.c */
118 long int ugold
,ugold0
,uexp
,urexp
;
119 int uhunger
; /* refd only in eat.c and shk.c */
121 struct monst
*ustuck
;
122 int nr_killed
[CMNUM
+2]; /* used for experience bookkeeping */
125 #define DIST(x1,y1,x2,y2) (((x1)-(x2))*((x1)-(x2)) + ((y1)-(y2))*((y1)-(y2)))
127 #define PL_CSIZ 20 /* sizeof pl_character */
128 #define MAX_CARR_CAP 120 /* so that boulders can be heavier */
130 #define FAR (COLNO+2) /* position outside screen */
132 extern boolean in_mklev
;
133 extern boolean level_exists
[];
134 extern boolean restoring
;
136 extern const char *catmore
;
138 extern const char *const hu_stat
[]; /* in eat.c */
139 extern const char *nomovemsg
;
140 extern const char *occtxt
;
141 extern char *save_cm
;
142 extern const char *killer
;
143 extern const char *const traps
[];
145 extern char fut_geno
[60]; /* idem */
146 extern char genocided
[60]; /* defined in Decl.c */
148 extern char mlarge
[];
151 extern char plname
[PL_NSIZ
], pl_character
[PL_CSIZ
];
152 extern const char quitchars
[];
153 extern char sdir
[]; /* defined in hack.c */
154 extern const char shtypes
[]; /* = "=/)%?!["; 8 types: 7 specialized, 1 mixed */
155 extern const char vowels
[];
156 extern coord bhitpos
; /* place where thrown weapon falls to the ground */
157 extern int (*afternmv
) __P((void));
158 extern int (*occupation
) __P((void));
159 extern int CO
, LI
; /* usually COLNO and ROWNO+2 */
161 extern int doorindex
;
167 extern schar xdir
[], ydir
[]; /* idem */
168 extern struct monst
*mydogs
;
169 extern struct monst youmonst
;
170 extern struct obj
*billobjs
;
171 extern struct obj
*invent
, *uwep
, *uarm
, *uarm2
, *uarmh
, *uarms
, *uarmg
;
172 extern struct obj
*uleft
, *uright
, *fcobj
;
173 extern struct obj
*uball
; /* defined if PUNISHED */
174 extern struct obj
*uchain
; /* defined iff PUNISHED */
175 extern struct obj zeroobj
;
176 extern const struct permonst li_dog
, dog
, la_dog
;
177 extern const struct permonst pm_eel
;
178 extern const struct permonst pm_ghost
;
179 extern const struct permonst pm_mail_daemon
;
180 extern const struct permonst pm_wizard
;
182 extern long wgrowtime
[32];
183 extern struct wseg
*m_atseg
;
184 extern struct wseg
*wsegs
[32], *wheads
[32];
187 extern xchar curx
, cury
; /* cursor location on screen */
188 extern xchar dlevel
, maxdlevel
; /* dungeon level */
189 extern xchar seehx
,seelx
,seehy
,seely
; /* where to see*/
190 extern xchar xdnstair
, ydnstair
, xupstair
, yupstair
; /* stairs up and down. */
191 #endif /* _HACK_H_ */