2 * Copyright (c) 1988, 1993
3 * The Regents of the University of California. All rights reserved.
5 * This code is derived from software contributed to Berkeley by
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * @(#)rogue.h 8.1 (Berkeley) 5/31/93
37 * $FreeBSD: src/games/rogue/rogue.h,v 1.3.2.1 2001/12/17 12:43:23 phantom Exp $
38 * $DragonFly: src/games/rogue/rogue.h,v 1.2 2003/06/17 04:25:25 dillon Exp $
47 * This source herein may be modified and/or distributed by anybody who
48 * so desires, with the following restrictions:
49 * 1.) This notice shall not be removed.
50 * 2.) Credit shall not be taken for the creation of this source.
51 * 3.) This code is not to be traded, sold, or used for personal
57 #define NOTHING ((unsigned short) 0)
58 #define OBJECT ((unsigned short) 01)
59 #define MONSTER ((unsigned short) 02)
60 #define STAIRS ((unsigned short) 04)
61 #define HORWALL ((unsigned short) 010)
62 #define VERTWALL ((unsigned short) 020)
63 #define DOOR ((unsigned short) 040)
64 #define FLOOR ((unsigned short) 0100)
65 #define TUNNEL ((unsigned short) 0200)
66 #define TRAP ((unsigned short) 0400)
67 #define HIDDEN ((unsigned short) 01000)
69 #define ARMOR ((unsigned short) 01)
70 #define WEAPON ((unsigned short) 02)
71 #define SCROL ((unsigned short) 04)
72 #define POTION ((unsigned short) 010)
73 #define GOLD ((unsigned short) 020)
74 #define FOOD ((unsigned short) 040)
75 #define WAND ((unsigned short) 0100)
76 #define RING ((unsigned short) 0200)
77 #define AMULET ((unsigned short) 0400)
78 #define ALL_OBJECTS ((unsigned short) 0777)
96 #define TWO_HANDED_SWORD 7
99 #define MAX_PACK_COUNT 24
101 #define PROTECT_ARMOR 0
102 #define HOLD_MONSTER 1
103 #define ENCH_WEAPON 2
108 #define SCARE_MONSTER 7
109 #define REMOVE_CURSE 8
110 #define CREATE_MONSTER 9
111 #define AGGRAVATE_MONSTER 10
112 #define MAGIC_MAPPING 11
116 #define INCREASE_STRENGTH 0
117 #define RESTORE_STRENGTH 1
119 #define EXTRA_HEALING 3
121 #define RAISE_LEVEL 5
123 #define HALLUCINATION 7
124 #define DETECT_MONSTER 8
125 #define DETECT_OBJECTS 9
127 #define LEVITATION 11
128 #define HASTE_SELF 12
129 #define SEE_INVISIBLE 13
133 #define SLOW_MONSTER 1
134 #define INVISIBILITY 2
136 #define HASTE_MONSTER 4
137 #define MAGIC_MISSILE 5
138 #define CANCELLATION 6
147 #define REGENERATION 2
148 #define SLOW_DIGEST 3
149 #define ADD_STRENGTH 4
150 #define SUSTAIN_STRENGTH 5
153 #define R_SEE_INVISIBLE 8
154 #define MAINTAIN_ARMOR 9
161 #define NOT_USED ((unsigned short) 0)
162 #define BEING_WIELDED ((unsigned short) 01)
163 #define BEING_WORN ((unsigned short) 02)
164 #define ON_LEFT_HAND ((unsigned short) 04)
165 #define ON_RIGHT_HAND ((unsigned short) 010)
166 #define ON_EITHER_HAND ((unsigned short) 014)
167 #define BEING_USED ((unsigned short) 017)
174 #define SLEEPING_GAS_TRAP 4
178 #define STEALTH_FACTOR 3
179 #define R_TELE_PERCENT 8
181 #define UNIDENTIFIED ((unsigned short) 00) /* MUST BE ZERO! */
182 #define IDENTIFIED ((unsigned short) 01)
183 #define CALLED ((unsigned short) 02)
188 #define MAX_TITLE_LENGTH 30
189 #define MAXSYLLABLES 40
191 #define WAND_MATERIALS 30
194 #define GOLD_PERCENT 46
196 #define MAX_OPT_LEN 40
202 unsigned short id_status;
205 /* The following #defines provide more meaningful names for some of the
206 * struct object fields that are used for monsters. This, since each monster
207 * and object (scrolls, potions, etc) are represented by a struct object.
208 * Ideally, this should be handled by some kind of union structure.
211 #define m_damage damage
212 #define hp_to_kill quantity
214 #define first_level is_protected
215 #define last_level is_cursed
216 #define m_hit_chance class
217 #define stationary_damage identified
218 #define drop_percent which_kind
219 #define trail_char d_enchant
220 #define slowed_toggle quiver
221 #define moves_confused hit_enchant
222 #define nap_length picked_up
223 #define disguise what_is
224 #define next_monster next_object
226 struct obj { /* comment is monster meaning */
227 unsigned long m_flags; /* monster flags */
228 const char *damage; /* damage it does */
229 short quantity; /* hit points to kill */
230 short ichar; /* 'A' is for aquatar */
231 short kill_exp; /* exp for killing it */
232 short is_protected; /* level starts */
233 short is_cursed; /* level ends */
234 short class; /* chance of hitting you */
235 short identified; /* 'F' damage, 1,2,3... */
236 unsigned short which_kind; /* item carry/drop % */
237 short o_row, o_col, o; /* o is how many times stuck at o_row, o_col */
238 short row, col; /* current row, col */
239 short d_enchant; /* room char when detect_monster */
240 short quiver; /* monster slowed toggle */
241 short trow, tcol; /* target row, col */
242 short hit_enchant; /* how many moves is confused */
243 unsigned short what_is; /* imitator's charactor (?!%: */
244 short picked_up; /* sleep from wand of sleep */
245 unsigned short in_use_flags;
246 struct obj *next_object; /* next monster */
249 typedef struct obj object;
251 #define INIT_AW (object*)0,(object*)0
252 #define INIT_RINGS (object*)0,(object*)0
253 #define INIT_HP 12,12
254 #define INIT_STR 16,16
256 #define INIT_PACK {0}
258 #define INIT_CHAR '@'
259 #define INIT_MOVES 1250
264 object *left_ring, *right_ring;
278 typedef struct fightr fighter;
288 typedef struct dr door;
291 short bottom_row, right_col, left_col, top_row;
293 unsigned short is_room;
296 typedef struct rm room;
303 #define PASSAGE -3 /* cur_room value */
305 #define AMULET_LEVEL 26
307 #define R_NOTHING ((unsigned short) 01)
308 #define R_ROOM ((unsigned short) 02)
309 #define R_MAZE ((unsigned short) 04)
310 #define R_DEADEND ((unsigned short) 010)
311 #define R_CROSS ((unsigned short) 020)
313 #define MAX_EXP_LEVEL 21
314 #define MAX_EXP 10000001L
315 #define MAX_GOLD 999999
318 #define MAX_STRENGTH 99
319 #define LAST_DUNGEON 99
321 #define STAT_LEVEL 01
324 #define STAT_STRENGTH 010
325 #define STAT_ARMOR 020
327 #define STAT_HUNGER 0100
328 #define STAT_LABEL 0200
329 #define STAT_ALL 0377
331 #define PARTY_TIME 10 /* one party somewhere in each 10 level span */
333 #define MAX_TRAPS 10 /* maximum traps per level */
335 #define HIDE_PERCENT 12
339 short trap_row, trap_col;
342 typedef struct tr trap;
344 extern fighter rogue;
347 extern unsigned short dungeon[DROWS][DCOLS];
348 extern object level_objects;
350 extern struct id id_scrolls[];
351 extern struct id id_potions[];
352 extern struct id id_wands[];
353 extern struct id id_rings[];
354 extern struct id id_weapons[];
355 extern struct id id_armors[];
357 extern object mon_tab[];
358 extern object level_monsters;
364 #define INVISIBLE 04L
370 #define CAN_FLIT 0400L /* can, but usually doesn't, flit */
371 #define CONFUSED 01000L
374 #define FREEZES 010000L
375 #define STEALS_GOLD 020000L
376 #define STEALS_ITEM 040000L
377 #define STINGS 0100000L
378 #define DRAINS_LIFE 0200000L
379 #define DROPS_LEVEL 0400000L
380 #define SEEKS_GOLD 01000000L
381 #define FREEZING_ROGUE 02000000L
382 #define RUST_VANISHED 04000000L
383 #define CONFUSES 010000000L
384 #define IMITATES 020000000L
385 #define FLAMES 040000000L
386 #define STATIONARY 0100000000L /* damage will be 1,2,3,... */
387 #define NAPPING 0200000000L /* can't wake up for a while */
388 #define ALREADY_MOVED 0400000000L
390 #define SPECIAL_HIT (RUSTS|HOLDS|FREEZES|STEALS_GOLD|STEALS_ITEM|STINGS|DRAINS_LIFE|DROPS_LEVEL)
392 #define WAKE_PERCENT 45
393 #define FLIT_PERCENT 40
394 #define PARTY_WAKE_PERCENT 75
396 #define HYPOTHERMIA 1
398 #define POISON_DART 3
420 #define MOVE_FAILED -1
421 #define STOPPED_ON_SOMETHING -2
422 #define CANCEL '\033'
432 /* external routine declarations.
434 const char *mon_name();
435 const char *get_ench_color();
436 const char *name_of();
437 const char *md_gln();
440 boolean is_direction();
445 boolean check_hunger();
448 boolean has_been_touched();
449 object *add_to_pack();
450 object *alloc_object();
451 object *get_letter_object();
452 object *gr_monster();
453 object *get_thrown_at_monster();
454 object *get_zapped_monster();
455 object *check_duplicate();
459 struct id *get_id_table();
460 unsigned short gr_what_is();
461 #define rrandom random
462 #define srrandom(x) srandomdev()
465 void byebye(), onintr(), error_save();
468 short year; /* >= 1987 */
469 short month; /* 1 - 12 */
470 short day; /* 1 - 31 */
471 short hour; /* 0 - 23 */
472 short minute; /* 0 - 59 */
473 short second; /* 0 - 59 */