Game is playable, and should compile on linux and Windows. Assumes you have a lua 5.3 library available. Removes level compiler and associated files. Replaces special level des-files with lua scripts. Exposes some NetHack internals to lua: - des-table with commands to create special levels - nh-table with NetHack core commands - nhc-table with some constants - u-table with some player-specific data (u-struct) - selection userdata Adds some rudimentary tests. Adds new extended command #wizloadlua to run a specific script, and #wizloaddes to run a specific level-creation script. nhlib.lua is loaded for every lua script. Download and untar lua: mkdir lib cd lib curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz tar zxf lua-5.3.5.tar.gz Then make nethack normally.
58 lines
2.2 KiB
Lua
58 lines
2.2 KiB
Lua
|
|
des.level_init({ style = "solidfill", fg = " " });
|
|
des.level_flags("mazelevel");
|
|
|
|
des.map([[
|
|
---------------------------------------------------------------------------
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
|.........................................................................|
|
|
---------------------------------------------------------------------------
|
|
]]);
|
|
-- Dungeon Description
|
|
des.region(selection.area(01,01,73,16),"lit");
|
|
|
|
local choice = math.random(0, 3)
|
|
if choice == 0 then
|
|
des.region(selection.area(01,07,22,09),"unlit");
|
|
des.region(selection.area(24,01,50,05),"unlit");
|
|
des.region(selection.area(24,11,50,16),"unlit");
|
|
des.region(selection.area(52,07,73,09),"unlit");
|
|
elseif choice == 1 then
|
|
des.region(selection.area(24,01,50,16),"unlit");
|
|
elseif choice == 2 then
|
|
des.region(selection.area(01,01,22,16),"unlit");
|
|
des.region(selection.area(52,01,73,16),"unlit");
|
|
end
|
|
|
|
-- Stairs
|
|
des.stair("up");
|
|
des.stair("down");
|
|
-- Non diggable walls
|
|
des.non_diggable();
|
|
-- Objects
|
|
for i = 1,15 do
|
|
des.object();
|
|
end
|
|
-- Random traps
|
|
for i = 1,6 do
|
|
des.trap();
|
|
end
|
|
-- Random monsters.
|
|
for i = 1,28 do
|
|
des.monster();
|
|
end
|