Source:NetHack 5.0.0/dat/bigrm-11.lua

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to bigrm-11.lua from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/dat/bigrm-11.lua#line12]], for example.

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

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.
4. --
5. -- Boulder "maze" with wide corridors
6. 
7. function t_or_f() return percent(50) and true or false; end
8. 
9. des.level_flags("mazelevel", "noflip");
10. des.level_init({ style = "maze", corrwid = 3 + nh.rn2(3), wallthick = 1, deadends=t_or_f() });
11. 
12. des.region(selection.area(00,00,75,18), "lit");
13. des.non_diggable();
14. 
15. function replace_wall_boulder(x,y)
16.    des.terrain(x, y, ".");
17.    des.object("boulder", x, y);
18. end
19. 
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);
26. 
27. des.stair("up");
28. des.stair("down");
29. 
30. for i = 1,15 do
31.    des.object();
32. end
33. for i = 1,6 do
34.    des.trap("rolling boulder");
35. end
36. for i = 1,28 do
37.   des.monster();
38. end
39.