File src/mkmaze.c


Included Files


Preprocessor definitions

#define x_maze_min 2

#define y_maze_min 2

#define INVPOS_X_MARGIN

#define INVPOS_Y_MARGIN

#define INVPOS_DISTANCE 11

#define register

#define CONS_OBJ 0

#define CONS_MON 1

#define CONS_HERO 2

#define CONS_TRAP 3

#define bxmin

#define bymin

#define bxmax

#define bymax


Type struct container

struct container
struct container 
   { 
     struct container* next; 
     xchar x; 
     xchar y; 
     short what; 
     genericptr_t list; 
   } 

Type struct bubble

struct bubble
struct bubble 
   { 
     xchar x; 
     xchar y; 
     schar dx; 
     schar dy; 
     uchar* bm; 
     struct bubble* prev; 
     struct bubble* next; 
     struct container* cons; 
   } 

External Variables

lev_message
extern char* lev_message

lregions
extern lev_region* lregions

num_lregions
extern int num_lregions


Local Variables

was_waterlevel
static boolean was_waterlevel
Used in: fixup_special()
  restore_waterlevel()

bbubbles
static struct bubble* bbubbles
Used in: mk_bubble()
  movebubbles()
  restore_waterlevel()
  save_waterlevel()
  unsetup_waterlevel()

ebubbles
static struct bubble* ebubbles
Used in: mk_bubble()
  movebubbles()
  restore_waterlevel()
  unsetup_waterlevel()

wportal
static struct trap* wportal
Used in: movebubbles()
  set_wportal()

xmin
static int xmin
Used in: mv_bubble()
  restore_waterlevel()
  save_waterlevel()
  setup_waterlevel()

ymin
static int ymin
Used in: mv_bubble()
  restore_waterlevel()
  save_waterlevel()
  setup_waterlevel()

xmax
static int xmax
Used in: mk_bubble()
  mv_bubble()
  restore_waterlevel()
  save_waterlevel()
  setup_waterlevel()

ymax
static int ymax
Used in: mk_bubble()
  mv_bubble()
  restore_waterlevel()
  save_waterlevel()
  setup_waterlevel()


Global Function bad_location()

boolean bad_location ( xchar x, xchar y, xchar lx, xchar ly, xchar hx, xchar hy )
Prototyped in: include/extern.h
Calls: occupied()src/mklev.c
Called by: put_lregion_here()src/mkmaze.c
References Variables: levelsrc/decl.c

Global Function bound_digging()

void bound_digging ( void )
Prototyped in: include/extern.h
Calls: on_level()src/dungeon.c
Called by: mklev()src/mklev.c
References Variables: dungeon_topologysrc/decl.c
  levelsrc/decl.c
  usrc/decl.c

Global Function makemaz()

void makemaz ( const char* s )
Prototyped in: include/extern.h
Calls: Invocation_lev()src/dungeon.c
  Is_branchlev()src/dungeon.c
  Is_special()src/dungeon.c
  distmin()src/hacklib.c
  dunlev()src/dungeon.c
  dunlevs_in_dungeon()src/dungeon.c
  fixup_special()src/mkmaze.c
  makemon()src/makemon.c
  maze0xy()src/mkmaze.c
  mazexy()src/mkmaze.c
  mkstairs()src/mklev.c
  mktrap()src/mklev.c
  occupied()src/mklev.c
  place_branch()src/mklev.c
  walkfrom()src/mkmaze.c
  wallification()src/mkmaze.c
  abs(), dmonsfree(), impossible(), load_special(), mkgold(), mkobj_at(), mksobj_at(), rn2(), rnd(), sprintf(), strcat(), strcpy()
Called by: makelevel()src/mklev.c
References Variables: dungeonssrc/decl.c
  inv_possrc/decl.c
  levelsrc/decl.c
  usrc/decl.c
  upstairsrc/decl.c
  x_maze_maxsrc/decl.c
  y_maze_maxsrc/decl.c
  mons

Global Function mazexy()

void mazexy ( coord* cc )
Prototyped in: include/extern.h
Calls: panic()src/end.c
  rn2()
Called by: find_branch_room()src/mklev.c
  makemaz()src/mkmaze.c
  mkfount()src/mklev.c
  mktrap()src/mklev.c
References Variables: levelsrc/decl.c
  x_maze_maxsrc/decl.c
  y_maze_maxsrc/decl.c

Global Function mkportal()

void mkportal ( xchar x, xchar y, xchar todnum, xchar todlevel )
Prototyped in: include/extern.h
Calls: impossible(), maketrap()
Called by: place_branch()src/mklev.c
  put_lregion_here()src/mkmaze.c

Global Function movebubbles()

