Files
nethack/dat/wizard3.lua
Pasi Kallinen fd55d9118e 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.
2019-11-06 18:43:20 +02:00

82 lines
2.8 KiB
Lua

-- NetHack 3.6 yendor.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1992 by M. Stephenson and Izchak Miller
-- NetHack may be freely redistributed. See license for details.
--
des.level_init({ style="mazegrid", bg ="-" });
des.level_flags("mazelevel", "noteleport", "hardfloor")
des.map([[
----------------------------.
|..|............S..........|.
|..|..------------------S--|.
|..|..|.........|..........|.
|..S..|.}}}}}}}.|..........|.
|..|..|.}}---}}.|-S--------|.
|..|..|.}--.--}.|..|.......|.
|..|..|.}|...|}.|..|.......|.
|..---|.}--.--}.|..|.......|.
|.....|.}}---}}.|..|.......|.
|.....S.}}}}}}}.|..|.......|.
|.....|.........|..|.......|.
----------------------------.
]]);
des.levregion({ type="stair-up", region={01,00,79,20}, region_islev=1, exclude={0,0,28,12} })
des.levregion({ type="stair-down", region={01,00,79,20}, region_islev=1, exclude={0,0,28,12} })
des.levregion({ type="branch", region={01,00,79,20}, region_islev=1, exclude={0,0,28,12} })
des.teleport_region({ region={01,00,79,20}, region_islev=1, exclude={0,0,27,12} })
des.levregion({ region={25,11,25,11}, type="portal", name="fakewiz1" });
des.mazewalk(28,09,"east")
des.region({ region={07,03, 15,11}, lit=0 ,type="morgue",prefilled=1 })
des.region({ region={17,06, 18,11}, lit=0, type="beehive" })
-- make the entry chamber a real room; it affects monster arrival;
-- `unfilled' is a kludge to force an ordinary room to remain a room
des.region({ region={20,06,26,11},lit=0,type="ordinary",prefilled=1,
contents = function()
local w = "north";
if math.random(0,99) < 50 then w = "west" end
des.door({ state="secret", wall=w })
end
});
des.door("closed",18,05)
des.ladder("up", 11,07)
-- Non diggable walls
-- Walls inside the moat stay diggable
des.non_diggable(selection.area(00,00,06,12))
des.non_diggable(selection.area(06,00,27,02))
des.non_diggable(selection.area(16,02,27,12))
des.non_diggable(selection.area(06,12,16,12))
--
des.non_passwall(selection.area(00,00,06,12))
des.non_passwall(selection.area(06,00,27,02))
des.non_passwall(selection.area(16,02,27,12))
des.non_passwall(selection.area(06,12,16,12))
--
des.monster("L", 10, 07)
des.monster("vampire lord", 12, 07)
-- Some surrounding horrors
des.monster("kraken", 08, 05)
des.monster("giant eel", 08, 08)
des.monster("kraken", 14, 05)
des.monster("giant eel", 14, 08)
-- Other monsters
des.monster("L")
des.monster("D")
des.monster("D", 26, 09)
des.monster("&")
des.monster("&")
des.monster("&")
-- And to make things a little harder.
des.trap("board",10,07)
des.trap("board",12,07)
des.trap("board",11,06)
des.trap("board",11,08)
-- Some loot
des.object(")")
des.object("!")
des.object("?")
des.object("?")
des.object("(")
-- treasures
des.object("\"", 11, 07)