1 /* NetHack 3.6 mkroom.h $NHDT-Date: 1432512780 2015/05/25 00:13:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
8 /* mkroom.h - types and structures for room and shop initialization */
11 schar lx
, hx
, ly
, hy
; /* usually xchar, but hx may be -1 */
12 schar rtype
; /* type of room (zoo, throne, etc...) */
13 schar orig_rtype
; /* same as rtype, but not zeroed later */
14 schar rlit
; /* is the room lit ? */
15 schar needfill
; /* sp_lev: does the room need filling? */
16 schar needjoining
; /* sp_lev */
17 schar doorct
; /* door count */
18 schar fdoor
; /* index for the first door of the room */
19 schar nsubrooms
; /* number of subrooms */
20 boolean irregular
; /* true if room is non-rectangular */
21 struct mkroom
*sbrooms
[MAX_SUBROOMS
]; /* Subrooms pointers */
22 struct monst
*resident
; /* priest/shopkeeper/guard for this room */
26 const char *name
; /* name of the shop type */
27 char symb
; /* this identifies the shop type */
28 int prob
; /* the shop type probability in % */
29 schar shdist
; /* object placement type */
30 #define D_SCATTER 0 /* normal placement */
31 #define D_SHOP 1 /* shop-like placement */
32 #define D_TEMPLE 2 /* temple-like placement */
34 int iprob
; /* probability of an item type */
35 int itype
; /* item type: if >=0 a class, if < 0 a specific item */
37 const char *const *shknms
; /* list of shopkeeper names for this type */
40 extern NEARDATA
struct mkroom rooms
[(MAXNROFROOMS
+ 1) * 2];
41 extern NEARDATA
struct mkroom
*subrooms
;
42 /* the normal rooms on the current level are described in rooms[0..n] for
44 * the vault, if any, is described by rooms[n+1]
45 * the next rooms entry has hx -1 as a flag
46 * there is at most one non-vault special room on a level
49 extern struct mkroom
*dnstairs_room
, *upstairs_room
, *sstairs_room
;
51 extern NEARDATA coord doors
[DOORMAX
];
53 /* values for rtype in the room definition structure */
54 #define OROOM 0 /* ordinary room */
55 #define COURT 2 /* contains a throne */
56 #define SWAMP 3 /* contains pools */
57 #define VAULT 4 /* contains piles of gold */
58 #define BEEHIVE 5 /* contains killer bees and royal jelly */
59 #define MORGUE 6 /* contains corpses, undead and ghosts */
60 #define BARRACKS 7 /* contains soldiers and their gear */
61 #define ZOO 8 /* floor covered with treasure and monsters */
62 #define DELPHI 9 /* contains Oracle and peripherals */
63 #define TEMPLE 10 /* contains a shrine */
64 #define LEPREHALL 11 /* leprechaun hall (Tom Proudfoot) */
65 #define COCKNEST 12 /* cockatrice nest (Tom Proudfoot) */
66 #define ANTHOLE 13 /* ants (Tom Proudfoot) */
67 #define SHOPBASE 14 /* everything above this is a shop */
68 #define ARMORSHOP 15 /* specific shop defines for level compiler */
77 #define FODDERSHOP 24 /* health food store */
78 #define UNIQUESHOP 25 /* shops here & below not randomly gen'd. */
80 #define MAXRTYPE 25 /* maximum valid room type */
82 /* Special type for search_special() */
86 #define NO_ROOM 0 /* indicates lack of room-occupancy */
87 #define SHARED 1 /* indicates normal shared boundary */
89 2 /* indicates shared boundary - extra adjacent- \
90 * square searching required */
94 * (levl[x][y].roomno - ROOMOFFSET) gives \
95 * rooms[] index, for inside-squares and \
96 * non-shared boundaries. \
99 #define IS_ROOM_PTR(x) ((x) >= rooms && (x) < rooms + MAXNROFROOMS)
100 #define IS_ROOM_INDEX(x) ((x) >= 0 && (x) < MAXNROFROOMS)
101 #define IS_SUBROOM_PTR(x) ((x) >= subrooms && (x) < subrooms + MAXNROFROOMS)
102 #define IS_SUBROOM_INDEX(x) ((x) > MAXNROFROOMS && (x) < (MAXNROFROOMS * 2))
103 #define ROOM_INDEX(x) ((x) -rooms)
104 #define SUBROOM_INDEX(x) ((x) -subrooms)
105 #define IS_LAST_ROOM_PTR(x) (ROOM_INDEX(x) == nroom)
106 #define IS_LAST_SUBROOM_PTR(x) (!nsubroom || SUBROOM_INDEX(x) == nsubroom)
108 #endif /* MKROOM_H */