forked from NetHack/NetHack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_lev.lua
More file actions
90 lines (84 loc) · 1.42 KB
/
test_lev.lua
File metadata and controls
90 lines (84 loc) · 1.42 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
82
83
84
85
86
87
88
89
90
-- Test all of the special levels
function saferequire(file)
if (not pcall(require, file)) then
nh.pline("Cannot load level file '" .. file .. "'.");
if (nhc.DLB == 1) then
nh.pline("Maybe due to compile-time option DLB.")
end
return false;
end
return true;
end;
local special_levels = {
"air",
"asmodeus",
"astral",
"baalz",
"bigrm-1",
"bigrm-2",
"bigrm-3",
"bigrm-4",
"bigrm-5",
"bigrm-6",
"bigrm-7",
"bigrm-8",
"bigrm-9",
"bigrm-10",
"bigrm-11",
"castle",
"earth",
"fakewiz1",
"fakewiz2",
"fire",
"juiblex",
"knox",
"medusa-1",
"medusa-2",
"medusa-3",
"medusa-4",
"minefill",
"minend-1",
"minend-2",
"minend-3",
"minetn-1",
"minetn-2",
"minetn-3",
"minetn-4",
"minetn-5",
"minetn-6",
"minetn-7",
"oracle",
"orcus",
"sanctum",
"soko1-1",
"soko1-2",
"soko2-1",
"soko2-2",
"soko3-1",
"soko3-2",
"soko4-1",
"soko4-2",
"tower1",
"tower2",
"tower3",
"valley",
"water",
"wizard1",
"wizard2",
"wizard3"
}
local roles = { "Arc", "Bar", "Cav", "Hea", "Kni", "Mon", "Pri", "Ran", "Rog", "Sam", "Tou", "Val", "Wiz" }
local questlevs = { "fila", "filb", "goal", "loca", "strt" }
for _,role in ipairs(roles) do
for _,qlev in ipairs(questlevs) do
local lev = role .. "-" .. qlev
table.insert(special_levels, lev)
end
end
for _,lev in ipairs(special_levels) do
des.reset_level();
if (not saferequire(lev)) then
error("Cannot load a required file.");
end
des.finalize_level();
end