Use lua for special level files
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.
This commit is contained in:
62
dat/tower1.lua
Normal file
62
dat/tower1.lua
Normal file
@@ -0,0 +1,62 @@
|
||||
-- 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.
|
||||
--
|
||||
--
|
||||
-- Upper stage of Vlad's tower
|
||||
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---
|
||||
|.| |.| |.|
|
||||
--- --- ---
|
||||
]] });
|
||||
|
||||
local niches = { {03,01}, {03,09}, {07,01}, {07,09}, {11,01}, {11,09} };
|
||||
shuffle(niches);
|
||||
|
||||
des.ladder("down", 11,05)
|
||||
-- The lord and his court
|
||||
des.monster("Vlad the Impaler", 06, 05)
|
||||
des.monster("V",niches[1])
|
||||
des.monster("V",niches[2])
|
||||
des.monster("V",niches[3])
|
||||
des.monster("V",niches[4])
|
||||
des.monster("V",niches[5])
|
||||
des.monster("V",niches[6])
|
||||
-- The doors
|
||||
des.door("closed",08,03)
|
||||
des.door("closed",10,03)
|
||||
des.door("closed",03,04)
|
||||
des.door("locked",10,05)
|
||||
des.door("locked",08,07)
|
||||
des.door("locked",10,07)
|
||||
des.door("closed",03,06)
|
||||
-- treasures
|
||||
des.object("chest", 07,05)
|
||||
|
||||
des.object("chest",niches[6])
|
||||
des.object("chest",niches[1])
|
||||
des.object("chest",niches[2])
|
||||
des.object("chest",niches[3])
|
||||
des.object({ id = "chest", coord=niches[4],
|
||||
contents = function()
|
||||
des.object({ id = "wax candle", quantity=math.random(4,8) })
|
||||
end
|
||||
});
|
||||
des.object({ id = "chest", coord=niches[5],
|
||||
contents = function()
|
||||
des.object({ id = "tallow candle", quantity=math.random(4,8) })
|
||||
end
|
||||
});
|
||||
-- We have to protect the tower against outside attacks
|
||||
des.non_diggable(selection.area(00,00,14,10))
|
||||
Reference in New Issue
Block a user