1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2024-09-19 14:05:02 +01:00
notnotdnethack/include/dgn_file.h
NeroOneTrueKing 81c297c0b3 Allow specifying alternate dungeon branches in one .def file
By default, they are all weighted equally, but the `select_alternate()` function may be given special cases.
Branches are numbered starting from 0, in the order they are written in dungeon.def.

Note: Chainbranches off of an alternate must exist on all alternates, or else it is possible the root of the chainbranch won't have been generated and the dungone linker will crash. Let me know if this is ever a feature we'd want to have, I can probably make it happen :)
2022-10-15 10:24:50 -05:00

79 lines
1.7 KiB
C

/* SCCS Id: @(#)dgn_file.h 3.4 1993/01/17 */
/* Copyright (c) 1989 by M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
#ifndef DGN_FILE_H
#define DGN_FILE_H
#ifndef ALIGN_H
#include "align.h"
#endif
/*
* Structures manipulated by the dungeon loader & compiler
*/
struct couple {
short base, rand;
};
struct tmpdungeon {
char name[24],
protoname[24];
struct couple lev;
int flags,
chance,
levels,
alternates,
branches,
entry_lev; /* entry level for this dungeon */
char boneschar;
};
struct tmplevel {
char name[24];
struct couple lev;
int chance, rndlevs, chain, flags;
char boneschar;
};
struct tmpbranch {
char name[24]; /* destination dungeon name */
struct couple lev;
int chain; /* index into tmplevel array (chained branch)*/
int type; /* branch type (see below) */
int up; /* branch is up or down */
};
/*
* Values for type for tmpbranch structure.
*/
#define TBR_STAIR 0 /* connection with both ends having a staircase */
#define TBR_NO_UP 1 /* connection with no up staircase */
#define TBR_NO_DOWN 2 /* connection with no down staircase */
#define TBR_PORTAL 3 /* portal connection */
/*
* Flags that map into the dungeon flags bitfields.
*/
#define TOWN 1 /* levels only */
#define HELLISH 2
#define MAZELIKE 4
#define ROGUELIKE 8
#define D_ALIGN_NONE 0
#define D_ALIGN_CHAOTIC (AM_CHAOTIC << 4)
#define D_ALIGN_NEUTRAL (AM_NEUTRAL << 4)
#define D_ALIGN_LAWFUL (AM_LAWFUL << 4)
#define D_ALIGN_MASK 0x70
/*
* Max number of prototype levels and branches.
*/
//increased LEV_LIMIT from 50 to 100 >:[ Not sure WHY there is a limit to begin with...
//...and now to 150
#define LEV_LIMIT 150
#define BRANCH_LIMIT 32
#endif /* DGN_FILE_H */