Defines | Functions | Variables

mklev.c File Reference

#include "hack.h"
Include dependency graph for mklev.c:

Defines

#define create_vault()   create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE)
#define init_vault()   vault_x = -1
#define do_vault()   (vault_x != -1)
#define x_maze_min   2
#define y_maze_min   2

Functions

STATIC_DCL void FDECL (mkfount,(int, struct mkroom *))
STATIC_DCL void FDECL (mkaltar,(struct mkroom *))
STATIC_DCL void FDECL (mkgrave,(struct mkroom *))
STATIC_DCL void NDECL (makevtele)
STATIC_DCL void NDECL (clear_level_structures)
STATIC_DCL void NDECL (makelevel)
STATIC_DCL void NDECL (mineralize)
STATIC_DCL boolean FDECL (bydoor,(XCHAR_P, XCHAR_P))
STATIC_DCL struct mkroomFDECL (find_branch_room,(coord *))
STATIC_DCL struct mkroomFDECL (pos_to_room,(XCHAR_P, XCHAR_P))
STATIC_DCL boolean FDECL (place_niche,(struct mkroom *, int *, int *, int *))
STATIC_DCL void FDECL (makeniche,(int))
STATIC_DCL void NDECL (make_niches)
STATIC_PTR int FDECL (CFDECLSPEC do_comp,(const genericptr, const genericptr))
STATIC_DCL void FDECL (dosdoor,(XCHAR_P, XCHAR_P, struct mkroom *, int))
STATIC_DCL void FDECL (join,(int, int, BOOLEAN_P))
STATIC_DCL void FDECL (do_room_or_subroom,(struct mkroom *, int, int, int, int, BOOLEAN_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P))
STATIC_DCL void NDECL (makerooms)
STATIC_DCL void FDECL (finddpos,(coord *, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P))
STATIC_DCL void FDECL (mkinvpos,(XCHAR_P, XCHAR_P, int))
STATIC_DCL void FDECL (mk_knox_portal,(XCHAR_P, XCHAR_P))
STATIC_DCL void NDECL (place_random_engravings)
STATIC_PTR int CFDECLSPEC do_comp (genericptr vx, const genericptr vy) const
STATIC_OVL void finddpos (coord *cc, xchar xl, xchar yl, xchar xh, xchar yh)
void sort_rooms ()
STATIC_OVL void do_room_or_subroom (struct mkroom *croom, int lowx, int lowy, int hix, int hiy, boolean lit, schar rtype, boolean special, boolean is_room)
void add_room (int lowx, int lowy, int hix, int hiy, boolean lit, schar rtype, boolean special)
void add_subroom (struct mkroom *proom, int lowx, int lowy, int hix, int hiy, boolean lit, schar rtype, boolean special)
void mk_split_room ()
STATIC_OVL void makerooms ()
STATIC_OVL void join (int a, int b, boolean nxcor)
void makecorridors (int style)
void add_door (int x, int y, struct mkroom *aroom)
STATIC_OVL void dosdoor (xchar x, xchar y, struct mkroom *aroom, int type)
STATIC_OVL boolean place_niche (struct mkroom *aroom, int *dy, int *xx, int *yy)
STATIC_OVL void makeniche (int trap_type)
void make_ironbarwalls (int chance)
STATIC_OVL void make_niches ()
STATIC_OVL void makevtele ()
STATIC_OVL void clear_level_structures ()
STATIC_OVL void makelevel ()
STATIC_OVL void mineralize ()
void wallwalk_right (xchar x, xchar y, schar fgtyp, schar fglit, schar bgtyp, int chance)
void mkpoolroom ()
void mklev ()
void topologize (struct mkroom *croom)
STATIC_OVL struct mkroomfind_branch_room (coord *mp)
STATIC_OVL struct mkroompos_to_room (xchar x, xchar y)
void place_branch (branch *br, xchar x, xchar y)
STATIC_OVL boolean bydoor (xchar x, xchar y)
int okdoor (xchar x, xchar y)
void dodoor (int x, int y, struct mkroom *aroom)
boolean occupied (xchar x, xchar y)
void mktrap (int num, int mazeflag, struct mkroom *croom, coord *tm)
void mkstairs (xchar x, xchar y, char up, struct mkroom *croom)
STATIC_OVL void mkfount (int mazeflag, struct mkroom *croom)
STATIC_OVL void mkaltar (struct mkroom *croom)
static void mkgrave (struct mkroom *croom)
void mkinvokearea ()
STATIC_OVL void mkinvpos (xchar x, xchar y, int dist)
STATIC_OVL void mk_knox_portal (xchar x, xchar y)
void place_random_engraving (engravings, const int size) const
void place_random_engravings ()

