NHDT->ANH, in most cases
[aNetHack.git] / include / mkroom.h
blob997eefadbbb3ae1ed64feb82ac21b44e0bb3b47a
1 /* NetHack 3.6 mkroom.h $ANH-Date: 1432512780 2015/05/25 00:13:00 $ $ANH-Branch: master $:$ANH-Revision: 1.13 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 #ifndef MKROOM_H
6 #define MKROOM_H
8 /* mkroom.h - types and structures for room and shop initialization */
10 struct mkroom {
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 */
25 struct shclass {
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 */
33 struct itp {
34 int iprob; /* probability of an item type */
35 int itype; /* item type: if >=0 a class, if < 0 a specific item */
36 } iprobs[6];
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
43 * some n<MAXNROFROOMS
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 enum roomtype_types {
55 OROOM = 0, /* ordinary room */
56 COURT = 2, /* contains a throne */
57 SWAMP, /* contains pools */
58 VAULT, /* contains piles of gold */
59 BEEHIVE, /* contains killer bees and royal jelly */
60 MORGUE, /* contains corpses, undead and ghosts */
61 BARRACKS, /* contains soldiers and their gear */
62 ZOO, /* floor covered with treasure and monsters */
63 DELPHI, /* contains Oracle and peripherals */
64 TEMPLE, /* contains a shrine */
65 LEPREHALL, /* leprechaun hall (Tom Proudfoot) */
66 COCKNEST, /* cockatrice nest (Tom Proudfoot) */
67 ANTHOLE, /* ants (Tom Proudfoot) */
68 SHOPBASE, /* everything above this is a shop */
69 ARMORSHOP, /* specific shop defines for level compiler */
70 SCROLLSHOP,
71 POTIONSHOP,
72 WEAPONSHOP,
73 FOODSHOP,
74 RINGSHOP,
75 WANDSHOP,
76 TOOLSHOP,
77 BOOKSHOP,
78 FODDERSHOP, /* health food store */
79 CANDLESHOP
82 #define MAXRTYPE (CANDLESHOP) /* maximum valid room type */
83 #define UNIQUESHOP (CANDLESHOP) /* shops here & above not randomly gen'd. */
85 /* Special type for search_special() */
86 #define ANY_TYPE (-1)
87 #define ANY_SHOP (-2)
89 #define NO_ROOM 0 /* indicates lack of room-occupancy */
90 #define SHARED 1 /* indicates normal shared boundary */
91 #define SHARED_PLUS \
92 2 /* indicates shared boundary - extra adjacent- \
93 * square searching required */
95 #define ROOMOFFSET \
96 3 /* \
97 * (levl[x][y].roomno - ROOMOFFSET) gives \
98 * rooms[] index, for inside-squares and \
99 * non-shared boundaries. \
102 #define IS_ROOM_PTR(x) ((x) >= rooms && (x) < rooms + MAXNROFROOMS)
103 #define IS_ROOM_INDEX(x) ((x) >= 0 && (x) < MAXNROFROOMS)
104 #define IS_SUBROOM_PTR(x) ((x) >= subrooms && (x) < subrooms + MAXNROFROOMS)
105 #define IS_SUBROOM_INDEX(x) ((x) > MAXNROFROOMS && (x) < (MAXNROFROOMS * 2))
106 #define ROOM_INDEX(x) ((x) -rooms)
107 #define SUBROOM_INDEX(x) ((x) -subrooms)
108 #define IS_LAST_ROOM_PTR(x) (ROOM_INDEX(x) == nroom)
109 #define IS_LAST_SUBROOM_PTR(x) (!nsubroom || SUBROOM_INDEX(x) == nsubroom)
111 #endif /* MKROOM_H */