Defines | Functions | Variables

mkmaze.c File Reference

#include "hack.h"
#include "sp_lev.h"
#include "lev.h"
Include dependency graph for mkmaze.c:

Defines

#define x_maze_min   2
#define y_maze_min   2
#define INVPOS_X_MARGIN   (6 - 2)
#define INVPOS_Y_MARGIN   (5 - 2)
#define INVPOS_DISTANCE   11
#define register
#define CONS_OBJ   0
#define CONS_MON   1
#define CONS_HERO   2
#define CONS_TRAP   3
#define bxmin   (xmin + 1)
#define bymin   (ymin + 1)
#define bxmax   (xmax - 1)
#define bymax   (ymax - 1)

Functions

STATIC_DCL boolean FDECL (iswall,(int, int))
STATIC_DCL boolean FDECL (iswall_or_stone,(int, int))
STATIC_DCL boolean FDECL (is_solid,(int, int))
STATIC_DCL int FDECL (extend_spine,(int[3][3], int, int, int))
STATIC_DCL boolean FDECL (okay,(int, int, int))
STATIC_DCL void FDECL (maze0xy,(coord *))
STATIC_DCL boolean FDECL (put_lregion_here,(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, BOOLEAN_P, d_level *))
STATIC_DCL void NDECL (fixup_special)
STATIC_DCL void FDECL (move,(int *, int *, int))
STATIC_DCL void NDECL (setup_waterlevel)
STATIC_DCL void NDECL (unsetup_waterlevel)
STATIC_OVL boolean iswall (int x, int y)
STATIC_OVL boolean iswall_or_stone (int x, int y)
STATIC_OVL boolean is_solid (int x, int y)
STATIC_OVL int extend_spine (locale, int wall_there, int dx, int dy)
void wallification (int x1, int y1, int x2, int y2)
void wall_extends (int x1, int y1, int x2, int y2)
STATIC_OVL boolean okay (int x, int y, int dir)
STATIC_OVL void maze0xy (coord *cc)
boolean bad_location (xchar x, xchar y, xchar lx, xchar ly, xchar hx, xchar hy)
void place_lregion (xchar lx, xchar ly, xchar hx, xchar hy, xchar nlx, xchar nly, xchar nhx, xchar nhy, xchar rtype, d_level *lev)
STATIC_OVL boolean put_lregion_here (xchar x, xchar y, xchar nlx, xchar nly, xchar nhx, xchar nhy, xchar rtype, boolean oneshot, d_level *lev)
STATIC_OVL void fixup_special ()
void makemaz (const char *s)
void walkfrom (int x, int y, schar typ)
STATIC_OVL void move (int *x, int *y, int dir)
void mazexy (coord *cc)
void bound_digging ()
void mkportal (xchar x, xchar y, xchar todnum, xchar todlevel)
STATIC_DCL void NDECL (set_wportal)
STATIC_DCL void FDECL (mk_bubble,(int, int, int))
STATIC_DCL void FDECL (mv_bubble,(struct bubble *, int, int, BOOLEAN_P))
void movebubbles ()
void water_friction ()
void save_waterlevel (int fd, int mode)
void restore_waterlevel (int fd)
const char * waterbody_name (xchar x, xchar y)
STATIC_OVL void set_wportal ()
STATIC_OVL void setup_waterlevel ()
STATIC_OVL void unsetup_waterlevel ()
STATIC_OVL void mk_bubble (int x, int y, int n)
STATIC_OVL void mv_bubble (struct bubble *b, int dx, int dy, boolean ini)

Variables

char * lev_message
lev_regionlregions
int num_lregions
char SpLev_Map [COLNO][ROWNO]
static boolean was_waterlevel
static struct bubblebbubbles
static struct bubbleebubbles
static struct trapwportal
static int xmin
static int ymin
static int xmax
static int ymax

Define Documentation

#define bxmax   (xmax - 1)
#define bxmin   (xmin + 1)

Referenced by mv_bubble(), and setup_waterlevel().

