Files
nethack/include/sp_lev.h
nethack.rankin 4c83db0294 fix #H1232 - hole in ice is described as moat [1 of 2] (trunk only)
From a bug report, when ice on the Valkyrie
quest home level was melted and a boulder filled the resulting pool, that
pool was described as a moat.  This was actually a terrain issue rather
than a formatting glitch, so instead of tweaking waterbody_name() with an
extra special case, extend the level compiler to allow specifying ice as
frozen pool instead of always being frozen moat.  There's no provision
for having both types of ice on the same level, just a level-wide flag to
control which of the two applies for ice on that level.

     This change has a side-effect for the V quest levels:  once ice has
been melted, a second blast of fire will now boil away the pool and leave
a pit.  The unfrozen water locations on the home level already behaved
that way (ie, they are pools rather than moats) so this should be ok.  I
also added <Someone>'s suggestion to make one of the two drawbridges
on the goal level start in random state instead of always being open.
2007-08-03 01:05:50 +00:00

248 lines
4.0 KiB
C

/* SCCS Id: @(#)sp_lev.h 3.5 2007/08/01 */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
#ifndef SP_LEV_H
#define SP_LEV_H
/* wall directions */
#define W_NORTH 1
#define W_SOUTH 2
#define W_EAST 4
#define W_WEST 8
#define W_ANY (W_NORTH|W_SOUTH|W_EAST|W_WEST)
/* MAP limits */
#define MAP_X_LIM 76
#define MAP_Y_LIM 21
/* Per level flags */
#define NOTELEPORT 1
#define HARDFLOOR 2
#define NOMMAP 4
#define SHORTSIGHTED 8
#define ARBOREAL 16
/* special level types */
#define SP_LEV_ROOMS 1
#define SP_LEV_MAZE 2
/*
* Structures manipulated by the special levels loader & compiler
*/
typedef union str_or_len {
char *str;
int len;
} Str_or_Len;
typedef struct {
boolean init_present, padding;
char fg, bg;
boolean smoothed, joined;
xchar lit, walled;
boolean icedpools; /* for ice locations: ICED_POOL vs ICED_MOAT */
} lev_init;
typedef struct {
xchar x, y, mask;
} door;
typedef struct {
xchar wall, pos, secret, mask;
} room_door;
typedef struct {
xchar x, y, chance, type;
} trap;
typedef struct {
Str_or_Len name, appear_as;
short id;
aligntyp align;
xchar x, y, chance, class, appear;
schar peaceful, asleep;
} monster;
typedef struct {
Str_or_Len name;
int corpsenm;
short id, spe;
xchar x, y, chance, class, containment;
schar curse_state;
} object;
typedef struct {
xchar x, y;
aligntyp align;
xchar shrine;
} altar;
typedef struct {
xchar x, y, dir, db_open;
} drawbridge;
typedef struct {
xchar x, y, dir;
} walk;
typedef struct {
xchar x1, y1, x2, y2;
} digpos;
typedef struct {
xchar x, y, up;
} lad;
typedef struct {
xchar x, y, up;
} stair;
typedef struct {
xchar x1, y1, x2, y2;
xchar rtype, rlit, rirreg;
} region;
/* values for rtype are defined in dungeon.h */
typedef struct {
struct { xchar x1, y1, x2, y2; } inarea;
struct { xchar x1, y1, x2, y2; } delarea;
boolean in_islev, del_islev;
xchar rtype, padding;
Str_or_Len rname;
} lev_region;
typedef struct {
xchar x, y;
int amount;
} gold;
typedef struct {
xchar x, y;
Str_or_Len engr;
xchar etype;
} engraving;
typedef struct {
xchar x, y;
} fountain;
typedef struct {
xchar x, y;
} sink;
typedef struct {
xchar x, y;
} pool;
typedef struct {
char halign, valign;
char xsize, ysize;
char **map;
char nrobjects;
char *robjects;
char nloc;
char *rloc_x;
char *rloc_y;
char nrmonst;
char *rmonst;
char nreg;
region **regions;
char nlreg;
lev_region **lregions;
char ndoor;
door **doors;
char ntrap;
trap **traps;
char nmonster;
monster **monsters;
char nobject;
object **objects;
char ndrawbridge;
drawbridge **drawbridges;
char nwalk;
walk **walks;
char ndig;
digpos **digs;
char npass;
digpos **passs;
char nlad;
lad **lads;
char nstair;
stair **stairs;
char naltar;
altar **altars;
char ngold;
gold **golds;
char nengraving;
engraving **engravings;
char nfountain;
fountain **fountains;
} mazepart;
typedef struct {
long flags;
lev_init init_lev;
schar filling;
char numpart;
mazepart **parts;
} specialmaze;
typedef struct _room {
char *name;
char *parent;
xchar x, y, w, h;
xchar xalign, yalign;
xchar rtype, chance, rlit, filled;
char ndoor;
room_door **doors;
char ntrap;
trap **traps;
char nmonster;
monster **monsters;
char nobject;
object **objects;
char naltar;
altar **altars;
char nstair;
stair **stairs;
char ngold;
gold **golds;
char nengraving;
engraving **engravings;
char nfountain;
fountain **fountains;
char nsink;
sink **sinks;
char npool;
pool **pools;
/* These three fields are only used when loading the level... */
int nsubroom;
struct _room *subrooms[MAX_SUBROOMS];
struct mkroom *mkr;
} room;
typedef struct {
struct {
xchar room;
xchar wall;
xchar door;
} src, dest;
} corridor;
/* used only by lev_comp */
typedef struct {
long flags;
lev_init init_lev;
char nrobjects;
char *robjects;
char nrmonst;
char *rmonst;
xchar nroom;
room **rooms;
xchar ncorr;
corridor **corrs;
} splev;
#endif /* SP_LEV_H */