Source:NetHack 5.0.0/include/dgn file.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to dgn_file.h from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/include/dgn_file.h#line12]], for example.

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1. /* NetHack 5.0	dgn_file.h	$NHDT-Date: 1596498533 2020/08/03 23:48:53 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.10 $ */
2. /* Copyright (c) 1989 by M. Stephenson                            */
3. /* NetHack may be freely redistributed.  See license for details. */
4. 
5. #ifndef DGN_FILE_H
6. #define DGN_FILE_H
7. 
8. #ifndef ALIGN_H
9. #include "align.h"
10. #endif
11. 
12. /*
13.  * Structures manipulated by the dungeon loader & compiler
14.  */
15. 
16. struct couple {
17.     short base, rand;
18. };
19. 
20. struct tmpdungeon {
21.     char *name, *protoname;
22.     struct couple lev;
23.     int flags, chance, levels, branches,
24.         entry_lev; /* entry level for this dungeon */
25.     char boneschar;
26.     int align;
27. };
28. 
29. struct tmplevel {
30.     char *name;
31.     char *chainlvl;
32.     struct couple lev;
33.     int chance, rndlevs, chain, flags;
34.     char boneschar;
35. };
36. 
37. struct tmpbranch {
38.     char *name; /* destination dungeon name */
39.     struct couple lev;
40.     int chain; /* index into tmplevel array (chained branch)*/
41.     int type;  /* branch type (see below) */
42.     int up;    /* branch is up or down */
43. };
44. 
45. /*
46.  *    Values for type in tmpbranch structure.
47.  */
48. #define TBR_STAIR 0   /* connection with both ends having a staircase */
49. #define TBR_NO_UP 1   /* connection with no up staircase */
50. #define TBR_NO_DOWN 2 /* connection with no down staircase */
51. #define TBR_PORTAL 3  /* portal connection */
52. 
53. /*
54.  *    Flags that map into the dungeon flags bitfields.
55.  */
56. #define TOWN        0x01 /* levels only */
57. #define HELLISH     0x02
58. #define MAZELIKE    0x04
59. #define ROGUELIKE   0x08
60. #define UNCONNECTED 0x10
61. 
62. #define D_ALIGN_NONE 0
63. #define D_ALIGN_CHAOTIC (AM_CHAOTIC << 4)
64. #define D_ALIGN_NEUTRAL (AM_NEUTRAL << 4)
65. #define D_ALIGN_LAWFUL (AM_LAWFUL << 4)
66. 
67. #define D_ALIGN_MASK 0x70
68. 
69. /*
70.  *    Max number of prototype levels and branches.
71.  */
72. #define LEV_LIMIT 50
73. #define BRANCH_LIMIT 32
74. 
75. #endif /* DGN_FILE_H */