#define bymax   (ymax - 1)
#define bymin   (ymin + 1)

Referenced by mv_bubble(), and setup_waterlevel().

#define CONS_HERO   2

Referenced by movebubbles(), and mv_bubble().

#define CONS_MON   1

Referenced by movebubbles(), and mv_bubble().

#define CONS_OBJ   0

Referenced by movebubbles(), and mv_bubble().

#define CONS_TRAP   3

Referenced by movebubbles(), and mv_bubble().

#define INVPOS_DISTANCE   11

Referenced by makemaz().

#define INVPOS_X_MARGIN   (6 - 2)

Referenced by makemaz().

#define INVPOS_Y_MARGIN   (5 - 2)

Referenced by makemaz().

#define register
#define x_maze_min   2
#define y_maze_min   2

Function Documentation

boolean bad_location ( xchar  x,
xchar  y,
xchar  lx,
xchar  ly,
xchar  hx,
xchar  hy 
)

References AIR, CORR, dlevel_t::flags, level, levl, occupied(), ROOM, rm::typ, and within_bounded_area.

Referenced by put_lregion_here().

Here is the call graph for this function:

Here is the caller graph for this function:

void bound_digging (  )

References COLNO, FALSE, dlevel_t::flags, Is_earthlevel, IS_WALL, level, levl, ROWNO, STONE, TRUE, rm::typ, u, you::uz, W_NONDIGGABLE, xmax, xmin, ymax, and ymin.

Referenced by mklev().

Here is the caller graph for this function:

STATIC_OVL int extend_spine ( locale  ,
int  wall_there,
int  dx,
int  dy 
)

Referenced by wall_extends().

Here is the caller graph for this function:

