Source:NetHack 2.2a/mkroom.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to mkroom.h from the source code of NetHack 2.2a. To link to a particular line, write [[NetHack 2.2a/mkroom.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

Screenshots and source code from Hack are used under the CWI license.

1.    /*	SCCS Id: @(#)mkroom.h	2.1	87/09/23
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    
4.    /* mkroom.h - types and structures for room and shop initialization */
5.    
6.    struct mkroom {
7.    	schar lx,hx,ly,hy;	/* usually xchar, but hx may be -1 */
8.    	schar rtype,rlit,doorct,fdoor;
9.    };
10.   
11.   struct shclass {
12.   	char	*name;	/* name of the shop type */
13.   	char	symb;	/* this identifies the shop type */
14.       	int	prob;	/* the shop type probability in % */
15.   	schar	dist;	/* artifact placement type */
16.   #define D_SCATTER	0	/* normal placement */
17.   #define D_SHOP		1	/* shop-like placement */
18.   #define D_TEMPLE	2	/* temple-like placement */
19.   	struct itp {
20.   	    int	iprob;	/* probability of an item type */
21.   	    int itype;	/* item type: if >=0 a class, if < 0 a specific item */
22.   	} iprobs[3];
23.   	char **shknms;	/* string list of shopkeeper names for this type */
24.   };
25.   extern struct shclass shtypes[];	/* defined in shknam.c */
26.   
27.   #define	MAXNROFROOMS	15
28.   extern struct mkroom rooms[MAXNROFROOMS+1];
29.   
30.   #define	DOORMAX	100
31.   extern coord doors[DOORMAX];
32.   
33.   /* values for rtype in the room definition structure */
34.   #define OROOM		 0	/* ordinary room */
35.   #define COURT		 2	/* contains a throne */
36.   #define	SWAMP		 3	/* contains pools */
37.   #define	VAULT		 4	/* contains piles of gold */
38.   #define	BEEHIVE		 5	/* contains killer bees and royal jelly */
39.   #define	MORGUE		 6	/* contains corpses, undead and ghosts */
40.   #define	ZOO		 7	/* floor covered with treasure and monsters */
41.   #define	SHOPBASE	 8	/* everything above this is a shop */
42.   
43.   #define IS_SHOP(x)	((x).rtype >= SHOPBASE)