1 -- NetHack bigroom bigrm-11.lua $NHDT-Date: 1652196024 2022/05/10 15:20:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.0 $
2 -- Copyright (c) 2021 by Pasi Kallinen
3 -- NetHack may be freely redistributed. See license for details.
5 -- Boulder "maze" with wide corridors
7 function t_or_f() return percent(50) and true or false; end
9 des
.level_flags("mazelevel", "noflip");
10 des
.level_init({ style
= "maze", corrwid
= 3 + nh
.rn2(3), wallthick
= 1, deadends
=t_or_f() });
12 des
.region(selection
.area(00,00,75,18), "lit");
15 function replace_wall_boulder(x
,y
)
16 des
.terrain(x
, y
, ".");
17 des
.object("boulder", x
, y
);
20 -- replace horizontal and vertical walls
21 local sel
= selection
.match([[.w.]]) | selection
.match(".\nw\n.");
22 sel
:iterate(replace_wall_boulder
);
23 -- replace the leftover corner walls
24 local sel
= selection
.match([[.w.]]);
25 sel
:iterate(replace_wall_boulder
);
34 des
.trap("rolling boulder");