Files
nethack/dat/Pri-loca.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

74 lines
2.8 KiB
Lua

-- NetHack 3.6 Priest.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
--
des.level_init({ style = "solidfill", fg = " " });
des.level_flags("mazelevel", "hardfloor")
-- This is a kludge to init the level as a lit field.
des.level_init({ style="mines", fg=".", bg=".", smoothed=false, joined=false, lit=1, walled=false })
des.map([[
........................................
........................................
..........----------+----------.........
..........|........|.|........|.........
..........|........|.|........|.........
..........|----.----.----.----|.........
..........+...................+.........
..........+...................+.........
..........|----.----.----.----|.........
..........|........|.|........|.........
..........|........|.|........|.........
..........----------+----------.........
........................................
........................................
]]);
-- Dungeon Description
des.region({ region={00,00, 09,13}, lit=0, type="morgue", prefilled=0 })
des.region({ region={09,00, 30,01}, lit=0, type="morgue", prefilled=0 })
des.region({ region={09,12, 30,13}, lit=0, type="morgue", prefilled=0 })
des.region({ region={31,00, 39,13}, lit=0, type="morgue", prefilled=0 })
des.region({ region={11,03, 29,10}, lit=1, type="temple", prefilled=0, irregular=1 })
-- The altar inside the temple
des.altar({ x=20,y=07, align="noalign", type="shrine" })
des.monster({ id = "aligned priest", x=20, y=07, align="noalign", peaceful = 0 })
-- Doors
des.door("locked",10,06)
des.door("locked",10,07)
des.door("locked",20,02)
des.door("locked",20,11)
des.door("locked",30,06)
des.door("locked",30,07)
-- Stairs
-- Note: The up stairs are *intentionally* off of the map.
des.stair("up", 43,05)
des.stair("down", 20,06)
-- Non diggable walls
des.non_diggable(selection.area(10,02,30,13))
-- Objects (inside the antechambers).
des.object({ coord = { 14, 03 } })
des.object({ coord = { 15, 03 } })
des.object({ coord = { 16, 03 } })
des.object({ coord = { 14, 10 } })
des.object({ coord = { 15, 10 } })
des.object({ coord = { 16, 10 } })
des.object({ coord = { 17, 10 } })
des.object({ coord = { 24, 03 } })
des.object({ coord = { 25, 03 } })
des.object({ coord = { 26, 03 } })
des.object({ coord = { 27, 03 } })
des.object({ coord = { 24, 10 } })
des.object({ coord = { 25, 10 } })
des.object({ coord = { 26, 10 } })
des.object({ coord = { 27, 10 } })
-- Random traps
des.trap({ coord = { 15,04 } })
des.trap({ coord = { 25,04 } })
des.trap({ coord = { 15,09 } })
des.trap({ coord = { 25,09 } })
des.trap()
des.trap()
-- No random monsters - the morgue generation will put them in.