* Copyright (c) 1988 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* @(#)rogue.h 5.3 (Berkeley) %G%
* This source herein may be modified and/or distributed by anybody who
* so desires, with the following restrictions:
* 1.) This notice shall not be removed.
* 2.) Credit shall not be taken for the creation of this source.
* 3.) This code is not to be traded, sold, or used for personal
#define NOTHING ((unsigned short) 0)
#define OBJECT ((unsigned short) 01)
#define MONSTER ((unsigned short) 02)
#define STAIRS ((unsigned short) 04)
#define HORWALL ((unsigned short) 010)
#define VERTWALL ((unsigned short) 020)
#define DOOR ((unsigned short) 040)
#define FLOOR ((unsigned short) 0100)
#define TUNNEL ((unsigned short) 0200)
#define TRAP ((unsigned short) 0400)
#define HIDDEN ((unsigned short) 01000)
#define ARMOR ((unsigned short) 01)
#define WEAPON ((unsigned short) 02)
#define SCROL ((unsigned short) 04)
#define POTION ((unsigned short) 010)
#define GOLD ((unsigned short) 020)
#define FOOD ((unsigned short) 040)
#define WAND ((unsigned short) 0100)
#define RING ((unsigned short) 0200)
#define AMULET ((unsigned short) 0400)
#define ALL_OBJECTS ((unsigned short) 0777)
#define TWO_HANDED_SWORD 7
#define MAX_PACK_COUNT 24
#define AGGRAVATE_MONSTER 10
#define INCREASE_STRENGTH 0
#define RESTORE_STRENGTH 1
#define SUSTAIN_STRENGTH 5
#define R_SEE_INVISIBLE 8
#define NOT_USED ((unsigned short) 0)
#define BEING_WIELDED ((unsigned short) 01)
#define BEING_WORN ((unsigned short) 02)
#define ON_LEFT_HAND ((unsigned short) 04)
#define ON_RIGHT_HAND ((unsigned short) 010)
#define ON_EITHER_HAND ((unsigned short) 014)
#define BEING_USED ((unsigned short) 017)
#define SLEEPING_GAS_TRAP 4
#define UNIDENTIFIED ((unsigned short) 00) /* MUST BE ZERO! */
#define IDENTIFIED ((unsigned short) 01)
#define CALLED ((unsigned short) 02)
#define MAX_TITLE_LENGTH 30
#define WAND_MATERIALS 30
#define SCORE_FILE "/usr/games/lib/rogue.scores"
#define LOCK_FILE "/usr/games/lib/rogue.lock"
unsigned short id_status
;
/* The following #defines provide more meaningful names for some of the
* struct object fields that are used for monsters. This, since each monster
* and object (scrolls, potions, etc) are represented by a struct object.
* Ideally, this should be handled by some kind of union structure.
#define hp_to_kill quantity
#define first_level is_protected
#define last_level is_cursed
#define m_hit_chance class
#define stationary_damage identified
#define drop_percent which_kind
#define trail_char d_enchant
#define slowed_toggle quiver
#define moves_confused hit_enchant
#define nap_length picked_up
#define next_monster next_object
struct obj
{ /* comment is monster meaning */
unsigned long m_flags
; /* monster flags */
char *damage
; /* damage it does */
short quantity
; /* hit points to kill */
short ichar
; /* 'A' is for aquatar */
short kill_exp
; /* exp for killing it */
short is_protected
; /* level starts */
short is_cursed
; /* level ends */
short class; /* chance of hitting you */
short identified
; /* 'F' damage, 1,2,3... */
unsigned short which_kind
; /* item carry/drop % */
short o_row
, o_col
, o
; /* o is how many times stuck at o_row, o_col */
short row
, col
; /* current row, col */
short d_enchant
; /* room char when detect_monster */
short quiver
; /* monster slowed toggle */
short trow
, tcol
; /* target row, col */
short hit_enchant
; /* how many moves is confused */
unsigned short what_is
; /* imitator's charactor (?!%: */
short picked_up
; /* sleep from wand of sleep */
unsigned short in_use_flags
;
struct obj
*next_object
; /* next monster */
typedef struct obj object
;
#define INIT_AW (object*)0,(object*)0
#define INIT_RINGS (object*)0,(object*)0
object
*left_ring
, *right_ring
;
typedef struct fightr fighter
;
short bottom_row
, right_col
, left_col
, top_row
;
#define PASSAGE -3 /* cur_room value */
#define R_NOTHING ((unsigned short) 01)
#define R_ROOM ((unsigned short) 02)
#define R_MAZE ((unsigned short) 04)
#define R_DEADEND ((unsigned short) 010)
#define R_CROSS ((unsigned short) 020)
#define MAX_EXP 10000001L
#define STAT_STRENGTH 010
#define PARTY_TIME 10 /* one party somewhere in each 10 level span */
#define MAX_TRAPS 10 /* maximum traps per level */
short trap_row
, trap_col
;
extern unsigned short dungeon
[DROWS
][DCOLS
];
extern object level_objects
;
extern struct id id_scrolls
[];
extern struct id id_potions
[];
extern struct id id_wands
[];
extern struct id id_rings
[];
extern struct id id_weapons
[];
extern struct id id_armors
[];
extern object level_monsters
;
#define CAN_FLIT 0400L /* can, but usually doesn't, flit */
#define STEALS_GOLD 020000L
#define STEALS_ITEM 040000L
#define DRAINS_LIFE 0200000L
#define DROPS_LEVEL 0400000L
#define SEEKS_GOLD 01000000L
#define FREEZING_ROGUE 02000000L
#define RUST_VANISHED 04000000L
#define CONFUSES 010000000L
#define IMITATES 020000000L
#define FLAMES 040000000L
#define STATIONARY 0100000000L /* damage will be 1,2,3,... */
#define NAPPING 0200000000L /* can't wake up for a while */
#define ALREADY_MOVED 0400000000L
#define SPECIAL_HIT (RUSTS|HOLDS|FREEZES|STEALS_GOLD|STEALS_ITEM|STINGS|DRAINS_LIFE|DROPS_LEVEL)
#define PARTY_WAKE_PERCENT 75
#define STOPPED_ON_SOMETHING -2
/* external routine declarations.
boolean
has_been_touched();
object
*get_letter_object();
object
*get_thrown_at_monster();
object
*get_zapped_monster();
object
*check_duplicate();
struct id
*get_id_table();
unsigned short gr_what_is();
int byebye(), onintr(), error_save();
short year
; /* >= 1987 */
short month
; /* 1 - 12 */
short minute
; /* 0 - 59 */
short second
; /* 0 - 59 */
typedef struct _win_st WINDOW
;