STATIC_DCL int FDECL ( extend_spine  ,
(int[3][3], int, int, int)   
)
STATIC_DCL void FDECL ( mv_bubble  ,
(struct bubble *, int, int, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( move  ,
(int *, int *, int)   
)
STATIC_DCL boolean FDECL ( iswall_or_stone  ,
(int, int)   
)
STATIC_DCL boolean FDECL ( okay  ,
(int, int, int)   
)
STATIC_DCL void FDECL ( maze0xy  ,
(coord *)   
)
STATIC_DCL boolean FDECL ( iswall  ,
(int, int)   
)
STATIC_DCL boolean FDECL ( is_solid  ,
(int, int)   
)
STATIC_DCL boolean FDECL ( put_lregion_here  ,
(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, BOOLEAN_P, d_level *)   
)
STATIC_DCL void FDECL ( mk_bubble  ,
(int, int, int)   
)
STATIC_OVL void fixup_special (  )

References AMULET_OF_ESP, AMULET_OF_LIFE_SAVING, AMULET_OF_REFLECTION, BAG_OF_HOLDING, BURN, CLOAK_OF_DISPLACEMENT, CLOAK_OF_MAGIC_RESISTANCE, obj::corpsenm, create_secret_door(), lev_region::delarea, s_level::dlevel, d_level::dlevel, dndest, dunlev(), engr::engr_txt, engr::engr_type, engr::engr_x, engr::engr_y, FALSE, find_level(), dlevel_t::flags, fmon, goodpos(), head_engr, dest_area::hx, dest_area::hy, In_sokoban, lev_region::inarea, index, Is_branchlev(), Is_knox, Is_medusa_level, is_pool(), Is_sanctum, is_solid(), Is_waterlevel, Is_wiz1_level, LANDMINE, lev_message, level, LR_BRANCH, LR_DOWNSTAIR, LR_DOWNTELE, LR_PORTAL, LR_TELE, LR_UPSTAIR, LR_UPTELE, lregions, mkroom::lx, dest_area::lx, mkroom::ly, dest_area::ly, maketrap(), mk_tt_object(), mkcorpstat(), mkgold(), mksobj_at(), mongone(), mons, MORGUE, MR_STONE, dest_area::nhx, dest_area::nhy, dest_area::nlx, dest_area::nly, monst::nmon, num_lregions, engr::nxt_engr, on_level(), orcus_level, OROOM, otmp, obj::owt, place_lregion(), pline(), pm_resistance, poly_when_stoned(), rn1, rn2(), lev_region::rname, rnd(), rndmonnum(), rooms, mkroom::rtype, lev_region::rtype, search_special(), setup_waterlevel(), somex(), somey(), SPIKED_PIT, STATUE, str_or_len::str, STRANGE_OBJECT, TEMPLE, TRUE, u, unsetup_waterlevel(), updest, you::uz, W_ANY, W_EAST, W_WEST, weight(), lev_region::x1, lev_region::x2, lev_region::y1, and lev_region::y2.

Referenced by makemaz().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean is_solid ( int  x,
int  y 
)

References IS_STWALL, isok(), and levl.

Referenced by fixup_special(), and wallification().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean iswall ( int  x,
int  y 
)

References FALSE, IRONBARS, IS_DOOR, IS_WALL, isok(), levl, and SDOOR.

Referenced by wall_extends().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean iswall_or_stone ( int  x,
int  y 
)

References IRONBARS, IS_DOOR, IS_WALL, isok(), levl, SDOOR, STONE, and TRUE.

Referenced by wall_extends().

Here is the call graph for this function:

Here is the caller graph for this function:

void makemaz ( const char *  s )
STATIC_OVL void maze0xy ( coord cc )

References rn2(), nhcoord::x, x_maze_max, and y_maze_max.

Referenced by makemaz().

Here is the call graph for this function:

Here is the caller graph for this function:

void mazexy ( coord cc )

References CORR, levl, rn2(), ROOM, WALLIFIED_MAZE, nhcoord::x, x_maze_max, and y_maze_max.

Referenced by find_branch_room(), getlev(), makemaz(), mkfount(), and mktrap().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void mk_bubble ( int  x,
int  y,
int  n 
)

References bubble::bm, bxmax, bymax, bubble::cons, bubble::dx, bubble::dy, ebubbles, mv_bubble(), bubble::next, bubble::prev, rn2(), SIZE, TRUE, bubble::x, and bubble::y.

Referenced by setup_waterlevel().

Here is the call graph for this function:

Here is the caller graph for this function:

void mkportal ( xchar  x,
xchar  y,
xchar  todnum,
xchar  todlevel 
)

References d_level::dlevel, d_level::dnum, trap::dst, dungeons, MAGIC_PORTAL, maketrap(), and pline().

Referenced by place_branch(), and put_lregion_here().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void move ( int *  x,
int *  y,
int  dir 
)

Referenced by okay(), and walkfrom().

Here is the caller graph for this function:

void movebubbles (  )
STATIC_OVL void mv_bubble ( struct bubble b,
int  dx,
int  dy,
boolean  ini 
)
STATIC_DCL void NDECL ( set_wportal   )
STATIC_DCL void NDECL ( setup_waterlevel   )
STATIC_DCL void NDECL ( unsetup_waterlevel   )
STATIC_DCL void NDECL ( fixup_special   )
STATIC_OVL boolean okay ( int  x,
int  y,
int  dir 
)

References FALSE, levl, move(), TRUE, rm::typ, x_maze_max, and y_maze_max.

Referenced by walkfrom().

Here is the call graph for this function:

Here is the caller graph for this function:

void place_lregion ( xchar  lx,
xchar  ly,
xchar  hx,
xchar  hy,
xchar  nlx,
xchar  nly,
xchar  nhx,
xchar  nhy,
xchar  rtype,
d_level lev 
)

References COLNO, Is_branchlev(), LR_BRANCH, nroom, place_branch(), put_lregion_here(), rn1, ROWNO, TRUE, u, and you::uz.

Referenced by fixup_special(), and goto_level().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean put_lregion_here ( xchar  x,
xchar  y,
xchar  nlx,
xchar  nly,
xchar  nhx,
xchar  nhy,
xchar  rtype,
boolean  oneshot,
d_level lev 
)

References bad_location(), deltrap(), d_level::dlevel, d_level::dnum, FALSE, Is_branchlev(), LR_BRANCH, LR_DOWNSTAIR, LR_DOWNTELE, LR_PORTAL, LR_TELE, LR_UPSTAIR, LR_UPTELE, m_at, MAGIC_PORTAL, mkportal(), mkstairs(), MON_AT, place_branch(), rloc(), t_at(), TRUE, u, u_on_newpos(), and you::uz.

Referenced by place_lregion().

Here is the call graph for this function:

Here is the caller graph for this function:

void restore_waterlevel ( int  fd )

References Is_waterlevel, mread(), mv_bubble(), bubble::next, bubble::prev, set_wportal(), TRUE, u, and you::uz.

Referenced by restgamestate().

Here is the call graph for this function:

Here is the caller graph for this function:

void save_waterlevel ( int  fd,
int  mode 
)

References bwrite(), Is_waterlevel, bubble::next, perform_bwrite, release_data, u, unsetup_waterlevel(), and you::uz.

Referenced by savegamestate().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void set_wportal (  )

References ftrap, MAGIC_PORTAL, trap::ntrap, and wportal.

Referenced by movebubbles(), and restore_waterlevel().

Here is the caller graph for this function:

STATIC_OVL void setup_waterlevel (  )

References bxmax, bxmin, bymax, bymin, cmap_to_glyph, rm::glyph, levl, mk_bubble(), rn2(), S_water, xmax, and ymax.

Referenced by fixup_special().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void unsetup_waterlevel (  )

References bubble::next.

Referenced by fixup_special(), and save_waterlevel().

Here is the caller graph for this function:

void walkfrom ( int  x,
int  y,
schar  typ 
)

References CORR, IS_DOOR, levl, move(), okay(), rn2(), ROOM, and SpLev_Map.

Referenced by makemaz(), and spo_mazewalk().

Here is the call graph for this function:

Here is the caller graph for this function:

void wall_extends ( int  x1,
int  y1,
int  x2,
int  y2 
)

References BLCORNER, BRCORNER, COLNO, CROSSWALL, DBWALL, extend_spine(), HWALL, IS_WALL, iswall(), iswall_or_stone(), levl, ROWNO, TDWALL, TLCORNER, TLWALL, TRCORNER, TRWALL, TUWALL, rm::typ, and VWALL.

Referenced by flip_level(), and wallification().

Here is the call graph for this function:

Here is the caller graph for this function:

void wallification ( int  x1,
int  y1,
int  x2,
int  y2 
)

References COLNO, DBWALL, is_solid(), IS_WALL, levl, ROWNO, STONE, rm::typ, and wall_extends().

Referenced by do_room_or_subroom(), makemaz(), and sp_level_coder().

Here is the call graph for this function:

Here is the caller graph for this function:

void water_friction (  )

References you::dx, you::dy, FALSE, is_pool(), isok(), pline(), rn2(), Swimming, TRUE, u, you::ux, you::uy, container::x, and container::y.

Referenced by domove().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* waterbody_name ( xchar  x,
xchar  y 
)

References DB_ICE, DB_MOAT, DB_UNDER, DRAWBRIDGE_UP, drawbridgemask, ICE, Is_juiblex_level, is_lava(), Is_medusa_level, Is_waterlevel, isok(), levl, POOL, rm::typ, u, you::uz, and WATER.

Referenced by boulder_hits_pool(), and dodip().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

struct bubble* bbubbles [static]
struct bubble * ebubbles

Referenced by mk_bubble().

char* lev_message

Referenced by fixup_special().

Referenced by fixup_special(), and spo_levregion().

Referenced by fixup_special(), and flip_level().

char SpLev_Map[COLNO][ROWNO]

Referenced by sp_level_coder(), and walkfrom().

struct trap* wportal [static]

Referenced by set_wportal().

int xmax
int xmin [static]
int ymax
int ymin