Variables

static xchar vault_x
static xchar vault_y
boolean goldseen
static boolean made_branch
static NEARDATA const char * trap_engravings [TRAPNUM]
static const char *const illuminati_engravings []
static const char *const hhgtg_engravings []

Define Documentation

#define create_vault (  )    create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE)

Referenced by makelevel(), and makerooms().

#define do_vault (  )    (vault_x != -1)

Referenced by makelevel().

#define init_vault (  )    vault_x = -1

Referenced by clear_level_structures().

#define x_maze_min   2

Referenced by makemaz(), and mkinvpos().

#define y_maze_min   2

Referenced by makemaz(), and mkinvpos().


Function Documentation

void add_door ( int  x,
int  y,
struct mkroom aroom 
)

References mkroom::doorct, doorindex, doors, mkroom::fdoor, mkroom::hx, nhcoord::x, and nhcoord::y.

Referenced by create_door(), create_secret_door(), dosdoor(), and sel_set_door().

Here is the caller graph for this function:

void add_room ( int  lowx,
int  lowy,
int  hix,
int  hiy,
boolean  lit,
schar  rtype,
boolean  special 
)

References do_room_or_subroom(), mkroom::hx, nroom, rooms, and TRUE.

Referenced by create_room(), join_map(), makelevel(), mk_split_room(), and spo_region().

Here is the call graph for this function:

Here is the caller graph for this function:

void add_subroom ( struct mkroom proom,
int  lowx,
int  lowy,
int  hix,
int  hiy,
boolean  lit,
schar  rtype,
boolean  special 
)

References do_room_or_subroom(), FALSE, mkroom::hx, nsubroom, and subrooms.

Referenced by create_subroom().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean bydoor ( xchar  x,
xchar  y 
)

References FALSE, IS_DOOR, isok(), levl, SDOOR, and TRUE.

Referenced by mkaltar(), mkfount(), mkgrave(), okdoor(), and wallwalk_right().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void clear_level_structures (  )
STATIC_PTR int CFDECLSPEC do_comp ( genericptr  vx,
const genericptr  vy 
) const

References mkroom::lx.

STATIC_OVL void do_room_or_subroom ( struct mkroom croom,
int  lowx,
int  lowy,
int  hix,
int  hiy,
boolean  lit,
schar  rtype,
boolean  special,
boolean  is_room 
)

References BLCORNER, BRCORNER, COLNO, doorindex, FALSE, HWALL, levl, max, ROOM, ROWNO, TLCORNER, TRCORNER, VWALL, and wallification().

Referenced by add_room(), and add_subroom().

Here is the call graph for this function:

Here is the caller graph for this function:

void dodoor ( int  x,
int  y,
struct mkroom aroom 
)

References DOOR, doorindex, DOORMAX, dosdoor(), rn2(), and SDOOR.

Referenced by join().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void dosdoor ( xchar  x,
xchar  y,
struct mkroom aroom,
int  type 
)

References add_door(), D_CLOSED, D_ISOPEN, D_LOCKED, D_NODOOR, D_TRAPPED, DOOR, doormask, FALSE, G_GONE, in_rooms(), IS_WALL, level_difficulty(), levl, makemon(), mkclass(), mvitals::mvflags, NO_MM_FLAGS, PM_GIANT_MIMIC, PM_LARGE_MIMIC, PM_SMALL_MIMIC, rn2(), S_MIMIC, set_mimic_sym(), SHOPBASE, and TRUE.

