-
Notifications
You must be signed in to change notification settings - Fork 635
Expand file tree
/
Copy pathbigrm-1.lua
More file actions
81 lines (72 loc) · 3.03 KB
/
Copy pathbigrm-1.lua
File metadata and controls
81 lines (72 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
-- NetHack bigroom bigrm-1.lua $NHDT-Date: 1781994878 2026/06/20 22:34:38 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.5 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1990 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
--
des.level_init({ style = "solidfill", fg = " " });
des.level_flags("mazelevel", "noflip");
des.map([[
---------------------------------------------------------------------------
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
---------------------------------------------------------------------------
]]);
if percent(80) then
local terrains = { "-", "F", "L", "T", "C" };
local tidx = math.random(1, #terrains);
local choice = math.random(0, 5);
if choice == 0 then
-- one horizontal line
des.terrain(selection.line(10,8, 65,8), terrains[tidx]);
elseif choice == 1 then
-- two vertical lines
local sel = selection.line(15,4, 15, 13) | selection.line(59,4, 59, 13);
des.terrain(sel, terrains[tidx]);
elseif choice == 2 then
-- plus sign
local sel = selection.line(10,8, 64, 8) | selection.line(37,3, 37, 14);
des.terrain(sel, terrains[tidx]);
elseif choice == 3 then
-- brackets: [ ]
des.terrain(selection.rect(4,4, 70,13), terrains[tidx]);
local sel = selection.line(25,4, 50,4) | selection.line(25,13, 50,13);
des.terrain(sel, '.');
elseif choice == 4 then
-- snake
des.terrain(selection.fillrect(5,5, 69, 12), terrains[tidx]);
for i = 0, 7 do
local x = 6 + i*8;
local y = 5 + (i%2);
des.terrain(selection.fillrect(x, y, x+6, y+6), '.');
end
else
-- nothing
end
end
des.region(selection.area(01,01, 73, 16), "lit");
des.stair("up");
des.stair("down");
des.non_diggable();
for i = 1,15 do
des.object();
end
for i = 1,6 do
des.trap();
end
for i = 1,28 do
des.monster();
end