From 0e9b1de77ceaf128d98db7155e9c2c7b17f553d7 Mon Sep 17 00:00:00 2001 From: jwalz Date: Sat, 5 Jan 2002 21:05:47 +0000 Subject: [PATCH] *** empty log message *** --- include/mkroom.h | 103 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 include/mkroom.h diff --git a/include/mkroom.h b/include/mkroom.h new file mode 100644 index 000000000..c8ad0a417 --- /dev/null +++ b/include/mkroom.h @@ -0,0 +1,103 @@ +/* SCCS Id: @(#)mkroom.h 3.3 92/11/14 */ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* 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 { + schar lx,hx,ly,hy; /* usually xchar, but hx may be -1 */ + schar rtype; /* type of room (zoo, throne, etc...) */ + schar rlit; /* is the room lit ? */ + schar doorct; /* door count */ + schar fdoor; /* index for the first door of the room */ + schar nsubrooms; /* number of subrooms */ + boolean irregular; /* true if room is non-rectangular */ + 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 */ + 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[5]; + const char **shknms; /* list of shopkeeper names for this type */ +}; + +extern NEARDATA struct mkroom rooms[(MAXNROFROOMS+1)*2]; +extern NEARDATA struct mkroom* subrooms; +/* the normal rooms on the current level are described in rooms[0..n] for + * some n= rooms && (x) < rooms + MAXNROFROOMS) +#define IS_ROOM_INDEX(x) ((x) >= 0 && (x) < MAXNROFROOMS) +#define IS_SUBROOM_PTR(x) ((x) >= subrooms && \ + (x) < subrooms + MAXNROFROOMS) +#define IS_SUBROOM_INDEX(x) ((x) > MAXNROFROOMS && (x) < (MAXNROFROOMS*2)) +#define ROOM_INDEX(x) ((x) - rooms) +#define SUBROOM_INDEX(x) ((x) - subrooms) +#define IS_LAST_ROOM_PTR(x) (ROOM_INDEX(x) == nroom) +#define IS_LAST_SUBROOM_PTR(x) (!nsubroom || SUBROOM_INDEX(x) == nsubroom) + +#endif /* MKROOM_H */