void movebubbles ( void )
Prototyped in: include/extern.h
Calls: alloc()src/alloc.c
  isok()src/cmd.c
  mv_bubble()src/mkmaze.c
  newsym()src/display.c
  panic()src/end.c
  placebc()src/ball.c
  set_wportal()src/mkmaze.c
  unplacebc()src/ball.c
  block_point(), impossible(), remove_object(), remove_worm(), rn2(), t_at(), vision_recalc()
Called by: goto_level()src/do.c
  moveloop()src/allmain.c
References Variables: bbubblessrc/mkmaze.c
  ebubblessrc/mkmaze.c
  levelsrc/decl.c
  usrc/decl.c
  uballsrc/decl.c
  vision_full_recalcsrc/decl.c
  wportalsrc/mkmaze.c

Global Function place_lregion()

void place_lregion ( xchar lx, xchar ly, xchar hx, xchar hy, xchar nlx, xchar nly, xchar nhx, xchar nhy, xchar rtype, d_level* lev )
Prototyped in: include/extern.h
Calls: Is_branchlev()src/dungeon.c
  place_branch()src/mklev.c
  put_lregion_here()src/mkmaze.c
  impossible(), rn2()
Called by: fixup_special()src/mkmaze.c
  goto_level()src/do.c
References Variables: nroomsrc/decl.c
  usrc/decl.c

Global Function restore_waterlevel()

void restore_waterlevel ( int fd )
Prototyped in: include/extern.h
Calls: alloc()src/alloc.c
  mv_bubble()src/mkmaze.c
  on_level()src/dungeon.c
  set_wportal()src/mkmaze.c
  mread()
References Variables: bbubblessrc/mkmaze.c
  dungeon_topologysrc/decl.c
  ebubblessrc/mkmaze.c
  usrc/decl.c
  was_waterlevelsrc/mkmaze.c
  xmaxsrc/mkmaze.c
  xminsrc/mkmaze.c
  ymaxsrc/mkmaze.c
  yminsrc/mkmaze.c

Global Function save_waterlevel()

void save_waterlevel ( int fd, int mode )
Prototyped in: include/extern.h
Calls: on_level()src/dungeon.c
  unsetup_waterlevel()src/mkmaze.c
  bwrite()
References Variables: bbubblessrc/mkmaze.c
  dungeon_topologysrc/decl.c
  usrc/decl.c
  xmaxsrc/mkmaze.c
  xminsrc/mkmaze.c
  ymaxsrc/mkmaze.c
  yminsrc/mkmaze.c

Global Function walkfrom()

void walkfrom ( int x, int y )
Prototyped in: include/extern.h
Calls: move()src/mkmaze.c
  okay()src/mkmaze.c
  walkfrom()src/mkmaze.c
  rn2()
Called by: makemaz()src/mkmaze.c
  walkfrom()src/mkmaze.c
References Variables: levelsrc/decl.c

Global Function wallification()

void wallification ( int x1, int y1, int x2, int y2 )
Prototyped in: include/extern.h
Calls: extend_spine()src/mkmaze.c
  is_solid()src/mkmaze.c
  iswall()src/mkmaze.c
  iswall_or_stone()src/mkmaze.c
  panic()src/end.c
Called by: do_room_or_subroom()src/mklev.c
  makemaz()src/mkmaze.c
References Variables: levelsrc/decl.c

Global Function water_friction()

void water_friction ( void )
Prototyped in: include/extern.h
Calls: is_pool()src/dbridge.c
  isok()src/cmd.c
  pline(), rn2()
Called by: domove()src/hack.c
References Variables: usrc/decl.c
  youmonstsrc/decl.c

Local Function extend_spine()

static int extend_spine ( int locale[3][3], int wall_there, int dx, int dy )
Prototyped in: src/mkmaze.c
Called by: wallification()src/mkmaze.c

Local Function fixup_special()

static void fixup_special ( void )
Prototyped in: src/mkmaze.c
Calls: In_quest()src/dungeon.c
  Is_branchlev()src/dungeon.c
  find_level()src/dungeon.c
  is_pool()src/dbridge.c
  on_level()src/dungeon.c
  place_lregion()src/mkmaze.c
  setup_waterlevel()src/mkmaze.c
  sokoban_detect()src/detect.c
  unsetup_waterlevel()src/mkmaze.c
  atoi(), create_secret_door(), free(), goodpos(), maketrap(), mk_tt_object(), mkcorpstat(), mkgold(), mongone(), pline(), poly_when_stoned(), rn2(), rnd(), rndmonnum(), search_special(), somex(), somey(), strchr(), weight()
