Commit | Line | Data |
---|---|---|
b3afadef KB |
1 | /* |
2 | * rogue.h | |
3 | * | |
4 | * This source herein may be modified and/or distributed by anybody who | |
5 | * so desires, with the following restrictions: | |
6 | * 1.) This notice shall not be removed. | |
7 | * 2.) Credit shall not be taken for the creation of this source. | |
8 | * 3.) This code is not to be traded, sold, or used for personal | |
9 | * gain or profit. | |
10 | * | |
3c6c9c0c | 11 | * @(#)rogue.h 5.2 (Berkeley) %G% |
b3afadef KB |
12 | */ |
13 | ||
14 | #define boolean char | |
15 | ||
16 | #define NOTHING ((unsigned short) 0) | |
17 | #define OBJECT ((unsigned short) 01) | |
18 | #define MONSTER ((unsigned short) 02) | |
19 | #define STAIRS ((unsigned short) 04) | |
20 | #define HORWALL ((unsigned short) 010) | |
21 | #define VERTWALL ((unsigned short) 020) | |
22 | #define DOOR ((unsigned short) 040) | |
23 | #define FLOOR ((unsigned short) 0100) | |
24 | #define TUNNEL ((unsigned short) 0200) | |
25 | #define TRAP ((unsigned short) 0400) | |
26 | #define HIDDEN ((unsigned short) 01000) | |
27 | ||
28 | #define ARMOR ((unsigned short) 01) | |
29 | #define WEAPON ((unsigned short) 02) | |
30 | #define SCROL ((unsigned short) 04) | |
31 | #define POTION ((unsigned short) 010) | |
32 | #define GOLD ((unsigned short) 020) | |
33 | #define FOOD ((unsigned short) 040) | |
34 | #define WAND ((unsigned short) 0100) | |
35 | #define RING ((unsigned short) 0200) | |
36 | #define AMULET ((unsigned short) 0400) | |
37 | #define ALL_OBJECTS ((unsigned short) 0777) | |
38 | ||
39 | #define LEATHER 0 | |
40 | #define RINGMAIL 1 | |
41 | #define SCALE 2 | |
42 | #define CHAIN 3 | |
43 | #define BANDED 4 | |
44 | #define SPLINT 5 | |
45 | #define PLATE 6 | |
46 | #define ARMORS 7 | |
47 | ||
48 | #define BOW 0 | |
49 | #define DART 1 | |
50 | #define ARROW 2 | |
51 | #define DAGGER 3 | |
52 | #define SHURIKEN 4 | |
53 | #define MACE 5 | |
54 | #define LONG_SWORD 6 | |
55 | #define TWO_HANDED_SWORD 7 | |
56 | #define WEAPONS 8 | |
57 | ||
58 | #define MAX_PACK_COUNT 24 | |
59 | ||
60 | #define PROTECT_ARMOR 0 | |
61 | #define HOLD_MONSTER 1 | |
62 | #define ENCH_WEAPON 2 | |
63 | #define ENCH_ARMOR 3 | |
64 | #define IDENTIFY 4 | |
65 | #define TELEPORT 5 | |
66 | #define SLEEP 6 | |
67 | #define SCARE_MONSTER 7 | |
68 | #define REMOVE_CURSE 8 | |
69 | #define CREATE_MONSTER 9 | |
70 | #define AGGRAVATE_MONSTER 10 | |
71 | #define MAGIC_MAPPING 11 | |
72 | #define CON_MON 12 | |
73 | #define SCROLS 13 | |
74 | ||
75 | #define INCREASE_STRENGTH 0 | |
76 | #define RESTORE_STRENGTH 1 | |
77 | #define HEALING 2 | |
78 | #define EXTRA_HEALING 3 | |
79 | #define POISON 4 | |
80 | #define RAISE_LEVEL 5 | |
81 | #define BLINDNESS 6 | |
82 | #define HALLUCINATION 7 | |
83 | #define DETECT_MONSTER 8 | |
84 | #define DETECT_OBJECTS 9 | |
85 | #define CONFUSION 10 | |
86 | #define LEVITATION 11 | |
87 | #define HASTE_SELF 12 | |
88 | #define SEE_INVISIBLE 13 | |
89 | #define POTIONS 14 | |
90 | ||
91 | #define TELE_AWAY 0 | |
92 | #define SLOW_MONSTER 1 | |
93 | #define INVISIBILITY 2 | |
94 | #define POLYMORPH 3 | |
95 | #define HASTE_MONSTER 4 | |
96 | #define MAGIC_MISSILE 5 | |
97 | #define CANCELLATION 6 | |
98 | #define DO_NOTHING 7 | |
99 | #define DRAIN_LIFE 8 | |
100 | #define COLD 9 | |
101 | #define FIRE 10 | |
102 | #define WANDS 11 | |
103 | ||
104 | #define STEALTH 0 | |
105 | #define R_TELEPORT 1 | |
106 | #define REGENERATION 2 | |
107 | #define SLOW_DIGEST 3 | |
108 | #define ADD_STRENGTH 4 | |
109 | #define SUSTAIN_STRENGTH 5 | |
110 | #define DEXTERITY 6 | |
111 | #define ADORNMENT 7 | |
112 | #define R_SEE_INVISIBLE 8 | |
113 | #define MAINTAIN_ARMOR 9 | |
114 | #define SEARCHING 10 | |
115 | #define RINGS 11 | |
116 | ||
117 | #define RATION 0 | |
118 | #define FRUIT 1 | |
119 | ||
120 | #define NOT_USED ((unsigned short) 0) | |
121 | #define BEING_WIELDED ((unsigned short) 01) | |
122 | #define BEING_WORN ((unsigned short) 02) | |
123 | #define ON_LEFT_HAND ((unsigned short) 04) | |
124 | #define ON_RIGHT_HAND ((unsigned short) 010) | |
125 | #define ON_EITHER_HAND ((unsigned short) 014) | |
126 | #define BEING_USED ((unsigned short) 017) | |
127 | ||
128 | #define NO_TRAP -1 | |
129 | #define TRAP_DOOR 0 | |
130 | #define BEAR_TRAP 1 | |
131 | #define TELE_TRAP 2 | |
132 | #define DART_TRAP 3 | |
133 | #define SLEEPING_GAS_TRAP 4 | |
134 | #define RUST_TRAP 5 | |
135 | #define TRAPS 6 | |
136 | ||
137 | #define STEALTH_FACTOR 3 | |
138 | #define R_TELE_PERCENT 8 | |
139 | ||
140 | #define UNIDENTIFIED ((unsigned short) 00) /* MUST BE ZERO! */ | |
141 | #define IDENTIFIED ((unsigned short) 01) | |
142 | #define CALLED ((unsigned short) 02) | |
143 | ||
144 | #define DROWS 24 | |
145 | #define DCOLS 80 | |
146 | #define NMESSAGES 5 | |
147 | #define MAX_TITLE_LENGTH 30 | |
148 | #define MAXSYLLABLES 40 | |
149 | #define MAX_METAL 14 | |
150 | #define WAND_MATERIALS 30 | |
151 | #define GEMS 14 | |
152 | ||
153 | #define GOLD_PERCENT 46 | |
154 | ||
3c6c9c0c KB |
155 | #define SCORE_FILE "/usr/games/lib/rogue.scores" |
156 | #define LOCK_FILE "/usr/games/lib/rogue.lock" | |
b3afadef KB |
157 | |
158 | #define MAX_OPT_LEN 40 | |
159 | ||
160 | struct id { | |
161 | short value; | |
162 | char *title; | |
163 | char *real; | |
164 | unsigned short id_status; | |
165 | }; | |
166 | ||
167 | /* The following #defines provide more meaningful names for some of the | |
168 | * struct object fields that are used for monsters. This, since each monster | |
169 | * and object (scrolls, potions, etc) are represented by a struct object. | |
170 | * Ideally, this should be handled by some kind of union structure. | |
171 | */ | |
172 | ||
173 | #define m_damage damage | |
174 | #define hp_to_kill quantity | |
175 | #define m_char ichar | |
176 | #define first_level is_protected | |
177 | #define last_level is_cursed | |
178 | #define m_hit_chance class | |
179 | #define stationary_damage identified | |
180 | #define drop_percent which_kind | |
181 | #define trail_char d_enchant | |
182 | #define slowed_toggle quiver | |
183 | #define moves_confused hit_enchant | |
184 | #define nap_length picked_up | |
185 | #define disguise what_is | |
186 | #define next_monster next_object | |
187 | ||
188 | struct obj { /* comment is monster meaning */ | |
189 | unsigned long m_flags; /* monster flags */ | |
190 | char *damage; /* damage it does */ | |
191 | short quantity; /* hit points to kill */ | |
192 | short ichar; /* 'A' is for aquatar */ | |
193 | short kill_exp; /* exp for killing it */ | |
194 | short is_protected; /* level starts */ | |
195 | short is_cursed; /* level ends */ | |
196 | short class; /* chance of hitting you */ | |
197 | short identified; /* 'F' damage, 1,2,3... */ | |
198 | unsigned short which_kind; /* item carry/drop % */ | |
199 | short o_row, o_col, o; /* o is how many times stuck at o_row, o_col */ | |
200 | short row, col; /* current row, col */ | |
201 | short d_enchant; /* room char when detect_monster */ | |
202 | short quiver; /* monster slowed toggle */ | |
203 | short trow, tcol; /* target row, col */ | |
204 | short hit_enchant; /* how many moves is confused */ | |
205 | unsigned short what_is; /* imitator's charactor (?!%: */ | |
206 | short picked_up; /* sleep from wand of sleep */ | |
207 | unsigned short in_use_flags; | |
208 | struct obj *next_object; /* next monster */ | |
209 | }; | |
210 | ||
211 | typedef struct obj object; | |
212 | ||
213 | #define INIT_AW (object*)0,(object*)0 | |
214 | #define INIT_RINGS (object*)0,(object*)0 | |
215 | #define INIT_HP 12,12 | |
216 | #define INIT_STR 16,16 | |
217 | #define INIT_EXP 1,0 | |
218 | #define INIT_PACK {0} | |
219 | #define INIT_GOLD 0 | |
220 | #define INIT_CHAR '@' | |
221 | #define INIT_MOVES 1250 | |
222 | ||
223 | struct fightr { | |
224 | object *armor; | |
225 | object *weapon; | |
226 | object *left_ring, *right_ring; | |
227 | short hp_current; | |
228 | short hp_max; | |
229 | short str_current; | |
230 | short str_max; | |
231 | object pack; | |
232 | long gold; | |
233 | short exp; | |
234 | long exp_points; | |
235 | short row, col; | |
236 | short fchar; | |
237 | short moves_left; | |
238 | }; | |
239 | ||
240 | typedef struct fightr fighter; | |
241 | ||
242 | struct dr { | |
243 | short oth_room; | |
244 | short oth_row, | |
245 | oth_col; | |
246 | short door_row, | |
247 | door_col; | |
248 | }; | |
249 | ||
250 | typedef struct dr door; | |
251 | ||
252 | struct rm { | |
253 | short bottom_row, right_col, left_col, top_row; | |
254 | door doors[4]; | |
255 | unsigned short is_room; | |
256 | }; | |
257 | ||
258 | typedef struct rm room; | |
259 | ||
260 | #define MAXROOMS 9 | |
261 | #define BIG_ROOM 10 | |
262 | ||
263 | #define NO_ROOM -1 | |
264 | ||
265 | #define PASSAGE -3 /* cur_room value */ | |
266 | ||
267 | #define AMULET_LEVEL 26 | |
268 | ||
269 | #define R_NOTHING ((unsigned short) 01) | |
270 | #define R_ROOM ((unsigned short) 02) | |
271 | #define R_MAZE ((unsigned short) 04) | |
272 | #define R_DEADEND ((unsigned short) 010) | |
273 | #define R_CROSS ((unsigned short) 020) | |
274 | ||
275 | #define MAX_EXP_LEVEL 21 | |
276 | #define MAX_EXP 10000001L | |
277 | #define MAX_GOLD 999999 | |
278 | #define MAX_ARMOR 99 | |
279 | #define MAX_HP 999 | |
280 | #define MAX_STRENGTH 99 | |
281 | #define LAST_DUNGEON 99 | |
282 | ||
283 | #define STAT_LEVEL 01 | |
284 | #define STAT_GOLD 02 | |
285 | #define STAT_HP 04 | |
286 | #define STAT_STRENGTH 010 | |
287 | #define STAT_ARMOR 020 | |
288 | #define STAT_EXP 040 | |
289 | #define STAT_HUNGER 0100 | |
290 | #define STAT_LABEL 0200 | |
291 | #define STAT_ALL 0377 | |
292 | ||
293 | #define PARTY_TIME 10 /* one party somewhere in each 10 level span */ | |
294 | ||
295 | #define MAX_TRAPS 10 /* maximum traps per level */ | |
296 | ||
297 | #define HIDE_PERCENT 12 | |
298 | ||
299 | struct tr { | |
300 | short trap_type; | |
301 | short trap_row, trap_col; | |
302 | }; | |
303 | ||
304 | typedef struct tr trap; | |
305 | ||
306 | extern fighter rogue; | |
307 | extern room rooms[]; | |
308 | extern trap traps[]; | |
309 | extern unsigned short dungeon[DROWS][DCOLS]; | |
310 | extern object level_objects; | |
311 | ||
312 | extern struct id id_scrolls[]; | |
313 | extern struct id id_potions[]; | |
314 | extern struct id id_wands[]; | |
315 | extern struct id id_rings[]; | |
316 | extern struct id id_weapons[]; | |
317 | extern struct id id_armors[]; | |
318 | ||
319 | extern object mon_tab[]; | |
320 | extern object level_monsters; | |
321 | ||
322 | #define MONSTERS 26 | |
323 | ||
324 | #define HASTED 01L | |
325 | #define SLOWED 02L | |
326 | #define INVISIBLE 04L | |
327 | #define ASLEEP 010L | |
328 | #define WAKENS 020L | |
329 | #define WANDERS 040L | |
330 | #define FLIES 0100L | |
331 | #define FLITS 0200L | |
332 | #define CAN_FLIT 0400L /* can, but usually doesn't, flit */ | |
333 | #define CONFUSED 01000L | |
334 | #define RUSTS 02000L | |
335 | #define HOLDS 04000L | |
336 | #define FREEZES 010000L | |
337 | #define STEALS_GOLD 020000L | |
338 | #define STEALS_ITEM 040000L | |
339 | #define STINGS 0100000L | |
340 | #define DRAINS_LIFE 0200000L | |
341 | #define DROPS_LEVEL 0400000L | |
342 | #define SEEKS_GOLD 01000000L | |
343 | #define FREEZING_ROGUE 02000000L | |
344 | #define RUST_VANISHED 04000000L | |
345 | #define CONFUSES 010000000L | |
346 | #define IMITATES 020000000L | |
347 | #define FLAMES 040000000L | |
348 | #define STATIONARY 0100000000L /* damage will be 1,2,3,... */ | |
349 | #define NAPPING 0200000000L /* can't wake up for a while */ | |
350 | #define ALREADY_MOVED 0400000000L | |
351 | ||
352 | #define SPECIAL_HIT (RUSTS|HOLDS|FREEZES|STEALS_GOLD|STEALS_ITEM|STINGS|DRAINS_LIFE|DROPS_LEVEL) | |
353 | ||
354 | #define WAKE_PERCENT 45 | |
355 | #define FLIT_PERCENT 40 | |
356 | #define PARTY_WAKE_PERCENT 75 | |
357 | ||
358 | #define HYPOTHERMIA 1 | |
359 | #define STARVATION 2 | |
360 | #define POISON_DART 3 | |
361 | #define QUIT 4 | |
362 | #define WIN 5 | |
363 | #define KFIRE 6 | |
364 | ||
365 | #define UPWARD 0 | |
366 | #define UPRIGHT 1 | |
367 | #define RIGHT 2 | |
368 | #define DOWNRIGHT 3 | |
369 | #define DOWN 4 | |
370 | #define DOWNLEFT 5 | |
371 | #define LEFT 6 | |
372 | #define UPLEFT 7 | |
373 | #define DIRS 8 | |
374 | ||
375 | #define ROW1 7 | |
376 | #define ROW2 15 | |
377 | ||
378 | #define COL1 26 | |
379 | #define COL2 52 | |
380 | ||
381 | #define MOVED 0 | |
382 | #define MOVE_FAILED -1 | |
383 | #define STOPPED_ON_SOMETHING -2 | |
384 | #define CANCEL '\033' | |
385 | #define LIST '*' | |
386 | ||
387 | #define HUNGRY 300 | |
388 | #define WEAK 150 | |
389 | #define FAINT 20 | |
390 | #define STARVE 0 | |
391 | ||
392 | #define MIN_ROW 1 | |
393 | ||
394 | /* external routine declarations. | |
395 | */ | |
396 | char *strcpy(); | |
397 | char *strncpy(); | |
398 | char *strcat(); | |
399 | ||
400 | char *mon_name(); | |
401 | char *get_ench_color(); | |
402 | char *name_of(); | |
403 | char *md_gln(); | |
404 | char *md_getenv(); | |
405 | char *md_malloc(); | |
406 | boolean is_direction(); | |
407 | boolean mon_sees(); | |
408 | boolean mask_pack(); | |
409 | boolean mask_room(); | |
410 | boolean is_digit(); | |
411 | boolean check_hunger(); | |
412 | boolean reg_move(); | |
413 | boolean md_df(); | |
414 | boolean has_been_touched(); | |
415 | object *add_to_pack(); | |
416 | object *alloc_object(); | |
417 | object *get_letter_object(); | |
418 | object *gr_monster(); | |
419 | object *get_thrown_at_monster(); | |
420 | object *get_zapped_monster(); | |
421 | object *check_duplicate(); | |
422 | object *gr_object(); | |
423 | object *object_at(); | |
424 | object *pick_up(); | |
425 | struct id *get_id_table(); | |
426 | unsigned short gr_what_is(); | |
427 | long rrandom(); | |
428 | long lget_number(); | |
429 | long xxx(); | |
430 | int byebye(), onintr(), error_save(); | |
431 | ||
432 | struct rogue_time { | |
433 | short year; /* >= 1987 */ | |
434 | short month; /* 1 - 12 */ | |
435 | short day; /* 1 - 31 */ | |
436 | short hour; /* 0 - 23 */ | |
437 | short minute; /* 0 - 59 */ | |
438 | short second; /* 0 - 59 */ | |
439 | }; | |
440 | ||
441 | #ifdef CURSES | |
442 | struct _win_st { | |
443 | short _cury, _curx; | |
444 | short _maxy, _maxx; | |
445 | }; | |
446 | ||
447 | typedef struct _win_st WINDOW; | |
448 | ||
449 | extern int LINES, COLS; | |
450 | extern WINDOW *curscr; | |
451 | extern char *CL; | |
452 | ||
453 | char *md_gdtcf(); | |
454 | ||
455 | #else | |
456 | #include <curses.h> | |
457 | #endif |