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

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to bigrm-2.lua from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/dat/bigrm-2.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-2.lua	$NHDT-Date: 1652196021 2022/05/10 15:20:21 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
2. --	Copyright (c) 1989 by Jean-Christophe Collet
3. --	Copyright (c) 1990 by M. Stephenson
4. -- NetHack may be freely redistributed.  See license for details.
5. --
6. des.level_init({ style = "solidfill", fg = " " });
7. des.level_flags("mazelevel", "noflip");
8. 
9. des.map([[
10. ---------------------------------------------------------------------------
11. |.........................................................................|
12. |.........................................................................|
13. |.........................................................................|
14. |.........................................................................|
15. |.........................................................................|
16. |.........................................................................|
17. |.........................................................................|
18. |.........................................................................|
19. |.........................................................................|
20. |.........................................................................|
21. |.........................................................................|
22. |.........................................................................|
23. |.........................................................................|
24. |.........................................................................|
25. |.........................................................................|
26. |.........................................................................|
27. ---------------------------------------------------------------------------
28. ]]);
29. -- Dungeon Description
30. des.region(selection.area(01,01,73,16),"lit");
31. 
32. local darkness;
33. 
34. local choice = math.random(0, 3)
35. if choice == 0 then
36.    darkness = selection.area(01,07,22,09)
37.       | selection.area(24,01,50,05)
38.       | selection.area(24,11,50,16)
39.       | selection.area(52,07,73,09);
40. elseif choice == 1 then
41.    darkness = selection.area(24,01,50,16);
42. elseif choice == 2 then
43.    darkness = selection.area(01,01,22,16)
44.       | selection.area(52,01,73,16);
45. end
46. 
47. if darkness ~= nil then
48.    des.region(darkness,"unlit");
49.    if percent(25) then
50.       des.replace_terrain({ selection = darkness:grow(),
51.                             fromterrain = ".", toterrain = "I" });
52.    end
53. end
54. 
55. -- Stairs
56. des.stair("up");
57. des.stair("down");
58. -- Non diggable walls
59. des.non_diggable();
60. -- Objects
61. for i = 1,15 do
62.    des.object();
63. end
64. -- Random traps
65. for i = 1,6 do
66.    des.trap();
67. end
68. -- Random monsters.
69. for i = 1,28 do
70.    des.monster();
71. end