/* NetHack 3.7 mkroom.h $NHDT-Date: 1725653011 2024/09/06 20:03:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.33 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2016. */ /* NetHack may be freely redistributed. See license for details. */ #ifndef MKROOM_H #define MKROOM_H /* mkroom.h - types and structures for room and shop initialization */ struct mkroom { coordxy lx, hx, ly, hy; /* usually coordxy, but hx may be -1 */ schar rtype; /* type of room (zoo, throne, etc...) */ schar orig_rtype; /* same as rtype, but not zeroed later */ schar rlit; /* is the room lit ? */ schar needfill; /* sp_lev: does the room need filling? */ boolean needjoining; /* sp_lev: should the room connect to others? */ schar doorct; /* door count */ int fdoor; /* index for the first door of the room */ schar nsubrooms; /* number of subrooms */ boolean irregular; /* true if room is non-rectangular */ schar roomnoidx; struct mkroom *sbrooms[MAX_SUBROOMS]; /* Subrooms pointers */ struct monst *resident; /* priest/shopkeeper/guard for this room */ }; struct shclass { const char *name; /* name of the shop type */ const char *annotation; /* simpler name for #overview; Null if same */ char symb; /* this identifies the shop type */ int prob; /* the shop type probability in % */ schar shdist; /* object placement type */ #define D_SCATTER 0 /* normal placement */ #define D_SHOP 1 /* shop-like placement */ #define D_TEMPLE 2 /* temple-like placement */ struct itp { int iprob; /* probability of an item type */ int itype; /* item type: if >=0 a class, if < 0 a specific item */ } iprobs[9]; const char *const *shknms; /* list of shopkeeper names for this type */ }; /* the normal rooms on the current level are described in svr.rooms[0..n] for * some n= svr.rooms && (x) < svr.rooms + MAXNROFROOMS) #define IS_ROOM_INDEX(x) ((x) >= 0 && (x) < MAXNROFROOMS) #define IS_SUBROOM_PTR(x) \ ((x) >= gs.subrooms && (x) < gs.subrooms + MAXNROFROOMS) #define IS_SUBROOM_INDEX(x) ((x) > MAXNROFROOMS && (x) <= (MAXNROFROOMS * 2)) #define ROOM_INDEX(x) ((x) - svr.rooms) #define SUBROOM_INDEX(x) ((x) - gs.subrooms) #define IS_LAST_ROOM_PTR(x) (ROOM_INDEX(x) == svn.nroom) #define IS_LAST_SUBROOM_PTR(x) \ (!gn.nsubroom || SUBROOM_INDEX(x) == gn.nsubroom) #endif /* MKROOM_H */