dgn_file.h

Go to the documentation of this file.
00001 /*      SCCS Id: @(#)dgn_file.h 3.4     1993/01/17      */
00002 /* Copyright (c) 1989 by M. Stephenson                            */
00003 /* NetHack may be freely redistributed.  See license for details. */
00004 
00005 #ifndef DGN_FILE_H
00006 #define DGN_FILE_H
00007 
00008 #ifndef ALIGN_H
00009 #include "align.h"
00010 #endif
00011 
00012 /*
00013  * Structures manipulated by the dungeon loader & compiler
00014  */
00015 
00016 struct  couple {
00017         short   base, rand;
00018 };
00019 
00020 struct tmpdungeon {
00021         char    name[24],
00022                 protoname[24];
00023         struct  couple  lev;
00024         int     flags,
00025                 chance,
00026                 levels,
00027                 branches,
00028                 entry_lev;              /* entry level for this dungeon */
00029         char    boneschar;
00030 };
00031 
00032 struct tmplevel {
00033         char    name[24];
00034         struct  couple  lev;
00035         int     chance, rndlevs, chain, flags;
00036         char    boneschar;
00037 };
00038 
00039 struct tmpbranch {
00040         char    name[24];       /* destination dungeon name */
00041         struct  couple  lev;
00042         int     chain;          /* index into tmplevel array (chained branch)*/
00043         int     type;           /* branch type (see below) */
00044         int     up;             /* branch is up or down */
00045 };
00046 
00047 /*
00048  *      Values for type for tmpbranch structure.
00049  */
00050 #define TBR_STAIR   0   /* connection with both ends having a staircase */
00051 #define TBR_NO_UP   1   /* connection with no up staircase */
00052 #define TBR_NO_DOWN 2   /* connection with no down staircase */
00053 #define TBR_PORTAL  3   /* portal connection */
00054 
00055 /*
00056  *      Flags that map into the dungeon flags bitfields.
00057  */
00058 #define TOWN        1   /* levels only */
00059 #define HELLISH     2
00060 #define MAZELIKE    4
00061 #define ROGUELIKE   8
00062 
00063 #define D_ALIGN_NONE    0
00064 #define D_ALIGN_CHAOTIC (AM_CHAOTIC << 4)
00065 #define D_ALIGN_NEUTRAL (AM_NEUTRAL << 4)
00066 #define D_ALIGN_LAWFUL  (AM_LAWFUL << 4)
00067 
00068 #define D_ALIGN_MASK    0x70
00069 
00070 /*
00071  *      Max number of prototype levels and branches.
00072  */
00073 #define LEV_LIMIT       50
00074 #define BRANCH_LIMIT    32
00075 
00076 #endif /* DGN_FILE_H */