Referenced by dodoor(), and makeniche().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL void FDECL ( mkfount  ,
(int, struct mkroom *)   
)
STATIC_DCL void FDECL ( join  ,
(int, int, BOOLEAN_P)   
)
STATIC_DCL boolean FDECL ( bydoor  ,
(XCHAR_P, XCHAR_P)   
)
STATIC_DCL void FDECL ( do_room_or_subroom  ,
(struct mkroom *, int, int, int, int, BOOLEAN_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P)   
)
STATIC_DCL struct mkroom* FDECL ( find_branch_room  ,
(coord *)   
) [read]
STATIC_DCL void FDECL ( finddpos  ,
(coord *, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)   
)
STATIC_DCL void FDECL ( mkaltar  ,
(struct mkroom *)   
)
STATIC_DCL void FDECL ( mkinvpos  ,
(XCHAR_P, XCHAR_P, int)   
)
STATIC_DCL void FDECL ( mk_knox_portal  ,
(XCHAR_P, XCHAR_P)   
)
STATIC_DCL struct mkroom* FDECL ( pos_to_room  ,
(XCHAR_P, XCHAR_P)   
) [read]
STATIC_DCL boolean FDECL ( place_niche  ,
(struct mkroom *, int *, int *, int *)   
)
STATIC_DCL void FDECL ( mkgrave  ,
(struct mkroom *)   
)
STATIC_DCL void FDECL ( makeniche  ,
(int)   
)
STATIC_PTR int FDECL ( CFDECLSPEC  do_comp,
(const genericptr, const genericptr)   
)
STATIC_DCL void FDECL ( dosdoor  ,
(XCHAR_P, XCHAR_P, struct mkroom *, int)   
)
STATIC_OVL struct mkroom* find_branch_room ( coord mp ) [read]

References CORR, dnstairs_room, levl, mazexy(), nroom, occupied(), OROOM, rn2(), ROOM, rooms, mkroom::rtype, somexy(), and upstairs_room.

Referenced by place_branch().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void finddpos ( coord cc,
xchar  xl,
xchar  yl,
xchar  xh,
xchar  yh 
)

References IS_DOOR, levl, okdoor(), rn2(), SDOOR, and nhcoord::x.

Referenced by join(), and place_niche().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void join ( int  a,
int  b,
boolean  nxcor 
)

References CORR, dig_corridor(), dodoor(), doorindex, DOORMAX, finddpos(), dlevel_t::flags, mkroom::hx, mkroom::hy, level, levl, mkroom::lx, mkroom::ly, okdoor(), ROOM, rooms, smeq, STONE, nhcoord::x, and nhcoord::y.

Referenced by makecorridors(), and mkmap().

Here is the call graph for this function:

Here is the caller graph for this function:

void make_ironbarwalls ( int  chance )

References COLNO, HWALL, IRONBARS, IS_WALL, levl, rn2(), ROWNO, SPACE_POS, VWALL, trap::x, and trap::y.

Referenced by makelevel().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void make_niches (  )

References depth(), FALSE, dlevel_t::flags, level, LEVEL_TELEP, makeniche(), NO_TRAP, nroom, rn2(), rnd(), TRAPDOOR, u, and you::uz.

Referenced by makelevel().

Here is the call graph for this function:

Here is the caller graph for this function:

void makecorridors ( int  style )

References mkroom::doorct, FALSE, join(), nroom, rn2(), rooms, smeq, and TRUE.

Referenced by create_corridor(), and makelevel().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void makelevel (  )
STATIC_OVL void makeniche ( int  trap_type )
STATIC_OVL void makerooms (  )

References create_room(), create_vault, FALSE, mkroom::hx, mkroom::lx, mkroom::ly, MAXNROFROOMS, nroom, OROOM, rn2(), rnd_rect(), rooms, and TRUE.

Referenced by makelevel().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void makevtele (  )

