mkroom.h update
Give room type enums explicit values so that it is easier to find them when searching by value rather than by name. Also some reformatting.
This commit is contained in:
+39
-45
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mkroom.h $NHDT-Date: 1432512780 2015/05/25 00:13:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */
|
/* NetHack 3.6 mkroom.h $NHDT-Date: 1560851014 2019/06/18 09:43:34 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.16 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Pasi Kallinen, 2016. */
|
/*-Copyright (c) Pasi Kallinen, 2016. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -32,8 +32,8 @@ struct shclass {
|
|||||||
#define D_SHOP 1 /* shop-like placement */
|
#define D_SHOP 1 /* shop-like placement */
|
||||||
#define D_TEMPLE 2 /* temple-like placement */
|
#define D_TEMPLE 2 /* temple-like placement */
|
||||||
struct itp {
|
struct itp {
|
||||||
int iprob; /* probability of an item type */
|
int iprob; /* probability of an item type */
|
||||||
int itype; /* item type: if >=0 a class, if < 0 a specific item */
|
int itype; /* item type: if >=0 a class, if < 0 a specific item */
|
||||||
} iprobs[6];
|
} iprobs[6];
|
||||||
const char *const *shknms; /* list of shopkeeper names for this type */
|
const char *const *shknms; /* list of shopkeeper names for this type */
|
||||||
};
|
};
|
||||||
@@ -53,31 +53,31 @@ extern NEARDATA coord doors[DOORMAX];
|
|||||||
|
|
||||||
/* values for rtype in the room definition structure */
|
/* values for rtype in the room definition structure */
|
||||||
enum roomtype_types {
|
enum roomtype_types {
|
||||||
OROOM = 0, /* ordinary room */
|
OROOM = 0, /* ordinary room */
|
||||||
COURT = 2, /* contains a throne */
|
COURT = 2, /* contains a throne */
|
||||||
SWAMP, /* contains pools */
|
SWAMP = 3, /* contains pools */
|
||||||
VAULT, /* contains piles of gold */
|
VAULT = 4, /* detached room usually reached via teleport trap */
|
||||||
BEEHIVE, /* contains killer bees and royal jelly */
|
BEEHIVE = 5, /* contains killer bees and royal jelly */
|
||||||
MORGUE, /* contains corpses, undead and ghosts */
|
MORGUE = 6, /* contains corpses, undead and graves */
|
||||||
BARRACKS, /* contains soldiers and their gear */
|
BARRACKS = 7, /* contains soldiers and their gear */
|
||||||
ZOO, /* floor covered with treasure and monsters */
|
ZOO = 8, /* floor covered with treasure and monsters */
|
||||||
DELPHI, /* contains Oracle and peripherals */
|
DELPHI = 9, /* contains Oracle and peripherals */
|
||||||
TEMPLE, /* contains a shrine */
|
TEMPLE = 10, /* contains a shrine (altar attended by priest[ess]) */
|
||||||
LEPREHALL, /* leprechaun hall (Tom Proudfoot) */
|
LEPREHALL = 11, /* leprechaun hall (Tom Proudfoot) */
|
||||||
COCKNEST, /* cockatrice nest (Tom Proudfoot) */
|
COCKNEST = 12, /* cockatrice nest (Tom Proudfoot) */
|
||||||
ANTHOLE, /* ants (Tom Proudfoot) */
|
ANTHOLE = 13, /* ants (Tom Proudfoot) */
|
||||||
SHOPBASE, /* everything above this is a shop */
|
SHOPBASE = 14, /* everything above this is a shop */
|
||||||
ARMORSHOP, /* specific shop defines for level compiler */
|
ARMORSHOP = 15, /* specific shop defines for level compiler */
|
||||||
SCROLLSHOP,
|
SCROLLSHOP = 16,
|
||||||
POTIONSHOP,
|
POTIONSHOP = 17,
|
||||||
WEAPONSHOP,
|
WEAPONSHOP = 18,
|
||||||
FOODSHOP,
|
FOODSHOP = 19,
|
||||||
RINGSHOP,
|
RINGSHOP = 20,
|
||||||
WANDSHOP,
|
WANDSHOP = 21,
|
||||||
TOOLSHOP,
|
TOOLSHOP = 22,
|
||||||
BOOKSHOP,
|
BOOKSHOP = 23,
|
||||||
FODDERSHOP, /* health food store */
|
FODDERSHOP = 24, /* health food store */
|
||||||
CANDLESHOP
|
CANDLESHOP = 25
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAXRTYPE (CANDLESHOP) /* maximum valid room type */
|
#define MAXRTYPE (CANDLESHOP) /* maximum valid room type */
|
||||||
@@ -87,25 +87,19 @@ enum roomtype_types {
|
|||||||
#define ANY_TYPE (-1)
|
#define ANY_TYPE (-1)
|
||||||
#define ANY_SHOP (-2)
|
#define ANY_SHOP (-2)
|
||||||
|
|
||||||
#define NO_ROOM 0 /* indicates lack of room-occupancy */
|
#define NO_ROOM 0 /* indicates lack of room-occupancy */
|
||||||
#define SHARED 1 /* indicates normal shared boundary */
|
#define SHARED 1 /* indicates normal shared boundary */
|
||||||
#define SHARED_PLUS \
|
#define SHARED_PLUS 2 /* indicates shared boundary - extra adjacent-square
|
||||||
2 /* indicates shared boundary - extra adjacent- \
|
* searching required */
|
||||||
* square searching required */
|
#define ROOMOFFSET 3 /* (levl[x][y].roomno - ROOMOFFSET) gives rooms[] index,
|
||||||
|
* for inside-squares and non-shared boundaries */
|
||||||
|
|
||||||
#define ROOMOFFSET \
|
#define IS_ROOM_PTR(x) ((x) >= rooms && (x) < rooms + MAXNROFROOMS)
|
||||||
3 /* \
|
#define IS_ROOM_INDEX(x) ((x) >= 0 && (x) < MAXNROFROOMS)
|
||||||
* (levl[x][y].roomno - ROOMOFFSET) gives \
|
#define IS_SUBROOM_PTR(x) ((x) >= subrooms && (x) < subrooms + MAXNROFROOMS)
|
||||||
* rooms[] index, for inside-squares and \
|
|
||||||
* non-shared boundaries. \
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define IS_ROOM_PTR(x) ((x) >= 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 IS_SUBROOM_INDEX(x) ((x) > MAXNROFROOMS && (x) < (MAXNROFROOMS * 2))
|
||||||
#define ROOM_INDEX(x) ((x) -rooms)
|
#define ROOM_INDEX(x) ((x) -rooms)
|
||||||
#define SUBROOM_INDEX(x) ((x) -subrooms)
|
#define SUBROOM_INDEX(x) ((x) -subrooms)
|
||||||
#define IS_LAST_ROOM_PTR(x) (ROOM_INDEX(x) == nroom)
|
#define IS_LAST_ROOM_PTR(x) (ROOM_INDEX(x) == nroom)
|
||||||
#define IS_LAST_SUBROOM_PTR(x) (!nsubroom || SUBROOM_INDEX(x) == nsubroom)
|
#define IS_LAST_SUBROOM_PTR(x) (!nsubroom || SUBROOM_INDEX(x) == nsubroom)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user