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.
51 lines
1.5 KiB
Lua
51 lines
1.5 KiB
Lua
-- NetHack 3.6 tower.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $
|
|
-- Copyright (c) 1989 by Jean-Christophe Collet
|
|
-- NetHack may be freely redistributed. See license for details.
|
|
--
|
|
des.level_init({ style = "solidfill", fg = " " });
|
|
|
|
des.level_flags("mazelevel", "noteleport", "hardfloor", "solidify")
|
|
des.map({ halign = "half-left", valign = "center", map = [[
|
|
--- --- ---
|
|
|.| |.| |.|
|
|
---S---S---S---
|
|
|.S.........S.|
|
|
---.------+----
|
|
|......|..|
|
|
--------.------
|
|
|.S......+..S.|
|
|
---S---S---S---
|
|
|.| |.| |.|
|
|
--- --- ---
|
|
]] });
|
|
-- Random places are the 10 niches
|
|
local place = { {03,01},{07,01},{11,01},{01,03},{13,03},
|
|
{01,07},{13,07},{03,09},{07,09},{11,09} }
|
|
shuffle(place)
|
|
|
|
des.ladder("up", 11,05)
|
|
des.ladder("down", 03,07)
|
|
des.door("locked",10,04)
|
|
des.door("locked",09,07)
|
|
des.monster("&",place[10])
|
|
des.monster("&",place[1])
|
|
des.monster("hell hound pup",place[2])
|
|
des.monster("hell hound pup",place[3])
|
|
des.monster("winter wolf",place[4])
|
|
des.object({ id = "chest", coord = place[5],
|
|
contents = function()
|
|
des.object("amulet of life saving")
|
|
end
|
|
});
|
|
des.object({ id = "chest", coord = place[6],
|
|
contents = function()
|
|
des.object("amulet of strangulation")
|
|
end
|
|
});
|
|
des.object("water walking boots",place[7])
|
|
des.object("crystal plate mail",place[8])
|
|
des.object("invisibility",place[9])
|
|
-- Walls in the tower are non diggable
|
|
des.non_diggable(selection.area(00,00,14,10))
|
|
|