Called by: makemaz()src/mkmaze.c
References Variables: dndestsrc/decl.c
  dungeon_topologysrc/decl.c
  levelsrc/decl.c
  roomssrc/decl.c
  usrc/decl.c
  updestsrc/decl.c
  was_waterlevelsrc/mkmaze.c
  lev_message, lregions, mons, num_lregions, urole

Local Function is_solid()

static boolean is_solid ( int x, int y )
Prototyped in: src/mkmaze.c
Calls: isok()src/cmd.c
Called by: wallification()src/mkmaze.c
References Variables: levelsrc/decl.c

Local Function iswall()

static boolean iswall ( int x, int y )
Prototyped in: src/mkmaze.c
Calls: isok()src/cmd.c
Called by: wallification()src/mkmaze.c
References Variables: levelsrc/decl.c

Local Function iswall_or_stone()

static boolean iswall_or_stone ( int x, int y )
Prototyped in: src/mkmaze.c
Calls: isok()src/cmd.c
Called by: wallification()src/mkmaze.c
References Variables: levelsrc/decl.c

Local Function maze0xy()

static void maze0xy ( coord* cc )
Prototyped in: src/mkmaze.c
Calls: rn2()
Called by: makemaz()src/mkmaze.c
References Variables: x_maze_maxsrc/decl.c
  y_maze_maxsrc/decl.c

Local Function mk_bubble()

static void mk_bubble ( int x, int y, int n )
Prototyped in: src/mkmaze.c
Calls: alloc()src/alloc.c
  mv_bubble()src/mkmaze.c
  impossible(), rn2()
Called by: setup_waterlevel()src/mkmaze.c
References Variables: bbubblessrc/mkmaze.c
  ebubblessrc/mkmaze.c
  xmaxsrc/mkmaze.c
  ymaxsrc/mkmaze.c

Local Function move()

static void move ( int* x, int* y, int dir )
Prototyped in: src/mkmaze.c
Calls: panic()src/end.c
Called by: okay()src/mkmaze.c
  walkfrom()src/mkmaze.c

Local Function mv_bubble()

static void mv_bubble ( struct bubble* b, int dx, int dy, boolean ini )
Prototyped in: src/mkmaze.c
Calls: newsym()src/display.c
  sgn()src/hacklib.c
  free(), impossible(), mnearto(), mnexto(), place_object(), pline(), rn2(), unblock_point()
Called by: mk_bubble()src/mkmaze.c
  movebubbles()src/mkmaze.c
  restore_waterlevel()src/mkmaze.c
References Variables: levelsrc/decl.c
  usrc/decl.c
  xmaxsrc/mkmaze.c
  xminsrc/mkmaze.c
  ymaxsrc/mkmaze.c
  yminsrc/mkmaze.c

Local Function okay()

static boolean okay ( int x, int y, int dir )
Prototyped in: src/mkmaze.c
Calls: move()src/mkmaze.c
Called by: walkfrom()src/mkmaze.c
References Variables: levelsrc/decl.c
  x_maze_maxsrc/decl.c
  y_maze_maxsrc/decl.c

Local Function put_lregion_here()

static boolean put_lregion_here ( xchar x, xchar y, xchar nlx, xchar nly, xchar nhx, xchar nhy, xchar rtype, boolean oneshot, d_level* lev )
Prototyped in: src/mkmaze.c
Calls: Is_branchlev()src/dungeon.c
  bad_location()src/mkmaze.c
  mkportal()src/mkmaze.c
  mkstairs()src/mklev.c
  place_branch()src/mklev.c
  u_on_newpos()src/dungeon.c
  deltrap(), rloc(), t_at()
Called by: place_lregion()src/mkmaze.c
References Variables: levelsrc/decl.c
  usrc/decl.c

Local Function set_wportal()

static void set_wportal ( void )
Prototyped in: src/mkmaze.c
Calls: impossible()
Called by: movebubbles()src/mkmaze.c
  restore_waterlevel()src/mkmaze.c
References Variables: ftrapsrc/decl.c
  wportalsrc/mkmaze.c

Local Function setup_waterlevel()

static void setup_waterlevel ( void )
Prototyped in: src/mkmaze.c
Calls: mk_bubble()src/mkmaze.c
  rn2()
Called by: fixup_special()src/mkmaze.c
References Variables: levelsrc/decl.c
  xmaxsrc/mkmaze.c
  xminsrc/mkmaze.c
  ymaxsrc/mkmaze.c
  yminsrc/mkmaze.c

Local Function unsetup_waterlevel()

static void unsetup_waterlevel ( void )
Prototyped in: src/mkmaze.c
Calls: free()
Called by: fixup_special()src/mkmaze.c
  save_waterlevel()src/mkmaze.c
References Variables: bbubblessrc/mkmaze.c
  ebubblessrc/mkmaze.c