References makeniche(), and TELEP_TRAP.

Referenced by makelevel().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void mineralize (  )
STATIC_OVL void mk_knox_portal ( xchar  x,
xchar  y 
)

References at_dgn_entrance(), depth(), d_level::dnum, dungeon_branch(), branch::end1, branch::end2, insert_branch(), Is_branchlev(), knox_level, medusa_level, n_dgns, on_level(), oracle_level, place_branch(), pline(), rn2(), TRUE, u, you::uz, wizard, and WIZARD.

Referenced by makelevel().

Here is the call graph for this function:

Here is the caller graph for this function:

void mk_split_room (  )
STATIC_OVL void mkaltar ( struct mkroom croom )

References A_LAWFUL, Align2amask, ALTAR, bydoor(), levl, m, occupied(), OROOM, rn2(), somexy(), nhcoord::x, and nhcoord::y.

Referenced by makelevel().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void mkfount ( int  mazeflag,
struct mkroom croom 
)

References bydoor(), dlevel_t::flags, FOUNTAIN, level, levl, m, mazexy(), levelflags::nfountains, occupied(), rn2(), somexy(), nhcoord::x, and nhcoord::y.

Referenced by makelevel().

Here is the call graph for this function:

Here is the caller graph for this function:

static void mkgrave ( struct mkroom croom ) [static]

References add_to_buried(), BELL, bydoor(), curse(), FALSE, m, make_grave(), mkgold(), mkobj(), mksobj_at(), occupied(), OROOM, otmp, obj::ox, obj::oy, RANDOM_CLASS, rn2(), somexy(), TRUE, nhcoord::x, and nhcoord::y.

Referenced by makelevel().

Here is the call graph for this function:

Here is the caller graph for this function:

void mkinvokearea (  )

References delay_output, display_nhwindow, flush_screen(), inv_pos, mkinvpos(), mkstairs(), newsym(), TRUE, u, you::ux, you::uy, vision_full_recalc, WIN_MESSAGE, nhcoord::x, xmax, xmin, nhcoord::y, ymax, and ymin.

Referenced by deadbook().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void mkinvpos ( xchar  x,
xchar  y,
int  dist 
)
void mklev (  )

References bound_digging(), FALSE, dlevel_t::flags, getbones(), in_mklev, init_mapseen(), level, makelevel(), mineralize(), nroom, place_random_engravings(), rooms, set_wall_state(), topologize(), TRUE, u, and you::uz.

Referenced by goto_level(), and newgame().

Here is the call graph for this function:

Here is the caller graph for this function:

void mkpoolroom (  )

References mkroom::hx, mkroom::hy, LAVAPOOL, mkroom::lx, mkroom::ly, pick_room(), POOL, POOLROOM, mkroom::rlit, rn2(), ROOM, mkroom::rtype, TRUE, and wallwalk_right().

Referenced by mkroom(), and mkshop().

Here is the call graph for this function:

Here is the caller graph for this function:

void mkstairs ( xchar  x,
xchar  y,
char  up,
struct mkroom croom 
)

References dnstairs_room, dunlev(), dunlevs_in_dungeon(), LA_DOWN, LA_UP, levl, STAIRS, u, upstairs_room, you::uz, xdnstair, xupstair, ydnstair, and yupstair.

Referenced by create_stairs(), makelevel(), makemaz(), mkinvokearea(), put_lregion_here(), and spo_stair().

Here is the call graph for this function:

Here is the caller graph for this function:

void mktrap ( int  num,
int  mazeflag,
struct mkroom croom,
coord tm 
)
STATIC_DCL void NDECL ( make_niches   )
STATIC_DCL void NDECL ( mineralize   )
STATIC_DCL void NDECL ( makerooms   )
STATIC_DCL void NDECL ( clear_level_structures   )
STATIC_DCL void NDECL ( place_random_engravings   )
STATIC_DCL void NDECL ( makelevel   )
STATIC_DCL void NDECL ( makevtele   )
boolean occupied ( xchar  x,
xchar  y 
)

References invocation_pos(), IS_FURNITURE, is_lava(), is_pool(), levl, and t_at().

Referenced by bad_location(), fill_zoo(), find_branch_room(), goto_level(), makelevel(), makemaz(), mkaltar(), mkfount(), mkgrave(), mktrap(), and place_random_engraving().

Here is the call graph for this function:

Here is the caller graph for this function:

int okdoor ( xchar  x,
xchar  y 
)

References bydoor(), doorindex, DOORMAX, HWALL, levl, and VWALL.

Referenced by create_door(), create_secret_door(), finddpos(), and join().

Here is the call graph for this function:

Here is the caller graph for this function:

void place_branch ( branch br,
xchar  x,
xchar  y 
)
STATIC_OVL boolean place_niche ( struct mkroom aroom,
int *  dy,
int *  xx,
int *  yy 
)

References finddpos(), IS_FURNITURE, IS_POOL, isok(), levl, rn2(), STONE, nhcoord::x, and nhcoord::y.

Referenced by makeniche().

Here is the call graph for this function:

Here is the caller graph for this function:

void place_random_engraving ( engravings  ,
const int  size 
) const

References BURN, COLNO, Inhell, make_engr_at(), nroom, occupied(), rn2(), rooms, ROWNO, somex(), and somey().

Referenced by place_random_engravings().

Here is the call graph for this function:

Here is the caller graph for this function:

void place_random_engravings (  )

References depth(), place_random_engraving(), SIZE, u, and you::uz.

Referenced by mklev().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL struct mkroom* pos_to_room ( xchar  x,
xchar  y 
) [read]

References inside_room(), nroom, and rooms.

Referenced by place_branch().

Here is the call graph for this function:

Here is the caller graph for this function:

void sort_rooms (  )

References nroom, and rooms.

Referenced by makelevel().

Here is the caller graph for this function:

void topologize ( struct mkroom croom )

References Is_rogue_level, levl, NO_ROOM, mkroom::nsubrooms, OROOM, ROOMOFFSET, rooms, mkroom::rtype, SHARED, TRUE, u, and you::uz.

Referenced by build_room(), mk_split_room(), mklev(), mkshop(), and spo_region().

Here is the caller graph for this function:

void wallwalk_right ( xchar  x,
xchar  y,
schar  fgtyp,
schar  fglit,
schar  bgtyp,
int  chance 
)

References bydoor(), isok(), levl, rn2(), SET_TYPLIT, and t_at().

Referenced by mkpoolroom(), and spo_wallwalk().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const char* const hhgtg_engravings[] [static]
Initial value:
 {
        "Beeblebrox for President!",
        "Don't Panic",
        "Got your towel?",
        "Time is an illusion. Lunchtime doubly so.",
        "Oh no, not again.",
        "Resistance is useless!",
        "Slartibartfast was here!",
        "So long, and thanks for all the fish",
        "Visit Milliways, the Restaurant at the End of the Universe!",
        "We apologize for the inconvenience",
}
const char* const illuminati_engravings[] [static]
Initial value:
 {
        "Ewige Blumenkraft!", 
        "Ewige Blumenkraft Und Ewige Schlangenkraft", 
        "fnord", 
        "FUCKUP calculates your odds of ascending as negligibly small",
        "Hail Eris!",
        "Jeder Gedanke ist verschenkt, wenn Adam Weishaupt fuer dich denkt", 
        "Novus Ordo Seclorum",
        "Think for yourself, schmuck",
}
boolean made_branch [static]
NEARDATA const char* trap_engravings[TRAPNUM] [static]
Initial value:
 {
                        (char *)0, (char *)0, (char *)0, (char *)0, (char *)0,
                        (char *)0, (char *)0, (char *)0, (char *)0, (char *)0,
                        (char *)0, (char *)0, (char *)0, (char *)0,
                        
                        "Vlad was here", "ad aerarium", "ad aerarium",
                        (char *)0, (char *)0, (char *)0, (char *)0, (char *)0,
                        (char *)0,
}
xchar vault_x [static]