diff --git a/dat/Arc-fila.lua b/dat/Arc-fila.lua new file mode 100644 index 000000000..2e2dc1578 --- /dev/null +++ b/dat/Arc-fila.lua @@ -0,0 +1,59 @@ +-- NetHack 3.6 Arch.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- +des.room({ type = "ordinary", + contents = function() + des.stair("up") + des.object() + des.monster("S") + end +}); + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.monster("S") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.object() + des.monster("S") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.stair("down") + des.object() + des.trap() + des.monster("S") + des.monster("human mummy") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.trap() + des.monster("S") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.monster("S") + end +}) + +des.random_corridors() diff --git a/dat/Arc-filb.lua b/dat/Arc-filb.lua new file mode 100644 index 000000000..8b3f1d257 --- /dev/null +++ b/dat/Arc-filb.lua @@ -0,0 +1,59 @@ +-- NetHack 3.6 Arch.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- +des.room({ type = "ordinary", + contents = function() + des.stair("up") + des.object() + des.monster("M") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.monster("M") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.object() + des.monster("M") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.stair("down") + des.object() + des.trap() + des.monster("S") + des.monster("human mummy") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.trap() + des.monster("S") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.monster("S") + end +}) + +des.random_corridors() diff --git a/dat/Arc-goal.lua b/dat/Arc-goal.lua new file mode 100644 index 000000000..4f48ec516 --- /dev/null +++ b/dat/Arc-goal.lua @@ -0,0 +1,115 @@ +-- NetHack 3.6 Arch.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ + + --------- + |..|.|..| + -----------|..S.S..|----------- + |.|........|+-|.|-+|........|.| + |.S........S..|.|..S........S.| + |.|........|..|.|..|........|.| + ------------------+------------------ + |..|..........|.......|..........|..| + |..|..........+.......|..........S..| + |..S..........|.......+..........|..| + |..|..........|.......|..........|..| + ------------------+------------------ + |.|........|..|.|..|........|.| + |.S........S..|.|..S........S.| + |.|........|+-|.|-+|........|.| + -----------|..S.S..|----------- + |..|.|..| + --------- + +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region(selection.area(35,02,36,03), "unlit") +des.region(selection.area(40,02,41,03), "unlit") +des.region(selection.area(24,04,24,06), "unlit") +des.region(selection.area(26,04,33,06), "lit") +des.region(selection.area(38,02,38,06), "unlit") +des.region(selection.area(43,04,50,06), "lit") +des.region(selection.area(52,04,52,06), "unlit") +des.region(selection.area(35,05,36,06), "unlit") +des.region(selection.area(40,05,41,06), "unlit") +des.region(selection.area(21,08,22,11), "unlit") +des.region(selection.area(24,08,33,11), "lit") +des.region(selection.area(35,08,41,11), "unlit") +des.region(selection.area(43,08,52,11), "lit") +des.region(selection.area(54,08,55,11), "unlit") +des.region(selection.area(24,13,24,15), "unlit") +des.region(selection.area(26,13,33,15), "unlit") +des.region(selection.area(35,13,36,14), "unlit") +des.region(selection.area(35,16,36,17), "unlit") +des.region(selection.area(38,13,38,17), "unlit") +des.region(selection.area(40,13,41,14), "unlit") +des.region(selection.area(40,16,41,17), "unlit") +des.region({ region={43,13, 50,15}, lit=0, type="temple", prefilled=0 }) +des.region(selection.area(52,13,52,15), "unlit") +-- Stairs +des.stair("up", 38,10) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- The altar of Huhetotl. Unattended. +des.altar({ x=50,y=14,align="chaos",type="altar" }) +-- Objects +des.object({ id = "crystal ball", x=50, y=14,buc="blessed",spe=5,name="The Orb of Detection" }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap("rolling boulder",46,14) +-- Random monsters. +des.monster("Minion of Huhetotl", 50, 14) +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("M") diff --git a/dat/Arc-loca.lua b/dat/Arc-loca.lua new file mode 100644 index 000000000..374deb595 --- /dev/null +++ b/dat/Arc-loca.lua @@ -0,0 +1,145 @@ +-- NetHack 3.6 Arch.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "hardfloor") + +des.map([[ +............................................................................ +............................................................................ +............................................................................ +........................-------------------------------..................... +........................|....|.S......................|..................... +........................|....|.|.|+------------------.|..................... +........................|....|.|.|.|.........|......|.|..................... +........................|....|.|.|.|.........|......|.|..................... +........................|---+-.|.|.|..---....+......|.|..................... +........................|....|.|.|.---|.|....|......|.|..................... +........................|....S.|.|.+..S.|--S-----S--|.|..................... +........................|....|.|.|.---|.|....|......+.|..................... +........................|---+-.|.|.|..---....|.------.|..................... +........................|....|.|.|.|.........|.|....+.|..................... +........................|....|.|.|.|.........|+|....|-|..................... +........................|....|.|.|------------+------.S..................... +........................|....|.S......................|..................... +........................-------------------------------..................... +............................................................................ +............................................................................ +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region({ region={25,04, 28,07}, lit=1, type="temple", prefilled=0 }) +des.region({ region={25,09, 28,11}, lit=0, type="temple", prefilled=0 }) +des.region({ region={25,13, 28,16}, lit=1, type="temple", prefilled=0 }) +des.region(selection.area(30,04,30,16), "lit") +des.region(selection.area(32,04,32,16), "unlit") +des.region({ region={33,04, 53,04}, lit=0, type="ordinary", prefilled=0, irregular=1 }) +des.region(selection.area(36,10,37,10), "unlit") +des.region(selection.area(39,09,39,11), "unlit") +des.region({ region={36,06, 42,08}, lit=0, type="ordinary", prefilled=0, irregular=1 }) +des.region({ region={36,12, 42,14}, lit=0, type="ordinary", prefilled=0, irregular=1 }) +des.region(selection.area(46,06,51,09), "unlit") +des.region({ region={46,11, 49,11}, lit=0, type="ordinary", prefilled=0, irregular=1 }) +des.region(selection.area(48,13,51,14), "unlit") +-- Doors +des.door("closed",31,04) +des.door("closed",28,08) +des.door("locked",29,10) +des.door("closed",28,12) +des.door("closed",31,16) +des.door("locked",34,05) +des.door("locked",35,10) +des.door("locked",38,10) +des.door("closed",43,10) +des.door("closed",45,08) +des.door("locked",46,14) +des.door("locked",46,15) +des.door("locked",49,10) +des.door("locked",52,11) +des.door("closed",52,13) +des.door("closed",54,15) +-- Stairs +des.stair("up", 03,17) +des.stair("down", 39,10) +-- Altars - three types. All are unattended. +des.altar({ x=26,y=05,align=align[1], type="altar" }) +des.altar({ x=26,y=10,align=align[2], type="altar" }) +des.altar({ x=26,y=15,align=align[3], type="altar" }) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Objects +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Treasure? +des.engraving({ type="engrave", text="X marks the spot." }) +des.engraving({ type="engrave", text="X marks the spot." }) +des.engraving({ type="engrave", text="X marks the spot." }) +des.engraving({ type="engrave", text="X marks the spot." }) +-- Random traps +des.trap("spiked pit",24,02) +des.trap("spiked pit",37,00) +des.trap("spiked pit",23,05) +des.trap("spiked pit",26,19) +des.trap("spiked pit",55,10) +des.trap("spiked pit",55,08) +des.trap("pit",51,01) +des.trap("pit",23,18) +des.trap("pit",31,18) +des.trap("pit",48,19) +des.trap("pit",55,15) +des.trap("magic",60,04) +des.trap("statue",72,07) +des.trap("statue") +des.trap("statue") +des.trap("anti magic",64,12) +des.trap("sleep gas") +des.trap("sleep gas") +des.trap("dart") +des.trap("dart") +des.trap("dart") +des.trap("rolling boulder",32,10) +des.trap("rolling boulder",40,16) +-- Random monsters. +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("S") +des.monster("M") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("human mummy") +des.monster("M") diff --git a/dat/Arc-strt.lua b/dat/Arc-strt.lua new file mode 100644 index 000000000..9292d40ca --- /dev/null +++ b/dat/Arc-strt.lua @@ -0,0 +1,113 @@ +-- NetHack 3.6 Arch.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, Lord Carnarvon +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor") + +des.map([[ +............................................................................ +............................................................................ +............................................................................ +............................................................................ +....................}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................. +....................}-------------------------------------}................. +....................}|..S......+.................+.......|}................. +....................}-S---------------+----------|.......|}................. +....................}|.|...............|.......+.|.......|}................. +....................}|.|...............---------.---------}................. +....................}|.S.\.............+.................+.................. +....................}|.|...............---------.---------}................. +....................}|.|...............|.......+.|.......|}................. +....................}-S---------------+----------|.......|}................. +....................}|..S......+.................+.......|}................. +....................}-------------------------------------}................. +....................}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................. +............................................................................ +............................................................................ +............................................................................ +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region(selection.area(22,06,23,06), "unlit") +des.region(selection.area(25,06,30,06), "unlit") +des.region(selection.area(32,06,48,06), "unlit") +des.region(selection.area(50,06,56,08), "lit") +des.region(selection.area(40,08,46,08), "unlit") +des.region(selection.area(22,08,22,12), "unlit") +des.region(selection.area(24,08,38,12), "unlit") +des.region(selection.area(48,08,48,08), "lit") +des.region(selection.area(40,10,56,10), "lit") +des.region(selection.area(48,12,48,12), "lit") +des.region(selection.area(40,12,46,12), "unlit") +des.region(selection.area(50,12,56,14), "lit") +des.region(selection.area(22,14,23,14), "unlit") +des.region(selection.area(25,14,30,14), "unlit") +des.region(selection.area(32,14,48,14), "unlit") +-- Stairs +des.stair("down", 55,07) +-- Portal arrival point +des.levregion({ region = {63,06,63,06}, type="branch" }) +-- Doors +des.door("closed",22,07) +des.door("closed",38,07) +des.door("locked",47,08) +des.door("locked",23,10) +des.door("locked",39,10) +des.door("locked",57,10) +des.door("locked",47,12) +des.door("closed",22,13) +des.door("closed",38,13) +des.door("locked",24,14) +des.door("closed",31,14) +des.door("locked",49,14) +-- Lord Carnarvon +des.monster("Lord Carnarvon", 25, 10) +-- The treasure of Lord Carnarvon +des.object("chest", 25, 10) +-- student guards for the audience chamber +des.monster("student", 26, 09) +des.monster("student", 27, 09) +des.monster("student", 28, 09) +des.monster("student", 26, 10) +des.monster("student", 28, 10) +des.monster("student", 26, 11) +des.monster("student", 27, 11) +des.monster("student", 28, 11) +-- city watch guards in the antechambers +des.monster("watchman", 50, 06) +des.monster("watchman", 50, 14) +-- Eels in the moat +des.monster("giant eel", 20, 10) +des.monster("giant eel", 45, 04) +des.monster("giant eel", 33, 16) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Monsters on siege duty. +des.monster("S", 60, 09) +des.monster("M", 60, 10) +des.monster("S", 60, 11) +des.monster("S", 60, 12) +des.monster("M", 60, 13) +des.monster("S", 61, 10) +des.monster("S", 61, 11) +des.monster("S", 61, 12) +des.monster("S", 30, 03) +des.monster("M", 20, 17) +des.monster("S", 67, 02) +des.monster("S", 10, 19) diff --git a/dat/Arch.des b/dat/Arch.des deleted file mode 100644 index 9335f7d2f..000000000 --- a/dat/Arch.des +++ /dev/null @@ -1,472 +0,0 @@ -# NetHack 3.6 Arch.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1991 by M. Stephenson -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, Lord Carnarvon -# and receive your quest assignment. -# -MAZE: "Arc-strt",' ' -FLAGS: noteleport,hardfloor -GEOMETRY:center,center -MAP -............................................................................ -............................................................................ -............................................................................ -............................................................................ -....................}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................. -....................}-------------------------------------}................. -....................}|..S......+.................+.......|}................. -....................}-S---------------+----------|.......|}................. -....................}|.|...............|.......+.|.......|}................. -....................}|.|...............---------.---------}................. -....................}|.S.\.............+.................+.................. -....................}|.|...............---------.---------}................. -....................}|.|...............|.......+.|.......|}................. -....................}-S---------------+----------|.......|}................. -....................}|..S......+.................+.......|}................. -....................}-------------------------------------}................. -....................}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................. -............................................................................ -............................................................................ -............................................................................ -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION: (22,06,23,06),unlit,"ordinary" -REGION: (25,06,30,06),unlit,"ordinary" -REGION: (32,06,48,06),unlit,"ordinary" -REGION: (50,06,56,08),lit,"ordinary" -REGION: (40,08,46,08),unlit,"ordinary" -REGION: (22,08,22,12),unlit,"ordinary" -REGION: (24,08,38,12),unlit,"ordinary" -REGION: (48,08,48,08),lit,"ordinary" -REGION: (40,10,56,10),lit,"ordinary" -REGION: (48,12,48,12),lit,"ordinary" -REGION: (40,12,46,12),unlit,"ordinary" -REGION: (50,12,56,14),lit,"ordinary" -REGION: (22,14,23,14),unlit,"ordinary" -REGION: (25,14,30,14),unlit,"ordinary" -REGION: (32,14,48,14),unlit,"ordinary" -# Stairs -STAIR:(55,07),down -# Portal arrival point -BRANCH:(63,06,63,06),(0,0,0,0) -# Doors -DOOR:closed,(22,07) -DOOR:closed,(38,07) -DOOR:locked,(47,08) -DOOR:locked,(23,10) -DOOR:locked,(39,10) -DOOR:locked,(57,10) -DOOR:locked,(47,12) -DOOR:closed,(22,13) -DOOR:closed,(38,13) -DOOR:locked,(24,14) -DOOR:closed,(31,14) -DOOR:locked,(49,14) -# Lord Carnarvon -MONSTER:('@',"Lord Carnarvon"),(25,10) -# The treasure of Lord Carnarvon -OBJECT:('(',"chest"),(25,10) -# student guards for the audience chamber -MONSTER:('@',"student"),(26,09) -MONSTER:('@',"student"),(27,09) -MONSTER:('@',"student"),(28,09) -MONSTER:('@',"student"),(26,10) -MONSTER:('@',"student"),(28,10) -MONSTER:('@',"student"),(26,11) -MONSTER:('@',"student"),(27,11) -MONSTER:('@',"student"),(28,11) -# city watch guards in the antechambers -MONSTER:('@',"watchman"),(50,06) -MONSTER:('@',"watchman"),(50,14) -# Eels in the moat -MONSTER:(';',"giant eel"),(20,10) -MONSTER:(';',"giant eel"),(45,04) -MONSTER:(';',"giant eel"),(33,16) -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Monsters on siege duty. -MONSTER: 'S',(60,09) -MONSTER: 'M',(60,10) -MONSTER: 'S',(60,11) -MONSTER: 'S',(60,12) -MONSTER: 'M',(60,13) -MONSTER: 'S',(61,10) -MONSTER: 'S',(61,11) -MONSTER: 'S',(61,12) -MONSTER: 'S',(30,03) -MONSTER: 'M',(20,17) -MONSTER: 'S',(67,02) -MONSTER: 'S',(10,19) - -# -# The "locate" level for the quest. -# -# Here you have to find the Entrance to the Tomb of the Toltec Kings -# to go further towards your assigned quest. -# - -MAZE: "Arc-loca",' ' -FLAGS: hardfloor -GEOMETRY:center,center -MAP -............................................................................ -............................................................................ -............................................................................ -........................-------------------------------..................... -........................|....|.S......................|..................... -........................|....|.|.|+------------------.|..................... -........................|....|.|.|.|.........|......|.|..................... -........................|....|.|.|.|.........|......|.|..................... -........................|---+-.|.|.|..---....+......|.|..................... -........................|....|.|.|.---|.|....|......|.|..................... -........................|....S.|.|.+..S.|--S-----S--|.|..................... -........................|....|.|.|.---|.|....|......+.|..................... -........................|---+-.|.|.|..---....|.------.|..................... -........................|....|.|.|.|.........|.|....+.|..................... -........................|....|.|.|.|.........|+|....|-|..................... -........................|....|.|.|------------+------.S..................... -........................|....|.S......................|..................... -........................-------------------------------..................... -............................................................................ -............................................................................ -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION:(25,04,28,07),lit,"temple" -REGION:(25,09,28,11),unlit,"temple" -REGION:(25,13,28,16),lit,"temple" -REGION:(30,04,30,16),lit,"ordinary" -REGION:(32,04,32,16),unlit,"ordinary" -REGION:(33,04,53,04),unlit,"ordinary",unfilled,irregular -REGION:(36,10,37,10),unlit,"ordinary" -REGION:(39,09,39,11),unlit,"ordinary" -REGION:(36,06,42,08),unlit,"ordinary",unfilled,irregular -REGION:(36,12,42,14),unlit,"ordinary",unfilled,irregular -REGION:(46,06,51,09),unlit,"ordinary" -REGION:(46,11,49,11),unlit,"ordinary",unfilled,irregular -REGION:(48,13,51,14),unlit,"ordinary" -# Doors -DOOR:closed,(31,04) -DOOR:closed,(28,08) -DOOR:locked,(29,10) -DOOR:closed,(28,12) -DOOR:closed,(31,16) -DOOR:locked,(34,05) -DOOR:locked,(35,10) -DOOR:locked,(38,10) -DOOR:closed,(43,10) -DOOR:closed,(45,08) -DOOR:locked,(46,14) -DOOR:locked,(46,15) -DOOR:locked,(49,10) -DOOR:locked,(52,11) -DOOR:closed,(52,13) -DOOR:closed,(54,15) -# Stairs -STAIR:(03,17),up -STAIR:(39,10),down -# Altars - three types. All are unattended. -ALTAR:(26,05),align[0],altar -ALTAR:(26,10),align[1],altar -ALTAR:(26,15),align[2],altar -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Treasure? -ENGRAVING:random,engrave,"X marks the spot." -ENGRAVING:random,engrave,"X marks the spot." -ENGRAVING:random,engrave,"X marks the spot." -ENGRAVING:random,engrave,"X marks the spot." -# Random traps -TRAP:"spiked pit",(24,02) -TRAP:"spiked pit",(37,00) -TRAP:"spiked pit",(23,05) -TRAP:"spiked pit",(26,19) -TRAP:"spiked pit",(55,10) -TRAP:"spiked pit",(55,08) -TRAP:"pit",(51,01) -TRAP:"pit",(23,18) -TRAP:"pit",(31,18) -TRAP:"pit",(48,19) -TRAP:"pit",(55,15) -TRAP:"magic",(60,04) -TRAP:"statue",(72,07) -TRAP:"statue",random -TRAP:"statue",random -TRAP:"anti magic",(64,12) -TRAP:"sleep gas",random -TRAP:"sleep gas",random -TRAP:"dart",random -TRAP:"dart",random -TRAP:"dart",random -TRAP:"rolling boulder",(32,10) -TRAP:"rolling boulder",(40,16) -# Random monsters. -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'M',random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:'M',random - -# -# The "goal" level for the quest. -# -# Here you meet Minion of Huhetotl your nemesis monster. You have to -# defeat Minion of Huhetotl in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Arc-goal", ' ' -GEOMETRY:center,center -MAP - - --------- - |..|.|..| - -----------|..S.S..|----------- - |.|........|+-|.|-+|........|.| - |.S........S..|.|..S........S.| - |.|........|..|.|..|........|.| - ------------------+------------------ - |..|..........|.......|..........|..| - |..|..........+.......|..........S..| - |..S..........|.......+..........|..| - |..|..........|.......|..........|..| - ------------------+------------------ - |.|........|..|.|..|........|.| - |.S........S..|.|..S........S.| - |.|........|+-|.|-+|........|.| - -----------|..S.S..|----------- - |..|.|..| - --------- - -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION:(35,02,36,03),unlit,"ordinary" -REGION:(40,02,41,03),unlit,"ordinary" -REGION:(24,04,24,06),unlit,"ordinary" -REGION:(26,04,33,06),lit,"ordinary" -REGION:(38,02,38,06),unlit,"ordinary" -REGION:(43,04,50,06),lit,"ordinary" -REGION:(52,04,52,06),unlit,"ordinary" -REGION:(35,05,36,06),unlit,"ordinary" -REGION:(40,05,41,06),unlit,"ordinary" -REGION:(21,08,22,11),unlit,"ordinary" -REGION:(24,08,33,11),lit,"ordinary" -REGION:(35,08,41,11),unlit,"ordinary" -REGION:(43,08,52,11),lit,"ordinary" -REGION:(54,08,55,11),unlit,"ordinary" -REGION:(24,13,24,15),unlit,"ordinary" -REGION:(26,13,33,15),unlit,"ordinary" -REGION:(35,13,36,14),unlit,"ordinary" -REGION:(35,16,36,17),unlit,"ordinary" -REGION:(38,13,38,17),unlit,"ordinary" -REGION:(40,13,41,14),unlit,"ordinary" -REGION:(40,16,41,17),unlit,"ordinary" -REGION:(43,13,50,15),unlit,"temple" -REGION:(52,13,52,15),unlit,"ordinary" -# Stairs -STAIR:(38,10),up -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# The altar of Huhetotl. Unattended. -ALTAR:(50,14),chaos,altar -# Objects -OBJECT:('(',"crystal ball"),(50,14),blessed,5,name:"The Orb of Detection" -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:"rolling boulder",(46,14) -# Random monsters. -MONSTER:('&',"Minion of Huhetotl"),(50,14) -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:'S',random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:('M',"human mummy"),random -MONSTER:'M',random - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "filla" is the upper filler, between the -# start and locate levels, and "fillb" the lower between the locate -# and goal levels. -# - -LEVEL: "Arc-fila" -# -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random - MONSTER: 'S', random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random,random - MONSTER: 'S', random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - OBJECT: random,random - MONSTER: 'S', random -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - TRAP: random, random - MONSTER: 'S', random - MONSTER: ('M', "human mummy"), random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - TRAP: random, random - MONSTER: 'S', random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - MONSTER: 'S', random -} - -RANDOM_CORRIDORS - -LEVEL: "Arc-filb" -# -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random - MONSTER: 'M', random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random,random - MONSTER: 'M', random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - OBJECT: random,random - MONSTER: 'M', random -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - TRAP: random, random - MONSTER: 'S', random - MONSTER: ('M', "human mummy"), random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - TRAP: random, random - MONSTER: 'S', random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - MONSTER: 'S', random -} - -RANDOM_CORRIDORS diff --git a/dat/Bar-fila.lua b/dat/Bar-fila.lua new file mode 100644 index 000000000..3f685c50b --- /dev/null +++ b/dat/Bar-fila.lua @@ -0,0 +1,33 @@ +-- NetHack 3.6 Barb.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg=".", smoothed=true, joined=true, lit=0, walled=false }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.trap() +des.trap() +des.trap() +des.trap() +-- +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ class = "O", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) diff --git a/dat/Bar-filb.lua b/dat/Bar-filb.lua new file mode 100644 index 000000000..15d9f33a5 --- /dev/null +++ b/dat/Bar-filb.lua @@ -0,0 +1,44 @@ +-- NetHack 3.6 Barb.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg=" ", smoothed=true, joined=true, lit=0, walled=true }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.trap() +des.trap() +des.trap() +des.trap() +-- +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ class = "O", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ class = "T", peaceful=0 }) diff --git a/dat/Bar-goal.lua b/dat/Bar-goal.lua new file mode 100644 index 000000000..31754a4c0 --- /dev/null +++ b/dat/Bar-goal.lua @@ -0,0 +1,95 @@ +-- NetHack 3.6 Barb.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ + + ............. + .................. + .... ......................... .... + ....... .......................... ....... + ...... ........................ ....... + .. ...................................... .. + .. ..................... .. + .. .................. .. + .. ..S...S.............. ................ + .. ........ ... + ......... .. + ...... .. ... .... + .. ... .. ...... ........ + .... .. .................. ........ ...... + ...... ...................... ...... .. + .... .................. ........... + .............. + ........... + +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "unlit") +-- Secret doors +des.door("locked",22,09) +des.door("locked",26,09) +-- Stairs +des.stair("up", 36,05) +-- The altar. Unattended. +des.altar({ x=63,y=04,align="noncoaligned", type="altar" }) +des.non_diggable(selection.area(00,00,75,19)) +-- Objects +des.object({ id = "luckstone", x=63, y=04,buc="blessed",spe=0,name="The Heart of Ahriman" }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster({ id = "Thoth Amon", x=63, y=04, peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ class = "O", peaceful=0 }) +des.monster({ class = "O", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ class = "T", peaceful=0 }) +des.wallify() + diff --git a/dat/Bar-loca.lua b/dat/Bar-loca.lua new file mode 100644 index 000000000..df1e7d8aa --- /dev/null +++ b/dat/Bar-loca.lua @@ -0,0 +1,107 @@ +-- NetHack 3.6 Barb.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "hardfloor") + +des.map([[ +..........PPP......................................... +...........PP.......................................... ....... +..........PP...........-----..........------------------ .......... +...........PP..........+...|..........|....S...........|.. ............ +..........PPP..........|...|..........|-----...........|... ............. +...........PPP.........-----..........+....+...........|... ............. +..........PPPPPPPPP...................+....+...........S................. +........PPPPPPPPPPPPP.........-----...|-----...........|................ +......PPPPPPPPPPPPPP..P.......+...|...|....S...........| ... +.....PPPPPPP......P..PPPP.....|...|...------------------.. ... +....PPPPPPP.........PPPPPP....-----........................ ........ +...PPPPPPP..........PPPPPPP.................................. .......... +....PPPPPPP........PPPPPPP.................................... .......... +.....PPPPP........PPPPPPP.........-----........................ ........ +......PPP..PPPPPPPPPPPP...........+...|......................... ..... +..........PPPPPPPPPPP.............|...|......................... .... +..........PPPPPPPPP...............-----......................... . +..............PPP................................................. +...............PP.................................................... +................PPP................................................... +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region(selection.area(24,03,26,04), "unlit") +des.region(selection.area(31,08,33,09), "unlit") +des.region(selection.area(35,14,37,15), "unlit") +des.region(selection.area(39,03,54,08), "lit") +des.region(selection.area(56,00,75,08), "unlit") +des.region(selection.area(64,09,75,16), "unlit") +-- Doors +des.door("open",23,03) +des.door("open",30,08) +des.door("open",34,14) +des.door("locked",38,05) +des.door("locked",38,06) +des.door("closed",43,03) +des.door("closed",43,05) +des.door("closed",43,06) +des.door("closed",43,08) +des.door("locked",55,06) +-- Stairs +des.stair("up", 05,02) +des.stair("down", 70,13) +-- Objects +des.object({ x = 42, y = 03 }) +des.object({ x = 42, y = 03 }) +des.object({ x = 42, y = 03 }) +des.object({ x = 41, y = 03 }) +des.object({ x = 41, y = 03 }) +des.object({ x = 41, y = 03 }) +des.object({ x = 41, y = 03 }) +des.object({ x = 41, y = 08 }) +des.object({ x = 41, y = 08 }) +des.object({ x = 42, y = 08 }) +des.object({ x = 42, y = 08 }) +des.object({ x = 42, y = 08 }) +des.object({ x = 71, y = 13 }) +des.object({ x = 71, y = 13 }) +des.object({ x = 71, y = 13 }) +-- Random traps +des.trap("spiked pit",10,13) +des.trap("spiked pit",21,07) +des.trap("spiked pit",67,08) +des.trap("spiked pit",68,09) +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster({ id = "ogre", x=12, y=09, peaceful=0 }) +des.monster({ id = "ogre", x=18, y=11, peaceful=0 }) +des.monster({ id = "ogre", x=45, y=05, peaceful=0 }) +des.monster({ id = "ogre", x=45, y=06, peaceful=0 }) +des.monster({ id = "ogre", x=47, y=05, peaceful=0 }) +des.monster({ id = "ogre", x=46, y=05, peaceful=0 }) +des.monster({ id = "ogre", x=56, y=03, peaceful=0 }) +des.monster({ id = "ogre", x=56, y=04, peaceful=0 }) +des.monster({ id = "ogre", x=56, y=05, peaceful=0 }) +des.monster({ id = "ogre", x=56, y=06, peaceful=0 }) +des.monster({ id = "ogre", x=57, y=03, peaceful=0 }) +des.monster({ id = "ogre", x=57, y=04, peaceful=0 }) +des.monster({ id = "ogre", x=57, y=05, peaceful=0 }) +des.monster({ id = "ogre", x=57, y=06, peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ id = "ogre", peaceful=0 }) +des.monster({ class = "O", peaceful=0 }) +des.monster({ class = "T", peaceful=0 }) +des.monster({ id = "rock troll", x=46, y=06, peaceful=0 }) +des.monster({ id = "rock troll", x=47, y=06, peaceful=0 }) +des.monster({ id = "rock troll", x=56, y=07, peaceful=0 }) +des.monster({ id = "rock troll", x=57, y=07, peaceful=0 }) +des.monster({ id = "rock troll", x=70, y=13, peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ id = "rock troll", peaceful=0 }) +des.monster({ class = "T", peaceful=0 }) + diff --git a/dat/Bar-strt.lua b/dat/Bar-strt.lua new file mode 100644 index 000000000..c3a98de04 --- /dev/null +++ b/dat/Bar-strt.lua @@ -0,0 +1,103 @@ +-- NetHack 3.6 Barb.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, Pelias, +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor") + +des.map([[ +..................................PP........................................ +...................................PP....................................... +...................................PP....................................... +....................................PP...................................... +........--------------......-----....PPP.................................... +........|...S........|......+...|...PPP..................................... +........|----........|......|...|....PP..................................... +........|.\..........+......-----........................................... +........|----........|...............PP..................................... +........|...S........|...-----.......PPP.................................... +........--------------...+...|......PPPPP................................... +.........................|...|.......PPP.................................... +...-----......-----......-----........PP.................................... +...|...+......|...+..--+--.............PP................................... +...|...|......|...|..|...|..............PP.................................. +...-----......-----..|...|.............PPPP................................. +.....................-----............PP..PP................................ +.....................................PP...PP................................ +....................................PP...PP................................. +....................................PP....PP................................ +]]); + +-- the forest beyond the river +des.replace_terrain({ region={37,00, 59,19}, fromterrain=".", toterrain="T", chance=5 }) +des.replace_terrain({ region={60,00, 64,19}, fromterrain=".", toterrain="T", chance=10 }) +des.replace_terrain({ region={65,00, 75,19}, fromterrain=".", toterrain="T", chance=20 }) +-- guarantee a path and free spot for the portal +des.terrain(selection.randline(selection.new(), 37,7, 62,02, 7), ".") +des.terrain({62,02}, ".") + +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region(selection.area(09,05,11,05), "unlit") +des.region(selection.area(09,07,11,07), "lit") +des.region(selection.area(09,09,11,09), "unlit") +des.region(selection.area(13,05,20,09), "lit") +des.region(selection.area(29,05,31,06), "lit") +des.region(selection.area(26,10,28,11), "lit") +des.region(selection.area(04,13,06,14), "lit") +des.region(selection.area(15,13,17,14), "lit") +des.region(selection.area(22,14,24,15), "lit") +-- Stairs +des.stair("down", 09,09) +-- Portal arrival point +des.levregion({ region = {62,02,62,02}, type="branch" }) +-- Doors +des.door("locked",12,05) +des.door("locked",12,09) +des.door("closed",21,07) +des.door("open",07,13) +des.door("open",18,13) +des.door("open",23,13) +des.door("open",25,10) +des.door("open",28,05) +-- Elder +des.monster("Pelias", 10, 07) +-- The treasure of Pelias +des.object("chest", 09, 05) +-- chieftain guards for the audience chamber +des.monster("chieftain", 10, 05) +des.monster("chieftain", 10, 09) +des.monster("chieftain", 11, 05) +des.monster("chieftain", 11, 09) +des.monster("chieftain", 14, 05) +des.monster("chieftain", 14, 09) +des.monster("chieftain", 16, 05) +des.monster("chieftain", 16, 09) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- One trap to keep the ogres at bay. +des.trap("spiked pit",37,07) +-- Eels in the river +des.monster("giant eel", 36, 01) +des.monster("giant eel", 37, 09) +des.monster("giant eel", 39, 15) +-- Monsters on siege duty. +des.monster({ id = "ogre", x=40, y=08, peaceful=0 }) +des.monster({ id = "ogre", x=41, y=06, peaceful=0 }) +des.monster({ id = "ogre", x=41, y=07, peaceful=0 }) +des.monster({ id = "ogre", x=41, y=08, peaceful=0 }) +des.monster({ id = "ogre", x=41, y=09, peaceful=0 }) +des.monster({ id = "ogre", x=41, y=10, peaceful=0 }) +des.monster({ id = "ogre", x=42, y=06, peaceful=0 }) +des.monster({ id = "ogre", x=42, y=07, peaceful=0 }) +des.monster({ id = "ogre", x=42, y=08, peaceful=0 }) +des.monster({ id = "ogre", x=42, y=09, peaceful=0 }) +des.monster({ id = "ogre", x=42, y=10, peaceful=0 }) diff --git a/dat/Barb.des b/dat/Barb.des deleted file mode 100644 index 0be480636..000000000 --- a/dat/Barb.des +++ /dev/null @@ -1,377 +0,0 @@ -# NetHack 3.6 Barb.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1991 by M. Stephenson -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, Pelias, -# and receive your quest assignment. -# -MAZE: "Bar-strt",' ' -FLAGS: noteleport,hardfloor -GEOMETRY:center,center -MAP -..................................PP........................................ -...................................PP....................................... -...................................PP....................................... -....................................PP...................................... -........--------------......-----....PPP.................................... -........|...S........|......+...|...PPP..................................... -........|----........|......|...|....PP..................................... -........|.\..........+......-----........................................... -........|----........|...............PP..................................... -........|...S........|...-----.......PPP.................................... -........--------------...+...|......PPPPP................................... -.........................|...|.......PPP.................................... -...-----......-----......-----........PP.................................... -...|...+......|...+..--+--.............PP................................... -...|...|......|...|..|...|..............PP.................................. -...-----......-----..|...|.............PPPP................................. -.....................-----............PP..PP................................ -.....................................PP...PP................................ -....................................PP...PP................................. -....................................PP....PP................................ -ENDMAP - -# the forest beyond the river -REPLACE_TERRAIN:(37,0,59,19),'.','T', 5% -REPLACE_TERRAIN:(60,0,64,19),'.','T', 10% -REPLACE_TERRAIN:(65,0,75,19),'.','T', 20% -# guarantee a path and free spot for the portal -TERRAIN:(randline (37,7),(62,02),7), '.' -TERRAIN:(62,02),'.' - -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION:(09,05,11,05),unlit,"ordinary" -REGION:(09,07,11,07),lit,"ordinary" -REGION:(09,09,11,09),unlit,"ordinary" -REGION:(13,05,20,09),lit,"ordinary" -REGION:(29,05,31,06),lit,"ordinary" -REGION:(26,10,28,11),lit,"ordinary" -REGION:(04,13,06,14),lit,"ordinary" -REGION:(15,13,17,14),lit,"ordinary" -REGION:(22,14,24,15),lit,"ordinary" -# Stairs -STAIR:(09,09),down -# Portal arrival point -BRANCH:(62,02,62,02),(0,0,0,0) -# Doors -DOOR:locked,(12,05) -DOOR:locked,(12,09) -DOOR:closed,(21,07) -DOOR:open,(07,13) -DOOR:open,(18,13) -DOOR:open,(23,13) -DOOR:open,(25,10) -DOOR:open,(28,05) -# Elder -MONSTER:('@',"Pelias"),(10,07) -# The treasure of Pelias -OBJECT:('(',"chest"),(09,05) -# chieftain guards for the audience chamber -MONSTER:('@',"chieftain"),(10,05) -MONSTER:('@',"chieftain"),(10,09) -MONSTER:('@',"chieftain"),(11,05) -MONSTER:('@',"chieftain"),(11,09) -MONSTER:('@',"chieftain"),(14,05) -MONSTER:('@',"chieftain"),(14,09) -MONSTER:('@',"chieftain"),(16,05) -MONSTER:('@',"chieftain"),(16,09) -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# One trap to keep the ogres at bay. -TRAP:"spiked pit",(37,07) -# Eels in the river -MONSTER:(';',"giant eel"),(36,01) -MONSTER:(';',"giant eel"),(37,09) -MONSTER:(';',"giant eel"),(39,15) -# Monsters on siege duty. -MONSTER:('O',"ogre"),(40,08),hostile -MONSTER:('O',"ogre"),(41,06),hostile -MONSTER:('O',"ogre"),(41,07),hostile -MONSTER:('O',"ogre"),(41,08),hostile -MONSTER:('O',"ogre"),(41,09),hostile -MONSTER:('O',"ogre"),(41,10),hostile -MONSTER:('O',"ogre"),(42,06),hostile -MONSTER:('O',"ogre"),(42,07),hostile -MONSTER:('O',"ogre"),(42,08),hostile -MONSTER:('O',"ogre"),(42,09),hostile -MONSTER:('O',"ogre"),(42,10),hostile - -# -# The "locate" level for the quest. -# -# Here you have to infiltrate the Duali Oasis to go -# further towards your assigned quest. -# - -MAZE: "Bar-loca",' ' -FLAGS: hardfloor -GEOMETRY:center,center -MAP -..........PPP......................................... -...........PP.......................................... ....... -..........PP...........-----..........------------------ .......... -...........PP..........+...|..........|....S...........|.. ............ -..........PPP..........|...|..........|-----...........|... ............. -...........PPP.........-----..........+....+...........|... ............. -..........PPPPPPPPP...................+....+...........S................. -........PPPPPPPPPPPPP.........-----...|-----...........|................ -......PPPPPPPPPPPPPP..P.......+...|...|....S...........| ... -.....PPPPPPP......P..PPPP.....|...|...------------------.. ... -....PPPPPPP.........PPPPPP....-----........................ ........ -...PPPPPPP..........PPPPPPP.................................. .......... -....PPPPPPP........PPPPPPP.................................... .......... -.....PPPPP........PPPPPPP.........-----........................ ........ -......PPP..PPPPPPPPPPPP...........+...|......................... ..... -..........PPPPPPPPPPP.............|...|......................... .... -..........PPPPPPPPP...............-----......................... . -..............PPP................................................. -...............PP.................................................... -................PPP................................................... -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION:(24,03,26,04),unlit,"ordinary" -REGION:(31,08,33,09),unlit,"ordinary" -REGION:(35,14,37,15),unlit,"ordinary" -REGION:(39,03,54,08),lit,"ordinary" -REGION:(56,00,75,08),unlit,"ordinary" -REGION:(64,09,75,16),unlit,"ordinary" -# Doors -DOOR:open,(23,03) -DOOR:open,(30,08) -DOOR:open,(34,14) -DOOR:locked,(38,05) -DOOR:locked,(38,06) -DOOR:closed,(43,03) -DOOR:closed,(43,05) -DOOR:closed,(43,06) -DOOR:closed,(43,08) -DOOR:locked,(55,06) -# Stairs -STAIR:(05,02),up -STAIR:(70,13),down -# Objects -OBJECT:random,(42,03) -OBJECT:random,(42,03) -OBJECT:random,(42,03) -OBJECT:random,(41,03) -OBJECT:random,(41,03) -OBJECT:random,(41,03) -OBJECT:random,(41,03) -OBJECT:random,(41,08) -OBJECT:random,(41,08) -OBJECT:random,(42,08) -OBJECT:random,(42,08) -OBJECT:random,(42,08) -OBJECT:random,(71,13) -OBJECT:random,(71,13) -OBJECT:random,(71,13) -# Random traps -TRAP:"spiked pit",(10,13) -TRAP:"spiked pit",(21,07) -TRAP:"spiked pit",(67,08) -TRAP:"spiked pit",(68,09) -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('O',"ogre"),(12,09),hostile -MONSTER:('O',"ogre"),(18,11),hostile -MONSTER:('O',"ogre"),(45,05),hostile -MONSTER:('O',"ogre"),(45,06),hostile -MONSTER:('O',"ogre"),(47,05),hostile -MONSTER:('O',"ogre"),(46,05),hostile -MONSTER:('O',"ogre"),(56,03),hostile -MONSTER:('O',"ogre"),(56,04),hostile -MONSTER:('O',"ogre"),(56,05),hostile -MONSTER:('O',"ogre"),(56,06),hostile -MONSTER:('O',"ogre"),(57,03),hostile -MONSTER:('O',"ogre"),(57,04),hostile -MONSTER:('O',"ogre"),(57,05),hostile -MONSTER:('O',"ogre"),(57,06),hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:'O',random,hostile -MONSTER:'T',random,hostile -MONSTER:('T',"rock troll"),(46,06),hostile -MONSTER:('T',"rock troll"),(47,06),hostile -MONSTER:('T',"rock troll"),(56,07),hostile -MONSTER:('T',"rock troll"),(57,07),hostile -MONSTER:('T',"rock troll"),(70,13),hostile -MONSTER:('T',"rock troll"),random,hostile -MONSTER:('T',"rock troll"),random,hostile -MONSTER:'T',random,hostile - -# -# The "goal" level for the quest. -# -# Here you meet Thoth Amon, your nemesis monster. You have to -# defeat Thoth Amon in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Bar-goal", ' ' -GEOMETRY:center,center -MAP - - ............. - .................. - .... ......................... .... - ....... .......................... ....... - ...... ........................ ....... - .. ...................................... .. - .. ..................... .. - .. .................. .. - .. ..S...S.............. ................ - .. ........ ... - ......... .. - ...... .. ... .... - .. ... .. ...... ........ - .... .. .................. ........ ...... - ...... ...................... ...... .. - .... .................. ........... - .............. - ........... - -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),unlit,"ordinary" -# Secret doors -DOOR:locked,(22,09) -DOOR:locked,(26,09) -# Stairs -STAIR:(36,05),up -# The altar. Unattended. -ALTAR:(63,04),noncoaligned,altar -NON_DIGGABLE:(00,00,75,19) -# Objects -OBJECT:('*',"luckstone"),(63,04),blessed,0,name:"The Heart of Ahriman" -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('@',"Thoth Amon"),(63,04),hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:('O',"ogre"),random,hostile -MONSTER:'O',random,hostile -MONSTER:'O',random,hostile -MONSTER:('T',"rock troll"),random,hostile -MONSTER:('T',"rock troll"),random,hostile -MONSTER:('T',"rock troll"),random,hostile -MONSTER:('T',"rock troll"),random,hostile -MONSTER:('T',"rock troll"),random,hostile -MONSTER:('T',"rock troll"),random,hostile -MONSTER:('T',"rock troll"),random,hostile -MONSTER:('T',"rock troll"),random,hostile -MONSTER:'T',random,hostile -WALLIFY - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "filla" is the upper filler, between the -# start and locate levels, and "fillb" the lower between the locate -# and goal levels. -# - -MAZE: "Bar-fila" , ' ' -INIT_MAP: mines, '.' , '.' , true , true , unlit , false -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -# -MONSTER: ('O', "ogre"), random, hostile -MONSTER: ('O', "ogre"), random, hostile -MONSTER: 'O', random, hostile -MONSTER: ('T', "rock troll"), random, hostile - -MAZE: "Bar-filb" , ' ' -INIT_MAP: mines, '.' , ' ' , true , true , unlit , true -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -# -MONSTER: ('O', "ogre"), random, hostile -MONSTER: ('O', "ogre"), random, hostile -MONSTER: ('O', "ogre"), random, hostile -MONSTER: ('O', "ogre"), random, hostile -MONSTER: ('O', "ogre"), random, hostile -MONSTER: ('O', "ogre"), random, hostile -MONSTER: ('O', "ogre"), random, hostile -MONSTER: 'O' , random, hostile -MONSTER: ('T', "rock troll"), random, hostile -MONSTER: ('T', "rock troll"), random, hostile -MONSTER: ('T', "rock troll"), random, hostile -MONSTER: 'T' , random, hostile diff --git a/dat/Cav-fila.lua b/dat/Cav-fila.lua new file mode 100644 index 000000000..b32a90854 --- /dev/null +++ b/dat/Cav-fila.lua @@ -0,0 +1,35 @@ +-- NetHack 3.6 Caveman.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.level_init({ style = "mines", fg = ".", bg = " ", smoothed=true, joined=true, walled=true }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.trap() +des.trap() +des.trap() +des.trap() +-- +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ class = "h", peaceful=0 }) +des.monster({ id = "hill giant", peaceful=0 }) diff --git a/dat/Cav-filb.lua b/dat/Cav-filb.lua new file mode 100644 index 000000000..0e0c24542 --- /dev/null +++ b/dat/Cav-filb.lua @@ -0,0 +1,41 @@ +-- NetHack 3.6 Caveman.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.level_init({ style = "mines", fg = ".", bg = " ", smoothed=true, joined=true, walled=true }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.trap() +des.trap() +des.trap() +des.trap() +-- +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ class = "h", peaceful=0 }) +des.monster({ class = "h", peaceful=0 }) +des.monster({ id = "hill giant", peaceful=0 }) +des.monster({ id = "hill giant", peaceful=0 }) diff --git a/dat/Cav-goal.lua b/dat/Cav-goal.lua new file mode 100644 index 000000000..98919b04f --- /dev/null +++ b/dat/Cav-goal.lua @@ -0,0 +1,59 @@ +-- NetHack 3.6 Caveman.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ + + ..................... + ....................... + ......................... + ........................... + ............................. + ............................... + ................................. + ................................... + ..................................... + ....................................... + ..................................... + ................................... + ................................. + ............................... + ............................. + ........................... + ......................... + ....................... + +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +-- Stairs +des.stair("up") +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Objects +des.object({ id = "mace", x=23, y=10, buc="blessed", spe=0, name="The Sceptre of Might" }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- monsters. +des.monster({ id = "Chromatic Dragon", x=23, y=10, asleep=1 }) +des.monster("shrieker", 26, 13) +des.monster("shrieker", 25, 8) +des.monster("shrieker", 45, 11) +des.wallify() diff --git a/dat/Cav-loca.lua b/dat/Cav-loca.lua new file mode 100644 index 000000000..e3b970948 --- /dev/null +++ b/dat/Cav-loca.lua @@ -0,0 +1,101 @@ +-- NetHack 3.6 Caveman.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "hardfloor") + +des.map([[ + + ............. ........... + ............... ............. + ............. ............... .......... + ........... ............. ............... + ... ... .................. + ... .......... ... .................. + ... ............ BBB................... + ... .......... ...................... + ..... .. .....B........................ + .... ............... . ........B.......................... + ...... .. .............S.............. .................. + .... .. ........... ............... + .. ... .................... + .... BB................... + .. .. .. ............... + .. ....... .... ..... .... .. ....... S + ............ ....... .. ....... ..... ... .... + ....... ..... ...... ....... + +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "unlit") +des.region({ region={52,06, 73,15}, lit=1, type="ordinary", prefilled=0, irregular=1 }) +-- Doors +des.door("locked",28,11) +-- Stairs +des.stair("up", 04,03) +des.stair("down", 73,10) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Objects +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster({ id = "bugbear", x=02, y=10, peaceful=0 }) +des.monster({ id = "bugbear", x=03, y=11, peaceful=0 }) +des.monster({ id = "bugbear", x=04, y=12, peaceful=0 }) +des.monster({ id = "bugbear", x=02, y=11, peaceful=0 }) +des.monster({ id = "bugbear", x=16, y=16, peaceful=0 }) +des.monster({ id = "bugbear", x=17, y=17, peaceful=0 }) +des.monster({ id = "bugbear", x=18, y=18, peaceful=0 }) +des.monster({ id = "bugbear", x=19, y=16, peaceful=0 }) +des.monster({ id = "bugbear", x=30, y=06, peaceful=0 }) +des.monster({ id = "bugbear", x=31, y=07, peaceful=0 }) +des.monster({ id = "bugbear", x=32, y=08, peaceful=0 }) +des.monster({ id = "bugbear", x=33, y=06, peaceful=0 }) +des.monster({ id = "bugbear", x=34, y=07, peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ id = "bugbear", peaceful=0 }) +des.monster({ class = "h", peaceful=0 }) +des.monster({ class = "H", peaceful=0 }) +des.monster({ id = "hill giant", x=03, y=12, peaceful=0 }) +des.monster({ id = "hill giant", x=20, y=17, peaceful=0 }) +des.monster({ id = "hill giant", x=35, y=08, peaceful=0 }) +des.monster({ id = "hill giant", peaceful=0 }) +des.monster({ id = "hill giant", peaceful=0 }) +des.monster({ id = "hill giant", peaceful=0 }) +des.monster({ id = "hill giant", peaceful=0 }) +des.monster({ class = "H", peaceful=0 }) +des.wallify() + +-- +-- The "goal" level for the quest. +-- +-- Here you meet Tiamat your nemesis monster. You have to +-- defeat Tiamat in combat to gain the artifact you have +-- been assigned to retrieve. +-- diff --git a/dat/Cav-strt.lua b/dat/Cav-strt.lua new file mode 100644 index 000000000..eae5c35d1 --- /dev/null +++ b/dat/Cav-strt.lua @@ -0,0 +1,91 @@ +-- NetHack 3.6 Caveman.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, Shaman Karnov +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor") + +des.map([[ + + ...... .......................... ... .... ...... + ...... .......................... ........ .... ..... + ..BB ............................. ......... .... .. + .. ...................... ....... .. .... .. + .. .................... .. ....... .. ... + .. S BB ..... ....... .... .... + .. ... . .. ........ .. .. .. ... + .. ...... .. ............ .. ... + . .... .. ........ .. ........... + ... .. .. ............. ................... + ..... ..... ............................... ........... + .....B................ ... ... + ..... . .......... .... . ... .......... ... + ... .. ............. .. ................... .... + BB .. ......... BB ... .......... .. ... ... + ...... ..... B ........ .. .. .... ... + .......... .......... ..... ... ..... ........ + .. ... . ..... .... .. ... .. + +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "unlit") +des.region({ region={13,01, 40,05}, lit=1, type="temple", prefilled=0, irregular=1 }) +-- The occupied rooms. +des.region({ region={02,01, 08,03}, lit=1, type="ordinary", prefilled=0, irregular=1 }) +des.region({ region={01,11, 06,14}, lit=1, type="ordinary", prefilled=0, irregular=1 }) +des.region({ region={13,08, 18,10}, lit=1, type="ordinary", prefilled=0, irregular=1 }) +des.region({ region={05,17, 14,18}, lit=1, type="ordinary", prefilled=0, irregular=1 }) +des.region({ region={17,16, 23,18}, lit=1, type="ordinary", prefilled=0, irregular=1 }) +des.region({ region={35,16, 44,18}, lit=1, type="ordinary", prefilled=0, irregular=1 }) +-- Stairs +des.stair("down", 02,03) +-- Portal arrival point +des.levregion({ region = {71,09,71,09}, type="branch" }) +-- Doors +des.door("locked",19,06) +-- The temple altar (this will force a priest(ess) to be created) +des.altar({ x=36,y=02, align="coaligned", type="shrine" }) +-- Shaman Karnov +des.monster("Shaman Karnov", 35, 02) +-- The treasure of Shaman Karnov +des.object("chest", 34, 02) +-- neanderthal guards for the audience chamber +des.monster("neanderthal", 20, 03) +des.monster("neanderthal", 20, 02) +des.monster("neanderthal", 20, 01) +des.monster("neanderthal", 21, 03) +des.monster("neanderthal", 21, 02) +des.monster("neanderthal", 21, 01) +des.monster("neanderthal", 22, 01) +des.monster("neanderthal", 26, 09) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Random traps +des.trap("pit",47,11) +des.trap("pit",57,10) +des.trap() +des.trap() +des.trap() +des.trap() +-- Monsters on siege duty (in the outer caves). +des.monster({ id ="bugbear", x=47, y=02, peaceful=0 }) +des.monster({ id ="bugbear", x=48, y=03, peaceful=0 }) +des.monster({ id ="bugbear", x=49, y=04, peaceful=0 }) +des.monster({ id ="bugbear", x=67, y=03, peaceful=0 }) +des.monster({ id ="bugbear", x=69, y=04, peaceful=0 }) +des.monster({ id ="bugbear", x=51, y=13, peaceful=0 }) +des.monster({ id ="bugbear", x=53, y=14, peaceful=0 }) +des.monster({ id ="bugbear", x=55, y=15, peaceful=0 }) +des.monster({ id ="bugbear", x=63, y=10, peaceful=0 }) +des.monster({ id ="bugbear", x=65, y=09, peaceful=0 }) +des.monster({ id ="bugbear", x=67, y=10, peaceful=0 }) +des.monster({ id ="bugbear", x=69, y=11, peaceful=0 }) +des.wallify() diff --git a/dat/Caveman.des b/dat/Caveman.des deleted file mode 100644 index a2e2ec9b8..000000000 --- a/dat/Caveman.des +++ /dev/null @@ -1,316 +0,0 @@ -# NetHack 3.6 Caveman.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1991 by M. Stephenson -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, Shaman Karnov -# and receive your quest assignment. -# -MAZE: "Cav-strt",' ' -FLAGS: noteleport,hardfloor -GEOMETRY:center,center -MAP - - ...... .......................... ... .... ...... - ...... .......................... ........ .... ..... - ..BB ............................. ......... .... .. - .. ...................... ....... .. .... .. - .. .................... .. ....... .. ... - .. S BB ..... ....... .... .... - .. ... . .. ........ .. .. .. ... - .. ...... .. ............ .. ... - . .... .. ........ .. ........... - ... .. .. ............. ................... - ..... ..... ............................... ........... - .....B................ ... ... - ..... . .......... .... . ... .......... ... - ... .. ............. .. ................... .... - BB .. ......... BB ... .......... .. ... ... - ...... ..... B ........ .. .. .... ... - .......... .......... ..... ... ..... ........ - .. ... . ..... .... .. ... .. - -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),unlit,"ordinary" -REGION:(13,01,40,05),lit,"temple",unfilled,irregular -# The occupied rooms. -REGION:(02,01,08,03),lit,"ordinary",unfilled,irregular -REGION:(01,11,06,14),lit,"ordinary",unfilled,irregular -REGION:(13,08,18,10),lit,"ordinary",unfilled,irregular -REGION:(05,17,14,18),lit,"ordinary",unfilled,irregular -REGION:(17,16,23,18),lit,"ordinary",unfilled,irregular -REGION:(35,16,44,18),lit,"ordinary",unfilled,irregular -# Stairs -STAIR:(02,03),down -# Portal arrival point -BRANCH:(71,09,71,09),(0,0,0,0) -# Doors -DOOR:locked,(19,06) -# The temple altar (this will force a priest(ess) to be created) -ALTAR:(36,02),coaligned,shrine -# Shaman Karnov -MONSTER:('@',"Shaman Karnov"),(35,02) -# The treasure of Shaman Karnov -OBJECT:('(',"chest"),(34,02) -# neanderthal guards for the audience chamber -MONSTER:('@',"neanderthal"),(20,03) -MONSTER:('@',"neanderthal"),(20,02) -MONSTER:('@',"neanderthal"),(20,01) -MONSTER:('@',"neanderthal"),(21,03) -MONSTER:('@',"neanderthal"),(21,02) -MONSTER:('@',"neanderthal"),(21,01) -MONSTER:('@',"neanderthal"),(22,01) -MONSTER:('@',"neanderthal"),(26,09) -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Random traps -TRAP:"pit",(47,11) -TRAP:"pit",(57,10) -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Monsters on siege duty (in the outer caves). -MONSTER: ('h',"bugbear"),(47,02),hostile -MONSTER: ('h',"bugbear"),(48,03),hostile -MONSTER: ('h',"bugbear"),(49,04),hostile -MONSTER: ('h',"bugbear"),(67,03),hostile -MONSTER: ('h',"bugbear"),(69,04),hostile -MONSTER: ('h',"bugbear"),(51,13),hostile -MONSTER: ('h',"bugbear"),(53,14),hostile -MONSTER: ('h',"bugbear"),(55,15),hostile -MONSTER: ('h',"bugbear"),(63,10),hostile -MONSTER: ('h',"bugbear"),(65,09),hostile -MONSTER: ('h',"bugbear"),(67,10),hostile -MONSTER: ('h',"bugbear"),(69,11),hostile -WALLIFY - -# -# The "locate" level for the quest. -# -# Here you have to find the lair of Tiamat to go -# further towards your assigned quest. -# - -MAZE: "Cav-loca",' ' -FLAGS: hardfloor -GEOMETRY:center,center -MAP - - ............. ........... - ............... ............. - ............. ............... .......... - ........... ............. ............... - ... ... .................. - ... .......... ... .................. - ... ............ BBB................... - ... .......... ...................... - ..... .. .....B........................ - .... ............... . ........B.......................... - ...... .. .............S.............. .................. - .... .. ........... ............... - .. ... .................... - .... BB................... - .. .. .. ............... - .. ....... .... ..... .... .. ....... S - ............ ....... .. ....... ..... ... .... - ....... ..... ...... ....... - -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),unlit,"ordinary" -REGION:(52,06,73,15),lit,"ordinary",unfilled,irregular -# Doors -DOOR:locked,(28,11) -# Stairs -STAIR:(04,03),up -STAIR:(73,10),down -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('h',"bugbear"),(02,10),hostile -MONSTER:('h',"bugbear"),(03,11),hostile -MONSTER:('h',"bugbear"),(04,12),hostile -MONSTER:('h',"bugbear"),(02,11),hostile -MONSTER:('h',"bugbear"),(16,16),hostile -MONSTER:('h',"bugbear"),(17,17),hostile -MONSTER:('h',"bugbear"),(18,18),hostile -MONSTER:('h',"bugbear"),(19,16),hostile -MONSTER:('h',"bugbear"),(30,06),hostile -MONSTER:('h',"bugbear"),(31,07),hostile -MONSTER:('h',"bugbear"),(32,08),hostile -MONSTER:('h',"bugbear"),(33,06),hostile -MONSTER:('h',"bugbear"),(34,07),hostile -MONSTER:('h',"bugbear"),random,hostile -MONSTER:('h',"bugbear"),random,hostile -MONSTER:('h',"bugbear"),random,hostile -MONSTER:('h',"bugbear"),random,hostile -MONSTER:'h',random,hostile -MONSTER:'H',random,hostile -MONSTER:('H',"hill giant"),(03,12),hostile -MONSTER:('H',"hill giant"),(20,17),hostile -MONSTER:('H',"hill giant"),(35,08),hostile -MONSTER:('H',"hill giant"),random,hostile -MONSTER:('H',"hill giant"),random,hostile -MONSTER:('H',"hill giant"),random,hostile -MONSTER:('H',"hill giant"),random,hostile -MONSTER:'H',random,hostile -WALLIFY - -# -# The "goal" level for the quest. -# -# Here you meet Tiamat your nemesis monster. You have to -# defeat Tiamat in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Cav-goal", ' ' -GEOMETRY:center,center -MAP - - ..................... - ....................... - ......................... - ........................... - ............................. - ............................... - ................................. - ................................... - ..................................... - ....................................... - ..................................... - ................................... - ................................. - ............................... - ............................. - ........................... - ......................... - ....................... - -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -# Stairs -STAIR:random,up -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Objects -OBJECT:(')',"mace"),(23,10),blessed,0,name:"The Sceptre of Might" -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# monsters. -MONSTER:('D',"Chromatic Dragon"),(23,10),asleep -MONSTER:('F',"shrieker"),(26,13) -MONSTER:('F',"shrieker"),(25,8) -MONSTER:('F',"shrieker"),(45,11) -WALLIFY - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "filla" is the upper filler, between the -# start and locate levels, and "fillb" the lower between the locate -# and goal levels. -# - -MAZE: "Cav-fila" , ' ' -INIT_MAP: mines, '.' , ' ' , true , true , random , true -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -# -MONSTER: ('h', "bugbear"), random, hostile -MONSTER: ('h', "bugbear"), random, hostile -MONSTER: ('h', "bugbear"), random, hostile -MONSTER: ('h', "bugbear"), random, hostile -MONSTER: ('h', "bugbear"), random, hostile -MONSTER: 'h', random, hostile -MONSTER: ('H', "hill giant"), random, hostile - -MAZE: "Cav-filb" , ' ' -INIT_MAP: mines, '.' , ' ' , true , true , random , true -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -# -MONSTER: ('h', "bugbear"), random, hostile -MONSTER: ('h', "bugbear"), random, hostile -MONSTER: ('h', "bugbear"), random, hostile -MONSTER: ('h', "bugbear"), random, hostile -MONSTER: 'h', random, hostile -MONSTER: 'h', random, hostile -MONSTER: ('H', "hill giant"), random, hostile -MONSTER: ('H', "hill giant"), random, hostile diff --git a/dat/Hea-fila.lua b/dat/Hea-fila.lua new file mode 100644 index 000000000..bee89587f --- /dev/null +++ b/dat/Hea-fila.lua @@ -0,0 +1,42 @@ +-- NetHack 3.6 Healer.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991, 1993 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = "P" }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg="P", smoothed=false, joined=true, lit=1, walled=false }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.monster("rabid rat") +des.monster({ class = "r", peaceful=0 }) +des.monster({ class = "r", peaceful=0 }) +des.monster("giant eel") +des.monster("giant eel") +des.monster("electric eel") +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +-- +des.trap() +des.trap() +des.trap() +des.trap() diff --git a/dat/Hea-filb.lua b/dat/Hea-filb.lua new file mode 100644 index 000000000..ac6325866 --- /dev/null +++ b/dat/Hea-filb.lua @@ -0,0 +1,50 @@ +-- NetHack 3.6 Healer.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991, 1993 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = "P" }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg="P", smoothed=false, joined=true, lit=1, walled=false }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.monster("rabid rat") +des.monster("rabid rat") +des.monster({ class = "r", peaceful=0 }) +des.monster({ class = "r", peaceful=0 }) +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("electric eel") +des.monster("electric eel") +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +-- +des.trap() +des.trap() +des.trap() +des.trap() diff --git a/dat/Hea-goal.lua b/dat/Hea-goal.lua new file mode 100644 index 000000000..48d6fbae4 --- /dev/null +++ b/dat/Hea-goal.lua @@ -0,0 +1,90 @@ +-- NetHack 3.6 Healer.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991, 1993 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = "P" }); + +des.level_flags("mazelevel"); + +-- +des.level_init({ style="mines", fg=".", bg="P", smoothed=false, joined=true, lit=1, walled=false }) + +des.map([[ +.P....................................PP. +PP.......PPPPPPP....PPPPPPP....PPPP...PP. +...PPPPPPP....PPPPPPP.....PPPPPP..PPP...P +...PP..............................PPP... +..PP..............................PP..... +..PP..............................PPP.... +..PPP..............................PP.... +.PPP..............................PPPP... +...PP............................PPP...PP +..PPPP...PPPPP..PPPP...PPPPP.....PP...PP. +P....PPPPP...PPPP..PPPPP...PPPPPPP...PP.. +PPP..................................PPP. +]]); +-- Dungeon Description +des.region(selection.area(00,00,40,11), "lit") +-- Stairs +des.stair("up", 39,10) +-- Non diggable walls +des.non_diggable(selection.area(00,00,40,11)) +-- Objects +des.object({ id = "quarterstaff", x=20, y=06, buc="blessed", spe=0, name="The Staff of Aesculapius" }) +des.object("lightning", 20, 06) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster({ id = "Cyclops", x=20, y=06, peaceful=0 }) +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster({ class = "r", peaceful=0 }) +des.monster({ class = "r", peaceful=0 }) +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("electric eel") +des.monster("electric eel") +des.monster("shark") +des.monster("shark") +des.monster({ class = ";", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) + diff --git a/dat/Hea-loca.lua b/dat/Hea-loca.lua new file mode 100644 index 000000000..fdc432471 --- /dev/null +++ b/dat/Hea-loca.lua @@ -0,0 +1,97 @@ +-- NetHack 3.6 Healer.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991, 1993 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "hardfloor"); +-- +des.level_init({ style="mines", fg=".", bg="P", smoothed=true ,joined=true, lit=1, walled=false }) + +des.map([[ +PPPPPPPPPPPPP.......PPPPPPPPPPP +PPPPPPPP...............PPPPPPPP +PPPP.....-------------...PPPPPP +PPPPP....|.S.........|....PPPPP +PPP......+.|.........|...PPPPPP +PPP......+.|.........|..PPPPPPP +PPPP.....|.S.........|..PPPPPPP +PPPPP....-------------....PPPPP +PPPPPPPP...............PPPPPPPP +PPPPPPPPPPP........PPPPPPPPPPPP +]]); +-- Dungeon Description +des.region(selection.area(00,00,30,09), "lit") +des.region({ region={12,03, 20,06}, lit=1, type="temple" }) +-- Doors +des.door("closed",09,04) +des.door("closed",09,05) +des.door("locked",11,03) +des.door("locked",11,06) +-- Stairs +des.stair("up", 04,04) +des.stair("down", 20,06) +-- Non diggable walls +des.non_diggable(selection.area(11,02,21,07)) +-- Altar in the temple. +des.altar({ x=13,y=05, align="chaos", type="shrine" }) +-- Objects +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster({ class = "r", peaceful=0 }) +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("electric eel") +des.monster("electric eel") +des.monster("kraken") +des.monster("shark") +des.monster("shark") +des.monster({ class = ";", peaceful=0 }) +des.monster({ class = ";", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) diff --git a/dat/Hea-strt.lua b/dat/Hea-strt.lua new file mode 100644 index 000000000..665c73097 --- /dev/null +++ b/dat/Hea-strt.lua @@ -0,0 +1,107 @@ +-- NetHack 3.6 Healer.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991, 1993 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, Hippocrates +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor") + +des.map([[ +PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP +PPPP........PPPP.....PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP.P..PPPPP......PPPPPPPP +PPP..........PPPP...PPPPP.........................PPPP..PPPPP........PPPPPPP +PP............PPPPPPPP..............................PPP...PPPP......PPPPPPPP +P.....PPPPPPPPPPPPPPP................................PPPPPPPPPPPPPPPPPPPPPPP +PPPP....PPPPPPPPPPPP...................................PPPPP.PPPPPPPPPPPPPPP +PPPP........PPPPP.........-----------------------........PP...PPPPPPP.....PP +PPP............PPPPP....--|.|......S..........S.|--.....PPPP.PPPPPPP.......P +PPPP..........PPPPP.....|.S.|......-----------|S|.|......PPPPPP.PPP.......PP +PPPPPP......PPPPPP......|.|.|......|...|......|.|.|.....PPPPPP...PP.......PP +PPPPPPPPPPPPPPPPPPP.....+.|.|......S.\.S......|.|.+......PPPPPP.PPPP.......P +PPP...PPPPP...PPPP......|.|.|......|...|......|.|.|.......PPPPPPPPPPP.....PP +PP.....PPP.....PPP......|.|S|-----------......|.S.|......PPPPPPPPPPPPPPPPPPP +PPP..PPPPP...PPPP.......--|.S..........S......|.|--.....PPPPPPPPP....PPPPPPP +PPPPPPPPPPPPPPPP..........-----------------------..........PPPPP..........PP +PPPPPPPPPPPPPPPPP........................................PPPPPP............P +PPP.............PPPP...................................PPP..PPPP..........PP +PP...............PPPPP................................PPPP...PPPP........PPP +PPP.............PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP....PPPPPP +PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP +]]); + +des.replace_terrain({ region={01,01, 74,18}, fromterrain="P", toterrain=".", chance=10 }) + +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +-- Stairs +des.stair("down", 37,9) +-- Portal arrival point +des.levregion({ region = {04,12,04,12}, type="branch" }) +-- altar for the Temple +des.altar({ x=32,y=09,align="neutral",type="altar" }) +-- Doors +des.door("locked",24,10) +des.door("closed",26,08) +des.door("closed",27,12) +des.door("locked",28,13) +des.door("closed",35,07) +des.door("locked",35,10) +des.door("locked",39,10) +des.door("closed",39,13) +des.door("locked",46,07) +des.door("closed",47,08) +des.door("closed",48,12) +des.door("locked",50,10) +-- Hippocrates +des.monster("Hippocrates", 37, 10) +-- The treasure of Hippocrates +des.object("chest", 37, 10) +-- intern guards for the audience chamber +des.monster("attendant", 29, 08) +des.monster("attendant", 29, 09) +des.monster("attendant", 29, 10) +des.monster("attendant", 29, 11) +des.monster("attendant", 40, 09) +des.monster("attendant", 40, 10) +des.monster("attendant", 40, 11) +des.monster("attendant", 40, 13) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Monsters on siege duty. +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("rabid rat") +des.monster("giant eel") +des.monster("shark") +des.monster(";") +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) +des.monster({ class = "S", peaceful=0 }) diff --git a/dat/Healer.des b/dat/Healer.des deleted file mode 100644 index 1f8e3497d..000000000 --- a/dat/Healer.des +++ /dev/null @@ -1,380 +0,0 @@ -# NetHack 3.6 Healer.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1991, 1993 by M. Stephenson, P. Winner -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, Hippocrates -# and receive your quest assignment. -# -MAZE: "Hea-strt",' ' -FLAGS: noteleport,hardfloor -GEOMETRY:center,center -MAP -PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP -PPPP........PPPP.....PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP.P..PPPPP......PPPPPPPP -PPP..........PPPP...PPPPP.........................PPPP..PPPPP........PPPPPPP -PP............PPPPPPPP..............................PPP...PPPP......PPPPPPPP -P.....PPPPPPPPPPPPPPP................................PPPPPPPPPPPPPPPPPPPPPPP -PPPP....PPPPPPPPPPPP...................................PPPPP.PPPPPPPPPPPPPPP -PPPP........PPPPP.........-----------------------........PP...PPPPPPP.....PP -PPP............PPPPP....--|.|......S..........S.|--.....PPPP.PPPPPPP.......P -PPPP..........PPPPP.....|.S.|......-----------|S|.|......PPPPPP.PPP.......PP -PPPPPP......PPPPPP......|.|.|......|...|......|.|.|.....PPPPPP...PP.......PP -PPPPPPPPPPPPPPPPPPP.....+.|.|......S.\.S......|.|.+......PPPPPP.PPPP.......P -PPP...PPPPP...PPPP......|.|.|......|...|......|.|.|.......PPPPPPPPPPP.....PP -PP.....PPP.....PPP......|.|S|-----------......|.S.|......PPPPPPPPPPPPPPPPPPP -PPP..PPPPP...PPPP.......--|.S..........S......|.|--.....PPPPPPPPP....PPPPPPP -PPPPPPPPPPPPPPPP..........-----------------------..........PPPPP..........PP -PPPPPPPPPPPPPPPPP........................................PPPPPP............P -PPP.............PPPP...................................PPP..PPPP..........PP -PP...............PPPPP................................PPPP...PPPP........PPP -PPP.............PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP....PPPPPP -PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP -ENDMAP - -REPLACE_TERRAIN:(01,01,74,18), 'P', '.', 10% - -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -# Stairs -STAIR:(37,9),down -# Portal arrival point -BRANCH:(04,12,04,12),(0,0,0,0) -# altar for the Temple -ALTAR:(32,09),neutral,altar -# Doors -DOOR:locked,(24,10) -DOOR:closed,(26,08) -DOOR:closed,(27,12) -DOOR:locked,(28,13) -DOOR:closed,(35,07) -DOOR:locked,(35,10) -DOOR:locked,(39,10) -DOOR:closed,(39,13) -DOOR:locked,(46,07) -DOOR:closed,(47,08) -DOOR:closed,(48,12) -DOOR:locked,(50,10) -# Hippocrates -MONSTER:('@',"Hippocrates"),(37,10) -# The treasure of Hippocrates -OBJECT:('(',"chest"),(37,10) -# intern guards for the audience chamber -MONSTER:('@',"attendant"),(29,08) -MONSTER:('@',"attendant"),(29,09) -MONSTER:('@',"attendant"),(29,10) -MONSTER:('@',"attendant"),(29,11) -MONSTER:('@',"attendant"),(40,09) -MONSTER:('@',"attendant"),(40,10) -MONSTER:('@',"attendant"),(40,11) -MONSTER:('@',"attendant"),(40,13) -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Monsters on siege duty. -MONSTER: ('r',"rabid rat"),random -MONSTER: ('r',"rabid rat"),random -MONSTER: ('r',"rabid rat"),random -MONSTER: ('r',"rabid rat"),random -MONSTER: ('r',"rabid rat"),random -MONSTER: ('r',"rabid rat"),random -MONSTER: ('r',"rabid rat"),random -MONSTER: ('r',"rabid rat"),random -MONSTER: ('r',"rabid rat"),random -MONSTER: ('r',"rabid rat"),random -MONSTER: (';',"giant eel"),random -MONSTER: (';',"shark"),random -MONSTER: ';', random -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -# -# The "locate" level for the quest. -# -# Here you have to find the Temple of Coeus to go -# further towards your assigned quest. -# - -MAZE: "Hea-loca",' ' -FLAGS: hardfloor -# -INIT_MAP: mines, '.' , 'P', true , true , lit , false -GEOMETRY:center,center -MAP -PPPPPPPPPPPPP.......PPPPPPPPPPP -PPPPPPPP...............PPPPPPPP -PPPP.....-------------...PPPPPP -PPPPP....|.S.........|....PPPPP -PPP......+.|.........|...PPPPPP -PPP......+.|.........|..PPPPPPP -PPPP.....|.S.........|..PPPPPPP -PPPPP....-------------....PPPPP -PPPPPPPP...............PPPPPPPP -PPPPPPPPPPP........PPPPPPPPPPPP -ENDMAP -# Dungeon Description -REGION:(00,00,30,09),lit,"ordinary" -REGION:(12,03,20,06),lit,"temple" -# Doors -DOOR:closed,(09,04) -DOOR:closed,(09,05) -DOOR:locked,(11,03) -DOOR:locked,(11,06) -# Stairs -STAIR:(04,04),up -STAIR:(20,06),down -# Non diggable walls -NON_DIGGABLE:(11,02,21,07) -# Altar in the temple. -ALTAR:(13,05), chaos, shrine -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('r',"rabid rat"),random -MONSTER:('r',"rabid rat"),random -MONSTER:('r',"rabid rat"),random -MONSTER:('r',"rabid rat"),random -MONSTER:('r',"rabid rat"),random -MONSTER:('r',"rabid rat"),random -MONSTER:('r',"rabid rat"),random -MONSTER:('r',"rabid rat"),random -MONSTER:'r',random,hostile -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"kraken"),random -MONSTER:(';',"shark"),random -MONSTER:(';',"shark"),random -MONSTER:';', random,hostile -MONSTER:';', random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile - -# -# The "goal" level for the quest. -# -# Here you meet Cyclops your nemesis monster. You have to -# defeat Cyclops in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Hea-goal", 'P' -# -INIT_MAP: mines, '.' , 'P' , false , true , lit , false -GEOMETRY:center,center -MAP -.P....................................PP. -PP.......PPPPPPP....PPPPPPP....PPPP...PP. -...PPPPPPP....PPPPPPP.....PPPPPP..PPP...P -...PP..............................PPP... -..PP..............................PP..... -..PP..............................PPP.... -..PPP..............................PP.... -.PPP..............................PPPP... -...PP............................PPP...PP -..PPPP...PPPPP..PPPP...PPPPP.....PP...PP. -P....PPPPP...PPPP..PPPPP...PPPPPPP...PP.. -PPP..................................PPP. -ENDMAP -# Dungeon Description -REGION:(00,00,40,11),lit,"ordinary" -# Stairs -STAIR:(39,10),up -# Non diggable walls -NON_DIGGABLE:(00,00,40,11) -# Objects -OBJECT:(')',"quarterstaff"),(20,06),blessed,0,name:"The Staff of Aesculapius" -OBJECT:('/',"lightning"),(20,06) -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('H',"Cyclops"),(20,06),hostile -MONSTER:('r',"rabid rat"),random -MONSTER:('r',"rabid rat"),random -MONSTER:('r',"rabid rat"),random -MONSTER:'r',random,hostile -MONSTER:'r',random,hostile -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"shark"),random -MONSTER:(';',"shark"),random -MONSTER:';',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "filla" is the upper filler, between the -# start and locate levels, and "fillb" the lower between the locate -# and goal levels. -# - -MAZE: "Hea-fila" , 'P' -INIT_MAP: mines, '.' , 'P' , false , true , lit , false -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -MONSTER: ('r', "rabid rat"), random -MONSTER: 'r', random,hostile -MONSTER: 'r', random,hostile -MONSTER: (';', "giant eel"), random -MONSTER: (';', "giant eel"), random -MONSTER: (';', "electric eel"), random -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random - -MAZE: "Hea-filb" , 'P' -INIT_MAP: mines, '.' , 'P' , false , true , lit , false -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -MONSTER: ('r', "rabid rat"), random -MONSTER: ('r', "rabid rat"), random -MONSTER: 'r', random,hostile -MONSTER: 'r', random,hostile -MONSTER: (';', "giant eel"), random -MONSTER: (';', "giant eel"), random -MONSTER: (';', "giant eel"), random -MONSTER: (';', "giant eel"), random -MONSTER: (';', "giant eel"), random -MONSTER: (';', "electric eel"), random -MONSTER: (';', "electric eel"), random -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'D',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -MONSTER: 'S',random,hostile -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random diff --git a/dat/Kni-fila.lua b/dat/Kni-fila.lua new file mode 100644 index 000000000..08bc089cf --- /dev/null +++ b/dat/Kni-fila.lua @@ -0,0 +1,35 @@ +-- NetHack 3.6 Knight.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991,92 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = "." }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg="P", smoothed=false, joined=true, lit=1, walled=false }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ class = "i", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +-- +des.trap() +des.trap() +des.trap() +des.trap() diff --git a/dat/Kni-filb.lua b/dat/Kni-filb.lua new file mode 100644 index 000000000..98a324b37 --- /dev/null +++ b/dat/Kni-filb.lua @@ -0,0 +1,40 @@ +-- NetHack 3.6 Knight.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991,92 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = "." }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg="P", smoothed=false, joined=true, lit=1, walled=false }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ class = "i", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +-- +des.trap() +des.trap() +des.trap() +des.trap() diff --git a/dat/Kni-goal.lua b/dat/Kni-goal.lua new file mode 100644 index 000000000..577355937 --- /dev/null +++ b/dat/Kni-goal.lua @@ -0,0 +1,99 @@ +-- NetHack 3.6 Knight.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991,92 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ +....PPPP..PPP.. +.PPPPP...PP.. .......... ................................. +..PPPPP...P.. ........... ................................... +..PPP....... ........... ...................................... +...PPP....... ......... ............... ..................... +........... ............ ............ ...................... +............ ............. ....... ..................... +.............................. ......................... +............................... .................................. +............................. .................................... +......... ...................................................... +.....PP... ..................................................... +.....PPP.... .................................................... +......PPP.... .............. .................................... +.......PPP.... ............. ..................................... +........PP... ............ ...................................... +...PPP........ .......... .................................. +..PPPPP........ .......... .............................. +....PPPPP...... ......... .......................... +.......PPPP... +]]); +-- Dungeon Description +des.region(selection.area(00,00,14,19), "lit") +des.region(selection.area(15,00,75,19), "unlit") +-- Stairs +des.stair("up", 03,08) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Objects +des.object({ id = "mirror", x=50,y=06, buc="blessed", spe=0, name="The Magic Mirror of Merlin" }) +des.object({ coord = { 33, 01 } }) +des.object({ coord = { 33, 02 } }) +des.object({ coord = { 33, 03 } }) +des.object({ coord = { 33, 04 } }) +des.object({ coord = { 33, 05 } }) +des.object({ coord = { 34, 01 } }) +des.object({ coord = { 34, 02 } }) +des.object({ coord = { 34, 03 } }) +des.object({ coord = { 34, 04 } }) +des.object({ coord = { 34, 05 } }) +des.object({ coord = { 35, 01 } }) +des.object({ coord = { 35, 02 } }) +des.object({ coord = { 35, 03 } }) +des.object({ coord = { 35, 04 } }) +des.object({ coord = { 35, 05 } }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap("spiked pit",13,07) +des.trap("spiked pit",12,08) +des.trap("spiked pit",12,09) +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster({ id = "Ixoth", x=50, y=06, peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ class = "i", peaceful=0 }) +des.monster({ class = "i", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ class = "j", peaceful=0 }) diff --git a/dat/Kni-loca.lua b/dat/Kni-loca.lua new file mode 100644 index 000000000..20aed41f5 --- /dev/null +++ b/dat/Kni-loca.lua @@ -0,0 +1,137 @@ +-- NetHack 3.6 Knight.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991,92 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "hardfloor") + +des.level_init({ style="mines", fg=".", bg="P", smoothed=false, joined=true, lit=1, walled=false }) + +des.map([[ +xxxxxxxxx......xxxx...........xxxxxxxxxx +xxxxxxx.........xxx.............xxxxxxxx +xxxx..............................xxxxxx +xx.................................xxxxx +....................................xxxx +.......................................x +........................................ +xx...................................xxx +xxxx..............................xxxxxx +xxxxxx..........................xxxxxxxx +xxxxxxxx.........xx..........xxxxxxxxxxx +xxxxxxxxx.......xxxxxx.....xxxxxxxxxxxxx +]]); +-- Dungeon Description +-- The Isle of Glass is a Tor rising out of the swamps surrounding it. +des.region(selection.area(00,00,39,11), "lit") +-- The top area of the Tor is a holy site. +des.region({ region={09,02, 27,09}, lit=1, type="temple" }) +-- Stairs +des.stair("up", 38,0) +des.stair("down", 18,05) +-- The altar atop the Tor and its attendant (creating altar makes the priest). +des.altar({ x=17, y=05, align="neutral", type="shrine" }) +-- Objects +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +-- All of the avenues are guarded by magic except for the East. +-- South +des.trap("magic",08,11) +des.trap("magic",09,11) +des.trap("magic",10,11) +des.trap("magic",11,11) +des.trap("magic",12,11) +des.trap("magic",13,11) +des.trap("magic",14,11) +des.trap("magic",15,11) +des.trap("magic",16,11) +des.trap("magic",20,11) +des.trap("magic",21,11) +des.trap("magic",22,11) +des.trap("magic",23,11) +des.trap("magic",24,11) +des.trap("magic",25,11) +des.trap("magic",26,11) +des.trap("magic",27,11) +des.trap("magic",28,11) +-- West +des.trap("magic",00,03) +des.trap("magic",00,04) +des.trap("magic",00,05) +des.trap("magic",00,06) +-- North +des.trap("magic",06,00) +des.trap("magic",07,00) +des.trap("magic",08,00) +des.trap("magic",09,00) +des.trap("magic",10,00) +des.trap("magic",11,00) +des.trap("magic",12,00) +des.trap("magic",13,00) +des.trap("magic",14,00) +des.trap("magic",19,00) +des.trap("magic",20,00) +des.trap("magic",21,00) +des.trap("magic",22,00) +des.trap("magic",23,00) +des.trap("magic",24,00) +des.trap("magic",25,00) +des.trap("magic",26,00) +des.trap("magic",27,00) +des.trap("magic",28,00) +des.trap("magic",29,00) +des.trap("magic",30,00) +des.trap("magic",31,00) +des.trap("magic",32,00) +-- Even so, there are magic "sinkholes" around. +des.trap("anti magic") +des.trap("anti magic") +des.trap("anti magic") +des.trap("anti magic") +des.trap("anti magic") +des.trap("anti magic") +des.trap("anti magic") +-- Random monsters. +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ id = "quasit", peaceful=0 }) +des.monster({ class = "i", peaceful=0 }) +des.monster({ class = "j", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ id = "ochre jelly", peaceful=0 }) +des.monster({ class = "j", peaceful=0 }) diff --git a/dat/Kni-strt.lua b/dat/Kni-strt.lua new file mode 100644 index 000000000..8feba3489 --- /dev/null +++ b/dat/Kni-strt.lua @@ -0,0 +1,102 @@ +-- NetHack 3.6 Knight.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991,92 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, King Arthur +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = "." }); + +des.level_flags("mazelevel", "noteleport", "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(selection.area(00,00,49,15), "lit") +des.region(selection.area(04,04,45,11), "unlit") +des.region({ region={06,06,22,09}, lit=1, type="throne", prefilled=1 }) +des.region(selection.area(27,06,43,09), "lit") +-- Portal arrival point +des.levregion({ region = {20,14,20,14}, type="branch" }) +-- Stairs +des.stair("down", 40,7) +-- Doors +-- Outside Doors +des.door("locked",24,03) +des.door("locked",25,03) +-- Inside Doors +des.door("closed",23,04) +des.door("closed",26,04) +des.door("locked",24,05) +des.door("locked",25,05) +des.door("closed",23,07) +des.door("closed",26,07) +des.door("closed",23,08) +des.door("closed",26,08) +des.door("closed",36,08) +-- Watchroom Doors +des.door("closed",04,03) +des.door("closed",45,03) +des.door("closed",04,12) +des.door("closed",45,12) +-- King Arthur +des.monster("King Arthur", 09, 07) +-- The treasure of King Arthur +des.object("chest", 09, 07) +-- knight guards for the watchrooms +des.monster({ id = "knight", x=04, y=02, peaceful = 1 }) +des.monster({ id = "knight", x=04, y=13, peaceful = 1 }) +des.monster({ id = "knight", x=45, y=02, peaceful = 1 }) +des.monster({ id = "knight", x=45, y=13, peaceful = 1 }) +-- page guards for the audience chamber +des.monster("page", 16, 06) +des.monster("page", 18, 06) +des.monster("page", 20, 06) +des.monster("page", 16, 09) +des.monster("page", 18, 09) +des.monster("page", 20, 09) +-- Non diggable walls +des.non_diggable(selection.area(00,00,49,15)) +-- Random traps +des.trap("sleep gas",24,04) +des.trap("sleep gas",25,04) +des.trap() +des.trap() +des.trap() +des.trap() +-- Monsters on siege duty. +des.monster({ id = "quasit", x=14, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=16, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=18, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=20, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=22, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=24, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=26, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=28, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=30, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=32, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=34, y=00, peaceful=0 }) +des.monster({ id = "quasit", x=36, y=00, peaceful=0 }) + diff --git a/dat/Knight.des b/dat/Knight.des deleted file mode 100644 index d5db2e01c..000000000 --- a/dat/Knight.des +++ /dev/null @@ -1,408 +0,0 @@ -# NetHack 3.6 Knight.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1991,92 by M. Stephenson -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, King Arthur -# and receive your quest assignment. -# -MAZE: "Kni-strt",'.' -FLAGS: noteleport,hardfloor -# This is a kludge to init the level as a lit field. -INIT_MAP: mines, '.' , '.' , false , false , lit , false -GEOMETRY:center,center -MAP -.................................................. -.-----......................................-----. -.|...|......................................|...|. -.--|+-------------------++-------------------+|--. -...|...................+..+...................|... -...|.|-----------------|++|-----------------|.|... -...|.|.................|..|.........|.......|.|... -...|.|...\.............+..+.........|.......|.|... -...|.|.................+..+.........+.......|.|... -...|.|.................|..|.........|.......|.|... -...|.|--------------------------------------|.|... -...|..........................................|... -.--|+----------------------------------------+|--. -.|...|......................................|...|. -.-----......................................-----. -.................................................. -ENDMAP -# Dungeon Description -REGION:(00,00,49,15),lit,"ordinary" -REGION:(04,04,45,11),unlit,"ordinary" -REGION:(06,06,22,09),lit,"throne" , unfilled -REGION:(27,06,43,09),lit,"ordinary" -# Portal arrival point -BRANCH:(20,14,20,14),(0,0,0,0) -# Stairs -STAIR:(40,7),down -# Doors -# Outside Doors -DOOR:locked,(24,03) -DOOR:locked,(25,03) -# Inside Doors -DOOR:closed,(23,04) -DOOR:closed,(26,04) -DOOR:locked,(24,05) -DOOR:locked,(25,05) -DOOR:closed,(23,07) -DOOR:closed,(26,07) -DOOR:closed,(23,08) -DOOR:closed,(26,08) -DOOR:closed,(36,08) -# Watchroom Doors -DOOR:closed,(04,03) -DOOR:closed,(45,03) -DOOR:closed,(04,12) -DOOR:closed,(45,12) -# King Arthur -MONSTER:('@',"King Arthur"),(09,07) -# The treasure of King Arthur -OBJECT:('(',"chest"),(09,07) -# knight guards for the watchrooms -MONSTER:('@',"knight"),(04,02),peaceful -MONSTER:('@',"knight"),(04,13),peaceful -MONSTER:('@',"knight"),(45,02),peaceful -MONSTER:('@',"knight"),(45,13),peaceful -# page guards for the audience chamber -MONSTER:('@',"page"),(16,06) -MONSTER:('@',"page"),(18,06) -MONSTER:('@',"page"),(20,06) -MONSTER:('@',"page"),(16,09) -MONSTER:('@',"page"),(18,09) -MONSTER:('@',"page"),(20,09) -# Non diggable walls -NON_DIGGABLE:(00,00,49,15) -# Random traps -TRAP:"sleep gas",(24,04) -TRAP:"sleep gas",(25,04) -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Monsters on siege duty. -MONSTER: ('i',"quasit"),(14,00),hostile -MONSTER: ('i',"quasit"),(16,00),hostile -MONSTER: ('i',"quasit"),(18,00),hostile -MONSTER: ('i',"quasit"),(20,00),hostile -MONSTER: ('i',"quasit"),(22,00),hostile -MONSTER: ('i',"quasit"),(24,00),hostile -MONSTER: ('i',"quasit"),(26,00),hostile -MONSTER: ('i',"quasit"),(28,00),hostile -MONSTER: ('i',"quasit"),(30,00),hostile -MONSTER: ('i',"quasit"),(32,00),hostile -MONSTER: ('i',"quasit"),(34,00),hostile -MONSTER: ('i',"quasit"),(36,00),hostile - -# -# The "locate" level for the quest. -# -# Here you have to find your way to the Isle of Glass to go -# further towards your assigned quest. -# - -MAZE: "Kni-loca",' ' -FLAGS: hardfloor -INIT_MAP: mines, '.' , 'P' , false , true , lit , false -GEOMETRY:center,center -MAP -xxxxxxxxx......xxxx...........xxxxxxxxxx -xxxxxxx.........xxx.............xxxxxxxx -xxxx..............................xxxxxx -xx.................................xxxxx -....................................xxxx -.......................................x -........................................ -xx...................................xxx -xxxx..............................xxxxxx -xxxxxx..........................xxxxxxxx -xxxxxxxx.........xx..........xxxxxxxxxxx -xxxxxxxxx.......xxxxxx.....xxxxxxxxxxxxx -ENDMAP -# Dungeon Description -# The Isle of Glass is a Tor rising out of the swamps surrounding it. -REGION:(00,00,39,11),lit,"ordinary" -# The top area of the Tor is a holy site. -REGION:(09,02,27,09),lit,"temple" -# Stairs -STAIR:(38,0),up -STAIR:(18,05),down -# The altar atop the Tor and its attendant (creating altar makes the priest). -ALTAR:(17,05),neutral,shrine -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -# All of the avenues are guarded by magic except for the East. -# South -TRAP:"magic",(08,11) -TRAP:"magic",(09,11) -TRAP:"magic",(10,11) -TRAP:"magic",(11,11) -TRAP:"magic",(12,11) -TRAP:"magic",(13,11) -TRAP:"magic",(14,11) -TRAP:"magic",(15,11) -TRAP:"magic",(16,11) -TRAP:"magic",(20,11) -TRAP:"magic",(21,11) -TRAP:"magic",(22,11) -TRAP:"magic",(23,11) -TRAP:"magic",(24,11) -TRAP:"magic",(25,11) -TRAP:"magic",(26,11) -TRAP:"magic",(27,11) -TRAP:"magic",(28,11) -# West -TRAP:"magic",(00,03) -TRAP:"magic",(00,04) -TRAP:"magic",(00,05) -TRAP:"magic",(00,06) -# North -TRAP:"magic",(06,00) -TRAP:"magic",(07,00) -TRAP:"magic",(08,00) -TRAP:"magic",(09,00) -TRAP:"magic",(10,00) -TRAP:"magic",(11,00) -TRAP:"magic",(12,00) -TRAP:"magic",(13,00) -TRAP:"magic",(14,00) -TRAP:"magic",(19,00) -TRAP:"magic",(20,00) -TRAP:"magic",(21,00) -TRAP:"magic",(22,00) -TRAP:"magic",(23,00) -TRAP:"magic",(24,00) -TRAP:"magic",(25,00) -TRAP:"magic",(26,00) -TRAP:"magic",(27,00) -TRAP:"magic",(28,00) -TRAP:"magic",(29,00) -TRAP:"magic",(30,00) -TRAP:"magic",(31,00) -TRAP:"magic",(32,00) -# Even so, there are magic "sinkholes" around. -TRAP:"anti magic",random -TRAP:"anti magic",random -TRAP:"anti magic",random -TRAP:"anti magic",random -TRAP:"anti magic",random -TRAP:"anti magic",random -TRAP:"anti magic",random -# Random monsters. -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:'i',random,hostile -MONSTER:'j',random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:'j',random,hostile - -# -# The "goal" level for the quest. -# -# Here you meet Ixoth your nemesis monster. You have to -# defeat Ixoth in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Kni-goal", ' ' -GEOMETRY:center,center -MAP -....PPPP..PPP.. -.PPPPP...PP.. .......... ................................. -..PPPPP...P.. ........... ................................... -..PPP....... ........... ...................................... -...PPP....... ......... ............... ..................... -........... ............ ............ ...................... -............ ............. ....... ..................... -.............................. ......................... -............................... .................................. -............................. .................................... -......... ...................................................... -.....PP... ..................................................... -.....PPP.... .................................................... -......PPP.... .............. .................................... -.......PPP.... ............. ..................................... -........PP... ............ ...................................... -...PPP........ .......... .................................. -..PPPPP........ .......... .............................. -....PPPPP...... ......... .......................... -.......PPPP... -ENDMAP -# Dungeon Description -REGION:(00,00,14,19),lit,"ordinary" -REGION:(15,00,75,19),unlit,"ordinary" -# Stairs -STAIR:(03,08),up -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Objects -OBJECT:('(',"mirror"),(50,06),blessed,0,name:"The Magic Mirror of Merlin" -OBJECT:random,(33,01) -OBJECT:random,(33,02) -OBJECT:random,(33,03) -OBJECT:random,(33,04) -OBJECT:random,(33,05) -OBJECT:random,(34,01) -OBJECT:random,(34,02) -OBJECT:random,(34,03) -OBJECT:random,(34,04) -OBJECT:random,(34,05) -OBJECT:random,(35,01) -OBJECT:random,(35,02) -OBJECT:random,(35,03) -OBJECT:random,(35,04) -OBJECT:random,(35,05) -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:"spiked pit",(13,07) -TRAP:"spiked pit",(12,08) -TRAP:"spiked pit",(12,09) -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('D',"Ixoth"),(50,06),hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:('i',"quasit"),random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:('j',"ochre jelly"),random,hostile -MONSTER:'j',random,hostile - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "filla" is the upper filler, between the -# start and locate levels, and "fillb" the lower between the locate -# and goal levels. -# - -MAZE: "Kni-fila" , '.' -INIT_MAP: mines, '.' , 'P' , false , true , lit , false -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -MONSTER: ('i', "quasit"), random, hostile -MONSTER: ('i', "quasit"), random, hostile -MONSTER: ('i', "quasit"), random, hostile -MONSTER: ('i', "quasit"), random, hostile -MONSTER: 'i', random, hostile -MONSTER: ('j', "ochre jelly"), random, hostile -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random - -MAZE: "Kni-filb" , '.' -INIT_MAP: mines, '.' , 'P' , false , true , lit , false -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -MONSTER: ('i', "quasit"), random, hostile -MONSTER: ('i', "quasit"), random, hostile -MONSTER: ('i', "quasit"), random, hostile -MONSTER: ('i', "quasit"), random, hostile -MONSTER: 'i', random, hostile -MONSTER: ('j', "ochre jelly"), random, hostile -MONSTER: ('j', "ochre jelly"), random, hostile -MONSTER: ('j', "ochre jelly"), random, hostile -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random diff --git a/dat/Mon-fila.lua b/dat/Mon-fila.lua new file mode 100644 index 000000000..d0e36ad2c --- /dev/null +++ b/dat/Mon-fila.lua @@ -0,0 +1,61 @@ +-- NetHack 3.6 Monk.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991-2 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- + +-- +des.room({ type = "ordinary", + contents = function() + des.stair("up") + des.object() + des.monster({ class = "E", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.monster({ class = "E", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.object() + des.monster("xorn") + des.monster("earth elemental") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.stair("down") + des.object() + des.trap() + des.monster({ class = "E", peaceful=0 }) + des.monster("earth elemental") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.trap() + des.monster({ class = "X", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.monster("earth elemental") + end +}) + +des.random_corridors() diff --git a/dat/Mon-filb.lua b/dat/Mon-filb.lua new file mode 100644 index 000000000..a6fbdd5b1 --- /dev/null +++ b/dat/Mon-filb.lua @@ -0,0 +1,60 @@ +-- NetHack 3.6 Monk.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991-2 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- + +-- +des.room({ type = "ordinary", + contents = function() + des.stair("up") + des.object() + des.monster({ class = "X", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.monster({ class = "X", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.object() + des.monster({ class = "E", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.stair("down") + des.object() + des.trap() + des.monster({ class = "E", peaceful=0 }) + des.monster("earth elemental") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.trap() + des.monster({ class = "X", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.monster("earth elemental") + end +}) + +des.random_corridors() diff --git a/dat/Mon-goal.lua b/dat/Mon-goal.lua new file mode 100644 index 000000000..d339e323d --- /dev/null +++ b/dat/Mon-goal.lua @@ -0,0 +1,75 @@ +-- NetHack 3.6 Monk.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ +-- 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"); + +des.level_init({ style="mines", fg="L", bg=".", smoothed=false, joined=false, lit=0, walled=false }) + +des.map([[ +xxxxxx..xxxxxx...xxxxxxxxx +xxxx......xx......xxxxxxxx +xx.xx.............xxxxxxxx +x....................xxxxx +......................xxxx +......................xxxx +xx........................ +xxx......................x +xxx................xxxxxxx +xxxx.....x.xx.......xxxxxx +xxxxx...xxxxxx....xxxxxxxx +]]); +-- Dungeon Description +local place = { {14,04},{13,07} } +local placeidx = math.random(1, #place); + +des.region(selection.area(00,00,25,10), "unlit") +-- Stairs +des.stair("up", 20,05) +-- Objects +des.object({ id = "lenses", coord = place[placeidx], buc="blessed", spe=0, name="The Eyes of the Overworld" }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap() +des.trap() +-- Random monsters. +des.monster("Master Kaen",place[placeidx]) +des.altar({ coord = place[placeidx], align="noalign", type="altar" }) +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") diff --git a/dat/Mon-loca.lua b/dat/Mon-loca.lua new file mode 100644 index 000000000..2436a33da --- /dev/null +++ b/dat/Mon-loca.lua @@ -0,0 +1,90 @@ +-- NetHack 3.6 Monk.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ +-- 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"); + +-- 1 2 3 4 5 6 7 +--123456789012345678901234567890123456789012345678901234567890123456789012345 +des.map([[ + ---------------------------------------------------- -------- + ---.................................................- --.....| + ---...--------........------........................--- ---...| + ---.....- --.......- ----..................---- --.-- + ---.....---- --------- --..................-- --..| + ---...----- ----.----.....----.....--- --..|| +----..---- -----..--- |...--- |.......--- --...| +|...--- ----....--- |.--- |.........-- --...|| +|...- ----.....--- ---- |..........---....| +|...---- ----......--- | |...|.......-....|| +|......----- ---.........- | -----...|............| +|..........----- ----...........--- -------......||...........|| +|..............-----................--- |............|||..........| +|-S----...............................--- |...........|| |.........|| +|.....|..............------.............-----..........|| ||........| +|.....|.............-- ---.........................|| |.......|| +|.....|.............- ---.....................--| ||......| +|---S--------.......---- --.................---- |.....|| +|...........|..........--------..............----- ||....| +|...........|............................----- |....| +------------------------------------------ ------ +]]); +-- Random Monsters + +-- Dungeon Description +des.region(selection.area(00,00,75,20), "lit") +-- Stairs +des.stair("up") +des.stair("down") +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,20)) +-- Objects +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("earth elemental") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") +des.monster("xorn") diff --git a/dat/Mon-strt.lua b/dat/Mon-strt.lua new file mode 100644 index 000000000..1add47ab6 --- /dev/null +++ b/dat/Mon-strt.lua @@ -0,0 +1,104 @@ +-- NetHack 3.6 Monk.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991-2 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, the Grand Master +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor") + +des.map([[ +............................................................................ +............................................................................ +............................................................................ +....................------------------------------------.................... +....................|................|.....|.....|.....|.................... +....................|..------------..|--+-----+-----+--|.................... +....................|..|..........|..|.................|.................... +....................|..|..........|..|+---+---+-----+--|.................... +..................---..|..........|......|...|...|.....|.................... +..................+....|..........+......|...|...|.....|.................... +..................+....|..........+......|...|...|.....|.................... +..................---..|..........|......|...|...|.....|.................... +....................|..|..........|..|+-----+---+---+--|.................... +....................|..|..........|..|.................|.................... +....................|..------------..|--+-----+-----+--|.................... +....................|................|.....|.....|.....|.................... +....................------------------------------------.................... +............................................................................ +............................................................................ +............................................................................ +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region({ region={24,06, 33,13}, lit=1, type="temple" }) + +des.replace_terrain({ region={00,00, 10,19}, fromterrain=".", toterrain="T", chance=10 }) +des.replace_terrain({ region={65,00, 75,19}, fromterrain=".", toterrain="T", chance=10 }) + +-- Portal arrival point +des.terrain({05,04}, ".") +des.levregion({ region = {05,04,05,04}, type="branch" }) +-- Stairs +des.stair("down", 52,09) +-- Doors +des.door("locked",18,09) +des.door("locked",18,10) +des.door("closed",34,09) +des.door("closed",34,10) +des.door("closed",40,05) +des.door("closed",46,05) +des.door("closed",52,05) +des.door("locked",38,07) +des.door("closed",42,07) +des.door("closed",46,07) +des.door("closed",52,07) +des.door("locked",38,12) +des.door("closed",44,12) +des.door("closed",48,12) +des.door("closed",52,12) +des.door("closed",40,14) +des.door("closed",46,14) +des.door("closed",52,14) +-- Unattended Altar - unaligned due to conflict - player must align it. +des.altar({ x=28,y=09, align="noalign", type="altar" }) +-- The Grand Master +des.monster("Grand Master", 28, 10) +-- No treasure chest! +-- guards for the audience chamber +des.monster("abbot", 32, 07) +des.monster("abbot", 32, 08) +des.monster("abbot", 32, 11) +des.monster("abbot", 32, 12) +des.monster("abbot", 33, 07) +des.monster("abbot", 33, 08) +des.monster("abbot", 33, 11) +des.monster("abbot", 33, 12) +-- Non diggable walls +des.non_diggable(selection.area(18,03,55,16)) +-- Random traps +des.trap("dart",20,09) +des.trap("dart",20,10) +des.trap() +des.trap() +des.trap() +des.trap() +-- Monsters on siege duty. +des.monster("earth elemental", 37, 01) +des.monster("earth elemental", 37, 18) +des.monster("earth elemental", 03, 03) +des.monster("earth elemental", 65, 04) +des.monster("earth elemental", 12, 11) +des.monster("earth elemental", 60, 12) +des.monster("earth elemental", 14, 08) +des.monster("earth elemental", 55, 00) +des.monster("xorn", 18, 18) +des.monster("xorn", 59, 10) +des.monster("xorn", 13, 09) +des.monster("xorn", 01, 17) diff --git a/dat/Monk.des b/dat/Monk.des deleted file mode 100644 index 5b1ba7caa..000000000 --- a/dat/Monk.des +++ /dev/null @@ -1,378 +0,0 @@ -# NetHack 3.6 Monk.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1991-2 by M. Stephenson -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, the Grand Master -# and receive your quest assignment. -# -MAZE: "Mon-strt",' ' -FLAGS: noteleport,hardfloor -GEOMETRY:center,center -MAP -............................................................................ -............................................................................ -............................................................................ -....................------------------------------------.................... -....................|................|.....|.....|.....|.................... -....................|..------------..|--+-----+-----+--|.................... -....................|..|..........|..|.................|.................... -....................|..|..........|..|+---+---+-----+--|.................... -..................---..|..........|......|...|...|.....|.................... -..................+....|..........+......|...|...|.....|.................... -..................+....|..........+......|...|...|.....|.................... -..................---..|..........|......|...|...|.....|.................... -....................|..|..........|..|+-----+---+---+--|.................... -....................|..|..........|..|.................|.................... -....................|..------------..|--+-----+-----+--|.................... -....................|................|.....|.....|.....|.................... -....................------------------------------------.................... -............................................................................ -............................................................................ -............................................................................ -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION:(24,06,33,13),lit,"temple" - -REPLACE_TERRAIN:(0,0,10,19),'.','T',10% -REPLACE_TERRAIN:(65,0,75,19),'.','T',10% - -# Portal arrival point -TERRAIN:(05,04),'.' -BRANCH:(05,04,05,04),(0,0,0,0) -# Stairs -STAIR:(52,09),down -# Doors -DOOR:locked,(18,09) -DOOR:locked,(18,10) -DOOR:closed,(34,09) -DOOR:closed,(34,10) -DOOR:closed,(40,05) -DOOR:closed,(46,05) -DOOR:closed,(52,05) -DOOR:locked,(38,07) -DOOR:closed,(42,07) -DOOR:closed,(46,07) -DOOR:closed,(52,07) -DOOR:locked,(38,12) -DOOR:closed,(44,12) -DOOR:closed,(48,12) -DOOR:closed,(52,12) -DOOR:closed,(40,14) -DOOR:closed,(46,14) -DOOR:closed,(52,14) -# Unattended Altar - unaligned due to conflict - player must align it. -ALTAR:(28,09),noalign,altar -# The Grand Master -MONSTER:('@',"Grand Master"),(28,10) -# No treasure chest! -# guards for the audience chamber -MONSTER:('@',"abbot"),(32,07) -MONSTER:('@',"abbot"),(32,08) -MONSTER:('@',"abbot"),(32,11) -MONSTER:('@',"abbot"),(32,12) -MONSTER:('@',"abbot"),(33,07) -MONSTER:('@',"abbot"),(33,08) -MONSTER:('@',"abbot"),(33,11) -MONSTER:('@',"abbot"),(33,12) -# Non diggable walls -NON_DIGGABLE:(18,03,55,16) -# Random traps -TRAP:"dart",(20,09) -TRAP:"dart",(20,10) -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Monsters on siege duty. -MONSTER: ('E',"earth elemental"),(37,01) -MONSTER: ('E',"earth elemental"),(37,18) -MONSTER: ('E',"earth elemental"),(03,03) -MONSTER: ('E',"earth elemental"),(65,04) -MONSTER: ('E',"earth elemental"),(12,11) -MONSTER: ('E',"earth elemental"),(60,12) -MONSTER: ('E',"earth elemental"),(14,08) -MONSTER: ('E',"earth elemental"),(55,00) -MONSTER: ('X',"xorn"),(18,18) -MONSTER: ('X',"xorn"),(59,10) -MONSTER: ('X',"xorn"),(13,09) -MONSTER: ('X',"xorn"),(01,17) - -# -# The "locate" level for the quest. -# -# Here you have to locate the Monastery of the Earth-Lord to -# go further towards your assigned quest. -# - -MAZE: "Mon-loca",' ' -GEOMETRY:center,center -# 1 2 3 4 5 6 7 -#123456789012345678901234567890123456789012345678901234567890123456789012345 -MAP - ---------------------------------------------------- -------- - ---.................................................- --.....| - ---...--------........------........................--- ---...| - ---.....- --.......- ----..................---- --.-- - ---.....---- --------- --..................-- --..| - ---...----- ----.----.....----.....--- --..|| -----..---- -----..--- |...--- |.......--- --...| -|...--- ----....--- |.--- |.........-- --...|| -|...- ----.....--- ---- |..........---....| -|...---- ----......--- | |...|.......-....|| -|......----- ---.........- | -----...|............| -|..........----- ----...........--- -------......||...........|| -|..............-----................--- |............|||..........| -|-S----...............................--- |...........|| |.........|| -|.....|..............------.............-----..........|| ||........| -|.....|.............-- ---.........................|| |.......|| -|.....|.............- ---.....................--| ||......| -|---S--------.......---- --.................---- |.....|| -|...........|..........--------..............----- ||....| -|...........|............................----- |....| ------------------------------------------- ------ -ENDMAP -# Random Monsters -$monster = monster: { 'E', 'X' } -SHUFFLE: $monster - -# Dungeon Description -REGION:(00,00,75,20),lit,"ordinary" -# Stairs -STAIR:random,up -STAIR:random,down -# Non diggable walls -NON_DIGGABLE:(00,00,75,20) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random - -# -# The "goal" level for the quest. -# -# Here you meet Master Kaen, your nemesis monster. You have to -# defeat Master Kaen in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Mon-goal", ' ' -INIT_MAP: mines, 'L' , '.' , false , false , unlit , false -GEOMETRY:center,center -MAP -xxxxxx..xxxxxx...xxxxxxxxx -xxxx......xx......xxxxxxxx -xx.xx.............xxxxxxxx -x....................xxxxx -......................xxxx -......................xxxx -xx........................ -xxx......................x -xxx................xxxxxxx -xxxx.....x.xx.......xxxxxx -xxxxx...xxxxxx....xxxxxxxx -ENDMAP -# Dungeon Description -$place = { (14,04),(13,07) } -SHUFFLE: $place - -REGION:(00,00,25,10),unlit,"ordinary" -# Stairs -STAIR:(20,05),up -# Objects -OBJECT:('(',"lenses"),$place[0],blessed,0,name:"The Eyes of the Overworld" -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('@',"Master Kaen"),$place[0] -ALTAR:$place[0],noalign,altar -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('E',"earth elemental"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random -MONSTER: ('X',"xorn"),random - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "fila" is the upper filler, between the -# start and locate levels, and "filb" the lower between the locate -# and goal levels. -# - -LEVEL: "Mon-fila" -# Random Monsters -$monster = monster: { 'E', 'X' } -SHUFFLE: $monster - -# -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random - MONSTER: 'E', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random,random - MONSTER: 'E', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - OBJECT: random,random - MONSTER: ('X', "xorn"), random - MONSTER: ('E', "earth elemental"), random -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - TRAP: random, random - MONSTER: 'E', random, hostile - MONSTER: ('E', "earth elemental"), random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - TRAP: random, random - MONSTER: 'X', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - MONSTER: ('E', "earth elemental"), random -} - -RANDOM_CORRIDORS - -LEVEL: "Mon-filb" -# Random Monsters -$monster = monster: { 'E', 'X' } -SHUFFLE: $monster - -# -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random - MONSTER: 'X', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random,random - MONSTER: 'X', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - OBJECT: random,random - MONSTER: 'E', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - TRAP: random, random - MONSTER: 'E', random, hostile - MONSTER: ('E', "earth elemental"), random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - TRAP: random, random - MONSTER: 'X', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - MONSTER: ('E', "earth elemental"), random -} - -RANDOM_CORRIDORS - diff --git a/dat/Pri-fila.lua b/dat/Pri-fila.lua new file mode 100644 index 000000000..6df964f60 --- /dev/null +++ b/dat/Pri-fila.lua @@ -0,0 +1,55 @@ +-- 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.room({ type = "ordinary", + contents = function() + des.stair("up") + des.object() + des.monster("human zombie") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.object() + des.monster("human zombie") + end +}) + +des.room({ type = "morgue", + contents = function() + des.stair("down") + des.object() + des.trap() + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.trap() + des.monster("wraith") + end +}) + +des.room({ type = "morgue", + contents = function() + des.object() + des.trap() + end +}) + +des.random_corridors() diff --git a/dat/Pri-filb.lua b/dat/Pri-filb.lua new file mode 100644 index 000000000..060afd246 --- /dev/null +++ b/dat/Pri-filb.lua @@ -0,0 +1,62 @@ +-- 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.room({ type = "ordinary", + contents = function() + des.stair("up") + des.object() + des.monster("human zombie") + des.monster("wraith") + end +}) + +des.room({ type = "morgue", + contents = function() + des.object() + des.object() + des.object() + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.object() + des.monster("human zombie") + des.monster("wraith") + end +}) + +des.room({ type = "morgue", + contents = function() + des.stair("down") + des.object() + des.object() + des.trap() + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.trap() + des.monster("human zombie") + des.monster("wraith") + end +}) + + +des.room({ type = "morgue", + contents = function() + des.object() + des.trap() + end +}) + +des.random_corridors() diff --git a/dat/Pri-goal.lua b/dat/Pri-goal.lua new file mode 100644 index 000000000..5de237d20 --- /dev/null +++ b/dat/Pri-goal.lua @@ -0,0 +1,83 @@ +-- 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"); + +des.level_init({ style="mines", fg="L", bg=".", smoothed=false, joined=false, lit=0, walled=false }) + +des.map([[ +xxxxxx..xxxxxx...xxxxxxxxx +xxxx......xx......xxxxxxxx +xx.xx.............xxxxxxxx +x....................xxxxx +......................xxxx +......................xxxx +xx........................ +xxx......................x +xxx................xxxxxxx +xxxx.....x.xx.......xxxxxx +xxxxx...xxxxxx....xxxxxxxx +]]); +-- Dungeon Description +local place = { {14,04}, {13,07} } +local placeidx = math.random(1, #place); + +des.region(selection.area(00,00,25,10), "unlit") +-- Stairs +des.stair("up", 20,05) +-- Objects +des.object({ id = "helm of brilliance", coord = place[placeidx], buc="blessed", spe=0, name="The Mitre of Holiness" }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap() +des.trap() +-- Random monsters. +des.monster("Nalzok",place[placeidx]) +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("Z") +des.monster("Z") +des.monster("wraith") +des.monster("wraith") +des.monster("wraith") +des.monster("wraith") +des.monster("wraith") +des.monster("wraith") +des.monster("wraith") +des.monster("wraith") +des.monster("W") diff --git a/dat/Pri-loca.lua b/dat/Pri-loca.lua new file mode 100644 index 000000000..16f5bdb85 --- /dev/null +++ b/dat/Pri-loca.lua @@ -0,0 +1,73 @@ +-- 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. diff --git a/dat/Pri-strt.lua b/dat/Pri-strt.lua new file mode 100644 index 000000000..691a4b8ad --- /dev/null +++ b/dat/Pri-strt.lua @@ -0,0 +1,105 @@ +-- 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. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, High Priest +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor") + +des.map([[ +............................................................................ +............................................................................ +............................................................................ +....................------------------------------------.................... +....................|................|.....|.....|.....|.................... +....................|..------------..|--+-----+-----+--|.................... +....................|..|..........|..|.................|.................... +....................|..|..........|..|+---+---+-----+--|.................... +..................---..|..........|......|...|...|.....|.................... +..................+....|..........+......|...|...|.....|.................... +..................+....|..........+......|...|...|.....|.................... +..................---..|..........|......|...|...|.....|.................... +....................|..|..........|..|+-----+---+---+--|.................... +....................|..|..........|..|.................|.................... +....................|..------------..|--+-----+-----+--|.................... +....................|................|.....|.....|.....|.................... +....................------------------------------------.................... +............................................................................ +............................................................................ +............................................................................ +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region({ region={24,06, 33,13}, lit=1, type="temple" }) + +des.replace_terrain({ region={00,00, 10,19}, fromterrain=".", toterrain="T", chance=10 }) +des.replace_terrain({ region={65,00, 75,19}, fromterrain=".", toterrain="T", chance=10 }) +des.terrain({05,04}, ".") + +-- Portal arrival point +des.levregion({ region = {05,04,05,04}, type="branch" }) +-- Stairs +des.stair("down", 52,09) +-- Doors +des.door("locked",18,09) +des.door("locked",18,10) +des.door("closed",34,09) +des.door("closed",34,10) +des.door("closed",40,05) +des.door("closed",46,05) +des.door("closed",52,05) +des.door("locked",38,07) +des.door("closed",42,07) +des.door("closed",46,07) +des.door("closed",52,07) +des.door("locked",38,12) +des.door("closed",44,12) +des.door("closed",48,12) +des.door("closed",52,12) +des.door("closed",40,14) +des.door("closed",46,14) +des.door("closed",52,14) +-- Unattended Altar - unaligned due to conflict - player must align it. +des.altar({ x=28, y=09, align="noalign", type="altar" }) +-- High Priest +des.monster("Arch Priest", 28, 10) +-- The treasure of High Priest +des.object("chest", 27, 10) +-- knight guards for the audience chamber +des.monster("acolyte", 32, 07) +des.monster("acolyte", 32, 08) +des.monster("acolyte", 32, 11) +des.monster("acolyte", 32, 12) +des.monster("acolyte", 33, 07) +des.monster("acolyte", 33, 08) +des.monster("acolyte", 33, 11) +des.monster("acolyte", 33, 12) +-- Non diggable walls +des.non_diggable(selection.area(18,03,55,16)) +-- Random traps +des.trap("dart",20,09) +des.trap("dart",20,10) +des.trap() +des.trap() +des.trap() +des.trap() +-- Monsters on siege duty. +des.monster("human zombie", 37, 01) +des.monster("human zombie", 37, 18) +des.monster("human zombie", 03, 03) +des.monster("human zombie", 65, 04) +des.monster("human zombie", 12, 11) +des.monster("human zombie", 60, 12) +des.monster("human zombie", 14, 08) +des.monster("human zombie", 55, 00) +des.monster("human zombie", 18, 18) +des.monster("human zombie", 59, 10) +des.monster("human zombie", 13, 09) +des.monster("human zombie", 01, 17) diff --git a/dat/Priest.des b/dat/Priest.des deleted file mode 100644 index d6cfdcef5..000000000 --- a/dat/Priest.des +++ /dev/null @@ -1,356 +0,0 @@ -# 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. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, High Priest -# and receive your quest assignment. -# -MAZE: "Pri-strt",' ' -FLAGS: noteleport,hardfloor -GEOMETRY:center,center -MAP -............................................................................ -............................................................................ -............................................................................ -....................------------------------------------.................... -....................|................|.....|.....|.....|.................... -....................|..------------..|--+-----+-----+--|.................... -....................|..|..........|..|.................|.................... -....................|..|..........|..|+---+---+-----+--|.................... -..................---..|..........|......|...|...|.....|.................... -..................+....|..........+......|...|...|.....|.................... -..................+....|..........+......|...|...|.....|.................... -..................---..|..........|......|...|...|.....|.................... -....................|..|..........|..|+-----+---+---+--|.................... -....................|..|..........|..|.................|.................... -....................|..------------..|--+-----+-----+--|.................... -....................|................|.....|.....|.....|.................... -....................------------------------------------.................... -............................................................................ -............................................................................ -............................................................................ -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION:(24,06,33,13),lit,"temple" - -REPLACE_TERRAIN:(0,0,10,19),'.','T',10% -REPLACE_TERRAIN:(65,0,75,19),'.','T',10% -TERRAIN:(05,04),'.' - -# Portal arrival point -BRANCH:(05,04,05,04),(0,0,0,0) -# Stairs -STAIR:(52,09),down -# Doors -DOOR:locked,(18,09) -DOOR:locked,(18,10) -DOOR:closed,(34,09) -DOOR:closed,(34,10) -DOOR:closed,(40,05) -DOOR:closed,(46,05) -DOOR:closed,(52,05) -DOOR:locked,(38,07) -DOOR:closed,(42,07) -DOOR:closed,(46,07) -DOOR:closed,(52,07) -DOOR:locked,(38,12) -DOOR:closed,(44,12) -DOOR:closed,(48,12) -DOOR:closed,(52,12) -DOOR:closed,(40,14) -DOOR:closed,(46,14) -DOOR:closed,(52,14) -# Unattended Altar - unaligned due to conflict - player must align it. -ALTAR:(28,09),noalign,altar -# High Priest -MONSTER:('@',"Arch Priest"),(28,10) -# The treasure of High Priest -OBJECT:('(',"chest"),(27,10) -# knight guards for the audience chamber -MONSTER:('@',"acolyte"),(32,07) -MONSTER:('@',"acolyte"),(32,08) -MONSTER:('@',"acolyte"),(32,11) -MONSTER:('@',"acolyte"),(32,12) -MONSTER:('@',"acolyte"),(33,07) -MONSTER:('@',"acolyte"),(33,08) -MONSTER:('@',"acolyte"),(33,11) -MONSTER:('@',"acolyte"),(33,12) -# Non diggable walls -NON_DIGGABLE:(18,03,55,16) -# Random traps -TRAP:"dart",(20,09) -TRAP:"dart",(20,10) -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Monsters on siege duty. -MONSTER: ('Z',"human zombie"),(37,01) -MONSTER: ('Z',"human zombie"),(37,18) -MONSTER: ('Z',"human zombie"),(03,03) -MONSTER: ('Z',"human zombie"),(65,04) -MONSTER: ('Z',"human zombie"),(12,11) -MONSTER: ('Z',"human zombie"),(60,12) -MONSTER: ('Z',"human zombie"),(14,08) -MONSTER: ('Z',"human zombie"),(55,00) -MONSTER: ('Z',"human zombie"),(18,18) -MONSTER: ('Z',"human zombie"),(59,10) -MONSTER: ('Z',"human zombie"),(13,09) -MONSTER: ('Z',"human zombie"),(01,17) - -# -# The "locate" level for the quest. -# -# Here you have to locate the Temple of Nalzok to go -# further towards your assigned quest. -# - -MAZE: "Pri-loca",' ' -FLAGS: hardfloor -# This is a kludge to init the level as a lit field. -INIT_MAP: mines, '.' , '.' , false , false , lit , false -GEOMETRY:center,center -MAP -........................................ -........................................ -..........----------+----------......... -..........|........|.|........|......... -..........|........|.|........|......... -..........|----.----.----.----|......... -..........+...................+......... -..........+...................+......... -..........|----.----.----.----|......... -..........|........|.|........|......... -..........|........|.|........|......... -..........----------+----------......... -........................................ -........................................ -ENDMAP -# Dungeon Description -REGION:(00,00,09,13),unlit,"morgue" -REGION:(09,00,30,01),unlit,"morgue" -REGION:(09,12,30,13),unlit,"morgue" -REGION:(31,00,39,13),unlit,"morgue" -REGION:(11,03,29,10),lit,"temple",filled,irregular -# The altar inside the temple -ALTAR:(20,07),noalign,shrine -MONSTER:('@',"aligned priest"),(20,07),noalign,hostile -# Doors -DOOR:locked,(10,06) -DOOR:locked,(10,07) -DOOR:locked,(20,02) -DOOR:locked,(20,11) -DOOR:locked,(30,06) -DOOR:locked,(30,07) -# Stairs -# Note: The up stairs are *intentionally* off of the map. -STAIR:(43,05),up -STAIR:(20,06),down -# Non diggable walls -NON_DIGGABLE:(10,02,30,13) -# Objects (inside the antechambers). -OBJECT:random,(14,03) -OBJECT:random,(15,03) -OBJECT:random,(16,03) -OBJECT:random,(14,10) -OBJECT:random,(15,10) -OBJECT:random,(16,10) -OBJECT:random,(17,10) -OBJECT:random,(24,03) -OBJECT:random,(25,03) -OBJECT:random,(26,03) -OBJECT:random,(27,03) -OBJECT:random,(24,10) -OBJECT:random,(25,10) -OBJECT:random,(26,10) -OBJECT:random,(27,10) -# Random traps -TRAP:random,(15,04) -TRAP:random,(25,04) -TRAP:random,(15,09) -TRAP:random,(25,09) -TRAP:random,random -TRAP:random,random -# No random monsters - the morgue generation will put them in. - -# -# The "goal" level for the quest. -# -# Here you meet Nalzok your nemesis monster. You have to -# defeat Nalzok in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Pri-goal", ' ' -INIT_MAP: mines, 'L' , '.' , false , false , unlit , false -GEOMETRY:center,center -MAP -xxxxxx..xxxxxx...xxxxxxxxx -xxxx......xx......xxxxxxxx -xx.xx.............xxxxxxxx -x....................xxxxx -......................xxxx -......................xxxx -xx........................ -xxx......................x -xxx................xxxxxxx -xxxx.....x.xx.......xxxxxx -xxxxx...xxxxxx....xxxxxxxx -ENDMAP -# Dungeon Description -$place = { (14,04),(13,07) } -SHUFFLE: $place - -REGION:(00,00,25,10),unlit,"ordinary" -# Stairs -STAIR:(20,05),up -# Objects -OBJECT:('[',"helm of brilliance"),$place[0],blessed,0,name:"The Mitre of Holiness" -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('&',"Nalzok"),$place[0] -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:'Z',random -MONSTER:'Z',random -MONSTER:('W',"wraith"),random -MONSTER:('W',"wraith"),random -MONSTER:('W',"wraith"),random -MONSTER:('W',"wraith"),random -MONSTER:('W',"wraith"),random -MONSTER:('W',"wraith"),random -MONSTER:('W',"wraith"),random -MONSTER:('W',"wraith"),random -MONSTER:'W',random - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "filla" is the upper filler, between the -# start and locate levels, and "fillb" the lower between the locate -# and goal levels. -# - -LEVEL: "Pri-fila" -# -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random - MONSTER: ('Z', "human zombie"), random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random,random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - OBJECT: random,random - MONSTER: ('Z', "human zombie"), random -} - -ROOM: "morgue" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - TRAP: random, random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - TRAP: random, random - MONSTER: ('W', "wraith"), random -} - -ROOM: "morgue" , random, random, random, random { - OBJECT: random, random - TRAP: random, random -} - -RANDOM_CORRIDORS - -LEVEL: "Pri-filb" -# -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random - MONSTER: ('Z', "human zombie"), random - MONSTER: ('W', "wraith"), random -} - -ROOM: "morgue" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - OBJECT: random,random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - OBJECT: random,random - MONSTER: ('Z', "human zombie"), random - MONSTER: ('W', "wraith"), random -} - -ROOM: "morgue" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - OBJECT: random, random - TRAP: random, random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - TRAP: random, random - MONSTER: ('Z', "human zombie"), random - MONSTER: ('W', "wraith"), random -} - -ROOM: "morgue" , random, random, random, random { - OBJECT: random, random - TRAP: random, random -} - -RANDOM_CORRIDORS diff --git a/dat/Ran-fila.lua b/dat/Ran-fila.lua new file mode 100644 index 000000000..321a9bc55 --- /dev/null +++ b/dat/Ran-fila.lua @@ -0,0 +1,35 @@ +-- NetHack 3.6 Ranger.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg="T", smoothed=true, joined=true, walled=true }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.trap() +des.trap() +des.trap() +des.trap() +-- +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "forest centaur", peaceful=0 }) +des.monster({ id = "forest centaur", peaceful=0 }) +des.monster({ id = "forest centaur", peaceful=0 }) +des.monster({ class = "C", peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) diff --git a/dat/Ran-filb.lua b/dat/Ran-filb.lua new file mode 100644 index 000000000..e7109541f --- /dev/null +++ b/dat/Ran-filb.lua @@ -0,0 +1,39 @@ +-- NetHack 3.6 Ranger.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg=" ", smoothed=true, joined=true, walled=true }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.trap() +des.trap() +des.trap() +des.trap() +-- +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ class = "C", peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) diff --git a/dat/Ran-goal.lua b/dat/Ran-goal.lua new file mode 100644 index 000000000..b32c5add4 --- /dev/null +++ b/dat/Ran-goal.lua @@ -0,0 +1,106 @@ +-- NetHack 3.6 Ranger.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ + + ... ... + .......................................................................... + ... + ... + . ............ ....... . ....... . + . ............................. . ........ .........S.. . + . ............ . ...... . . . ....... .. . + . ......... . .... + . ... . .. . + . S . ......... .S. .S............... . + . ... . ... . ......... . . + . ........ .....S.+.......+....\....+........+. . + . ... ... S ......... .. ..... . + . .. ......... .. ...... . + . ....... ... + .... .... .......... . + . .............. .. . ...... .. ............. . + . ............. . .......... ...... . + ... + ... + .......................................................................... + ... ... + +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +-- Stairs +des.stair("up", 19,10) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Objects +des.object({ id = "bow", x=37, y=10, buc="blessed", spe=0, name="The Longbow of Diana" }) +des.object("chest", 37, 10) +des.object({ coord = { 36, 09 } }) +des.object({ coord = { 36, 10 } }) +des.object({ coord = { 36, 11 } }) +des.object({ coord = { 37, 09 } }) +des.object({ coord = { 37, 11 } }) +des.object({ coord = { 38, 09 } }) +des.object({ coord = { 38, 10 } }) +des.object({ coord = { 38, 11 } }) +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- doors +des.door("locked",12,08) +des.door("closed",22,10) +des.door("locked",24,10) +des.door("closed",25,11) +des.door("closed",32,10) +des.door("closed",37,03) +des.door("closed",37,07) +des.door("closed",37,13) +des.door("closed",37,16) +des.door("closed",42,10) +des.door("locked",46,08) +des.door("closed",51,10) +des.door("locked",53,08) +des.door("closed",65,05) +-- Random monsters. +des.monster({ id = "Scorpius", x=37, y=10, peaceful=0 }) +des.monster({ id = "forest centaur", x=36, y=09, peaceful=0 }) +des.monster({ id = "forest centaur", x=36, y=10, peaceful=0 }) +des.monster({ id = "forest centaur", x=36, y=11, peaceful=0 }) +des.monster({ id = "forest centaur", x=37, y=09, peaceful=0 }) +des.monster({ id = "forest centaur", x=37, y=11, peaceful=0 }) +des.monster({ id = "forest centaur", x=38, y=09, peaceful=0 }) +des.monster({ id = "mountain centaur", x=38, y=10, peaceful=0 }) +des.monster({ id = "mountain centaur", x=38, y=11, peaceful=0 }) +des.monster({ id = "mountain centaur", x=02, y=02, peaceful=0 }) +des.monster({ id = "mountain centaur", x=71, y=02, peaceful=0 }) +des.monster({ id = "mountain centaur", x=02, y=16, peaceful=0 }) +des.monster({ id = "mountain centaur", x=71, y=16, peaceful=0 }) +des.monster({ id = "forest centaur", peaceful=0 }) +des.monster({ id = "forest centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ class = "C", peaceful=0 }) +des.monster({ class = "C", peaceful=0 }) +des.monster({ id = "scorpion", x=03, y=02, peaceful=0 }) +des.monster({ id = "scorpion", x=72, y=02, peaceful=0 }) +des.monster({ id = "scorpion", x=03, y=17, peaceful=0 }) +des.monster({ id = "scorpion", x=72, y=17, peaceful=0 }) +des.monster({ id = "scorpion", x=41, y=10, peaceful=0 }) +des.monster({ id = "scorpion", x=33, y=09, peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) +des.monster({ class = "s", peaceful=0 }) + +des.wallify() diff --git a/dat/Ran-loca.lua b/dat/Ran-loca.lua new file mode 100644 index 000000000..c9af3f1f3 --- /dev/null +++ b/dat/Ran-loca.lua @@ -0,0 +1,79 @@ +-- NetHack 3.6 Ranger.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "hardfloor") +--1234567890123456789012345678901234567890123456789012345678901234567890 +des.map([[ + ....... ......... ....... + ................... ................... + .... ....... ....... .... +... ..... . ..... . ..... ... +. .......... ..... ........... ..... .......... . +. .. ..... .......... ..... .......... ..... .. . +. . . ..... . ..... . . . +. . ..... ............. ..... . . +. . ................ ....... ................ . . +. . ..... ....... ..... . . +. . . ...... ...... . . . +. . ........... ......... ........... . . +. . .......... .......... . . +. .. ..... . ..... . ..... .. . +. .......... ..... ........... ..... .......... . +. ..... .......... ..... .......... ..... . +. . ..... . ..... . . +... ....... ....... ....... ... + .............. ............. .............. + ....... ....... ....... ....... ....... +]]); +-- Dungeon Description +des.region(selection.area(00,00,54,19), "lit") +-- Stairs +des.stair("up", 25,05) +des.stair("down", 27,18) +-- Non diggable walls +des.non_diggable(selection.area(00,00,54,19)) +-- Objects +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap("spiked pit") +des.trap("spiked pit") +des.trap("teleport") +des.trap("teleport") +des.trap("arrow") +des.trap("arrow") +-- Random monsters. +des.monster({ id = "wumpus", x=27, y=18, peaceful=0, asleep=1 }) +des.monster({ id = "giant bat", peaceful=0 }) +des.monster({ id = "giant bat", peaceful=0 }) +des.monster({ id = "giant bat", peaceful=0 }) +des.monster({ id = "giant bat", peaceful=0 }) +des.monster({ id = "forest centaur", peaceful=0 }) +des.monster({ id = "forest centaur", peaceful=0 }) +des.monster({ id = "forest centaur", peaceful=0 }) +des.monster({ id = "forest centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "mountain centaur", peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) +des.monster({ class = "s", peaceful=0 }) +des.monster({ class = "s", peaceful=0 }) + diff --git a/dat/Ran-strt.lua b/dat/Ran-strt.lua new file mode 100644 index 000000000..66ea5028a --- /dev/null +++ b/dat/Ran-strt.lua @@ -0,0 +1,97 @@ +-- NetHack 3.6 Ranger.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, Orion, +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = "." }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "arboreal") + +des.level_init({ style="mines", fg=".", bg=".", smoothed=true, joined=true, lit=1, walled=false }) +des.replace_terrain({ region={00,00, 76,19}, fromterrain=".", toterrain="T", chance=5 }) +--1234567890123456789012345678901234567890123456789012345678901234567890 +des.map({ halign = "left", valign = "center", map = [[ + xx + ................................... x + .. .. + .. ...............F............... .. + . .. .F. .. . + . .. .............F............. .. . + . . .. .. . . + . . .. ....................... .. ... + . . . .. .. . + ... . .. .|..................... ...... + FFF . . ..S.................. + ... . .. .|................. .... ... + . . . .. .. . . . + . . .. ....................... .. . . + . . .. .. . . + . .. .............F............. .. . + . .. .F. .. . + .. ...............F............... .. + .. .. + ................................... x + xx +]] }); +-- Dungeon Description +des.region(selection.area(00,00,40,20), "lit") +-- Stairs +des.stair("down", 10,10) +-- Portal arrival point; just about anywhere on the right hand side of the map +des.levregion({ region = {51,2,77,18}, region_islev = 1, type="branch" }) +-- Orion +des.monster("Orion", 20, 10) +-- The treasure of Orion +des.object("chest", 20, 10) +-- Guards for the audience chamber +des.monster("hunter", 19, 09) +des.monster("hunter", 20, 09) +des.monster("hunter", 21, 09) +des.monster("hunter", 19, 10) +des.monster("hunter", 21, 10) +des.monster("hunter", 19, 11) +des.monster("hunter", 20, 11) +des.monster("hunter", 21, 11) +-- Non diggable walls +des.non_diggable(selection.area(00,00,40,20)) +-- Traps +des.trap("arrow",30,09) +des.trap("arrow",30,10) +des.trap("pit",40,09) +des.trap("spiked pit") +des.trap("bear") +des.trap("bear") +-- Monsters on siege duty. +des.monster({ id = "minotaur", x=33, y=09, peaceful=0, asleep=1 }) +des.monster({ id = "forest centaur", x=19, y=03, peaceful=0 }) +des.monster({ id = "forest centaur", x=19, y=04, peaceful=0 }) +des.monster({ id = "forest centaur", x=19, y=05, peaceful=0 }) +des.monster({ id = "forest centaur", x=21, y=03, peaceful=0 }) +des.monster({ id = "forest centaur", x=21, y=04, peaceful=0 }) +des.monster({ id = "forest centaur", x=21, y=05, peaceful=0 }) +des.monster({ id = "forest centaur", x=01, y=09, peaceful=0 }) +des.monster({ id = "forest centaur", x=02, y=09, peaceful=0 }) +des.monster({ id = "forest centaur", x=03, y=09, peaceful=0 }) +des.monster({ id = "forest centaur", x=01, y=11, peaceful=0 }) +des.monster({ id = "forest centaur", x=02, y=11, peaceful=0 }) +des.monster({ id = "forest centaur", x=03, y=11, peaceful=0 }) +des.monster({ id = "forest centaur", x=19, y=15, peaceful=0 }) +des.monster({ id = "forest centaur", x=19, y=16, peaceful=0 }) +des.monster({ id = "forest centaur", x=19, y=17, peaceful=0 }) +des.monster({ id = "forest centaur", x=21, y=15, peaceful=0 }) +des.monster({ id = "forest centaur", x=21, y=16, peaceful=0 }) +des.monster({ id = "forest centaur", x=21, y=17, peaceful=0 }) +des.monster({ id = "plains centaur", peaceful=0 }) +des.monster({ id = "plains centaur", peaceful=0 }) +des.monster({ id = "plains centaur", peaceful=0 }) +des.monster({ id = "plains centaur", peaceful=0 }) +des.monster({ id = "plains centaur", peaceful=0 }) +des.monster({ id = "plains centaur", peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) +des.monster({ id = "scorpion", peaceful=0 }) diff --git a/dat/Ranger.des b/dat/Ranger.des deleted file mode 100644 index aa081cfe8..000000000 --- a/dat/Ranger.des +++ /dev/null @@ -1,356 +0,0 @@ -# NetHack 3.6 Ranger.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1991 by M. Stephenson -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, Orion, -# and receive your quest assignment. -# -MAZE: "Ran-strt",'.' -FLAGS: noteleport,hardfloor,arboreal -INIT_MAP:mines,'.','.',true,true,lit,false -REPLACE_TERRAIN:(0,0,76,19),'.', 'T', 5% -GEOMETRY:left,center -#1234567890123456789012345678901234567890123456789012345678901234567890 -MAP - xx - ................................... x - .. .. - .. ...............F............... .. - . .. .F. .. . - . .. .............F............. .. . - . . .. .. . . - . . .. ....................... .. ... - . . . .. .. . - ... . .. .|..................... ...... - FFF . . ..S.................. - ... . .. .|................. .... ... - . . . .. .. . . . - . . .. ....................... .. . . - . . .. .. . . - . .. .............F............. .. . - . .. .F. .. . - .. ...............F............... .. - .. .. - ................................... x - xx -ENDMAP -# Dungeon Description -REGION:(00,00,40,20),lit,"ordinary" -# Stairs -STAIR:(10,10),down -# Portal arrival point; just about anywhere on the right hand side of the map -BRANCH:levregion(51,2,77,18),(0,0,40,20) -# Orion -MONSTER:('@',"Orion"),(20,10) -# The treasure of Orion -OBJECT:('(',"chest"),(20,10) -# Guards for the audience chamber -MONSTER:('@',"hunter"),(19,09) -MONSTER:('@',"hunter"),(20,09) -MONSTER:('@',"hunter"),(21,09) -MONSTER:('@',"hunter"),(19,10) -MONSTER:('@',"hunter"),(21,10) -MONSTER:('@',"hunter"),(19,11) -MONSTER:('@',"hunter"),(20,11) -MONSTER:('@',"hunter"),(21,11) -# Non diggable walls -NON_DIGGABLE:(00,00,40,20) -# Traps -TRAP:"arrow",(30,09) -TRAP:"arrow",(30,10) -TRAP:"pit",(40,09) -TRAP:"spiked pit",random -TRAP:"bear",random -TRAP:"bear",random -# Monsters on siege duty. -MONSTER: ('H',"minotaur"),(33,09),hostile,asleep -MONSTER: ('C',"forest centaur"),(19,03),hostile -MONSTER: ('C',"forest centaur"),(19,04),hostile -MONSTER: ('C',"forest centaur"),(19,05),hostile -MONSTER: ('C',"forest centaur"),(21,03),hostile -MONSTER: ('C',"forest centaur"),(21,04),hostile -MONSTER: ('C',"forest centaur"),(21,05),hostile -MONSTER: ('C',"forest centaur"),(01,09),hostile -MONSTER: ('C',"forest centaur"),(02,09),hostile -MONSTER: ('C',"forest centaur"),(03,09),hostile -MONSTER: ('C',"forest centaur"),(01,11),hostile -MONSTER: ('C',"forest centaur"),(02,11),hostile -MONSTER: ('C',"forest centaur"),(03,11),hostile -MONSTER: ('C',"forest centaur"),(19,15),hostile -MONSTER: ('C',"forest centaur"),(19,16),hostile -MONSTER: ('C',"forest centaur"),(19,17),hostile -MONSTER: ('C',"forest centaur"),(21,15),hostile -MONSTER: ('C',"forest centaur"),(21,16),hostile -MONSTER: ('C',"forest centaur"),(21,17),hostile -MONSTER: ('C',"plains centaur"),random,hostile -MONSTER: ('C',"plains centaur"),random,hostile -MONSTER: ('C',"plains centaur"),random,hostile -MONSTER: ('C',"plains centaur"),random,hostile -MONSTER: ('C',"plains centaur"),random,hostile -MONSTER: ('C',"plains centaur"),random,hostile -MONSTER: ('s',"scorpion"),random,hostile -MONSTER: ('s',"scorpion"),random,hostile - - -# -# The "locate" level for the quest. -# -# Here you have to infiltrate the Cave of the Wumpus to go -# further towards your assigned quest. -# - -MAZE: "Ran-loca",' ' -FLAGS: hardfloor -GEOMETRY:center,center -#1234567890123456789012345678901234567890123456789012345678901234567890 -MAP - ....... ......... ....... - ................... ................... - .... ....... ....... .... -... ..... . ..... . ..... ... -. .......... ..... ........... ..... .......... . -. .. ..... .......... ..... .......... ..... .. . -. . . ..... . ..... . . . -. . ..... ............. ..... . . -. . ................ ....... ................ . . -. . ..... ....... ..... . . -. . . ...... ...... . . . -. . ........... ......... ........... . . -. . .......... .......... . . -. .. ..... . ..... . ..... .. . -. .......... ..... ........... ..... .......... . -. ..... .......... ..... .......... ..... . -. . ..... . ..... . . -... ....... ....... ....... ... - .............. ............. .............. - ....... ....... ....... ....... ....... -ENDMAP -# Dungeon Description -REGION:(00,00,54,19),lit,"ordinary" -# Stairs -STAIR:(25,05),up -STAIR:(27,18),down -# Non diggable walls -NON_DIGGABLE:(00,00,54,19) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:"spiked pit",random -TRAP:"spiked pit",random -TRAP:"teleport",random -TRAP:"teleport",random -TRAP:"arrow",random -TRAP:"arrow",random -# Random monsters. -MONSTER:('q',"wumpus"),(27,18),hostile,asleep -MONSTER:('B',"giant bat"),random,hostile -MONSTER:('B',"giant bat"),random,hostile -MONSTER:('B',"giant bat"),random,hostile -MONSTER:('B',"giant bat"),random,hostile -MONSTER:('C',"forest centaur"),random,hostile -MONSTER:('C',"forest centaur"),random,hostile -MONSTER:('C',"forest centaur"),random,hostile -MONSTER:('C',"forest centaur"),random,hostile -MONSTER:('C',"mountain centaur"),random,hostile -MONSTER:('C',"mountain centaur"),random,hostile -MONSTER:('C',"mountain centaur"),random,hostile -MONSTER:('C',"mountain centaur"),random,hostile -MONSTER:('C',"mountain centaur"),random,hostile -MONSTER:('C',"mountain centaur"),random,hostile -MONSTER:('C',"mountain centaur"),random,hostile -MONSTER:('C',"mountain centaur"),random,hostile -MONSTER:('s',"scorpion"),random,hostile -MONSTER:('s',"scorpion"),random,hostile -MONSTER:('s',"scorpion"),random,hostile -MONSTER:('s',"scorpion"),random,hostile -MONSTER:'s',random,hostile -MONSTER:'s',random,hostile - - -# -# The "goal" level for the quest. -# -# Here you meet Scorpius, your nemesis monster. You have to -# defeat Scorpius in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Ran-goal", ' ' -GEOMETRY:center,center -MAP - - ... ... - .......................................................................... - ... + ... - . ............ ....... . ....... . - . ............................. . ........ .........S.. . - . ............ . ...... . . . ....... .. . - . ......... . .... + . ... . .. . - . S . ......... .S. .S............... . - . ... . ... . ......... . . - . ........ .....S.+.......+....\....+........+. . - . ... ... S ......... .. ..... . - . .. ......... .. ...... . - . ....... ... + .... .... .......... . - . .............. .. . ...... .. ............. . - . ............. . .......... ...... . - ... + ... - .......................................................................... - ... ... - -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -# Stairs -STAIR:(19,10),up -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Objects -OBJECT:(')',"bow"),(37,10),blessed,0,name:"The Longbow of Diana" -OBJECT:('(',"chest"),(37,10) -OBJECT:random,(36,09) -OBJECT:random,(36,10) -OBJECT:random,(36,11) -OBJECT:random,(37,09) -OBJECT:random,(37,11) -OBJECT:random,(38,09) -OBJECT:random,(38,10) -OBJECT:random,(38,11) -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# doors -DOOR:locked,(12,08) -DOOR:closed,(22,10) -DOOR:locked,(24,10) -DOOR:closed,(25,11) -DOOR:closed,(32,10) -DOOR:closed,(37,03) -DOOR:closed,(37,07) -DOOR:closed,(37,13) -DOOR:closed,(37,16) -DOOR:closed,(42,10) -DOOR:locked,(46,08) -DOOR:closed,(51,10) -DOOR:locked,(53,08) -DOOR:closed,(65,05) -# Random monsters. -MONSTER:('s',"Scorpius"),(37,10),hostile -MONSTER:('C',"forest centaur"),(36,09),hostile -MONSTER:('C',"forest centaur"),(36,10),hostile -MONSTER:('C',"forest centaur"),(36,11),hostile -MONSTER:('C',"forest centaur"),(37,09),hostile -MONSTER:('C',"forest centaur"),(37,11),hostile -MONSTER:('C',"forest centaur"),(38,09),hostile -MONSTER:('C',"mountain centaur"),(38,10),hostile -MONSTER:('C',"mountain centaur"),(38,11),hostile -MONSTER:('C',"mountain centaur"),(02,02),hostile -MONSTER:('C',"mountain centaur"),(71,02),hostile -MONSTER:('C',"mountain centaur"),(02,16),hostile -MONSTER:('C',"mountain centaur"),(71,16),hostile -MONSTER:('C',"forest centaur"),random,hostile -MONSTER:('C',"forest centaur"),random,hostile -MONSTER:('C',"mountain centaur"),random,hostile -MONSTER:('C',"mountain centaur"),random,hostile -MONSTER:'C',random,hostile -MONSTER:'C',random,hostile -MONSTER:('s',"scorpion"),(03,02),hostile -MONSTER:('s',"scorpion"),(72,02),hostile -MONSTER:('s',"scorpion"),(03,17),hostile -MONSTER:('s',"scorpion"),(72,17),hostile -MONSTER:('s',"scorpion"),(41,10),hostile -MONSTER:('s',"scorpion"),(33,09),hostile -MONSTER:('s',"scorpion"),random,hostile -MONSTER:('s',"scorpion"),random,hostile -MONSTER:'s',random,hostile - -WALLIFY - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "fila" is the upper filler, between the -# start and locate levels, and "filb" the lower between the locate -# and goal levels. -# - -MAZE: "Ran-fila" , ' ' -INIT_MAP: mines, '.' , 'T', true, true, random, true -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -# -MONSTER: ('C', "mountain centaur"), random, hostile -MONSTER: ('C', "mountain centaur"), random, hostile -MONSTER: ('C', "forest centaur"), random, hostile -MONSTER: ('C', "forest centaur"), random, hostile -MONSTER: ('C', "forest centaur"), random, hostile -MONSTER: 'C', random, hostile -MONSTER: ('s', "scorpion"), random, hostile - -MAZE: "Ran-filb" , ' ' -INIT_MAP: mines, '.' , ' ', true, true, random, true -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -# -MONSTER: ('C', "mountain centaur"), random, hostile -MONSTER: ('C', "mountain centaur"), random, hostile -MONSTER: ('C', "mountain centaur"), random, hostile -MONSTER: ('C', "mountain centaur"), random, hostile -MONSTER: 'C', random, hostile -MONSTER: ('s', "scorpion"), random, hostile -MONSTER: ('s', "scorpion"), random, hostile - diff --git a/dat/Rog-fila.lua b/dat/Rog-fila.lua new file mode 100644 index 000000000..b21be7db9 --- /dev/null +++ b/dat/Rog-fila.lua @@ -0,0 +1,64 @@ +-- NetHack 3.6 Rogue.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1992 by Dean Luick +-- NetHack may be freely redistributed. See license for details. +-- +-- +des.room({ type = "ordinary", + contents = function() + des.stair("up") + des.object() + des.monster({ id = "leprechaun", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.monster({ id = "leprechaun", peaceful=0 }) + des.monster({ id = "guardian naga", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.trap() + des.object() + des.monster({ id = "water nymph", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.stair("down") + des.object() + des.trap() + des.trap() + des.monster({ class = "l", peaceful=0 }) + des.monster({ id = "guardian naga", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.trap() + des.trap() + des.monster({ id = "leprechaun", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.trap() + des.monster({ id = "leprechaun", peaceful=0 }) + des.monster({ id = "water nymph", peaceful=0 }) + end +}) + +des.random_corridors() diff --git a/dat/Rog-filb.lua b/dat/Rog-filb.lua new file mode 100644 index 000000000..b21be7db9 --- /dev/null +++ b/dat/Rog-filb.lua @@ -0,0 +1,64 @@ +-- NetHack 3.6 Rogue.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1992 by Dean Luick +-- NetHack may be freely redistributed. See license for details. +-- +-- +des.room({ type = "ordinary", + contents = function() + des.stair("up") + des.object() + des.monster({ id = "leprechaun", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.monster({ id = "leprechaun", peaceful=0 }) + des.monster({ id = "guardian naga", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.trap() + des.object() + des.monster({ id = "water nymph", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.stair("down") + des.object() + des.trap() + des.trap() + des.monster({ class = "l", peaceful=0 }) + des.monster({ id = "guardian naga", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.trap() + des.trap() + des.monster({ id = "leprechaun", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.trap() + des.monster({ id = "leprechaun", peaceful=0 }) + des.monster({ id = "water nymph", peaceful=0 }) + end +}) + +des.random_corridors() diff --git a/dat/Rog-goal.lua b/dat/Rog-goal.lua new file mode 100644 index 000000000..3fa505c25 --- /dev/null +++ b/dat/Rog-goal.lua @@ -0,0 +1,110 @@ +-- NetHack 3.6 Rogue.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1992 by Dean Luick +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport") + +-- 1 2 3 4 5 6 7 +--123456789012345678901234567890123456789012345678901234567890123456789012345 +des.map([[ +----- -------.......................................|-----------------| +|...| -----.....|.......................................|.................| +|...----...|.....|.......................................|....---------....| +|.---......---..--.................................------------.......|....| +|...............|..................................|..|...|...----........-| +|.....-----....--.................................|-..--..-|.....----S----| +|--S---...|....|.................................|-........-|....|........| +|.........---------.............................|-....}}....-|...|...|....| +|....|.....S......|............................|-.....}}.....-|..--.------| +|-----.....--.....|...........................|-...}}}}}}}}...-|....|.....-- +|...........--....------S-----...............|-....}}}}}}}}....-|..........| +|............--........|...| |..............--.....}}.}}........----------S- +|.............|........|...| |..............|......}}}}}}}}......|...|.....| +|S-.---.---.---.---.---|...| ------------...--........}}.}}.....--..---....| +|.---.---.---.---.-S-..----- |....|.....|....|-....}}}}}}}}....---..S.|--..| +|...|.......|..........|...---....---...S.....|-...}}}}}}}}...-|.S..|...|..| +|...|..|....|..........|............|..--..----|-.....}}.....-|..----...-S-- +|...|---....----.......|----- ......|...---| |-....}}....-|...|..--.--..| +-----.....---.....--.---....--...--------..| |-........-|....|.........| + |.............|..........|.............S... |S-------|.....|..-----..| + ---------------------------------------- ...... ---------- ---- +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,20), "lit") +-- Stairs +des.levregion({ region={01,00,15,20}, region_islev=1, exclude={01,18,04,20}, type="stair-up" }); +-- Doors +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,20)) +-- One trap to keep the gnomes at bay. +des.trap("spiked pit",37,07) +-- Objects +des.object({ id = "skeleton key", x=38, y=10, buc="blessed", spe=0, name="The Master Key of Thievery" }) +des.object({ id = "tin", x=26, y=12, montype="chameleon" }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster({ id = "Master Assassin", x=38, y=10, peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ class = "l", peaceful=0 }) +des.monster({ class = "l", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ class = "N", peaceful=0 }) +des.monster({ class = "N", peaceful=0 }) +des.monster({ class = "N", peaceful=0 }) +des.monster({ id = "chameleon", peaceful=0 }) +des.monster({ id = "chameleon", peaceful=0 }) +des.monster({ id = "chameleon", peaceful=0 }) +des.monster({ id = "chameleon", peaceful=0 }) +des.monster({ id = "chameleon", peaceful=0 }) +des.monster({ id = "shark", x=51, y=14, peaceful=0 }) +des.monster({ id = "shark", x=53, y=09, peaceful=0 }) +des.monster({ id = "shark", x=55, y=15, peaceful=0 }) +des.monster({ id = "shark", x=58, y=10, peaceful=0 }) diff --git a/dat/Rog-loca.lua b/dat/Rog-loca.lua new file mode 100644 index 000000000..ef5b399ea --- /dev/null +++ b/dat/Rog-loca.lua @@ -0,0 +1,99 @@ +-- NetHack 3.6 Rogue.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1992 by Dean Luick +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +-- 1 2 3 4 5 6 7 +--123456789012345678901234567890123456789012345678901234567890123456789012345 +des.map([[ + ---------------------------------------------------- -------- + ---.................................................- --.....| + ---...--------........-------.......................--- ---...| + ---.....- ---......- ---..................---- --.-- + ---.....---- -------- --..................-- --..| + ---...----- ----.----.....----.....--- --..|| +----..---- -----..--- |...--- |.......--- --...| +|...--- ----....--- |.--- |.........-- --...|| +|...- ----.....--- ---- |..........---....| +|...---- ----......--- | |...|.......-....|| +|......----- ---.........- | -----...|............| +|..........----- ----...........--- -------......||...........|| +|..............-----................--- |............|||..........| +|------...............................--- |...........|| |.........|| +|.....|..............------.............-----..........|| ||........| +|.....|.............-- ---.........................|| |.......|| +|.....|.............- ---.....................--| ||......| +|-S----------.......---- --.................---- |.....|| +|...........|..........--------..............----- ||....| +|...........|............................----- |....| +------------------------------------------ ------ +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,20), "lit") +-- Doors +--DOOR:locked|closed|open,(xx,yy) +-- Stairs +des.stair("up") +des.stair("down") +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,20)) +-- Objects +des.object({ id = "teleportation", x=11, y=18, buc="cursed", spe=0 }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ id = "leprechaun", peaceful=0 }) +des.monster({ class = "l", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ id = "guardian naga", peaceful=0 }) +des.monster({ class = "N", peaceful=0 }) +des.monster({ class = "N", peaceful=0 }) +des.monster({ class = "N", peaceful=0 }) +des.monster({ id = "chameleon", peaceful=0 }) +des.monster({ id = "chameleon", peaceful=0 }) +des.monster({ id = "chameleon", peaceful=0 }) +des.monster({ id = "chameleon", peaceful=0 }) +des.monster({ id = "chameleon", peaceful=0 }) diff --git a/dat/Rog-strt.lua b/dat/Rog-strt.lua new file mode 100644 index 000000000..769cb517f --- /dev/null +++ b/dat/Rog-strt.lua @@ -0,0 +1,163 @@ +-- NetHack 3.6 Rogue.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1992 by Dean Luick +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, Master of Thieves +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "nommap") + +-- 1 2 3 4 5 6 7 +--123456789012345678901234567890123456789012345678901234567890123456789012345 +des.map([[ +---------------------------------.------------------------------------------ +|.....|.||..........|....|......|.|.........|.......+............---.......| +|.....|..+..........+....---....S.|...-S-----.-----.|............+.+.......| +|.....+.||........---......|....|.|...|.....|.|...|.---.....------.--------| +|-----|.-------|..|........------.-----.....|.--..|...-------..............| +|.....|........------+------..........+.....|..--S---.........------.-----.. +|.....|.------...............-----.}}.--------.|....-------.---....|.+...--| +|..-+--.|....|-----.--------.|...|.....+.....|.|....|.....+.+......|.--....| +|..|....|....|....+.|......|.|...-----.|.....|.--...|.....|.|......|..|....| +|..|.-----S----...|.+....-----...|...|.----..|..|.---....--.---S-----.|----| +|..|.|........|...------.|.S.....|...|....-----.+.|......|..|.......|.|....| +|---.-------..|...|....|.|.|.....|...----.|...|.|---.....|.|-.......|.---..| +...........|..S...|....---.----S----..|...|...+.|..-------.---+-....|...--+| +|---------.---------...|......|....S..|.---...|.|..|...........----.---....| +|........|.........|...+.------....|---.---...|.--+-.----.----....|.+...--+| +|........|.---+---.|----.--........|......-----......|..|..|.--+-.|.-S-.|..| +|........|.|.....|........----------.----.......---.--..|-.|....|.-----.|..| +|----....+.|.....----+---............|..|--------.+.|...SS.|....|.......|..| +|...--+-----.....|......|.------------............---...||.------+--+----..| +|..........S.....|......|.|..........S............|.....||...|.....|....|..| +-------------------------.-------------------------------------------------- +]]); +-- Dungeon Description +--REGION:(00,00,75,20),lit,"ordinary" + +local streets = selection.floodfill(selection.new(), 0,12) + + +-- The down stairs is at one of the 4 "exits". The others are mimics, +-- mimicing stairwells. +local place = { {33,0}, {0,12}, {25,20}, {75,05} } +shuffle(place) + +des.stair({ dir = "down", coord = place[1] }) +des.monster({ id = "giant mimic", coord = place[2], appear_as = "ter:staircase down" }) +des.monster({ id = "large mimic", coord = place[3], appear_as = "ter:staircase down" }) +des.monster({ id = "small mimic", coord = place[4], appear_as = "ter:staircase down" }) +-- Portal arrival point +des.levregion({ region = {19,09,19,09}, type="branch" }) +-- Doors (secret) +--DOOR:locked|closed|open,(xx,yy) +des.door("locked", 32, 2) +des.door("locked", 63, 9) +des.door("locked", 27,10) +des.door("locked", 31,12) +des.door("locked", 35,13) +des.door("locked", 69,15) +des.door("locked", 56,17) +des.door("locked", 57,17) +des.door("locked", 11,19) +des.door("locked", 37,19) +des.door("locked", 39, 2) +des.door("locked", 49, 5) +des.door("locked", 10, 9) +des.door("locked", 14,12) +-- Doors (regular) +des.door("closed", 52, 1) +des.door("closed", 9, 2) +des.door("closed", 20, 2) +des.door("closed", 65, 2) +des.door("closed", 67, 2) +des.door("closed", 6, 3) +des.door("closed", 21, 5) +des.door("closed", 38, 5) +des.door("closed", 69, 6) +des.door("closed", 4, 7) +des.door("closed", 39, 7) +des.door("closed", 58, 7) +des.door("closed", 60, 7) +des.door("closed", 18, 8) +des.door("closed", 20, 9) +des.door("closed", 48,10) +des.door("closed", 46,12) +des.door("closed", 62,12) +des.door("closed", 74,12) +des.door("closed", 23,14) +des.door("closed", 23,14) +des.door("closed", 50,14) +des.door("closed", 68,14) +des.door("closed", 74,14) +des.door("closed", 14,15) +des.door("closed", 63,15) +des.door("closed", 9,17) +des.door("closed", 21,17) +des.door("closed", 50,17) +des.door("closed", 6,18) +des.door("closed", 65,18) +des.door("closed", 68,18) +-- Master of Thieves +des.monster("Master of Thieves", 36, 11) +-- The treasure of Master of Thieves +des.object("chest", 36, 11) +-- thug guards, room #1 +des.monster("thug", 28, 10) +des.monster("thug", 29, 11) +des.monster("thug", 30, 09) +des.monster("thug", 31, 07) +-- thug guards, room #2 +des.monster("thug", 31, 13) +des.monster("thug", 33, 14) +des.monster("thug", 30, 15) +--thug guards, room #3 +des.monster("thug", 35, 09) +des.monster("thug", 36, 13) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,20)) +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- +-- Monsters to get in the way. +-- +-- West exit +des.monster({ id = "leprechaun", x=01, y=12, peaceful=0 }) +des.monster({ id = "water nymph", x=02, y=12, peaceful=0 }) +-- North exit +des.monster({ id = "water nymph", x=33, y=01, peaceful=0 }) +des.monster({ id = "leprechaun", x=33, y=02, peaceful=0 }) +-- East exit +des.monster({ id = "water nymph", x=74, y=05, peaceful=0 }) +des.monster({ id = "leprechaun", x=74, y=04, peaceful=0 }) +-- South exit +des.monster({ id = "leprechaun", x=25, y=19, peaceful=0 }) +des.monster({ id = "water nymph", x=25, y=18, peaceful=0 }) +-- Wandering the streets. +for i=1,4 + math.random(1 - 1,1*3) do + des.monster({ id = "water nymph", coord = {streets:rndcoord(1)}, peaceful=0 }) + des.monster({ id = "leprechaun", coord = {streets:rndcoord(1)}, peaceful=0 }) +end +for i=1,7 + math.random(1 - 1,1*3) do + des.monster({ id = "chameleon", coord = {streets:rndcoord(1)}, peaceful=0 }) +end diff --git a/dat/Rogue.des b/dat/Rogue.des deleted file mode 100644 index 1f0c4eb6c..000000000 --- a/dat/Rogue.des +++ /dev/null @@ -1,485 +0,0 @@ -# NetHack 3.6 Rogue.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ -# Copyright (c) 1992 by Dean Luick -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, Master of Thieves -# and receive your quest assignment. -# -MAZE: "Rog-strt",' ' -FLAGS: noteleport, hardfloor, nommap -GEOMETRY:center,center -# 1 2 3 4 5 6 7 -#123456789012345678901234567890123456789012345678901234567890123456789012345 -MAP ----------------------------------.------------------------------------------ -|.....|.||..........|....|......|.|.........|.......+............---.......| -|.....|..+..........+....---....S.|...-S-----.-----.|............+.+.......| -|.....+.||........---......|....|.|...|.....|.|...|.---.....------.--------| -|-----|.-------|..|........------.-----.....|.--..|...-------..............| -|.....|........------+------..........+.....|..--S---.........------.-----.. -|.....|.------...............-----.}}.--------.|....-------.---....|.+...--| -|..-+--.|....|-----.--------.|...|.....+.....|.|....|.....+.+......|.--....| -|..|....|....|....+.|......|.|...-----.|.....|.--...|.....|.|......|..|....| -|..|.-----S----...|.+....-----...|...|.----..|..|.---....--.---S-----.|----| -|..|.|........|...------.|.S.....|...|....-----.+.|......|..|.......|.|....| -|---.-------..|...|....|.|.|.....|...----.|...|.|---.....|.|-.......|.---..| -...........|..S...|....---.----S----..|...|...+.|..-------.---+-....|...--+| -|---------.---------...|......|....S..|.---...|.|..|...........----.---....| -|........|.........|...+.------....|---.---...|.--+-.----.----....|.+...--+| -|........|.---+---.|----.--........|......-----......|..|..|.--+-.|.-S-.|..| -|........|.|.....|........----------.----.......---.--..|-.|....|.-----.|..| -|----....+.|.....----+---............|..|--------.+.|...SS.|....|.......|..| -|...--+-----.....|......|.------------............---...||.------+--+----..| -|..........S.....|......|.|..........S............|.....||...|.....|....|..| --------------------------.-------------------------------------------------- -ENDMAP -# Dungeon Description -#REGION:(00,00,75,20),lit,"ordinary" - -$streets = selection: floodfill(0,12) - - -# The down stairs is at one of the 4 "exits". The others are mimics, -# mimicing stairwells. -$place = { (33,0), (0,12), (25,20), (75,05) } -SHUFFLE: $place - -STAIR:$place[0],down -MONSTER:('m',"giant mimic"), $place[1], m_feature "staircase down" -MONSTER:('m',"large mimic"), $place[2], m_feature "staircase down" -MONSTER:('m',"small mimic"), $place[3], m_feature "staircase down" -# Portal arrival point -BRANCH:(19,09,19,09),(0,0,0,0) -# Doors (secret) -#DOOR:locked|closed|open,(xx,yy) -DOOR: locked, (32, 2) -DOOR: locked, (63, 9) -DOOR: locked, (27,10) -DOOR: locked, (31,12) -DOOR: locked, (35,13) -DOOR: locked, (69,15) -DOOR: locked, (56,17) -DOOR: locked, (57,17) -DOOR: locked, (11,19) -DOOR: locked, (37,19) -DOOR: locked, (39, 2) -DOOR: locked, (49, 5) -DOOR: locked, (10, 9) -DOOR: locked, (14,12) -# Doors (regular) -DOOR: closed, (52, 1) -DOOR: closed, ( 9, 2) -DOOR: closed, (20, 2) -DOOR: closed, (65, 2) -DOOR: closed, (67, 2) -DOOR: closed, ( 6, 3) -DOOR: closed, (21, 5) -DOOR: closed, (38, 5) -DOOR: closed, (69, 6) -DOOR: closed, ( 4, 7) -DOOR: closed, (39, 7) -DOOR: closed, (58, 7) -DOOR: closed, (60, 7) -DOOR: closed, (18, 8) -DOOR: closed, (20, 9) -DOOR: closed, (48,10) -DOOR: closed, (46,12) -DOOR: closed, (62,12) -DOOR: closed, (74,12) -DOOR: closed, (23,14) -DOOR: closed, (23,14) -DOOR: closed, (50,14) -DOOR: closed, (68,14) -DOOR: closed, (74,14) -DOOR: closed, (14,15) -DOOR: closed, (63,15) -DOOR: closed, ( 9,17) -DOOR: closed, (21,17) -DOOR: closed, (50,17) -DOOR: closed, ( 6,18) -DOOR: closed, (65,18) -DOOR: closed, (68,18) -# Master of Thieves -MONSTER:('@',"Master of Thieves"),(36,11) -# The treasure of Master of Thieves -OBJECT:('(',"chest"),(36,11) -# thug guards, room #1 -MONSTER:('@',"thug"),(28,10) -MONSTER:('@',"thug"),(29,11) -MONSTER:('@',"thug"),(30,09) -MONSTER:('@',"thug"),(31,07) -# thug guards, room #2 -MONSTER:('@',"thug"),(31,13) -MONSTER:('@',"thug"),(33,14) -MONSTER:('@',"thug"),(30,15) -#thug guards, room #3 -MONSTER:('@',"thug"),(35,09) -MONSTER:('@',"thug"),(36,13) -# Non diggable walls -NON_DIGGABLE:(00,00,75,20) -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# -# Monsters to get in the way. -# -# West exit -MONSTER: ('l',"leprechaun"),(01,12),hostile -MONSTER: ('n',"water nymph"),(02,12),hostile -# North exit -MONSTER: ('n',"water nymph"),(33,01),hostile -MONSTER: ('l',"leprechaun"),(33,02),hostile -# East exit -MONSTER: ('n',"water nymph"),(74,05),hostile -MONSTER: ('l',"leprechaun"),(74,04),hostile -# South exit -MONSTER: ('l',"leprechaun"),(25,19),hostile -MONSTER: ('n',"water nymph"),(25,18),hostile -# Wandering the streets. -LOOP [ 4 + 1d3 ] { - MONSTER: ('n',"water nymph"),rndcoord($streets),hostile - MONSTER: ('l',"leprechaun"),rndcoord($streets),hostile -} -LOOP [ 7 + 1d3 ] { - MONSTER: (':',"chameleon"),rndcoord($streets),hostile -} - -# -# The "locate" level for the quest. -# -# Here you have to find the entrance to the Assassins' Guild to go -# further towards your assigned quest. -# - -MAZE: "Rog-loca",' ' -GEOMETRY:center,center -# 1 2 3 4 5 6 7 -#123456789012345678901234567890123456789012345678901234567890123456789012345 -MAP - ---------------------------------------------------- -------- - ---.................................................- --.....| - ---...--------........-------.......................--- ---...| - ---.....- ---......- ---..................---- --.-- - ---.....---- -------- --..................-- --..| - ---...----- ----.----.....----.....--- --..|| -----..---- -----..--- |...--- |.......--- --...| -|...--- ----....--- |.--- |.........-- --...|| -|...- ----.....--- ---- |..........---....| -|...---- ----......--- | |...|.......-....|| -|......----- ---.........- | -----...|............| -|..........----- ----...........--- -------......||...........|| -|..............-----................--- |............|||..........| -|------...............................--- |...........|| |.........|| -|.....|..............------.............-----..........|| ||........| -|.....|.............-- ---.........................|| |.......|| -|.....|.............- ---.....................--| ||......| -|-S----------.......---- --.................---- |.....|| -|...........|..........--------..............----- ||....| -|...........|............................----- |....| ------------------------------------------- ------ -ENDMAP -# Dungeon Description -REGION:(00,00,75,20),lit,"ordinary" -# Doors -#DOOR:locked|closed|open,(xx,yy) -# Stairs -STAIR:random,up -STAIR:random,down -# Non diggable walls -NON_DIGGABLE:(00,00,75,20) -# Objects -OBJECT:('?',"teleportation"),(11,18),cursed,0 -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:'l',random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:'N',random,hostile -MONSTER:'N',random,hostile -MONSTER:'N',random,hostile -MONSTER: (':',"chameleon"),random,hostile -MONSTER: (':',"chameleon"),random,hostile -MONSTER: (':',"chameleon"),random,hostile -MONSTER: (':',"chameleon"),random,hostile -MONSTER: (':',"chameleon"),random,hostile - -# -# The "goal" level for the quest. Teleportation and digging are -# disallowed. -# -# You have to reach The Master Assassin via some means other than -# simple searching or digging since there is no path between your -# arrival point and his location. -# -MAZE: "Rog-goal", ' ' -FLAGS: noteleport -GEOMETRY:center,center -# 1 2 3 4 5 6 7 -#123456789012345678901234567890123456789012345678901234567890123456789012345 -MAP ------ -------.......................................|-----------------| -|...| -----.....|.......................................|.................| -|...----...|.....|.......................................|....---------....| -|.---......---..--.................................------------.......|....| -|...............|..................................|..|...|...----........-| -|.....-----....--.................................|-..--..-|.....----S----| -|--S---...|....|.................................|-........-|....|........| -|.........---------.............................|-....}}....-|...|...|....| -|....|.....S......|............................|-.....}}.....-|..--.------| -|-----.....--.....|...........................|-...}}}}}}}}...-|....|.....-- -|...........--....------S-----...............|-....}}}}}}}}....-|..........| -|............--........|...| |..............--.....}}.}}........----------S- -|.............|........|...| |..............|......}}}}}}}}......|...|.....| -|S-.---.---.---.---.---|...| ------------...--........}}.}}.....--..---....| -|.---.---.---.---.-S-..----- |....|.....|....|-....}}}}}}}}....---..S.|--..| -|...|.......|..........|...---....---...S.....|-...}}}}}}}}...-|.S..|...|..| -|...|..|....|..........|............|..--..----|-.....}}.....-|..----...-S-- -|...|---....----.......|----- ......|...---| |-....}}....-|...|..--.--..| ------.....---.....--.---....--...--------..| |-........-|....|.........| - |.............|..........|.............S... |S-------|.....|..-----..| - ---------------------------------------- ...... ---------- ---- -ENDMAP -# Dungeon Description -REGION:(00,00,75,20),lit,"ordinary" -# Stairs -STAIR:levregion(01,00,15,20),(01,18,04,20),up -# Doors -# Non diggable walls -NON_DIGGABLE:(00,00,75,20) -# One trap to keep the gnomes at bay. -TRAP:"spiked pit",(37,07) -# Objects -OBJECT:('(',"skeleton key"),(38,10),blessed,0,name:"The Master Key of Thievery" -OBJECT:('%',"tin"),(26,12),montype:"chameleon" -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('@',"Master Assassin"),(38,10),hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:('l',"leprechaun"),random,hostile -MONSTER:'l',random,hostile -MONSTER:'l',random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:('N',"guardian naga"),random,hostile -MONSTER:'N',random,hostile -MONSTER:'N',random,hostile -MONSTER:'N',random,hostile -MONSTER: (':',"chameleon"),random,hostile -MONSTER: (':',"chameleon"),random,hostile -MONSTER: (':',"chameleon"),random,hostile -MONSTER: (':',"chameleon"),random,hostile -MONSTER: (':',"chameleon"),random,hostile -MONSTER:(';',"shark"),(51,14),hostile -MONSTER:(';',"shark"),(53,09),hostile -MONSTER:(';',"shark"),(55,15),hostile -MONSTER:(';',"shark"),(58,10),hostile - -# -# The "fill" level for the quest. -# -# This level is used to fill out any levels not occupied by specific -# levels as defined above. -# -LEVEL: "Rog-fila" -# -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random - MONSTER: ('l', "leprechaun"), random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random,random - MONSTER: ('l', "leprechaun"), random, hostile - MONSTER: ('N', "guardian naga"), random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - TRAP: random, random - OBJECT: random,random - MONSTER: ('n', "water nymph"), random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - TRAP: random, random - TRAP: random, random - MONSTER: 'l', random, hostile - MONSTER: ('N', "guardian naga"), random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - TRAP: random, random - TRAP: random, random - MONSTER: ('l', "leprechaun"), random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - TRAP: random, random - MONSTER: ('l', "leprechaun"), random, hostile - MONSTER: ('n', "water nymph"), random, hostile -} - -RANDOM_CORRIDORS - -# -# currently a & b are the same. -# -LEVEL: "Rog-filb" -# -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random - MONSTER: ('l', "leprechaun"), random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random,random - MONSTER: ('l', "leprechaun"), random, hostile - MONSTER: ('N', "guardian naga"), random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - TRAP: random, random - OBJECT: random,random - MONSTER: ('n', "water nymph"), random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - TRAP: random, random - TRAP: random, random - MONSTER: 'l', random, hostile - MONSTER: ('N', "guardian naga"), random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - TRAP: random, random - TRAP: random, random - MONSTER: ('l', "leprechaun"), random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - TRAP: random, random - MONSTER: ('l', "leprechaun"), random, hostile - MONSTER: ('n', "water nymph"), random, hostile -} - -RANDOM_CORRIDORS diff --git a/dat/Sam-fila.lua b/dat/Sam-fila.lua new file mode 100644 index 000000000..84a885d98 --- /dev/null +++ b/dat/Sam-fila.lua @@ -0,0 +1,37 @@ +-- NetHack 3.6 Samurai.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991-92 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg="P", smoothed=true, joined=true, walled=true }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.monster("d") +des.monster("wolf") +des.monster("wolf") +des.monster("wolf") +des.monster("wolf") +des.monster("wolf") +des.monster("stalker") +-- +des.trap() +des.trap() +des.trap() +des.trap() diff --git a/dat/Sam-filb.lua b/dat/Sam-filb.lua new file mode 100644 index 000000000..640f4b17b --- /dev/null +++ b/dat/Sam-filb.lua @@ -0,0 +1,60 @@ +-- NetHack 3.6 Samurai.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991-92 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ +------------- ------------- +|...........| |...........| +|...-----...|----------------------------------|...-----...| +|...| |...|..................................|...| |...| +|...-----..........................................-----...| +|...........|--S----------------------------S--|...........| +----...--------.|..........................|.--------...---- + |...|........+..........................+........|...| + |...|........+..........................+........|...| +----...--------.|..........................|.--------...---- +|...........|--S----------------------------S--|...........| +|...-----..........................................-----...| +|...| |...|..................................|...| |...| +|...-----...|----------------------------------|...-----...| +|...........| |...........| +------------- ------------- +]]); +des.region(selection.area(00,00,59,15), "unlit") +-- Doors +des.door("closed",16,07) +des.door("closed",16,08) +des.door("closed",43,07) +des.door("closed",43,08) +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.monster("d") +des.monster("wolf") +des.monster("wolf") +des.monster("wolf") +des.monster("wolf") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +-- +des.trap() +des.trap() +des.trap() +des.trap() \ No newline at end of file diff --git a/dat/Sam-goal.lua b/dat/Sam-goal.lua new file mode 100644 index 000000000..ce7215a0a --- /dev/null +++ b/dat/Sam-goal.lua @@ -0,0 +1,111 @@ +-- NetHack 3.6 Samurai.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991-92 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport"); + +des.map([[ + + ....................... + ......-------------------...... + ......----.................----...... + ....----.....-------------.....----.... + ....--.....----...........----.....--.... + ...||....---....---------....---....||... + ...|....--....---.......---....--....|... + ....|...||...---...--+--...---...||...|.... + ....|...|....|....|-...-|....|....|...|.... + ....|...|....|....+.....+....|....|...|.... + ....|...|....|....|-...-|....|....|...|.... + ....|...||...---...--+--...---...||...|.... + ...|....--....---.......---....--....|... + ...||....---....---------....---....||... + ....--.....----...........----.....--.... + ....----.....-------------.....----.... + ......----.................----...... + ......-------------------...... + ....................... +]]); +-- Dungeon Description +local place = { {02,11},{42,09} } +local placeidx = math.random(1, #place); + +des.region(selection.area(00,00,44,19), "unlit") +-- Doors +des.door("closed",19,10) +des.door("closed",22,08) +des.door("closed",22,12) +des.door("closed",25,10) +-- Stairs +des.stair({ dir = "up", coord = place[placeidx] }) + +-- Holes in the concentric ring walls +local place = { {22,14},{30,10},{22, 6},{14,10} } +local placeidx = math.random(1, #place); +des.terrain(place[placeidx], ".") +local place = { {22, 4},{35,10},{22,16},{ 9,10} } +local placeidx = math.random(1, #place); +des.terrain(place[placeidx], ".") +local place = { {22, 2},{22,18} } +local placeidx = math.random(1, #place); +des.terrain(place[placeidx], ".") + +-- Non diggable walls +des.non_diggable(selection.area(00,00,44,19)) +-- Objects +des.object({ id = "tsurugi", x=22, y=10, buc="blessed", spe=0, name="The Tsurugi of Muramasa" }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.trap("board",22,09) +des.trap("board",24,10) +des.trap("board",22,11) +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster("Ashikaga Takauji", 22, 10) +des.monster({ id = "samurai", peaceful=0 }) +des.monster({ id = "samurai", peaceful=0 }) +des.monster({ id = "samurai", peaceful=0 }) +des.monster({ id = "samurai", peaceful=0 }) +des.monster({ id = "samurai", peaceful=0 }) +des.monster({ id = "ninja", peaceful=0 }) +des.monster({ id = "ninja", peaceful=0 }) +des.monster({ id = "ninja", peaceful=0 }) +des.monster({ id = "ninja", peaceful=0 }) +des.monster({ id = "ninja", peaceful=0 }) +des.monster("wolf") +des.monster("wolf") +des.monster("wolf") +des.monster("wolf") +des.monster("d") +des.monster("d") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") diff --git a/dat/Sam-loca.lua b/dat/Sam-loca.lua new file mode 100644 index 000000000..ccad8e260 --- /dev/null +++ b/dat/Sam-loca.lua @@ -0,0 +1,141 @@ +-- NetHack 3.6 Samurai.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991-92 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "hardfloor"); + +des.map([[ +............................................................................ +............................................................................ +........-----..................................................-----........ +........|...|..................................................|...|........ +........|...---..}..--+------------------------------+--..}..---...|........ +........|-|...|.....|...|....|....|....|....|....|.|...|.....|...|-|........ +..........|...-------...|....|....|....|....|....S.|...-------...|.......... +..........|-|.........------+----+-+-------+-+--------.........|-|.......... +............|..--------.|}........................}|.--------..|............ +............|..+........+..........................+........+..|............ +............|..+........+..........................+........+..|............ +............|..--------.|}........................}|.--------..|............ +..........|-|.........--------+-+-------+-+----+------.........|-|.......... +..........|...-------...|.S....|....|....|....|....|...-------...|.......... +........|-|...|.....|...|.|....|....|....|....|....|...|.....|...|-|........ +........|...---..}..--+------------------------------+--..}..---...|........ +........|...|..................................................|...|........ +........-----..................................................-----........ +............................................................................ +............................................................................ +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +-- Doors +des.door("locked",22,04) +des.door("locked",22,15) +des.door("locked",53,04) +des.door("locked",53,15) +des.door("locked",49,06) +des.door("locked",26,13) +des.door("locked",28,07) +des.door("locked",30,12) +des.door("locked",33,07) +des.door("locked",32,12) +des.door("locked",35,07) +des.door("locked",40,12) +des.door("locked",43,07) +des.door("locked",42,12) +des.door("locked",45,07) +des.door("locked",47,12) +des.door("closed",15,09) +des.door("closed",15,10) +des.door("closed",24,09) +des.door("closed",24,10) +des.door("closed",51,09) +des.door("closed",51,10) +des.door("closed",60,09) +des.door("closed",60,10) +-- Stairs +des.stair("up", 10,10) +des.stair("down", 25,14) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Objects +des.object("*", 25, 05) +des.object("*", 26, 05) +des.object("*", 27, 05) +des.object("*", 28, 05) +des.object("*", 25, 06) +des.object("*", 26, 06) +des.object("*", 27, 06) +des.object("*", 28, 06) +-- +des.object("[", 40, 05) +des.object("[", 41, 05) +des.object("[", 42, 05) +des.object("[", 43, 05) +des.object("[", 40, 06) +des.object("[", 41, 06) +des.object("[", 42, 06) +des.object("[", 43, 06) +-- +des.object(")", 27, 13) +des.object(")", 28, 13) +des.object(")", 29, 13) +des.object(")", 30, 13) +des.object(")", 27, 14) +des.object(")", 28, 14) +des.object(")", 29, 14) +des.object(")", 30, 14) +-- +des.object("(", 37, 13) +des.object("(", 38, 13) +des.object("(", 39, 13) +des.object("(", 40, 13) +des.object("(", 37, 14) +des.object("(", 38, 14) +des.object("(", 39, 14) +des.object("(", 40, 14) +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster({ id = "ninja", x=15, y=05, peaceful=0 }) +des.monster({ id = "ninja", x=16, y=05, peaceful=0 }) +des.monster("wolf", 17, 05) +des.monster("wolf", 18, 05) +des.monster({ id = "ninja", x=19, y=05, peaceful=0 }) +des.monster("wolf", 15, 14) +des.monster("wolf", 16, 14) +des.monster({ id = "ninja", x=17, y=14, peaceful=0 }) +des.monster({ id = "ninja", x=18, y=14, peaceful=0 }) +des.monster("wolf", 56, 05) +des.monster({ id = "ninja", x=57, y=05, peaceful=0 }) +des.monster("wolf", 58, 05) +des.monster("wolf", 59, 05) +des.monster({ id = "ninja", x=56, y=14, peaceful=0 }) +des.monster("wolf", 57, 14) +des.monster({ id = "ninja", x=58, y=14, peaceful=0 }) +des.monster("d", 59, 14) +des.monster("wolf", 60, 14) +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +des.monster("stalker") +-- "guards" for the central courtyard. +des.monster({ id = "samurai", x=30, y=05, peaceful=0 }) +des.monster({ id = "samurai", x=31, y=05, peaceful=0 }) +des.monster({ id = "samurai", x=32, y=05, peaceful=0 }) +des.monster({ id = "samurai", x=32, y=14, peaceful=0 }) +des.monster({ id = "samurai", x=33, y=14, peaceful=0 }) +des.monster({ id = "samurai", x=34, y=14, peaceful=0 }) diff --git a/dat/Sam-strt.lua b/dat/Sam-strt.lua new file mode 100644 index 000000000..108f28f61 --- /dev/null +++ b/dat/Sam-strt.lua @@ -0,0 +1,91 @@ +-- NetHack 3.6 Samurai.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991-92 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, Lord Sato +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor") + +des.map([[ +..............................................................PP............ +...............................................................PP........... +..........---------------------------------------------------...PPP......... +..........|......|.........|...|..............|...|.........|....PPPPP...... +......... |......|.........S...|..............|...S.........|.....PPPP...... +..........|......|.........|---|..............|---|.........|.....PPP....... +..........+......|.........+...-------++-------...+.........|......PP....... +..........+......|.........|......................|.........|......PP....... +......... |......---------------------++--------------------|........PP..... +..........|.................................................|.........PP.... +..........|.................................................|...........PP.. +..........----------------------------------------...-------|............PP. +..........................................|.................|.............PP +.............. ................. .........|.................|..............P +............. } ............... } ........|.................|............... +.............. ........PP....... .........|.................|............... +.....................PPP..................|.................|............... +......................PP..................-------------------............... +............................................................................ +............................................................................ +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region({ region={18,03, 26,07}, lit=1, type="throne", prefilled=1 }) +-- Portal arrival zone +des.levregion({ region = {62,12,70,17}, type="branch" }) +-- Stairs +des.stair("down", 29,04) +-- Doors +des.door("locked",10,06) +des.door("locked",10,07) +des.door("closed",27,04) +des.door("closed",27,06) +des.door("closed",38,06) +des.door("locked",38,08) +des.door("closed",39,06) +des.door("locked",39,08) +des.door("closed",50,04) +des.door("closed",50,06) +-- Lord Sato +des.monster("Lord Sato", 20, 04) +-- The treasure of Lord Sato +des.object("chest", 20, 04) +-- roshi guards for the audience chamber +des.monster("roshi", 18, 04) +des.monster("roshi", 18, 05) +des.monster("roshi", 18, 06) +des.monster("roshi", 18, 07) +des.monster("roshi", 26, 04) +des.monster("roshi", 26, 05) +des.monster("roshi", 26, 06) +des.monster("roshi", 26, 07) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Monsters on siege duty. +des.monster({ id = "ninja", x=64, y=00, peaceful=0 }) +des.monster("wolf", 65, 01) +des.monster({ id = "ninja", x=67, y=02, peaceful=0 }) +des.monster({ id = "ninja", x=69, y=05, peaceful=0 }) +des.monster({ id = "ninja", x=69, y=06, peaceful=0 }) +des.monster("wolf", 69, 07) +des.monster({ id = "ninja", x=70, y=06, peaceful=0 }) +des.monster({ id = "ninja", x=70, y=07, peaceful=0 }) +des.monster({ id = "ninja", x=72, y=01, peaceful=0 }) +des.monster("wolf", 75, 09) +des.monster({ id = "ninja", x=73, y=05, peaceful=0 }) +des.monster({ id = "ninja", x=68, y=02, peaceful=0 }) +des.monster("stalker") diff --git a/dat/Samurai.des b/dat/Samurai.des deleted file mode 100644 index 1b3fa8785..000000000 --- a/dat/Samurai.des +++ /dev/null @@ -1,440 +0,0 @@ -# NetHack 3.6 Samurai.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1991-92 by M. Stephenson, P. Winner -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, Lord Sato -# and receive your quest assignment. -# -MAZE: "Sam-strt",' ' -FLAGS: noteleport,hardfloor -GEOMETRY:center,center -MAP -..............................................................PP............ -...............................................................PP........... -..........---------------------------------------------------...PPP......... -..........|......|.........|...|..............|...|.........|....PPPPP...... -......... |......|.........S...|..............|...S.........|.....PPPP...... -..........|......|.........|---|..............|---|.........|.....PPP....... -..........+......|.........+...-------++-------...+.........|......PP....... -..........+......|.........|......................|.........|......PP....... -......... |......---------------------++--------------------|........PP..... -..........|.................................................|.........PP.... -..........|.................................................|...........PP.. -..........----------------------------------------...-------|............PP. -..........................................|.................|.............PP -.............. ................. .........|.................|..............P -............. } ............... } ........|.................|............... -.............. ........PP....... .........|.................|............... -.....................PPP..................|.................|............... -......................PP..................-------------------............... -............................................................................ -............................................................................ -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION:(18,03,26,07),lit,"throne",unfilled -# Portal arrival zone -BRANCH:(62,12,70,17),(0,0,0,0) -# Stairs -STAIR:(29,04),down -# Doors -DOOR:locked,(10,06) -DOOR:locked,(10,07) -DOOR:closed,(27,04) -DOOR:closed,(27,06) -DOOR:closed,(38,06) -DOOR:locked,(38,08) -DOOR:closed,(39,06) -DOOR:locked,(39,08) -DOOR:closed,(50,04) -DOOR:closed,(50,06) -# Lord Sato -MONSTER:('@',"Lord Sato"),(20,04) -# The treasure of Lord Sato -OBJECT:('(',"chest"),(20,04) -# roshi guards for the audience chamber -MONSTER:('@',"roshi"),(18,04) -MONSTER:('@',"roshi"),(18,05) -MONSTER:('@',"roshi"),(18,06) -MONSTER:('@',"roshi"),(18,07) -MONSTER:('@',"roshi"),(26,04) -MONSTER:('@',"roshi"),(26,05) -MONSTER:('@',"roshi"),(26,06) -MONSTER:('@',"roshi"),(26,07) -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Monsters on siege duty. -MONSTER: ('@',"ninja"),(64,00),hostile -MONSTER: ('d',"wolf"),(65,01) -MONSTER: ('@',"ninja"),(67,02),hostile -MONSTER: ('@',"ninja"),(69,05),hostile -MONSTER: ('@',"ninja"),(69,06),hostile -MONSTER: ('d',"wolf"),(69,07) -MONSTER: ('@',"ninja"),(70,06),hostile -MONSTER: ('@',"ninja"),(70,07),hostile -MONSTER: ('@',"ninja"),(72,01),hostile -MONSTER: ('d',"wolf"),(75,09) -MONSTER: ('@',"ninja"),(73,05),hostile -MONSTER: ('@',"ninja"),(68,02),hostile -MONSTER:('E',"stalker"),random - -# -# The "locate" level for the quest. -# -# Here you have to invade the Shogun's Castle to go -# further towards your assigned quest. -# - -MAZE: "Sam-loca",' ' -FLAGS: hardfloor -GEOMETRY:center,center -MAP -............................................................................ -............................................................................ -........-----..................................................-----........ -........|...|..................................................|...|........ -........|...---..}..--+------------------------------+--..}..---...|........ -........|-|...|.....|...|....|....|....|....|....|.|...|.....|...|-|........ -..........|...-------...|....|....|....|....|....S.|...-------...|.......... -..........|-|.........------+----+-+-------+-+--------.........|-|.......... -............|..--------.|}........................}|.--------..|............ -............|..+........+..........................+........+..|............ -............|..+........+..........................+........+..|............ -............|..--------.|}........................}|.--------..|............ -..........|-|.........--------+-+-------+-+----+------.........|-|.......... -..........|...-------...|.S....|....|....|....|....|...-------...|.......... -........|-|...|.....|...|.|....|....|....|....|....|...|.....|...|-|........ -........|...---..}..--+------------------------------+--..}..---...|........ -........|...|..................................................|...|........ -........-----..................................................-----........ -............................................................................ -............................................................................ -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -# Doors -DOOR:locked,(22,04) -DOOR:locked,(22,15) -DOOR:locked,(53,04) -DOOR:locked,(53,15) -DOOR:locked,(49,06) -DOOR:locked,(26,13) -DOOR:locked,(28,07) -DOOR:locked,(30,12) -DOOR:locked,(33,07) -DOOR:locked,(32,12) -DOOR:locked,(35,07) -DOOR:locked,(40,12) -DOOR:locked,(43,07) -DOOR:locked,(42,12) -DOOR:locked,(45,07) -DOOR:locked,(47,12) -DOOR:closed,(15,09) -DOOR:closed,(15,10) -DOOR:closed,(24,09) -DOOR:closed,(24,10) -DOOR:closed,(51,09) -DOOR:closed,(51,10) -DOOR:closed,(60,09) -DOOR:closed,(60,10) -# Stairs -STAIR:(10,10),up -STAIR:(25,14),down -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Objects -OBJECT:'*',(25,05) -OBJECT:'*',(26,05) -OBJECT:'*',(27,05) -OBJECT:'*',(28,05) -OBJECT:'*',(25,06) -OBJECT:'*',(26,06) -OBJECT:'*',(27,06) -OBJECT:'*',(28,06) -# -OBJECT:'[',(40,05) -OBJECT:'[',(41,05) -OBJECT:'[',(42,05) -OBJECT:'[',(43,05) -OBJECT:'[',(40,06) -OBJECT:'[',(41,06) -OBJECT:'[',(42,06) -OBJECT:'[',(43,06) -# -OBJECT:')',(27,13) -OBJECT:')',(28,13) -OBJECT:')',(29,13) -OBJECT:')',(30,13) -OBJECT:')',(27,14) -OBJECT:')',(28,14) -OBJECT:')',(29,14) -OBJECT:')',(30,14) -# -OBJECT:'(',(37,13) -OBJECT:'(',(38,13) -OBJECT:'(',(39,13) -OBJECT:'(',(40,13) -OBJECT:'(',(37,14) -OBJECT:'(',(38,14) -OBJECT:'(',(39,14) -OBJECT:'(',(40,14) -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('@',"ninja"),(15,05),hostile -MONSTER:('@',"ninja"),(16,05),hostile -MONSTER:('d',"wolf"),(17,05) -MONSTER:('d',"wolf"),(18,05) -MONSTER:('@',"ninja"),(19,05),hostile -MONSTER:('d',"wolf"),(15,14) -MONSTER:('d',"wolf"),(16,14) -MONSTER:('@',"ninja"),(17,14),hostile -MONSTER:('@',"ninja"),(18,14),hostile -MONSTER:('d',"wolf"),(56,05) -MONSTER:('@',"ninja"),(57,05),hostile -MONSTER:('d',"wolf"),(58,05) -MONSTER:('d',"wolf"),(59,05) -MONSTER:('@',"ninja"),(56,14),hostile -MONSTER:('d',"wolf"),(57,14) -MONSTER:('@',"ninja"),(58,14),hostile -MONSTER:'d',(59,14) -MONSTER:('d',"wolf"),(60,14) -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -# "guards" for the central courtyard. -MONSTER:('@',"samurai"),(30,05),hostile -MONSTER:('@',"samurai"),(31,05),hostile -MONSTER:('@',"samurai"),(32,05),hostile -MONSTER:('@',"samurai"),(32,14),hostile -MONSTER:('@',"samurai"),(33,14),hostile -MONSTER:('@',"samurai"),(34,14),hostile - -# -# The "goal" level for the quest. -# -# Here you meet Takauji, your nemesis monster. You have to -# defeat him in combat to gain the artifact you have been -# assigned to retrieve. -# - -MAZE: "Sam-goal", ' ' -FLAGS: noteleport -GEOMETRY:center,center -MAP - - ....................... - ......-------------------...... - ......----.................----...... - ....----.....-------------.....----.... - ....--.....----...........----.....--.... - ...||....---....---------....---....||... - ...|....--....---.......---....--....|... - ....|...||...---...--+--...---...||...|.... - ....|...|....|....|-...-|....|....|...|.... - ....|...|....|....+.....+....|....|...|.... - ....|...|....|....|-...-|....|....|...|.... - ....|...||...---...--+--...---...||...|.... - ...|....--....---.......---....--....|... - ...||....---....---------....---....||... - ....--.....----...........----.....--.... - ....----.....-------------.....----.... - ......----.................----...... - ......-------------------...... - ....................... -ENDMAP -# Dungeon Description -$place = { (02,11),(42,09) } -SHUFFLE: $place - -REGION:(00,00,44,19),unlit,"ordinary" -# Doors -DOOR:closed,(19,10) -DOOR:closed,(22,08) -DOOR:closed,(22,12) -DOOR:closed,(25,10) -# Stairs -STAIR:$place[0],up - -# Holes in the concentric ring walls -$place = { (22,14),(30,10),(22, 6),(14,10) } -SHUFFLE:$place -TERRAIN:$place[0],'.' -$place = { (22, 4),(35,10),(22,16),( 9,10) } -SHUFFLE:$place -TERRAIN:$place[0],'.' -$place = { (22, 2),(22,18) } -SHUFFLE:$place -TERRAIN:$place[0],'.' - -# Non diggable walls -NON_DIGGABLE:(00,00,44,19) -# Objects -OBJECT:(')',"tsurugi"),(22,10),blessed,0,name:"The Tsurugi of Muramasa" -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# -TRAP:"board",(22,09) -TRAP:"board",(24,10) -TRAP:"board",(22,11) -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('@',"Ashikaga Takauji"),(22,10) -MONSTER:('@',"samurai"),random,hostile -MONSTER:('@',"samurai"),random,hostile -MONSTER:('@',"samurai"),random,hostile -MONSTER:('@',"samurai"),random,hostile -MONSTER:('@',"samurai"),random,hostile -MONSTER:('@',"ninja"),random,hostile -MONSTER:('@',"ninja"),random,hostile -MONSTER:('@',"ninja"),random,hostile -MONSTER:('@',"ninja"),random,hostile -MONSTER:('@',"ninja"),random,hostile -MONSTER:('d',"wolf"),random -MONSTER:('d',"wolf"),random -MONSTER:('d',"wolf"),random -MONSTER:('d',"wolf"),random -MONSTER:'d',random -MONSTER:'d',random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random -MONSTER:('E',"stalker"),random - - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "filla" is the upper filler, between the -# start and locate levels, and "fillb" the lower between the locate -# and goal levels. -# - -MAZE: "Sam-fila", ' ' -INIT_MAP: mines, '.' , 'P', true, true, random, true -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -MONSTER: 'd', random -MONSTER: ('d', "wolf"), random -MONSTER: ('d', "wolf"), random -MONSTER: ('d', "wolf"), random -MONSTER: ('d', "wolf"), random -MONSTER: ('d', "wolf"), random -MONSTER: ('E', "stalker"), random -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random - -MAZE: "Sam-filb", ' ' -GEOMETRY:center,center -MAP -------------- ------------- -|...........| |...........| -|...-----...|----------------------------------|...-----...| -|...| |...|..................................|...| |...| -|...-----..........................................-----...| -|...........|--S----------------------------S--|...........| -----...--------.|..........................|.--------...---- - |...|........+..........................+........|...| - |...|........+..........................+........|...| -----...--------.|..........................|.--------...---- -|...........|--S----------------------------S--|...........| -|...-----..........................................-----...| -|...| |...|..................................|...| |...| -|...-----...|----------------------------------|...-----...| -|...........| |...........| -------------- ------------- -ENDMAP -REGION:(00,00,59,15),unlit,"ordinary" -# Doors -DOOR:closed,(16,07) -DOOR:closed,(16,08) -DOOR:closed,(43,07) -DOOR:closed,(43,08) -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -MONSTER: 'd', random -MONSTER: ('d', "wolf"), random -MONSTER: ('d', "wolf"), random -MONSTER: ('d', "wolf"), random -MONSTER: ('d', "wolf"), random -MONSTER: ('E', "stalker"), random -MONSTER: ('E', "stalker"), random -MONSTER: ('E', "stalker"), random -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random diff --git a/dat/Tou-fila.lua b/dat/Tou-fila.lua new file mode 100644 index 000000000..0a84f8a2e --- /dev/null +++ b/dat/Tou-fila.lua @@ -0,0 +1,35 @@ +-- NetHack 3.6 Tourist.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991,92 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg=" ", smoothed=true, joined=true, walled=true }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.trap() +des.trap() +des.trap() +des.trap() +-- +des.monster({ id = "soldier", peaceful = 0 }) +des.monster({ id = "soldier", peaceful = 0 }) +des.monster({ id = "soldier", peaceful = 0 }) +des.monster({ id = "soldier", peaceful = 0 }) +des.monster({ id = "soldier", peaceful = 0 }) +des.monster({ class = "H", peaceful = 0 }) +des.monster({ class = "C", peaceful = 0 }) diff --git a/dat/Tou-filb.lua b/dat/Tou-filb.lua new file mode 100644 index 000000000..9b748a4cd --- /dev/null +++ b/dat/Tou-filb.lua @@ -0,0 +1,39 @@ +-- NetHack 3.6 Tourist.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991,92 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg=" ", smoothed=true, joined=true, walled=true }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.trap() +des.trap() +des.trap() +des.trap() +-- +des.monster({ id = "soldier", peaceful = 0 }) +des.monster({ id = "captain", peaceful = 0 }) +des.monster({ id = "captain", peaceful = 0 }) +des.monster({ class = "H", peaceful = 0 }) +des.monster({ class = "H", peaceful = 0 }) +des.monster({ class = "C", peaceful = 0 }) +des.monster("s") diff --git a/dat/Tou-goal.lua b/dat/Tou-goal.lua new file mode 100644 index 000000000..b1fb941ed --- /dev/null +++ b/dat/Tou-goal.lua @@ -0,0 +1,160 @@ +-- NetHack 3.6 Tourist.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991,92 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ +---------------------------------------------------------------------------- +|.........|.........|..........|..| |.................|........|........|..| +|.........|.........|..........|..| |....--------.....|........|........|..| +|------S--|--+-----------+------..| |....|......|.....|........|........|..| +|.........|.......................| |....|......+.....--+-------------+--..| +|.........|.......................| |....|......|..........................| +|-S-----S-|......----------.......| |....|......|..........................| +|..|..|...|......|........|.......| |....-----------.........----..........| +|..+..+...|......|........|.......| |....|.........|.........|}}|..........| +|..|..|...|......+........|.......| |....|.........+.........|}}|..........| +|..|..|...|......|........|.......S.S....|.........|.........----..........| +|---..----|......|........|.......| |....|.........|.......................| +|.........+......|+F-+F-+F|.......| |....-----------.......................| +|---..----|......|..|..|..|.......| |......................--------------..| +|..|..|...|......--F-F--F--.......| |......................+............|..| +|..+..+...|.......................| |--.---...-----+-----..|............|..| +|--|..----|--+-----------+------..| |.....|...|.........|..|------------|..| +|..+..+...|.........|..........|..| |.....|...|.........|..+............|..| +|..|..|...|.........|..........|..| |.....|...|.........|..|............|..| +---------------------------------------------------------------------------- +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +-- The Inn +des.region(selection.area(01,01,09,02), "lit") +des.region({ region = {01,04,09,05}, lit=1, type = "barracks" }) +des.region(selection.area(01,07,02,10), "unlit") +des.region(selection.area(07,07,09,10), "unlit") +des.region(selection.area(01,14,02,15), "unlit") +des.region(selection.area(07,14,09,15), "unlit") +des.region(selection.area(01,17,02,18), "unlit") +des.region(selection.area(07,17,09,18), "unlit") +-- +des.region({ region = {11,01,19,02}, lit = 0, type = "barracks" }) +des.region(selection.area(21,01,30,02), "unlit") +des.region({ region = {11,17,19,18}, lit = 0, type = "barracks" }) +des.region(selection.area(21,17,30,18), "unlit") +-- Police Station +des.region(selection.area(18,07,25,11), "lit") +des.region(selection.area(18,13,19,13), "unlit") +des.region(selection.area(21,13,22,13), "unlit") +des.region(selection.area(24,13,25,13), "unlit") +-- The town itself +des.region(selection.area(42,03,47,06), "unlit") +des.region(selection.area(42,08,50,11), "unlit") +des.region({ region = {37,16,41,18}, lit = 0, type = "morgue" }) +des.region(selection.area(47,16,55,18), "unlit") +des.region(selection.area(55,01,62,03), "unlit") +des.region(selection.area(64,01,71,03), "unlit") +des.region({ region = {60,14,71,15}, lit = 1, type = "shop" }) +des.region({ region = {60,17,71,18}, lit = 1, type = "shop" }) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Stairs +des.stair("up", 70,08) +-- Doors +des.door("locked",07,03) +des.door("locked",02,06) +des.door("locked",08,06) +des.door("closed",03,08) +des.door("closed",06,08) +des.door("open",10,12) +des.door("closed",03,15) +des.door("closed",06,15) +des.door("closed",03,17) +des.door("closed",06,17) +des.door("closed",13,03) +des.door("random",25,03) +des.door("closed",13,16) +des.door("random",25,16) +des.door("locked",17,09) +des.door("locked",18,12) +des.door("locked",21,12) +des.door("locked",24,12) +des.door("locked",34,10) +des.door("locked",36,10) +des.door("random",48,04) +des.door("random",56,04) +des.door("random",70,04) +des.door("random",51,09) +des.door("random",51,15) +des.door("open",59,14) +des.door("open",59,17) +-- Objects +des.object({ id = "credit card", x=04, y=01, buc="blessed", spe=0, name="The Platinum Yendorian Express Card" }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster({ id = "Master of Thieves", x=04, y=01, peaceful = 0 }) +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("s") +des.monster("s") +-- ladies of the evening +des.monster("succubus", 02, 08) +des.monster("succubus", 08, 08) +des.monster("incubus", 02, 14) +des.monster("incubus", 08, 14) +des.monster("incubus", 02, 17) +des.monster("incubus", 08, 17) +-- Police station (with drunken prisoners) +des.monster({ id = "Kop Kaptain", x=24, y=09, peaceful = 0 }) +des.monster({ id = "Kop Lieutenant", x=20, y=09, peaceful = 0 }) +des.monster({ id = "Kop Lieutenant", x=22, y=11, peaceful = 0 }) +des.monster({ id = "Kop Lieutenant", x=22, y=07, peaceful = 0 }) +des.monster({ id = "Keystone Kop", x=19, y=07, peaceful = 0 }) +des.monster({ id = "Keystone Kop", x=19, y=08, peaceful = 0 }) +des.monster({ id = "Keystone Kop", x=22, y=09, peaceful = 0 }) +des.monster({ id = "Keystone Kop", x=24, y=11, peaceful = 0 }) +des.monster({ id = "Keystone Kop", x=19, y=11, peaceful = 0 }) +des.monster("prisoner", 19, 13) +des.monster("prisoner", 21, 13) +des.monster("prisoner", 24, 13) +-- +des.monster({ id = "watchman", x=33, y=10, peaceful = 0 }) + +des.wallify() diff --git a/dat/Tou-loca.lua b/dat/Tou-loca.lua new file mode 100644 index 000000000..f82f5072f --- /dev/null +++ b/dat/Tou-loca.lua @@ -0,0 +1,157 @@ +-- NetHack 3.6 Tourist.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991,92 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "hardfloor") +des.map([[ +---------------------------------------------------------------------------- +|....|......|..........|......|......|...|....|.....|......|...............| +|....|......|.|------|.|......|......|.|.|....|..}..|......|.|----------|..| +|....|--+----.|......|.|-S---+|+-----|.|.S....|.....|---+--|.|..........+..| +|....|........|......|.|...|.........|.|------|..............|..........|-+| +|....+...}}...+......|.|...|.|-----|.|..............|--+----------------|..| +|----|........|------|.|---|.|.....|......|-----+-|.|.......|...........|--| +|............................|.....|.|--+-|.......|.|.......|...........|..| +|----|.....|-------------|...|--+--|.|....|.......|.|-----------+-------|..| +|....+.....+.........S...|...........|....|-------|........................| +|....|.....|.........|...|.|---------|....|.........|-------|.|----------|.| +|....|.....|---------|---|.|......|..+....|-------|.|.......|.+......S.\.|.| +|....|.....+.........S...|.|......|..|....|.......|.|.......|.|......|...|.| +|-------|..|.........|---|.|+-------------------+-|.|.......+.|----------|.| +|.......+..|---------|.........|.........|..........|.......|.|..........|.| +|.......|..............|--+--|.|.........|.|----+-----------|.|..........|.| +|---------+-|--+-----|-|.....|.|.........|.|........|.|.....+.|..........+.| +|...........|........|.S.....|.|----+----|.|--------|.|.....|.|----------|.| +|...........|........|.|.....|........................|.....|..............| +---------------------------------------------------------------------------- +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.non_diggable(selection.area(00,00,75,19)) +-- +des.region({ region={01,01, 04,05}, lit=0, type="morgue", prefilled = 0 }) +des.region({ region={15,03, 20,05}, lit=1, type="shop", prefilled = 0 }) +des.region({ region={62,03, 71,04}, lit=1, type="shop", prefilled = 0 }) +des.region({ region={01,17, 11,18}, lit=1, type="barracks", prefilled = 0 }) +des.region({ region={12,09, 20,10}, lit=1, type="barracks", prefilled = 0 }) +des.region({ region={53,11, 59,14}, lit=1, type="zoo", prefilled = 0 }) +des.region({ region={63,14, 72,16}, lit=1, type="barracks", prefilled = 0 }) +des.region({ region={32,14, 40,16}, lit=1, type="temple", prefilled = 0 }) +-- +des.region({ region = {06,01,11,02}, type = "ordinary" }) +des.region({ region = {24,01,29,02}, type = "ordinary" }) +des.region({ region = {31,01,36,02}, type = "ordinary" }) +des.region({ region = {42,01,45,03}, type = "ordinary" }) +des.region({ region = {53,01,58,02}, type = "ordinary" }) +des.region({ region = {24,04,26,05}, type = "ordinary" }) +des.region({ region = {30,06,34,07}, type = "ordinary" }) +des.region(selection.area(73,05,74,05), "unlit") +des.region({ region = {01,09,04,12}, type = "ordinary" }) +des.region({ region = {01,14,07,15}, type = "ordinary" }) +des.region({ region = {12,12,20,13}, type = "ordinary" }) +des.region({ region = {13,17,20,18}, type = "ordinary" }) +des.region({ region = {22,09,24,10}, type = "ordinary" }) +des.region({ region = {22,12,24,12}, type = "ordinary" }) +des.region({ region = {24,16,28,18}, type = "ordinary" }) +des.region({ region = {28,11,33,12}, type = "ordinary" }) +des.region(selection.area(35,11,36,12), "lit") +des.region({ region = {38,08,41,12}, type = "ordinary" }) +des.region({ region = {43,07,49,08}, type = "ordinary" }) +des.region({ region = {43,12,49,12}, type = "ordinary" }) +des.region({ region = {44,16,51,16}, type = "ordinary" }) +des.region({ region = {53,06,59,07}, type = "ordinary" }) +des.region({ region = {61,06,71,07}, type = "ordinary" }) +des.region({ region = {55,16,59,18}, type = "ordinary" }) +des.region({ region = {63,11,68,12}, type = "ordinary" }) +des.region({ region = {70,11,72,12}, type = "ordinary" }) +-- Stairs +des.stair("up", 10,04) +des.stair("down", 73,05) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +des.door("closed",05,05) +des.door("closed",05,09) +des.door("closed",08,14) +des.door("closed",08,03) +des.door("closed",11,09) +des.door("closed",11,12) +des.door("closed",10,16) +des.door("closed",14,05) +des.door("closed",15,16) +des.door("locked",21,09) +des.door("locked",21,12) +des.door("closed",23,17) +des.door("closed",25,03) +des.door("closed",26,15) +des.door("closed",29,03) +des.door("closed",28,13) +des.door("closed",31,03) +des.door("closed",32,08) +des.door("closed",37,11) +des.door("closed",36,17) +des.door("locked",41,03) +des.door("closed",40,07) +des.door("closed",48,06) +des.door("closed",48,13) +des.door("closed",48,15) +des.door("closed",56,03) +des.door("closed",55,05) +des.door("closed",72,03) +des.door("locked",74,04) +des.door("closed",64,08) +des.door("closed",62,11) +des.door("closed",69,11) +des.door("closed",60,13) +des.door("closed",60,16) +des.door("closed",73,16) + +-- Objects +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Toilet paper +des.object("blank paper", 71, 12) +des.object("blank paper", 71, 12) +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("s") +des.monster("s") diff --git a/dat/Tou-strt.lua b/dat/Tou-strt.lua new file mode 100644 index 000000000..8ca3f6a76 --- /dev/null +++ b/dat/Tou-strt.lua @@ -0,0 +1,131 @@ +-- NetHack 3.6 Tourist.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991,92 by M. Stephenson, P. Winner +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, Twoflower +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor") +des.map([[ +.......}}....---------..-------------------------------------------------... +........}}...|.......|..|.-------------------------------------------...|... +.........}}..|.......|..|.|......|......|.............|......|......|...|... +..........}}.|.......|..|.|......+......+.............+......+..\...|...|... +...........}}}..........|.|......|......|.............|......|......|...|... +.............}}.........|.|----S-|--S---|S----------S-|---S--|------|...|... +..............}}}.......|...............................................|... +................}}}.....----S------++--S----------S----------S-----------... +..................}}........... .. ................................... +......-------......}}}}........}}}}..}}}}..}}}}..}}}}....................... +......|.....|.......}}}}}}..}}}} .. }}}}..}}}}..}}}..................... +......|.....+...........}}}}}}........................}}}..}}}}..}}}..}}}... +......|.....|...........................................}}}}..}}}..}}}}.}}}} +......-------............................................................... +............................................................................ +...-------......-------..................................................... +...|.....|......|.....|..................................................... +...|.....+......+.....|..................................................... +...|.....|......|.....|..................................................... +...-------......-------..................................................... +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region({ region={14,01, 20,03}, lit=0, type="morgue", prefilled=0 }) +des.region(selection.area(07,10,11,12), "unlit") +des.region(selection.area(04,16,08,18), "unlit") +des.region(selection.area(17,16,21,18), "unlit") +des.region(selection.area(27,02,32,04), "unlit") +des.region(selection.area(34,02,39,04), "unlit") +des.region(selection.area(41,02,53,04), "unlit") +des.region(selection.area(55,02,60,04), "unlit") +des.region(selection.area(62,02,67,04), "lit") +-- Stairs +des.stair("down", 66,03) +-- Portal arrival point +des.levregion({ region = {68,14,68,14}, type="branch" }) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Doors +des.door("locked",31,05) +des.door("locked",36,05) +des.door("locked",41,05) +des.door("locked",52,05) +des.door("locked",58,05) +des.door("locked",28,07) +des.door("locked",39,07) +des.door("locked",50,07) +des.door("locked",61,07) +des.door("closed",33,03) +des.door("closed",40,03) +des.door("closed",54,03) +des.door("closed",61,03) +des.door("open",12,11) +des.door("open",09,17) +des.door("open",16,17) +des.door("locked",35,07) +des.door("locked",36,07) +-- Monsters on siege duty. +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("giant spider") +des.monster("s") +des.monster("s") +des.monster("forest centaur") +des.monster("forest centaur") +des.monster("forest centaur") +des.monster("forest centaur") +des.monster("forest centaur") +des.monster("forest centaur") +des.monster("forest centaur") +des.monster("forest centaur") +des.monster("C") +-- Twoflower +des.monster("Twoflower", 64, 03) +-- The treasure of Twoflower +des.object("chest", 64, 03) +-- guides for the audience chamber +des.monster("guide", 29, 03) +des.monster("guide", 32, 04) +des.monster("guide", 35, 02) +des.monster("guide", 38, 03) +des.monster("guide", 45, 03) +des.monster("guide", 48, 02) +des.monster("guide", 49, 04) +des.monster("guide", 51, 03) +des.monster("guide", 57, 03) +des.monster("guide", 62, 04) +des.monster("guide", 66, 04) +-- path guards +des.monster("watchman", 35, 08) +des.monster("watchman", 36, 08) +-- river monsters +des.monster("giant eel", 62, 12) +des.monster("piranha", 47, 10) +des.monster("piranha", 29, 11) +des.monster("kraken", 34, 09) +des.monster("kraken", 37, 09) +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() diff --git a/dat/Tourist.des b/dat/Tourist.des deleted file mode 100644 index c88372fd5..000000000 --- a/dat/Tourist.des +++ /dev/null @@ -1,519 +0,0 @@ -# NetHack 3.6 Tourist.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1991,92 by M. Stephenson, P. Winner -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, Twoflower -# and receive your quest assignment. -# -MAZE: "Tou-strt",' ' -FLAGS: noteleport,hardfloor -GEOMETRY:center,center -MAP -.......}}....---------..-------------------------------------------------... -........}}...|.......|..|.-------------------------------------------...|... -.........}}..|.......|..|.|......|......|.............|......|......|...|... -..........}}.|.......|..|.|......+......+.............+......+..\...|...|... -...........}}}..........|.|......|......|.............|......|......|...|... -.............}}.........|.|----S-|--S---|S----------S-|---S--|------|...|... -..............}}}.......|...............................................|... -................}}}.....----S------++--S----------S----------S-----------... -..................}}........... .. ................................... -......-------......}}}}........}}}}..}}}}..}}}}..}}}}....................... -......|.....|.......}}}}}}..}}}} .. }}}}..}}}}..}}}..................... -......|.....+...........}}}}}}........................}}}..}}}}..}}}..}}}... -......|.....|...........................................}}}}..}}}..}}}}.}}}} -......-------............................................................... -............................................................................ -...-------......-------..................................................... -...|.....|......|.....|..................................................... -...|.....+......+.....|..................................................... -...|.....|......|.....|..................................................... -...-------......-------..................................................... -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION:(14,01,20,03),unlit,"morgue" -REGION:(07,10,11,12),unlit,"ordinary" -REGION:(04,16,08,18),unlit,"ordinary" -REGION:(17,16,21,18),unlit,"ordinary" -REGION:(27,02,32,04),unlit,"ordinary" -REGION:(34,02,39,04),unlit,"ordinary" -REGION:(41,02,53,04),unlit,"ordinary" -REGION:(55,02,60,04),unlit,"ordinary" -REGION:(62,02,67,04),lit,"ordinary" -# Stairs -STAIR:(66,03),down -# Portal arrival point -BRANCH:(68,14,68,14),(0,0,0,0) -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Doors -DOOR:locked,(31,05) -DOOR:locked,(36,05) -DOOR:locked,(41,05) -DOOR:locked,(52,05) -DOOR:locked,(58,05) -DOOR:locked,(28,07) -DOOR:locked,(39,07) -DOOR:locked,(50,07) -DOOR:locked,(61,07) -DOOR:closed,(33,03) -DOOR:closed,(40,03) -DOOR:closed,(54,03) -DOOR:closed,(61,03) -DOOR:open,(12,11) -DOOR:open,(09,17) -DOOR:open,(16,17) -DOOR:locked,(35,07) -DOOR:locked,(36,07) -# Monsters on siege duty. -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: ('s',"giant spider"),random -MONSTER: 's',random -MONSTER: 's',random -MONSTER: ('C',"forest centaur"),random -MONSTER: ('C',"forest centaur"),random -MONSTER: ('C',"forest centaur"),random -MONSTER: ('C',"forest centaur"),random -MONSTER: ('C',"forest centaur"),random -MONSTER: ('C',"forest centaur"),random -MONSTER: ('C',"forest centaur"),random -MONSTER: ('C',"forest centaur"),random -MONSTER: 'C',random -# Twoflower -MONSTER:('@',"Twoflower"),(64,03) -# The treasure of Twoflower -OBJECT:('(',"chest"),(64,03) -# guides for the audience chamber -MONSTER:('@',"guide"),(29,03) -MONSTER:('@',"guide"),(32,04) -MONSTER:('@',"guide"),(35,02) -MONSTER:('@',"guide"),(38,03) -MONSTER:('@',"guide"),(45,03) -MONSTER:('@',"guide"),(48,02) -MONSTER:('@',"guide"),(49,04) -MONSTER:('@',"guide"),(51,03) -MONSTER:('@',"guide"),(57,03) -MONSTER:('@',"guide"),(62,04) -MONSTER:('@',"guide"),(66,04) -# path guards -MONSTER:('@',"watchman"),(35,08) -MONSTER:('@',"watchman"),(36,08) -# river monsters -MONSTER:(';',"giant eel"),(62,12) -MONSTER:(';',"piranha"),(47,10) -MONSTER:(';',"piranha"),(29,11) -MONSTER:(';',"kraken"),(34,09) -MONSTER:(';',"kraken"),(37,09) -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random - -# -# The "locate" level for the quest. -# -# Here you have to find the Thieves' Guild Hall to go -# further towards your assigned quest. -# - -MAZE: "Tou-loca",' ' -FLAGS: hardfloor -GEOMETRY:center,center -MAP ----------------------------------------------------------------------------- -|....|......|..........|......|......|...|....|.....|......|...............| -|....|......|.|------|.|......|......|.|.|....|..}..|......|.|----------|..| -|....|--+----.|......|.|-S---+|+-----|.|.S....|.....|---+--|.|..........+..| -|....|........|......|.|...|.........|.|------|..............|..........|-+| -|....+...}}...+......|.|...|.|-----|.|..............|--+----------------|..| -|----|........|------|.|---|.|.....|......|-----+-|.|.......|...........|--| -|............................|.....|.|--+-|.......|.|.......|...........|..| -|----|.....|-------------|...|--+--|.|....|.......|.|-----------+-------|..| -|....+.....+.........S...|...........|....|-------|........................| -|....|.....|.........|...|.|---------|....|.........|-------|.|----------|.| -|....|.....|---------|---|.|......|..+....|-------|.|.......|.+......S.\.|.| -|....|.....+.........S...|.|......|..|....|.......|.|.......|.|......|...|.| -|-------|..|.........|---|.|+-------------------+-|.|.......+.|----------|.| -|.......+..|---------|.........|.........|..........|.......|.|..........|.| -|.......|..............|--+--|.|.........|.|----+-----------|.|..........|.| -|---------+-|--+-----|-|.....|.|.........|.|........|.|.....+.|..........+.| -|...........|........|.S.....|.|----+----|.|--------|.|.....|.|----------|.| -|...........|........|.|.....|........................|.....|..............| ----------------------------------------------------------------------------- -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -NON_DIGGABLE:(00,00,75,19) -# -REGION:(01,01,04,05),unlit,"morgue" -REGION:(15,03,20,05),lit,"shop" -REGION:(62,03,71,04),lit,"shop" -REGION:(01,17,11,18),lit,"barracks" -REGION:(12,09,20,10),lit,"barracks" -REGION:(53,11,59,14),lit,"zoo" -REGION:(63,14,72,16),lit,"barracks" -REGION:(32,14,40,16),lit,"temple" -# -REGION:(06,01,11,02),random,"ordinary" -REGION:(24,01,29,02),random,"ordinary" -REGION:(31,01,36,02),random,"ordinary" -REGION:(42,01,45,03),random,"ordinary" -REGION:(53,01,58,02),random,"ordinary" -REGION:(24,04,26,05),random,"ordinary" -REGION:(30,06,34,07),random,"ordinary" -REGION:(73,05,74,05),unlit,"ordinary" -REGION:(01,09,04,12),random,"ordinary" -REGION:(01,14,07,15),random,"ordinary" -REGION:(12,12,20,13),random,"ordinary" -REGION:(13,17,20,18),random,"ordinary" -REGION:(22,09,24,10),random,"ordinary" -REGION:(22,12,24,12),random,"ordinary" -REGION:(24,16,28,18),random,"ordinary" -REGION:(28,11,33,12),random,"ordinary" -REGION:(35,11,36,12),lit,"ordinary" -REGION:(38,08,41,12),random,"ordinary" -REGION:(43,07,49,08),random,"ordinary" -REGION:(43,12,49,12),random,"ordinary" -REGION:(44,16,51,16),random,"ordinary" -REGION:(53,06,59,07),random,"ordinary" -REGION:(61,06,71,07),random,"ordinary" -REGION:(55,16,59,18),random,"ordinary" -REGION:(63,11,68,12),random,"ordinary" -REGION:(70,11,72,12),random,"ordinary" -# Stairs -STAIR:(10,04),up -STAIR:(73,05),down -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -DOOR:closed,(05,05) -DOOR:closed,(05,09) -DOOR:closed,(08,14) -DOOR:closed,(08,03) -DOOR:closed,(11,09) -DOOR:closed,(11,12) -DOOR:closed,(10,16) -DOOR:closed,(14,05) -DOOR:closed,(15,16) -DOOR:locked,(21,09) -DOOR:locked,(21,12) -DOOR:closed,(23,17) -DOOR:closed,(25,03) -DOOR:closed,(26,15) -DOOR:closed,(29,03) -DOOR:closed,(28,13) -DOOR:closed,(31,03) -DOOR:closed,(32,08) -DOOR:closed,(37,11) -DOOR:closed,(36,17) -DOOR:locked,(41,03) -DOOR:closed,(40,07) -DOOR:closed,(48,06) -DOOR:closed,(48,13) -DOOR:closed,(48,15) -DOOR:closed,(56,03) -DOOR:closed,(55,05) -DOOR:closed,(72,03) -DOOR:locked,(74,04) -DOOR:closed,(64,08) -DOOR:closed,(62,11) -DOOR:closed,(69,11) -DOOR:closed,(60,13) -DOOR:closed,(60,16) -DOOR:closed,(73,16) - -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Toilet paper -OBJECT:('?',"blank paper"),(71,12) -OBJECT:('?',"blank paper"),(71,12) -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:'s',random -MONSTER:'s',random - -# -# The "goal" level for the quest. -# -# Here you meet the Master of Thieves your nemesis monster. You have to -# defeat the Master of Thieves in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Tou-goal", ' ' -GEOMETRY:center,center -MAP ----------------------------------------------------------------------------- -|.........|.........|..........|..| |.................|........|........|..| -|.........|.........|..........|..| |....--------.....|........|........|..| -|------S--|--+-----------+------..| |....|......|.....|........|........|..| -|.........|.......................| |....|......+.....--+-------------+--..| -|.........|.......................| |....|......|..........................| -|-S-----S-|......----------.......| |....|......|..........................| -|..|..|...|......|........|.......| |....-----------.........----..........| -|..+..+...|......|........|.......| |....|.........|.........|}}|..........| -|..|..|...|......+........|.......| |....|.........+.........|}}|..........| -|..|..|...|......|........|.......S.S....|.........|.........----..........| -|---..----|......|........|.......| |....|.........|.......................| -|.........+......|+F-+F-+F|.......| |....-----------.......................| -|---..----|......|..|..|..|.......| |......................--------------..| -|..|..|...|......--F-F--F--.......| |......................+............|..| -|..+..+...|.......................| |--.---...-----+-----..|............|..| -|--|..----|--+-----------+------..| |.....|...|.........|..|------------|..| -|..+..+...|.........|..........|..| |.....|...|.........|..+............|..| -|..|..|...|.........|..........|..| |.....|...|.........|..|............|..| ----------------------------------------------------------------------------- -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -# The Inn -REGION:(01,01,09,02),lit,"ordinary" -REGION:(01,04,09,05),lit,"barracks" -REGION:(01,07,02,10),unlit,"ordinary" -REGION:(07,07,09,10),unlit,"ordinary" -REGION:(01,14,02,15),unlit,"ordinary" -REGION:(07,14,09,15),unlit,"ordinary" -REGION:(01,17,02,18),unlit,"ordinary" -REGION:(07,17,09,18),unlit,"ordinary" -# -REGION:(11,01,19,02),unlit,"barracks" -REGION:(21,01,30,02),unlit,"ordinary" -REGION:(11,17,19,18),unlit,"barracks" -REGION:(21,17,30,18),unlit,"ordinary" -# Police Station -REGION:(18,07,25,11),lit,"ordinary" -REGION:(18,13,19,13),unlit,"ordinary" -REGION:(21,13,22,13),unlit,"ordinary" -REGION:(24,13,25,13),unlit,"ordinary" -# The town itself -REGION:(42,03,47,06),unlit,"ordinary" -REGION:(42,08,50,11),unlit,"ordinary" -REGION:(37,16,41,18),unlit,"morgue" -REGION:(47,16,55,18),unlit,"ordinary" -REGION:(55,01,62,03),unlit,"ordinary" -REGION:(64,01,71,03),unlit,"ordinary" -REGION:(60,14,71,15),lit,"shop" -REGION:(60,17,71,18),lit,"shop" -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Stairs -STAIR:(70,08),up -# Doors -DOOR:locked,(07,03) -DOOR:locked,(02,06) -DOOR:locked,(08,06) -DOOR:closed,(03,08) -DOOR:closed,(06,08) -DOOR:open,(10,12) -DOOR:closed,(03,15) -DOOR:closed,(06,15) -DOOR:closed,(03,17) -DOOR:closed,(06,17) -DOOR:closed,(13,03) -DOOR:random,(25,03) -DOOR:closed,(13,16) -DOOR:random,(25,16) -DOOR:locked,(17,09) -DOOR:locked,(18,12) -DOOR:locked,(21,12) -DOOR:locked,(24,12) -DOOR:locked,(34,10) -DOOR:locked,(36,10) -DOOR:random,(48,04) -DOOR:random,(56,04) -DOOR:random,(70,04) -DOOR:random,(51,09) -DOOR:random,(51,15) -DOOR:open,(59,14) -DOOR:open,(59,17) -# Objects -OBJECT:('(',"credit card"),(04,01),blessed,0,name:"The Platinum Yendorian Express Card" -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('@',"Master of Thieves"),(04,01),hostile -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:('s',"giant spider"),random -MONSTER:'s',random -MONSTER:'s',random -# ladies of the evening -MONSTER:('&',"succubus"),(02,08) -MONSTER:('&',"succubus"),(08,08) -MONSTER:('&',"incubus"),(02,14) -MONSTER:('&',"incubus"),(08,14) -MONSTER:('&',"incubus"),(02,17) -MONSTER:('&',"incubus"),(08,17) -# Police station (with drunken prisoners) -MONSTER:('K',"Kop Kaptain"),(24,09),hostile -MONSTER:('K',"Kop Lieutenant"),(20,09),hostile -MONSTER:('K',"Kop Lieutenant"),(22,11),hostile -MONSTER:('K',"Kop Lieutenant"),(22,07),hostile -MONSTER:('K',"Keystone Kop"),(19,07),hostile -MONSTER:('K',"Keystone Kop"),(19,08),hostile -MONSTER:('K',"Keystone Kop"),(22,09),hostile -MONSTER:('K',"Keystone Kop"),(24,11),hostile -MONSTER:('K',"Keystone Kop"),(19,11),hostile -MONSTER:('@',"prisoner"),(19,13) -MONSTER:('@',"prisoner"),(21,13) -MONSTER:('@',"prisoner"),(24,13) -# -MONSTER:('@',"watchman"),(33,10),hostile - -WALLIFY - -# -# The "fill" level for the quest. -# -# This level is used to fill out any levels not occupied by specific -# levels as defined above. -# - -MAZE: "Tou-fila" , ' ' -INIT_MAP: mines, '.' , ' ', true, true, random, true -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -# -MONSTER: ('@', "soldier"), random, hostile -MONSTER: ('@', "soldier"), random, hostile -MONSTER: ('@', "soldier"), random, hostile -MONSTER: ('@', "soldier"), random, hostile -MONSTER: ('@', "soldier"), random, hostile -MONSTER: 'H', random, hostile -MONSTER: 'C', random, hostile - -MAZE: "Tou-filb" , ' ' -INIT_MAP: mines, '.' , ' ', true, true, random, true -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -# -MONSTER: ('@', "soldier"), random, hostile -MONSTER: ('@', "captain"), random, hostile -MONSTER: ('@', "captain"), random, hostile -MONSTER: 'H', random, hostile -MONSTER: 'H', random, hostile -MONSTER: 'C', random, hostile -MONSTER: 's', random diff --git a/dat/Val-fila.lua b/dat/Val-fila.lua new file mode 100644 index 000000000..caacf0bd3 --- /dev/null +++ b/dat/Val-fila.lua @@ -0,0 +1,40 @@ +-- NetHack 3.6 Valkyrie.des $NHDT-Date: 1553807172 2019/03/28 21:06:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.15 $ +-- 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 = "I" }); + +des.level_flags("mazelevel", "icedpools") + +des.level_init({ style="mines", fg=".", bg="I", smoothed=true, joined=true, lit=1, walled=false }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("a") +des.monster({ id = "fire giant", peaceful = 0 }) +-- +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() diff --git a/dat/Val-filb.lua b/dat/Val-filb.lua new file mode 100644 index 000000000..ee6f6027c --- /dev/null +++ b/dat/Val-filb.lua @@ -0,0 +1,42 @@ +-- NetHack 3.6 Valkyrie.des $NHDT-Date: 1553807172 2019/03/28 21:06:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.15 $ +-- 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 = "L" }); + +des.level_flags("mazelevel", "icedpools") + +des.level_init({ style="mines", fg=".", bg="L", smoothed=true, joined=true, lit=1, walled=false }) + +-- +des.stair("up") +des.stair("down") +-- +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("a") +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +-- +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap() +des.trap() diff --git a/dat/Val-goal.lua b/dat/Val-goal.lua new file mode 100644 index 000000000..9d5fe7a47 --- /dev/null +++ b/dat/Val-goal.lua @@ -0,0 +1,102 @@ +-- NetHack 3.6 Valkyrie.des $NHDT-Date: 1553807172 2019/03/28 21:06:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.15 $ +-- 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 = "L" }); + +des.level_flags("mazelevel", "icedpools") + +des.level_init({ style="mines", fg=".", bg="L", smoothed=true, joined=true, lit=1, walled=false }) + +des.map([[ +xxxxxx.....................xxxxxxxx +xxxxx.......LLLLL.LLLLL......xxxxxx +xxxx......LLLLLLLLLLLLLLL......xxxx +xxxx.....LLL|---------|LLL.....xxxx +xxxx....LL|--.........--|LL.....xxx +x......LL|-...LLLLLLL...-|LL.....xx +.......LL|...LL.....LL...|LL......x +......LL|-..LL.......LL..-|LL...... +......LL|.................|LL...... +......LL|-..LL.......LL..-|LL...... +.......LL|...LL.....LL...|LL....... +xx.....LL|-...LLLLLLL...-|LL......x +xxx.....LL|--.........--|LL.....xxx +xxxx.....LLL|---------|LLL...xxxxxx +xxxxx.....LLLLLLLLLLLLLLL...xxxxxxx +xxxxxx......LLLLL.LLLLL.....xxxxxxx +xxxxxxxxx..................xxxxxxxx +]]); +-- Dungeon Description +des.region(selection.area(00,00,34,16), "lit") +-- Stairs +-- Note: The up stairs are *intentionally* off of the map. +des.stair("up", 45,10) +-- Non diggable walls +des.non_diggable(selection.area(00,00,34,16)) +-- Drawbridges; northern one opens from the south (portcullis) to further +-- north (lowered span), southern one from the north to further south +des.drawbridge({ x=17, y=02, dir="south", state="random" }) +if math.random(0, 99) < 75 then + des.drawbridge({ x=17, y=14, dir="north", state="open" }) +else + des.drawbridge({ x=17, y=14, dir="north", state="random" }) +end +-- Objects +des.object({ id = "crystal ball", x=17, y=08, buc="blessed", spe=5, name="The Orb of Fate" }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Traps +des.trap("board",13,08) +des.trap("board",21,08) +-- Random traps +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("board") +des.trap() +des.trap() +-- Random monsters. +des.monster("Lord Surtur", 17, 08) +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("a") +des.monster("a") +des.monster({ id = "fire giant", x=10, y=06, peaceful = 0 }) +des.monster({ id = "fire giant", x=10, y=07, peaceful = 0 }) +des.monster({ id = "fire giant", x=10, y=08, peaceful = 0 }) +des.monster({ id = "fire giant", x=10, y=09, peaceful = 0 }) +des.monster({ id = "fire giant", x=10, y=10, peaceful = 0 }) +des.monster({ id = "fire giant", x=24, y=06, peaceful = 0 }) +des.monster({ id = "fire giant", x=24, y=07, peaceful = 0 }) +des.monster({ id = "fire giant", x=24, y=08, peaceful = 0 }) +des.monster({ id = "fire giant", x=24, y=09, peaceful = 0 }) +des.monster({ id = "fire giant", x=24, y=10, peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ class = "H", peaceful = 0 }) + +-- +-- The "fill" levels for the quest. +-- +-- These levels are used to fill out any levels not occupied by specific +-- levels as defined above. "filla" is the upper filler, between the +-- start and locate levels, and "fillb" the lower between the locate +-- and goal levels. +-- diff --git a/dat/Val-loca.lua b/dat/Val-loca.lua new file mode 100644 index 000000000..2dc7ad6d8 --- /dev/null +++ b/dat/Val-loca.lua @@ -0,0 +1,85 @@ +-- NetHack 3.6 Valkyrie.des $NHDT-Date: 1553807172 2019/03/28 21:06:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.15 $ +-- 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", "icedpools") + +des.level_init({ style="mines", fg=".", bg="I", smoothed=true, joined=false, lit=1, walled=false }) + +des.map([[ +PPPPxxxx xxxxPPPPPx +PLPxxx xPPLLLPP +PPP ....................... PPPLLP +xx ............................ PPPP +x ............................... xxxx + ................................. xx +.................................... x + ................................... +x .................................. x +xx .............................. PP +xPPP .......................... PLP +xPLLP xxPLLP +xPPPPxx xxxxPPPP +]]); +-- Dungeon Description +des.region(selection.area(00,00,39,12), "lit") +-- Stairs +des.stair("up", 48,14) +des.stair("down", 20,06) +-- Non diggable walls +des.non_diggable(selection.area(00,00,39,12)) +-- Objects +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap() +des.trap() +-- Random monsters. +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("fire ant") +des.monster("a") +des.monster({ class = "H", peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ id = "fire giant", peaceful = 0 }) +des.monster({ class = "H", peaceful = 0 }) + diff --git a/dat/Val-strt.lua b/dat/Val-strt.lua new file mode 100644 index 000000000..5bb9fce57 --- /dev/null +++ b/dat/Val-strt.lua @@ -0,0 +1,98 @@ +-- NetHack 3.6 Valkyrie.des $NHDT-Date: 1553807172 2019/03/28 21:06:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.15 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1991-2 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, the Norn, +-- and receive your quest assignment. +-- + +des.level_flags("mazelevel", "noteleport", "hardfloor", "icedpools") +des.level_init({ style = "solidfill", fg = "I" }) + +local pools = selection.new() +-- random locations +for i = 1,13 do + pools:set(); +end +-- some bigger ones +pools = pools | selection.grow(selection.set(selection.new()), "west") +pools = pools | selection.grow(selection.set(selection.new()), "north") +pools = pools | selection.grow(selection.set(selection.new()), "random") + +-- Lava pools surrounded by water +des.terrain(pools:clone():grow("all"), "P") +des.terrain(pools, "L") + +des.map([[ +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..{..xxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxx +xxxxxxxx.....xxxxxxxxxxxxx|----------------|xxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxx +xxxxxxx..xxx...xxxxxxxxxxx|................|xxxxxxxxxx..xxxxxxxxxxxxxxxxxxxx +xxxxxx..xxxxxx......xxxxx.|................|.xxxxxxxxx.xxxxxxxxxxxxxxxxxxxxx +xxxxx..xxxxxxxxxxxx.......+................+...xxxxxxx.xxxxxxxxxxxxxxxxxxxxx +xxxx..xxxxxxxxx.....xxxxx.|................|.x...xxxxx.xxxxxxxxxxxxxxxxxxxxx +xxx..xxxxxxxxx..xxxxxxxxxx|................|xxxx.......xxxxxxxxxxxxxxxxxxxxx +xxxx..xxxxxxx..xxxxxxxxxxx|----------------|xxxxxxxxxx...xxxxxxxxxxxxxxxxxxx +xxxxxx..xxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxx +xxxxxxx......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxx +xxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...x......xxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........xxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.......xxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +]]); +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region(selection.area(27,08,42,12), "lit") +-- Portal arrival point +des.levregion({ region = {66,17,66,17}, type="branch" }) +-- Stairs +des.stair("down", 18,01) +des.feature("fountain", 53,02) +-- Doors +des.door("locked",26,10) +des.door("locked",43,10) +-- Norn +des.monster("Norn", 35, 10) +-- The treasure of the Norn +des.object("chest", 36, 10) +-- valkyrie guards for the audience chamber +des.monster("warrior", 27, 08) +des.monster("warrior", 27, 09) +des.monster("warrior", 27, 11) +des.monster("warrior", 27, 12) +des.monster("warrior", 42, 08) +des.monster("warrior", 42, 09) +des.monster("warrior", 42, 11) +des.monster("warrior", 42, 12) +-- Non diggable walls +des.non_diggable(selection.area(26,07,43,13)) +-- Random traps +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +-- Monsters on siege duty. +des.monster("fire ant", 04, 12) +des.monster("fire ant", 08, 08) +des.monster("fire ant", 14, 04) +des.monster("fire ant", 17, 11) +des.monster("fire ant", 24, 10) +des.monster("fire ant", 45, 10) +des.monster("fire ant", 54, 02) +des.monster("fire ant", 55, 07) +des.monster("fire ant", 58, 14) +des.monster("fire ant", 63, 17) +des.monster({ id = "fire giant", x=18, y=01, peaceful = 0 }) +des.monster({ id = "fire giant", x=10, y=16, peaceful = 0 }) + diff --git a/dat/Valkyrie.des b/dat/Valkyrie.des deleted file mode 100644 index 252c6ce82..000000000 --- a/dat/Valkyrie.des +++ /dev/null @@ -1,353 +0,0 @@ -# NetHack 3.6 Valkyrie.des $NHDT-Date: 1553807172 2019/03/28 21:06:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.15 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1991-2 by M. Stephenson -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, the Norn, -# and receive your quest assignment. -# -MAZE: "Val-strt",' ' -FLAGS: noteleport,hardfloor,icedpools -INIT_MAP:solidfill,'I' - -$pools = selection: random & random & random & random & random & - random & random & random & random & random & random & - random & random & - grow(west, random) & - grow(north, random) & - grow(random & random) -# This works because the random coordinates in $pools are evaluated once, -# when the variable is initialized. -TERRAIN:grow($pools), 'P' -TERRAIN:$pools, 'L' - -GEOMETRY:center,center -MAP -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..{..xxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxx -xxxxxxxx.....xxxxxxxxxxxxx|----------------|xxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxx -xxxxxxx..xxx...xxxxxxxxxxx|................|xxxxxxxxxx..xxxxxxxxxxxxxxxxxxxx -xxxxxx..xxxxxx......xxxxx.|................|.xxxxxxxxx.xxxxxxxxxxxxxxxxxxxxx -xxxxx..xxxxxxxxxxxx.......+................+...xxxxxxx.xxxxxxxxxxxxxxxxxxxxx -xxxx..xxxxxxxxx.....xxxxx.|................|.x...xxxxx.xxxxxxxxxxxxxxxxxxxxx -xxx..xxxxxxxxx..xxxxxxxxxx|................|xxxx.......xxxxxxxxxxxxxxxxxxxxx -xxxx..xxxxxxx..xxxxxxxxxxx|----------------|xxxxxxxxxx...xxxxxxxxxxxxxxxxxxx -xxxxxx..xxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxx -xxxxxxx......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxx -xxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...x......xxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........xxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.......xxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -ENDMAP -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION:(27,08,42,12),lit,"ordinary" -# Portal arrival point -BRANCH:(66,17,66,17),(0,0,0,0) -# Stairs -STAIR:(18,01),down -FOUNTAIN:(53,02) -# Doors -DOOR:locked,(26,10) -DOOR:locked,(43,10) -# Norn -MONSTER:('@',"Norn"),(35,10) -# The treasure of the Norn -OBJECT:('(',"chest"),(36,10) -# valkyrie guards for the audience chamber -MONSTER:('@',"warrior"),(27,08) -MONSTER:('@',"warrior"),(27,09) -MONSTER:('@',"warrior"),(27,11) -MONSTER:('@',"warrior"),(27,12) -MONSTER:('@',"warrior"),(42,08) -MONSTER:('@',"warrior"),(42,09) -MONSTER:('@',"warrior"),(42,11) -MONSTER:('@',"warrior"),(42,12) -# Non diggable walls -NON_DIGGABLE:(26,07,43,13) -# Random traps -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -# Monsters on siege duty. -MONSTER: ('a',"fire ant"),(04,12) -MONSTER: ('a',"fire ant"),(08,08) -MONSTER: ('a',"fire ant"),(14,04) -MONSTER: ('a',"fire ant"),(17,11) -MONSTER: ('a',"fire ant"),(24,10) -MONSTER: ('a',"fire ant"),(45,10) -MONSTER: ('a',"fire ant"),(54,02) -MONSTER: ('a',"fire ant"),(55,07) -MONSTER: ('a',"fire ant"),(58,14) -MONSTER: ('a',"fire ant"),(63,17) -MONSTER: ('H',"fire giant"),(18,01),hostile -MONSTER: ('H',"fire giant"),(10,16),hostile - -# -# The "locate" level for the quest. -# -# Here you have to find the cave of Surtur to go -# further towards your assigned quest. -# - -MAZE: "Val-loca",' ' -FLAGS: hardfloor,icedpools -INIT_MAP: mines, '.', 'I', true, true, lit, false -GEOMETRY:center,center -MAP -PPPPxxxx xxxxPPPPPx -PLPxxx xPPLLLPP -PPP ....................... PPPLLP -xx ............................ PPPP -x ............................... xxxx - ................................. xx -.................................... x - ................................... -x .................................. x -xx .............................. PP -xPPP .......................... PLP -xPLLP xxPLLP -xPPPPxx xxxxPPPP -ENDMAP -# Dungeon Description -REGION:(00,00,39,12),lit,"ordinary" -# Stairs -STAIR:(48,14),up -STAIR:(20,06),down -# Non diggable walls -NON_DIGGABLE:(00,00,39,12) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:'a',random -MONSTER:'H',random,hostile -MONSTER:('H',"fire giant"),random,hostile -MONSTER:('H',"fire giant"),random,hostile -MONSTER:('H',"fire giant"),random,hostile -MONSTER:('H',"fire giant"),random,hostile -MONSTER:('H',"fire giant"),random,hostile -MONSTER:('H',"fire giant"),random,hostile -MONSTER:('H',"fire giant"),random,hostile -MONSTER:'H',random,hostile - -# -# The "goal" level for the quest. -# -# Here you meet Lord Surtur your nemesis monster. You have to -# defeat Lord Surtur in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Val-goal", 'L' -FLAGS: icedpools -INIT_MAP: mines, '.', 'L', true, true, lit, false -GEOMETRY:center,center -MAP -xxxxxx.....................xxxxxxxx -xxxxx.......LLLLL.LLLLL......xxxxxx -xxxx......LLLLLLLLLLLLLLL......xxxx -xxxx.....LLL|---------|LLL.....xxxx -xxxx....LL|--.........--|LL.....xxx -x......LL|-...LLLLLLL...-|LL.....xx -.......LL|...LL.....LL...|LL......x -......LL|-..LL.......LL..-|LL...... -......LL|.................|LL...... -......LL|-..LL.......LL..-|LL...... -.......LL|...LL.....LL...|LL....... -xx.....LL|-...LLLLLLL...-|LL......x -xxx.....LL|--.........--|LL.....xxx -xxxx.....LLL|---------|LLL...xxxxxx -xxxxx.....LLLLLLLLLLLLLLL...xxxxxxx -xxxxxx......LLLLL.LLLLL.....xxxxxxx -xxxxxxxxx..................xxxxxxxx -ENDMAP -# Dungeon Description -REGION:(00,00,34,16),lit,"ordinary" -# Stairs -# Note: The up stairs are *intentionally* off of the map. -STAIR:(45,10),up -# Non diggable walls -NON_DIGGABLE:(00,00,34,16) -# Drawbridges; northern one opens from the south (portcullis) to further -# north (lowered span), southern one from the north to further south -DRAWBRIDGE:(17,02),south,random -IF [75%] { - DRAWBRIDGE:(17,14),north,open -} ELSE { - DRAWBRIDGE:(17,14),north,random -} -# Objects -OBJECT:('(',"crystal ball"),(17,08),blessed,5,name:"The Orb of Fate" -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Traps -TRAP:"board",(13,08) -TRAP:"board",(21,08) -# Random traps -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"board",random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('H',"Lord Surtur"),(17,08) -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:('a',"fire ant"),random -MONSTER:'a',random -MONSTER:'a',random -MONSTER:('H',"fire giant"),(10,06),hostile -MONSTER:('H',"fire giant"),(10,07),hostile -MONSTER:('H',"fire giant"),(10,08),hostile -MONSTER:('H',"fire giant"),(10,09),hostile -MONSTER:('H',"fire giant"),(10,10),hostile -MONSTER:('H',"fire giant"),(24,06),hostile -MONSTER:('H',"fire giant"),(24,07),hostile -MONSTER:('H',"fire giant"),(24,08),hostile -MONSTER:('H',"fire giant"),(24,09),hostile -MONSTER:('H',"fire giant"),(24,10),hostile -MONSTER:('H',"fire giant"),random,hostile -MONSTER:('H',"fire giant"),random,hostile -MONSTER:'H',random,hostile - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "filla" is the upper filler, between the -# start and locate levels, and "fillb" the lower between the locate -# and goal levels. -# - -MAZE: "Val-fila" , 'I' -FLAGS: icedpools -INIT_MAP: mines, '.', 'I', true, true, lit, false -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -MONSTER: ('a', "fire ant"), random -MONSTER: ('a', "fire ant"), random -MONSTER: ('a', "fire ant"), random -MONSTER: ('a', "fire ant"), random -MONSTER: ('a', "fire ant"), random -MONSTER: 'a', random -MONSTER: ('H', "fire giant"), random, hostile -# -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random -TRAP: random, random - -MAZE: "Val-filb" , 'L' -FLAGS: icedpools -INIT_MAP: mines, '.', 'L', true, true, lit, false -NOMAP -# -STAIR: random, up -STAIR: random, down -# -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -OBJECT: random, random -# -MONSTER: ('a', "fire ant"), random -MONSTER: ('a', "fire ant"), random -MONSTER: ('a', "fire ant"), random -MONSTER: 'a', random -MONSTER: ('H', "fire giant"), random, hostile -MONSTER: ('H', "fire giant"), random, hostile -MONSTER: ('H', "fire giant"), random, hostile -# -TRAP: "fire", random -TRAP: "fire", random -TRAP: "fire", random -TRAP: "fire", random -TRAP: "fire", random -TRAP: random, random -TRAP: random, random diff --git a/dat/Wiz-fila.lua b/dat/Wiz-fila.lua new file mode 100644 index 000000000..61c78d75b --- /dev/null +++ b/dat/Wiz-fila.lua @@ -0,0 +1,59 @@ +-- NetHack 3.6 Wizard.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1992 by David Cohrs +-- NetHack may be freely redistributed. See license for details. +-- +-- +des.room({ type = "ordinary", + contents = function() + des.stair("up") + des.object() + des.monster({ class = "i", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.monster({ class = "i", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.object() + des.monster("vampire bat") + des.monster("vampire bat") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.stair("down") + des.object() + des.trap() + des.monster({ class = "i", peaceful=0 }) + des.monster("vampire bat") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.trap() + des.monster({ class = "i", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.monster("vampire bat") + end +}) + +des.random_corridors() diff --git a/dat/Wiz-filb.lua b/dat/Wiz-filb.lua new file mode 100644 index 000000000..41eae6c47 --- /dev/null +++ b/dat/Wiz-filb.lua @@ -0,0 +1,58 @@ +-- NetHack 3.6 Wizard.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1992 by David Cohrs +-- NetHack may be freely redistributed. See license for details. +-- +-- +des.room({ type = "ordinary", + contents = function() + des.stair("up") + des.object() + des.monster({ class = "X", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.monster({ class = "i", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.object() + des.monster({ class = "X", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.stair("down") + des.object() + des.trap() + des.monster({ class = "i", peaceful=0 }) + des.monster("vampire bat") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.object() + des.trap() + des.monster({ class = "i", peaceful=0 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.object() + des.trap() + des.monster("vampire bat") + end +}) + +des.random_corridors() diff --git a/dat/Wiz-goal.lua b/dat/Wiz-goal.lua new file mode 100644 index 000000000..5673410c6 --- /dev/null +++ b/dat/Wiz-goal.lua @@ -0,0 +1,132 @@ +-- NetHack 3.6 Wizard.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1992 by David Cohrs +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ + + + + ------------- ------------- + |...........| |...........| + -------|...........-------------------...........| + |......S...........|..|..|..|..|..|..|...........| + |......|...........|..|..|..|..|..|..|...........| + |......|...........-F+-F+-F+-F+-F+-F+-...........| + --S----|...........S.................+...........| + |......|...........-F+-F+-F+-F+-F+-F+-...........| + |......|...........|..|..|..|..|..|..|...........| + |......|...........|..|..|..|..|..|..|...........| + -------|...........-------------------...........| + |...........| |...........| + ------------- ------------- + + + + +]]); +-- Dungeon Description +des.region({ region={13,10,18,12}, lit=0, type="temple" }) +des.region(selection.area(13,06,18,08), "lit") +des.region(selection.area(20,04,30,14), "unlit") +des.region(selection.area(32,06,33,07), "unlit") +des.region(selection.area(35,06,36,07), "unlit") +des.region(selection.area(38,06,39,07), "unlit") +des.region(selection.area(41,06,42,07), "unlit") +des.region(selection.area(44,06,45,07), "unlit") +des.region(selection.area(47,06,48,07), "unlit") +des.region(selection.area(32,09,48,09), "unlit") +des.region(selection.area(32,11,33,12), "unlit") +des.region(selection.area(35,11,36,12), "unlit") +des.region(selection.area(38,11,39,12), "unlit") +des.region(selection.area(41,11,42,12), "unlit") +des.region(selection.area(44,11,45,12), "unlit") +des.region(selection.area(47,11,48,12), "unlit") +des.region(selection.area(50,04,60,14), "lit") +-- Doors +des.door("locked",19,06) +des.door("locked",14,09) +des.door("locked",31,09) +des.door("locked",33,08) +des.door("locked",36,08) +des.door("locked",39,08) +des.door("locked",42,08) +des.door("locked",45,08) +des.door("locked",48,08) +des.door("locked",33,10) +des.door("locked",36,10) +des.door("locked",39,10) +des.door("locked",42,10) +des.door("locked",45,10) +des.door("locked",48,10) +des.door("locked",49,09) +-- Stairs +des.stair("up", 55,05) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- The altar. This is not a shrine. +des.altar({ coord={16,11}, aligned="noncoaligned", type="altar" }) +-- Objects +des.object({ id = "amulet of ESP", x=16, y=11, buc="blessed", spe=0, name="The Eye of the Aethiopica" }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster("Dark One", 16, 11) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "B",random, peaceful = 0 }) +des.monster({ class = "i",random, peaceful = 0 }) +des.monster({ class = "i",random, peaceful = 0 }) +des.monster({ class = "i",random, peaceful = 0 }) +des.monster({ class = "i",random, peaceful = 0 }) +des.monster({ class = "i",random, peaceful = 0 }) +des.monster({ class = "i",random, peaceful = 0 }) +des.monster({ class = "i",random, peaceful = 0 }) +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster({ class = "i",random, peaceful = 0 }) +-- Captive Monsters in the dungeon +des.monster({ id = "rogue", x=35, y=06, peaceful=1, name="Pug" }) +des.monster({ id = "owlbear", x=47, y=06, peaceful=1, asleep=1 }) +des.monster({ id = "wizard", x=32, y=11, peaceful=1, asleep=1, name="Newt" }) +des.monster({ id = "Grey-elf", x=44, y=11, peaceful=1 }) +des.monster({ id = "hill giant", x=47, y=11, peaceful=1, asleep=1 }) +des.monster({ id = "gnomish wizard", x=38, y=06, peaceful=1 }) +des.monster({ id = "prisoner", x=35, y=11, peaceful=1 }) +des.monster({ id = "prisoner", x=41, y=11, peaceful=1, asleep=1 }) diff --git a/dat/Wiz-loca.lua b/dat/Wiz-loca.lua new file mode 100644 index 000000000..288660ca7 --- /dev/null +++ b/dat/Wiz-loca.lua @@ -0,0 +1,151 @@ +-- NetHack 3.6 Wizard.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1992 by David Cohrs +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "hardfloor") + +des.map([[ +............. ....................................................... +.............. .............}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}....... +.............. ..............}.................................}....... +.............. ..............}.-------------------------------.}....... +............... .........C....}.|.............................|.}....... +............... ..........C....}.|.---------------------------.|.}....... +............... .........CCC...}.|.|.........................|.|.}....... +................ ....C....CCC...}.|.|.-----------------------.|.|.}....... +.......C..C..... .....C....CCC...}.|.|.|......+.......+......|.|.|.}....... +.............C..CC.....C....CCC...}.|.|.|......|-------|......|.|.|.}....... +................ ....C....CCC...}.|.|.|......|.......|......|.|.|.}....... +......C..C..... ....C....CCC...}.|.|.|......|-------|......|.|.|.}....... +............C.. ...C....CCC...}.|.|.|......+.......+......|.|.|.}....... +........C...... ....C....CCC...}.|.|.-----------------------.|.|.}....... +....C......C... ........CCC...}.|.|.........................|.|.}....... +......C..C.... .........C....}.|.---------------------------.|.}....... +.............. .........C....}.|.............................|.}....... +............. ..............}.-------------------------------.}....... +............. .............}.................................}....... +............. .............}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}....... +............. ....................................................... +]]); + +des.replace_terrain({ region = { 0, 0,30,20}, fromterrain=".", toterrain="C", chance=15 }) +des.replace_terrain({ region = {68, 0,75,20}, fromterrain=".", toterrain="}", chance=25 }) +des.replace_terrain({ region = {34, 1,68,19}, fromterrain="}", toterrain=".", chance=2 }) + +-- Dungeon Description +des.region(selection.area(00,00,75,20), "lit") +des.region({ region={37,04,65,16}, lit=0, type="ordinary", prefilled=1, irregular=1, + contents = function() + des.door({ state="secret", wall="random" }) + end +}) +des.region({ region={39,06,63,14}, lit=0, type="ordinary", prefilled=1, irregular=1, + contents = function() + des.door({ state="secret", wall="random" }) + end +}) + +des.region({ region={41,08,46,12}, lit=1, type="ordinary", prefilled=1, irregular=1, + contents = function() + local walls = { "north", "south", "west" } + local widx = math.random(1, #walls) + des.door({ state="secret", wall=walls[widx] }) + end +}) + +des.region({ region={56,08,61,12}, lit=1, type="ordinary", prefilled=1, irregular=1, + contents = function() + local walls = { "north", "south", "east" } + local widx = math.random(1, #walls) + des.door({ state="secret", wall=walls[widx] }) + end +}) + +des.region(selection.area(48,08,54,08), "unlit") +des.region(selection.area(48,12,54,12), "unlit") + +des.region({ region={48,10,54,10}, lit=0, type="ordinary", prefilled=1, irregular=1, + contents = function() + des.door({ state="secret", wall="random" }) + end +}) + +-- Doors +des.door("locked",55,08) +des.door("locked",55,12) +des.door("locked",47,08) +des.door("locked",47,12) +-- Stairs +des.terrain({03,17}, ".") +des.stair("up", 03,17) +des.stair("down", 48,10) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,20)) +-- Objects +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap("spiked pit",24,02) +des.trap("spiked pit",07,10) +des.trap("spiked pit",23,05) +des.trap("spiked pit",26,19) +des.trap("spiked pit",72,02) +des.trap("spiked pit",72,12) +des.trap("falling rock",45,16) +des.trap("falling rock",65,13) +des.trap("falling rock",55,06) +des.trap("falling rock",39,11) +des.trap("falling rock",57,09) +des.trap("magic") +des.trap("statue") +des.trap("statue") +des.trap("polymorph") +des.trap("anti magic",53,10) +des.trap("sleep gas") +des.trap("sleep gas") +des.trap("dart") +des.trap("dart") +des.trap("dart") +-- Random monsters. +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "B", peaceful = 0 }) +des.monster({ class = "i", peaceful = 0 }) +des.monster({ class = "i", peaceful = 0 }) +des.monster({ class = "i", peaceful = 0 }) +des.monster({ class = "i", peaceful = 0 }) +des.monster({ class = "i", peaceful = 0 }) +des.monster({ class = "i", peaceful = 0 }) +des.monster({ class = "i", peaceful = 0 }) +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +des.monster({ class = "i", peaceful = 0 }) diff --git a/dat/Wiz-strt.lua b/dat/Wiz-strt.lua new file mode 100644 index 000000000..19478b249 --- /dev/null +++ b/dat/Wiz-strt.lua @@ -0,0 +1,104 @@ +-- NetHack 3.6 Wizard.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1992 by David Cohrs +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- The "start" level for the quest. +-- +-- Here you meet your (besieged) class leader, Neferet the Green +-- and receive your quest assignment. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor") + +des.map([[ +............................................................................ +.....................C....CC.C........................C..................... +..........CCC.....................CCC....................................... +........CC........-----------.......C.C...C...C....C........................ +.......C.....---------------------...C..C..C..C............................. +......C..C...------....\....------....C.....C............................... +........C...||....|.........|....||......................................... +.......C....||....|.........+....||......................................... +.......C...||---+--.........|....|||........................................ +......C....||...............|--S--||........................................ +...........||--+--|++----|---|..|.SS..........C......C...................... +........C..||.....|..|...|...|--|.||..CC..C.....C..........C................ +.......C...||.....|..|.--|.|.|....||.................C..C................... +.....C......||....|..|.....|.|.--||..C..C..........C...........}}}.......... +......C.C...||....|..-----.|.....||...C.C.C..............C....}}}}}}........ +.........C...------........|------....C..C.....C..CC.C......}}}}}}}}}}}..... +.........CC..---------------------...C.C..C.....CCCCC.C.......}}}}}}}}...... +.........C........-----------..........C.C.......CCC.........}}}}}}}}}...... +..........C.C.........................C............C...........}}}}}........ +......................CCC.C................................................. +]]); + +-- first do cloud everywhere +des.replace_terrain({ region={0,0, 75,19}, fromterrain=".", toterrain="C", chance=10 }) +-- then replace clouds inside the tower back to floor +des.replace_terrain({ region={13,5, 33,15}, fromterrain="C", toterrain=".", chance=100 }) + +-- Dungeon Description +des.region(selection.area(00,00,75,19), "lit") +des.region(selection.area(35,00,49,03), "unlit") +des.region(selection.area(43,12,49,16), "unlit") +des.region({ region={19,11,33,15}, lit=0, type="ordinary", prefilled=0, irregular=1 }) +des.region(selection.area(30,10,31,10), "unlit") +-- Stairs +des.stair("down", 30,10) +-- Portal arrival point +des.terrain({63,06}, ".") +des.levregion({ region = {63,06,63,06}, type="branch" }) +-- Doors +des.door("closed",31,09) +des.door("closed",16,08) +des.door("closed",28,07) +des.door("locked",34,10) +des.door("locked",35,10) +des.door("closed",15,10) +des.door("locked",19,10) +des.door("locked",20,10) +-- Neferet the Green, the quest leader +des.monster("Neferet the Green", 23, 05) +-- The treasure of the quest leader +des.object("chest", 24, 05) +-- apprentice guards for the audience chamber +des.monster("apprentice", 30, 07) +des.monster("apprentice", 24, 06) +des.monster("apprentice", 15, 06) +des.monster("apprentice", 15, 12) +des.monster("apprentice", 26, 11) +des.monster("apprentice", 27, 11) +des.monster("apprentice", 19, 09) +des.monster("apprentice", 20, 09) +-- Eels in the pond +des.monster("giant eel", 62, 14) +des.monster("giant eel", 69, 15) +des.monster("giant eel", 67, 17) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Monsters on siege duty. +des.monster({ class = "B", x=60, y=09, peaceful = 0 }) +des.monster({ class = "W", x=60, y=10, peaceful = 0 }) +des.monster({ class = "B", x=60, y=11, peaceful = 0 }) +des.monster({ class = "B", x=60, y=12, peaceful = 0 }) +des.monster({ class = "i", x=60, y=13, peaceful = 0 }) +des.monster({ class = "B", x=61, y=10, peaceful = 0 }) +des.monster({ class = "B", x=61, y=11, peaceful = 0 }) +des.monster({ class = "B", x=61, y=12, peaceful = 0 }) +des.monster({ class = "B", x=35, y=03, peaceful = 0 }) +des.monster({ class = "i", x=35, y=17, peaceful = 0 }) +des.monster({ class = "B", x=36, y=17, peaceful = 0 }) +des.monster({ class = "B", x=34, y=16, peaceful = 0 }) +des.monster({ class = "i", x=34, y=17, peaceful = 0 }) +des.monster({ class = "W", x=67, y=02, peaceful = 0 }) +des.monster({ class = "B", x=10, y=19, peaceful = 0 }) diff --git a/dat/Wizard.des b/dat/Wizard.des deleted file mode 100644 index f27f47680..000000000 --- a/dat/Wizard.des +++ /dev/null @@ -1,472 +0,0 @@ -# NetHack 3.6 Wizard.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ -# Copyright (c) 1992 by David Cohrs -# NetHack may be freely redistributed. See license for details. -# -# The "start" level for the quest. -# -# Here you meet your (besieged) class leader, Neferet the Green -# and receive your quest assignment. -# -MAZE: "Wiz-strt",' ' -FLAGS: noteleport,hardfloor -GEOMETRY:center,center -MAP -............................................................................ -.....................C....CC.C........................C..................... -..........CCC.....................CCC....................................... -........CC........-----------.......C.C...C...C....C........................ -.......C.....---------------------...C..C..C..C............................. -......C..C...------....\....------....C.....C............................... -........C...||....|.........|....||......................................... -.......C....||....|.........+....||......................................... -.......C...||---+--.........|....|||........................................ -......C....||...............|--S--||........................................ -...........||--+--|++----|---|..|.SS..........C......C...................... -........C..||.....|..|...|...|--|.||..CC..C.....C..........C................ -.......C...||.....|..|.--|.|.|....||.................C..C................... -.....C......||....|..|.....|.|.--||..C..C..........C...........}}}.......... -......C.C...||....|..-----.|.....||...C.C.C..............C....}}}}}}........ -.........C...------........|------....C..C.....C..CC.C......}}}}}}}}}}}..... -.........CC..---------------------...C.C..C.....CCCCC.C.......}}}}}}}}...... -.........C........-----------..........C.C.......CCC.........}}}}}}}}}...... -..........C.C.........................C............C...........}}}}}........ -......................CCC.C................................................. -ENDMAP - -# first do cloud everywhere -REPLACE_TERRAIN:(0,0, 75,19), '.', 'C', 10% -# then replace clouds inside the tower back to floor -REPLACE_TERRAIN:(13,5, 33,15), 'C', '.', 100% - -# Dungeon Description -REGION:(00,00,75,19),lit,"ordinary" -REGION:(35,00,49,03),unlit,"ordinary" -REGION:(43,12,49,16),unlit,"ordinary" -REGION:(19,11,33,15),unlit,"ordinary",unfilled,irregular -REGION:(30,10,31,10),unlit,"ordinary" -# Stairs -STAIR:(30,10),down -# Portal arrival point -TERRAIN:(63,06),'.' -BRANCH:(63,06,63,06),(0,0,0,0) -# Doors -DOOR:closed,(31,09) -DOOR:closed,(16,08) -DOOR:closed,(28,07) -DOOR:locked,(34,10) -DOOR:locked,(35,10) -DOOR:closed,(15,10) -DOOR:locked,(19,10) -DOOR:locked,(20,10) -# Neferet the Green, the quest leader -MONSTER:('@',"Neferet the Green"),(23,05) -# The treasure of the quest leader -OBJECT:('(',"chest"),(24,05) -# apprentice guards for the audience chamber -MONSTER:('@',"apprentice"),(30,07) -MONSTER:('@',"apprentice"),(24,06) -MONSTER:('@',"apprentice"),(15,06) -MONSTER:('@',"apprentice"),(15,12) -MONSTER:('@',"apprentice"),(26,11) -MONSTER:('@',"apprentice"),(27,11) -MONSTER:('@',"apprentice"),(19,09) -MONSTER:('@',"apprentice"),(20,09) -# Eels in the pond -MONSTER:(';',"giant eel"),(62,14) -MONSTER:(';',"giant eel"),(69,15) -MONSTER:(';',"giant eel"),(67,17) -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Monsters on siege duty. -MONSTER: 'B',(60,09),hostile -MONSTER: 'W',(60,10),hostile -MONSTER: 'B',(60,11),hostile -MONSTER: 'B',(60,12),hostile -MONSTER: 'i',(60,13),hostile -MONSTER: 'B',(61,10),hostile -MONSTER: 'B',(61,11),hostile -MONSTER: 'B',(61,12),hostile -MONSTER: 'B',(35,03),hostile -MONSTER: 'i',(35,17),hostile -MONSTER: 'B',(36,17),hostile -MONSTER: 'B',(34,16),hostile -MONSTER: 'i',(34,17),hostile -MONSTER: 'W',(67,02),hostile -MONSTER: 'B',(10,19),hostile - -# -# The "locate" level for the quest. -# -# Here you have to find the Entrance to the Tower of Darkness to go -# further towards your assigned quest. -# - -MAZE: "Wiz-loca",' ' -FLAGS: hardfloor -GEOMETRY:center,center -MAP -............. ....................................................... -.............. .............}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}....... -.............. ..............}.................................}....... -.............. ..............}.-------------------------------.}....... -............... .........C....}.|.............................|.}....... -............... ..........C....}.|.---------------------------.|.}....... -............... .........CCC...}.|.|.........................|.|.}....... -................ ....C....CCC...}.|.|.-----------------------.|.|.}....... -.......C..C..... .....C....CCC...}.|.|.|......+.......+......|.|.|.}....... -.............C..CC.....C....CCC...}.|.|.|......|-------|......|.|.|.}....... -................ ....C....CCC...}.|.|.|......|.......|......|.|.|.}....... -......C..C..... ....C....CCC...}.|.|.|......|-------|......|.|.|.}....... -............C.. ...C....CCC...}.|.|.|......+.......+......|.|.|.}....... -........C...... ....C....CCC...}.|.|.-----------------------.|.|.}....... -....C......C... ........CCC...}.|.|.........................|.|.}....... -......C..C.... .........C....}.|.---------------------------.|.}....... -.............. .........C....}.|.............................|.}....... -............. ..............}.-------------------------------.}....... -............. .............}.................................}....... -............. .............}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}....... -............. ....................................................... -ENDMAP - -REPLACE_TERRAIN:(0,0,30,20), '.', 'C', 15% -REPLACE_TERRAIN:(68,0,75,20), '.', '}', 25% -REPLACE_TERRAIN:(34,1,68,19), '}', '.', 2% - -# Dungeon Description -REGION:(00,00,75,20),lit,"ordinary" -REGION:(37,04,65,16),unlit,"ordinary",filled,irregular { - ROOMDOOR:true,closed,north|south|west|east,random -} -REGION:(39,06,63,14),unlit,"ordinary",filled,irregular { - ROOMDOOR:true,closed,north|south|west|east,random -} - -REGION:(41,08,46,12),lit,"ordinary",filled,irregular { - ROOMDOOR:true,closed,north|south|west,random -} -REGION:(56,08,61,12),lit,"ordinary",filled,irregular { - ROOMDOOR:true,closed,north|south|east,random -} -REGION:(48,08,54,08),unlit,"ordinary" -REGION:(48,12,54,12),unlit,"ordinary" -REGION:(48,10,54,10),unlit,"ordinary",filled,irregular { - ROOMDOOR:true,closed,north|south|west|east,random -} - -# Doors -DOOR:locked,(55,08) -DOOR:locked,(55,12) -DOOR:locked,(47,08) -DOOR:locked,(47,12) -# Stairs -TERRAIN:(03,17),'.' -STAIR:(03,17),up -STAIR:(48,10),down -# Non diggable walls -NON_DIGGABLE:(00,00,75,20) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:"spiked pit",(24,02) -TRAP:"spiked pit",(07,10) -TRAP:"spiked pit",(23,05) -TRAP:"spiked pit",(26,19) -TRAP:"spiked pit",(72,02) -TRAP:"spiked pit",(72,12) -TRAP:"falling rock",(45,16) -TRAP:"falling rock",(65,13) -TRAP:"falling rock",(55,06) -TRAP:"falling rock",(39,11) -TRAP:"falling rock",(57,09) -TRAP:"magic",random -TRAP:"statue",random -TRAP:"statue",random -TRAP:"polymorph",random -TRAP:"anti magic",(53,10) -TRAP:"sleep gas",random -TRAP:"sleep gas",random -TRAP:"dart",random -TRAP:"dart",random -TRAP:"dart",random -# Random monsters. -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:'i',random,hostile - -# -# The "goal" level for the quest. -# -# Here you meet the Dark One, your nemesis monster. You have to -# defeat the Dark One in combat to gain the artifact you have -# been assigned to retrieve. -# - -MAZE: "Wiz-goal", ' ' -GEOMETRY:center,center -MAP - - - - ------------- ------------- - |...........| |...........| - -------|...........-------------------...........| - |......S...........|..|..|..|..|..|..|...........| - |......|...........|..|..|..|..|..|..|...........| - |......|...........-F+-F+-F+-F+-F+-F+-...........| - --S----|...........S.................+...........| - |......|...........-F+-F+-F+-F+-F+-F+-...........| - |......|...........|..|..|..|..|..|..|...........| - |......|...........|..|..|..|..|..|..|...........| - -------|...........-------------------...........| - |...........| |...........| - ------------- ------------- - - - - -ENDMAP -# Dungeon Description -REGION:(13,10,18,12),unlit,"temple" -REGION:(13,06,18,08),lit,"ordinary" -REGION:(20,04,30,14),unlit,"ordinary" -REGION:(32,06,33,07),unlit,"ordinary" -REGION:(35,06,36,07),unlit,"ordinary" -REGION:(38,06,39,07),unlit,"ordinary" -REGION:(41,06,42,07),unlit,"ordinary" -REGION:(44,06,45,07),unlit,"ordinary" -REGION:(47,06,48,07),unlit,"ordinary" -REGION:(32,09,48,09),unlit,"ordinary" -REGION:(32,11,33,12),unlit,"ordinary" -REGION:(35,11,36,12),unlit,"ordinary" -REGION:(38,11,39,12),unlit,"ordinary" -REGION:(41,11,42,12),unlit,"ordinary" -REGION:(44,11,45,12),unlit,"ordinary" -REGION:(47,11,48,12),unlit,"ordinary" -REGION:(50,04,60,14),lit,"ordinary" -# Doors -DOOR:locked,(19,06) -DOOR:locked,(14,09) -DOOR:locked,(31,09) -DOOR:locked,(33,08) -DOOR:locked,(36,08) -DOOR:locked,(39,08) -DOOR:locked,(42,08) -DOOR:locked,(45,08) -DOOR:locked,(48,08) -DOOR:locked,(33,10) -DOOR:locked,(36,10) -DOOR:locked,(39,10) -DOOR:locked,(42,10) -DOOR:locked,(45,10) -DOOR:locked,(48,10) -DOOR:locked,(49,09) -# Stairs -STAIR:(55,05),up -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# The altar. This is not a shrine. -ALTAR:(16,11),noncoaligned,altar -# Objects -OBJECT:('"',"amulet of ESP"),(16,11),blessed,0,name:"The Eye of the Aethiopica" -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:('@',"Dark One"),(16,11) -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'B',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:'i',random,hostile -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:'i',random,hostile -# Captive Monsters in the dungeon -MONSTER:('@',"rogue"),(35,06),peaceful,"Pug" -MONSTER:('Y',"owlbear"),(47,06),peaceful,asleep -MONSTER:('@',"wizard"),(32,11),peaceful,asleep,"Newt" -MONSTER:('@',"Grey-elf"),(44,11),peaceful -MONSTER:('H',"hill giant"),(47,11),peaceful,asleep -MONSTER:('G',"gnomish wizard"),(38,06),peaceful -MONSTER:('@',"prisoner"),(35,11),peaceful -MONSTER:('@',"prisoner"),(41,11),peaceful,asleep - -# -# The "fill" levels for the quest. -# -# These levels are used to fill out any levels not occupied by specific -# levels as defined above. "filla" is the upper filler, between the -# start and locate levels, and "fillb" the lower between the locate -# and goal levels. -# - -LEVEL: "Wiz-fila" -# -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random - MONSTER: 'i', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random,random - MONSTER: 'i', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - OBJECT: random,random - MONSTER: ('B', "vampire bat"), random - MONSTER: ('B', "vampire bat"), random -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - TRAP: random, random - MONSTER: 'i', random, hostile - MONSTER: ('B', "vampire bat"), random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - TRAP: random, random - MONSTER: 'i', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - MONSTER: ('B', "vampire bat"), random -} - -RANDOM_CORRIDORS - -LEVEL: "Wiz-filb" -# -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random - MONSTER: 'X', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random,random - MONSTER: 'i', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - OBJECT: random,random - MONSTER: 'X', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - TRAP: random, random - MONSTER: 'i', random, hostile - MONSTER: ('B', "vampire bat"), random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - TRAP: random, random - MONSTER: 'i', random, hostile -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - MONSTER: ('B', "vampire bat"), random -} - -RANDOM_CORRIDORS diff --git a/dat/air.lua b/dat/air.lua new file mode 100644 index 000000000..ba925c86a --- /dev/null +++ b/dat/air.lua @@ -0,0 +1,108 @@ +-- NetHack 3.6 endgame.des $NHDT-Date: 1546303680 2019/01/01 00:48:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.14 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1992,1993 by Izchak Miller, David Cohrs, +-- and Timo Hakulinen +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "shortsighted") +-- The following messages are somewhat obtuse, to make then +-- equally meaningful if the player can see or not. +des.message("What a strange feeling!") +des.message("You notice that there is no gravity here.") +-- The player lands, upon arrival, in the +-- lower-left area. The location of the +-- portal to the next level is randomly chosen. +-- This map has no visible outer boundary, and +-- is all "air". +des.map([[ +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +]]); +-- Use up and down regions to partition the level into three parts; +-- teleportation can't cross from one part into another. +-- The up region is where you'll arrive after activating the portal from +-- the preceding level; the exit portal is placed inside the down region. +des.teleport_region({ region = {01,00,24,20}, region_islev = 1, exclude = {25,00,79,20}, exclude_islev=1, dir="up" }) +des.teleport_region({ region = {56,00,79,20}, region_islev = 1, exclude = {01,00,55,20}, exclude_islev=1, dir="down" }) + +-- des.portal(levregion(57,01,78,19),(0,0,0,0),"fire") +des.levregion({ region = {57,01,78,19}, region_islev=1, type="portal", name="fire" }); +des.region(selection.area(00,00,75,19),"lit") +des.monster({ id = "air elemental", peaceful = 0 }) +des.monster({ id = "air elemental", peaceful = 0 }) +des.monster({ id = "air elemental", peaceful = 0 }) +des.monster({ id = "air elemental", peaceful = 0 }) +des.monster({ id = "air elemental", peaceful = 0 }) +des.monster({ id = "air elemental", peaceful = 0 }) +des.monster({ id = "air elemental", peaceful = 0 }) +des.monster({ id = "air elemental", peaceful = 0 }) +des.monster({ id = "air elemental", peaceful = 0 }) +des.monster({ id = "air elemental", peaceful = 0 }) +des.monster({ id = "air elemental", peaceful = 0 }) + +des.monster({ id = "floating eye", peaceful = 0 }) +des.monster({ id = "floating eye", peaceful = 0 }) +des.monster({ id = "floating eye", peaceful = 0 }) + +des.monster({ id = "yellow light", peaceful = 0 }) +des.monster({ id = "yellow light", peaceful = 0 }) +des.monster({ id = "yellow light", peaceful = 0 }) + +des.monster("couatl") + +des.monster("D") +des.monster("D") +des.monster("D") +des.monster("D") +des.monster("D") + +des.monster("E") +des.monster("E") +des.monster("E") +des.monster("J") +des.monster("J") + +des.monster({ id = "djinni", peaceful = 0 }) +des.monster({ id = "djinni", peaceful = 0 }) +des.monster({ id = "djinni", peaceful = 0 }) + +des.monster({ id = "fog cloud", peaceful = 0 }) +des.monster({ id = "fog cloud", peaceful = 0 }) +des.monster({ id = "fog cloud", peaceful = 0 }) +des.monster({ id = "fog cloud", peaceful = 0 }) +des.monster({ id = "fog cloud", peaceful = 0 }) +des.monster({ id = "fog cloud", peaceful = 0 }) +des.monster({ id = "fog cloud", peaceful = 0 }) +des.monster({ id = "fog cloud", peaceful = 0 }) +des.monster({ id = "fog cloud", peaceful = 0 }) +des.monster({ id = "energy vortex", peaceful = 0 }) +des.monster({ id = "energy vortex", peaceful = 0 }) +des.monster({ id = "energy vortex", peaceful = 0 }) +des.monster({ id = "energy vortex", peaceful = 0 }) +des.monster({ id = "energy vortex", peaceful = 0 }) +des.monster({ id = "steam vortex", peaceful = 0 }) +des.monster({ id = "steam vortex", peaceful = 0 }) +des.monster({ id = "steam vortex", peaceful = 0 }) +des.monster({ id = "steam vortex", peaceful = 0 }) +des.monster({ id = "steam vortex", peaceful = 0 }) + diff --git a/dat/asmodeus.lua b/dat/asmodeus.lua new file mode 100644 index 000000000..7191f12cd --- /dev/null +++ b/dat/asmodeus.lua @@ -0,0 +1,88 @@ +-- NetHack 3.6 gehennom.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- 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") +-- First part +des.map({ halign = "half-left", valign = "center", map = [[ +--------------------- +|.............|.....| +|.............S.....| +|---+------------...| +|.....|.........|-+-- +|..---|.........|.... +|..|..S.........|.... +|..|..|.........|.... +|..|..|.........|-+-- +|..|..-----------...| +|..S..........|.....| +--------------------- +]] }); + +des.levregion({ region={01,00,6,20}, region_islev=1, exclude={6,1,70,16}, exclude_islev=1, type="stair-up" }); +-- des.stair(levregion(01,00,6,20),levregion(6,1,70,16),up) + +des.levregion({ region={01,00,6,20}, region_islev=1, exclude={6,1,70,16}, exclude_islev=1, type="branch" }); +-- des.branch(levregion(01,00,6,20),levregion(6,1,70,16)) +des.teleport_region({ region = {01,00,6,20}, region_islev=1, exclude={6,1,70,16}, exclude_islev=1 }) + +-- Doors +des.door("closed",04,03) +des.door("locked",18,04) +des.door("closed",18,08) +-- +des.stair("down", 13,07) +-- Non diggable walls +des.non_diggable(selection.area(00,00,20,11)) +-- Entire main area +des.region(selection.area(01,01,20,10),"unlit") +-- The fellow in residence +des.monster("Asmodeus",12,07) +-- Some random weapons and armor. +des.object("[") +des.object("[") +des.object(")") +des.object(")") +des.object("*") +des.object("!") +des.object("!") +des.object("?") +des.object("?") +des.object("?") +-- Some traps. +des.trap("spiked pit", 05,02) +des.trap("fire", 08,06) +des.trap("sleep gas") +des.trap("anti magic") +des.trap("fire") +des.trap("magic") +des.trap("magic") +-- Random monsters. +des.monster("ghost",11,07) +des.monster("horned devil",10,05) +des.monster("L") +-- Some Vampires for good measure +des.monster("V") +des.monster("V") +des.monster("V") +-- Second part +des.map({ halign = "half-right", valign = "center", map = [[ +--------------------------------- +................................| +................................+ +................................| +--------------------------------- +]] }); +des.mazewalk(32,02,"east") +-- Non diggable walls +des.non_diggable(selection.area(00,00,32,04)) +des.door("closed",32,02) +des.monster("&") +des.monster("&") +des.monster("&") +des.trap("anti magic") +des.trap("fire") +des.trap("magic") diff --git a/dat/astral.lua b/dat/astral.lua new file mode 100644 index 000000000..546022320 --- /dev/null +++ b/dat/astral.lua @@ -0,0 +1,187 @@ +-- NetHack 3.6 endgame.des $NHDT-Date: 1546303680 2019/01/01 00:48:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.14 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1992,1993 by Izchak Miller, David Cohrs, +-- and Timo Hakulinen +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "nommap", "shortsighted", "solidify") +des.message("You arrive on the Astral Plane!") +des.message("Here the High Temple of %d is located.") +des.message("You sense alarm, hostility, and excitement in the air!") +des.map([[ + --------------- + |.............| + |..---------..| + |..|.......|..| +--------------- |..|.......|..| --------------- +|.............| |..|.......|..| |.............| +|..---------..-| |-------| |..|.......|..| |-------| |-..---------..| +|..|.......|...-| |-.......-| |..|.......|..| |-.......-| |-...|.......|..| +|..|.......|....-|-.........-||..----+----..||-.........-|-....|.......|..| +|..|.......+.....+...........||.............||...........+.....+.......|..| +|..|.......|....-|-.........-|--|.........|--|-.........-|-....|.......|..| +|..|.......|...-| |-.......-| -|---+---|- |-.......-| |-...|.......|..| +|..---------..-| |---+---| |-.......-| |---+---| |-..---------..| +|.............| |...|-----|-.........-|-----|...| |.............| +--------------- |.........|...........|.........| --------------- + -------...|-.........-|...------- + |....|-.......-|....| + ---...|---+---|...--- + |...............| + ----------------- +]]); + +-- chance to alter above map and turn the wings of the bottom-center into +-- a pair of big (5x15) rooms +for i=1,2 do + -- 3.6.[01]: 75% chance that both sides opened up, 25% that neither did; + -- 3.6.2: 60% twice == 36% chance that both sides open up, 24% left side + -- only, 24% right side only, 16% that neither side opens up + local hall = selection.new() + if math.random(0, 99) < 60 then + if i == 1 then + des.terrain(selection.area(17,14, 30,18),".") + des.wallify() + -- temporarily close off the area to be filled so that it doesn't cover + -- the entire entry area + des.terrain(33,18, "|") + hall:floodfill(30,16) + -- re-connect the opened wing with the rest of the map + des.terrain(33,18, ".") + else + des.terrain(selection.area(44,14, 57,18),".") + des.wallify() + des.terrain(41,18, "|") + hall:floodfill(44,16) + des.terrain(41,18, ".") + end + -- extra monsters; was [6 + 3d4] when both wings were opened up at once + for i=1,3 + math.random(2 - 1,2*3) do + des.monster({ id="Angel", coord = { hall:rndcoord(1) }, align="noalign", peaceful=0 }) + if math.random(0,99) < 50 then + des.monster({ coord = { hall:rndcoord(1) }, peaceful=0 }) + end + end + end +end + +-- Rider locations +local place = selection.new(); +place:set(23,9); +place:set(37,14); +place:set(51,9); + +-- Where the player will land on arrival +des.teleport_region({ region = {29,15,45,15}, exclude = {30,15,44,15} }) +-- Lit courts +des.region({ region={01,05,16,14},lit=1,type="ordinary",prefilled=1,irregular=1 }) +des.region({ region={31,01,44,10},lit=1,type="ordinary",prefilled=1,irregular=1 }) +des.region({ region={61,05,74,14},lit=1,type="ordinary",prefilled=1,irregular=1 }) +-- A Sanctum for each alignment +-- The shrines' alignments are shuffled for +-- each game +des.region({ region={04,07,10,11},lit=1,type="temple" }) +des.region({ region={34,03,40,07},lit=1,type="temple" }) +des.region({ region={64,07,70,11},lit=1,type="temple" }) + +des.altar({ x=07, y=09, align=align[1],type="sanctum" }) +des.altar({ x=37, y=05, align=align[2],type="sanctum" }) +des.altar({ x=67, y=09, align=align[3],type="sanctum" }) +-- Doors +des.door("closed",11,09) +des.door("closed",17,09) +des.door("locked",23,12) +des.door("locked",37,08) +des.door("closed",37,11) +des.door("closed",37,17) +des.door("locked",51,12) +des.door("locked",57,09) +des.door("closed",63,09) +-- Non diggable and phazeable everywhere +des.non_diggable(selection.area(00,00,74,19)) +des.non_passwall(selection.area(00,00,74,19)) +-- Moloch's horde +-- West round room +des.monster({ id = "aligned priest",x=18,y=09,align="noalign", peaceful=0 }) +des.monster({ id = "aligned priest",x=19,y=08,align="noalign", peaceful=0 }) +des.monster({ id = "aligned priest",x=19,y=09,align="noalign", peaceful=0 }) +des.monster({ id = "aligned priest",x=19,y=10,align="noalign", peaceful=0 }) +des.monster({ id = "Angel",x=20,y=09,align="noalign", peaceful=0 }) +des.monster({ id = "Angel",x=20,y=10,align="noalign", peaceful=0 }) +des.monster({ id = "Pestilence", coord = { place:rndcoord(1) }, peaceful=0 }) +-- South-central round room +des.monster({ id = "aligned priest",x=36,y=12,align="noalign", peaceful=0 }) +des.monster({ id = "aligned priest",x=37,y=12,align="noalign", peaceful=0 }) +des.monster({ id = "aligned priest",x=38,y=12,align="noalign", peaceful=0 }) +des.monster({ id = "aligned priest",x=36,y=13,align="noalign", peaceful=0 }) +des.monster({ id = "Angel",x=38,y=13,align="noalign", peaceful=0 }) +des.monster({ id = "Angel",x=37,y=13,align="noalign", peaceful=0 }) +des.monster({ id = "Death", coord = { place:rndcoord(1) }, peaceful=0 }) +-- East round room +des.monster({ id = "aligned priest",x=56,y=09,align="noalign", peaceful=0 }) +des.monster({ id = "aligned priest",x=55,y=08,align="noalign", peaceful=0 }) +des.monster({ id = "aligned priest",x=55,y=09,align="noalign", peaceful=0 }) +des.monster({ id = "aligned priest",x=55,y=10,align="noalign", peaceful=0 }) +des.monster({ id = "Angel",x=54,y=09,align="noalign", peaceful=0 }) +des.monster({ id = "Angel",x=54,y=10,align="noalign", peaceful=0 }) +des.monster({ id = "Famine", coord = { place:rndcoord(1) }, peaceful=0 }) +-- +-- The aligned horde +-- +-- We do not know in advance the alignment of the +-- player. The mpeaceful bit will need resetting +-- when the level is created. The setting here is +-- but a place holder. +-- +-- West court +des.monster({ id = "aligned priest",x=12,y=07,align="chaos", peaceful=0 }) +des.monster({ id = "aligned priest",x=13,y=07,align="chaos",peaceful=1 }) +des.monster({ id = "aligned priest",x=14,y=07,align="law", peaceful=0 }) +des.monster({ id = "aligned priest",x=12,y=11,align="law",peaceful=1 }) +des.monster({ id = "aligned priest",x=13,y=11,align="neutral", peaceful=0 }) +des.monster({ id = "aligned priest",x=14,y=11,align="neutral",peaceful=1 }) +des.monster({ id = "Angel",x=11,y=05,align="chaos", peaceful=0 }) +des.monster({ id = "Angel",x=12,y=05,align="chaos",peaceful=1 }) +des.monster({ id = "Angel",x=13,y=05,align="law", peaceful=0 }) +des.monster({ id = "Angel",x=11,y=13,align="law",peaceful=1 }) +des.monster({ id = "Angel",x=12,y=13,align="neutral", peaceful=0 }) +des.monster({ id = "Angel",x=13,y=13,align="neutral",peaceful=1 }) +-- Central court +des.monster({ id = "aligned priest",x=32,y=09,align="chaos", peaceful=0 }) +des.monster({ id = "aligned priest",x=33,y=09,align="chaos",peaceful=1 }) +des.monster({ id = "aligned priest",x=34,y=09,align="law", peaceful=0 }) +des.monster({ id = "aligned priest",x=40,y=09,align="law",peaceful=1 }) +des.monster({ id = "aligned priest",x=41,y=09,align="neutral", peaceful=0 }) +des.monster({ id = "aligned priest",x=42,y=09,align="neutral",peaceful=1 }) +des.monster({ id = "Angel",x=31,y=08,align="chaos", peaceful=0 }) +des.monster({ id = "Angel",x=32,y=08,align="chaos",peaceful=1 }) +des.monster({ id = "Angel",x=31,y=09,align="law", peaceful=0 }) +des.monster({ id = "Angel",x=42,y=08,align="law",peaceful=1 }) +des.monster({ id = "Angel",x=43,y=08,align="neutral", peaceful=0 }) +des.monster({ id = "Angel",x=43,y=09,align="neutral",peaceful=1 }) +-- East court +des.monster({ id = "aligned priest",x=60,y=07,align="chaos", peaceful=0 }) +des.monster({ id = "aligned priest",x=61,y=07,align="chaos",peaceful=1 }) +des.monster({ id = "aligned priest",x=62,y=07,align="law", peaceful=0 }) +des.monster({ id = "aligned priest",x=60,y=11,align="law",peaceful=1 }) +des.monster({ id = "aligned priest",x=61,y=11,align="neutral", peaceful=0 }) +des.monster({ id = "aligned priest",x=62,y=11,align="neutral",peaceful=1 }) +des.monster({ id = "Angel",x=61,y=05,align="chaos", peaceful=0 }) +des.monster({ id = "Angel",x=62,y=05,align="chaos",peaceful=1 }) +des.monster({ id = "Angel",x=63,y=05,align="law", peaceful=0 }) +des.monster({ id = "Angel",x=61,y=13,align="law",peaceful=1 }) +des.monster({ id = "Angel",x=62,y=13,align="neutral", peaceful=0 }) +des.monster({ id = "Angel",x=63,y=13,align="neutral",peaceful=1 }) +-- +-- Assorted nasties +des.monster({ class = "L", peaceful=0 }) +des.monster({ class = "L", peaceful=0 }) +des.monster({ class = "L", peaceful=0 }) +des.monster({ class = "V", peaceful=0 }) +des.monster({ class = "V", peaceful=0 }) +des.monster({ class = "V", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) +des.monster({ class = "D", peaceful=0 }) diff --git a/dat/baalz.lua b/dat/baalz.lua new file mode 100644 index 000000000..04d6a4634 --- /dev/null +++ b/dat/baalz.lua @@ -0,0 +1,72 @@ +-- NetHack 3.6 gehennom.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- 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 = "solidfill", fg = " " }); + +-- TODO FIXME: see baalz_fixup - the legs get removed currently. + +des.level_flags("mazelevel", "noteleport", "corrmaze") +-- the two pools are fakes used to mark spots which need special wall fixups +-- the two iron bars are eyes and spots to their left will be made diggable +des.map({ halign = "right", valign = "center", map = [[ +------------------------------------------------- +| ---- ---- +| ---- | ----------- | +| ------ | ---------|.........|--P +| F....| -------|...........-------------- +---....|--|..................S............|---- ++...--....S..----------------|............S...| +---....|--|..................|............|---- +| F....| -------|...........-----S-------- +| ------ | ---------|.........|--P +| ---- | ----------- | +| ---- ---- +------------------------------------------------- +]] }); +des.levregion({ region = {01,00,15,20}, region_islev=1, exclude={15,1,70,16}, exclude_islev=1, type="stair-up" }) +des.levregion({ region = {01,00,15,20}, region_islev=1, exclude={15,1,70,16}, exclude_islev=1, type="branch" }) +des.teleport_region({region = {01,00,15,20}, region_islev=1, exclude = {15,1,70,16}, exclude_islev=1 }) +-- this actually leaves the farthest right column diggable +des.non_diggable(selection.area(00,00,47,12)) +des.mazewalk(00,06,"west") +des.stair("down", 44,06) +des.door("locked",00,06) +if math.random(0, 99) < 50 then + des.terrain(34,08,'-') + des.terrain(34,04,'S') + des.terrain(29,05,'|') + des.terrain(29,07,'S') +end +-- The fellow in residence +des.monster("Baalzebub",35,06) +-- Some random weapons and armor. +des.object("[") +des.object("[") +des.object(")") +des.object(")") +des.object("*") +des.object("!") +des.object("!") +des.object("?") +des.object("?") +des.object("?") +-- Some traps. +des.trap("spiked pit") +des.trap("fire") +des.trap("sleep gas") +des.trap("anti magic") +des.trap("fire") +des.trap("magic") +des.trap("magic") +-- Random monsters. +des.monster("ghost",37,07) +des.monster("horned devil",32,05) +des.monster("barbed devil",38,07) +des.monster("L") +-- Some Vampires for good measure +des.monster("V") +des.monster("V") +des.monster("V") + diff --git a/dat/bigrm-1.lua b/dat/bigrm-1.lua new file mode 100644 index 000000000..a644b129e --- /dev/null +++ b/dat/bigrm-1.lua @@ -0,0 +1,72 @@ + +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("mazelevel"); + +des.map([[ +--------------------------------------------------------------------------- +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +--------------------------------------------------------------------------- +]]); + + +if math.random(0,99) < 75 then + local terrains = { "-", "F", "L", "T", "C" }; + local tidx = math.random(1, #terrains); + local choice = math.random(0, 4); + if choice == 0 then + des.terrain(selection.line(10,8, 65,8), terrains[tidx]); + elseif choice == 1 then + local sel = selection.new(); + sel:line(15,4, 15, 13); + sel:line(59,4, 59, 13); + des.terrain(sel, terrains[tidx]); + elseif choice == 2 then + local sel = selection.new(); + sel:line(10,8, 38, 8); + sel:line(37,8, 65, 8); + sel:line(37,3, 37, 8); + sel:line(37,8, 37,14); + des.terrain(sel, terrains[tidx]); + elseif choice == 3 then + des.terrain(selection.rect(4,4, 70,13), terrains[tidx]); + local sel = selection.new(); + sel:line(25,4, 50,4); + sel:line(25,13, 50,13); + des.terrain(sel, '.'); + else + end +end + +des.region(selection.area(01,01, 73, 16), "lit"); + +des.stair("up"); +des.stair("down"); + +des.non_diggable(); + +for i = 1,15 do + des.object(); +end + +for i = 1,6 do + des.trap(); +end + +for i = 1,28 do + des.monster(); +end diff --git a/dat/bigrm-10.lua b/dat/bigrm-10.lua new file mode 100644 index 000000000..693697137 --- /dev/null +++ b/dat/bigrm-10.lua @@ -0,0 +1,58 @@ + + +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("mazelevel"); + +des.map([[ +....................................................................... +....................................................................... +....................................................................... +....................................................................... +...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... +...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... +...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... +...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... +...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... +...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... +...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... +...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... +...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... +...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... +...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... +....................................................................... +....................................................................... +....................................................................... +....................................................................... +]]); + +if math.random(0,99) < 40 then + -- occasionally it's not a fog maze + local terrain = { "L", "}", "T", "-", "F" }; + local tidx = math.random(1, #terrain); + -- break it up a bit + des.replace_terrain({ region={0, 0, 70, 18}, fromterrain="C", toterrain=".", chance=5 }); + des.replace_terrain({ region={0, 0, 70, 18}, fromterrain="C", toterrain=terrain[tidx] }); +end; + +des.region(selection.area(00,00,70,18), "lit"); + +-- when falling down on this level, never end up in the fog maze +des.teleport_region({ region = {00,00,70,18}, exclude = {02,03,68,15}, dir = "down" }); + +for i = 1,15 do + des.object(); +end + +for i = 1,6 do + des.trap(); +end + +for i = 1,28 do + des.monster(); +end + +des.mazewalk({ x=4, y=2, dir="south", stocked=0 }); + +-- Stairs up, not in the fog maze +des.levregion({ region = {00,00,70,18}, exclude = {02,03,68,15}, type="stair-up"}); +des.stair("down"); diff --git a/dat/bigrm-2.lua b/dat/bigrm-2.lua new file mode 100644 index 000000000..5d7b3f987 --- /dev/null +++ b/dat/bigrm-2.lua @@ -0,0 +1,57 @@ + +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 diff --git a/dat/bigrm-3.lua b/dat/bigrm-3.lua new file mode 100644 index 000000000..2f36fc533 --- /dev/null +++ b/dat/bigrm-3.lua @@ -0,0 +1,71 @@ + +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("mazelevel"); + +des.map([[ +--------------------------------------------------------------------------- +|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|..............---.......................................---..............| +|...............|.........................................|...............| +|.....|.|.|.|.|---|.|.|.|.|...................|.|.|.|.|.|---|.|.|.|.|.....| +|.....|-------- --------|...................|---------- --------|.....| +|.....|.|.|.|.|---|.|.|.|.|...................|.|.|.|.|.|---|.|.|.|.|.....| +|...............|.........................................|...............| +|..............---.......................................---..............| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.........................................................................| +|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.| +--------------------------------------------------------------------------- +]]); + +-- Dungeon Description +des.region(selection.area(01,01,73,16), "lit"); + +-- Stairs +des.stair("up"); +des.stair("down"); + +-- Non diggable walls +des.non_diggable(); + +for i = 1,15 do + des.object(); +end + +for i = 1,6 do + des.trap(); +end + +des.monster({ x = 01, y = 01 }); +des.monster({ x = 13, y = 01 }); +des.monster({ x = 25, y = 01 }); +des.monster({ x = 37, y = 01 }); +des.monster({ x = 49, y = 01 }); +des.monster({ x = 61, y = 01 }); +des.monster({ x = 73, y = 01 }); +des.monster({ x = 07, y = 07 }); +des.monster({ x = 13, y = 07 }); +des.monster({ x = 25, y = 07 }); +des.monster({ x = 37, y = 07 }); +des.monster({ x = 49, y = 07 }); +des.monster({ x = 61, y = 07 }); +des.monster({ x = 67, y = 07 }); +des.monster({ x = 07, y = 09 }); +des.monster({ x = 13, y = 09 }); +des.monster({ x = 25, y = 09 }); +des.monster({ x = 37, y = 09 }); +des.monster({ x = 49, y = 09 }); +des.monster({ x = 61, y = 09 }); +des.monster({ x = 67, y = 09 }); +des.monster({ x = 01, y = 16 }); +des.monster({ x = 13, y = 16 }); +des.monster({ x = 25, y = 16 }); +des.monster({ x = 37, y = 16 }); +des.monster({ x = 49, y = 16 }); +des.monster({ x = 61, y = 16 }); +des.monster({ x = 73, y = 16 }); diff --git a/dat/bigrm-4.lua b/dat/bigrm-4.lua new file mode 100644 index 000000000..d86f46b48 --- /dev/null +++ b/dat/bigrm-4.lua @@ -0,0 +1,43 @@ + +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("mazelevel"); + +des.map([[ +----------- ----------- +|.........| |.........| +|.........|-----------| |-----------|.........| +|-|...................|----------| |----------|...................|-| + -|.............................|-------|.............................|- + -|.................................................................|- + -|...............................................................|- + -|.............................................................|- + -|...........................................................|- + -|...........................................................|- + -|.............................................................|- + -|...............................................................|- + -|.................................................................|- + -|.............................|-------|.............................|- +|-|...................|----------| |----------|...................|-| +|.........|-----------| |-----------|.........| +|.........| |.........| +----------- ----------- +]]); + +des.region(selection.area(01,01,73,16), "lit"); + +des.stair("up"); +des.stair("down"); + +des.non_diggable(); + +for i = 1,15 do + des.object(); +end + +for i = 1,6 do + des.trap(); +end + +for i = 1,28 do + des.monster(); +end diff --git a/dat/bigrm-5.lua b/dat/bigrm-5.lua new file mode 100644 index 000000000..c85f55e12 --- /dev/null +++ b/dat/bigrm-5.lua @@ -0,0 +1,44 @@ + +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("mazelevel"); + +des.map([[ + ------------------ + ---------................--------- + -------................................------- + ------............................................------ + ----......................................................---- + ---............................................................--- + ---................................................................--- +---....................................................................--- +|........................................................................| +|........................................................................| +|........................................................................| +---....................................................................--- + ---................................................................--- + ---............................................................--- + ----......................................................---- + ------............................................------ + -------................................------- + ---------................--------- + ------------------ +]]); + +des.region(selection.area(00,00,72,18), "lit"); + +des.stair("up"); +des.stair("down"); + +des.non_diggable(); + +for i = 1,15 do + des.object(); +end + +for i = 1,6 do + des.trap(); +end + +for i = 1,28 do + des.monster(); +end diff --git a/dat/bigrm-6.lua b/dat/bigrm-6.lua new file mode 100644 index 000000000..6138be67e --- /dev/null +++ b/dat/bigrm-6.lua @@ -0,0 +1,45 @@ + + +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("mazelevel"); + +des.map([[ + --------- --------- --------- --------- + ---.......--- ---.......--- ---.......--- ---.......--- + --...........-- --...........-- --...........-- --...........-- + --.............-- --.............-- --.............-- --.............-- + -...............- -...............- -...............- -...............- +|-...............---...............---...............---...............-- +|.................-.................-.................-.................| +|........T.................T.................T.................T........| +|.......................................................................| +|......T.{.....................................................{.T......| +|.......................................................................| +|........T.................T.................T.................T........| +|.................-.................-.................-.................| +--...............---...............---...............---...............-- + -...............- -...............- -...............- -...............- + --.............-- --.............-- --.............-- --.............-- + --...........-- --...........-- --...........-- --...........-- + ---.......--- ---.......--- ---.......--- ---.......--- + --------- --------- --------- --------- +]]); + +des.region(selection.area(01,01,72,17), "lit"); + +des.stair("up"); +des.stair("down"); + +des.non_diggable(); + +for i = 1,15 do + des.object(); +end + +for i = 1,6 do + des.trap(); +end + +for i = 1,28 do + des.monster(); +end diff --git a/dat/bigrm-7.lua b/dat/bigrm-7.lua new file mode 100644 index 000000000..e8fccc8cf --- /dev/null +++ b/dat/bigrm-7.lua @@ -0,0 +1,48 @@ + +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("mazelevel"); + +des.map([[ + ----- + ---------...--- + ---------.........L...--- + ---------.......................--- + ---------.................................--- + ---------...........................................--- + ---------.....................................................--- +|--------...............................................................--| +|.........................................................................| +|.L.....................................................................L.| +|.........................................................................| +|--...............................................................--------| + ---.....................................................--------- + ---...........................................--------- + ---.................................--------- + ---.......................--------- + ---...L.........--------- + ---...--------- + ----- +]]); + +local terrain = { "L", "T", "{", "." }; +local tidx = math.random(1, #terrain); +des.replace_terrain({ region={00,00, 74,18}, fromterrain="L", toterrain=terrain[tidx] }); + +des.region(selection.area(01,01,73,17), "lit"); + +des.stair("up"); +des.stair("down"); + +des.non_diggable(); + +for i = 1,15 do + des.object(); +end + +for i = 1,6 do + des.trap(); +end + +for i = 1,28 do + des.monster(); +end diff --git a/dat/bigrm-8.lua b/dat/bigrm-8.lua new file mode 100644 index 000000000..2851b780d --- /dev/null +++ b/dat/bigrm-8.lua @@ -0,0 +1,50 @@ + + +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("mazelevel"); + +des.map([[ +---------------------------------------------- +|............................................--- +--.............................................--- + ---......................................FF.....--- + ---...................................FF........--- + ---................................FF...........--- + ---.............................FF..............--- + ---..........................FF.................--- + ---.......................FF....................--- + ---....................FF.......................--- + ---.................FF..........................--- + ---..............FF.............................--- + ---...........FF................................---- + ---........FF...................................--- + ---.....FF......................................--- + ---.............................................-- + ---............................................| + ---------------------------------------------- +]]); + +if math.random(0,99) < 40 then + local terrain = { "L", "}", "T", ".", "-", "C" }; + local tidx = math.random(1, #terrain); + des.replace_terrain({ region={00,00, 74,17}, fromterrain="F", toterrain=terrain[tidx] }); +end; + +des.region(selection.area(01,01,73,16), "lit"); + +des.stair("up"); +des.stair("down"); + +des.non_diggable(); + +for i = 1,15 do + des.object(); +end + +for i = 1,6 do + des.trap(); +end + +for i = 1,28 do + des.monster(); +end diff --git a/dat/bigrm-9.lua b/dat/bigrm-9.lua new file mode 100644 index 000000000..a1fdcd05f --- /dev/null +++ b/dat/bigrm-9.lua @@ -0,0 +1,48 @@ + +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("mazelevel"); + +des.map([[ +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}................................}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}............................................}}}}}}}}}}}}}}} +}}}}}}}}}}......................................................}}}}}}}}}} +}}}}}}}............................................................}}}}}}} +}}}}}.......................LLLLLLLLLLLLLLLLLL.......................}}}}} +}}}....................LLLLLLLLLLLLLLLLLLLLLLLLLLL.....................}}} +}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................} +}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................} +}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................} +}}}....................LLLLLLLLLLLLLLLLLLLLLLLLLLL.....................}}} +}}}}}.......................LLLLLLLLLLLLLLLLLL.......................}}}}} +}}}}}}}............................................................}}}}}}} +}}}}}}}}}}......................................................}}}}}}}}}} +}}}}}}}}}}}}}}}............................................}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}................................}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +]]); + +-- Unlit, except 3 mapgrids around the "pupil" +des.region(selection.area(00,00,73,18),"unlit"); +des.region(selection.area(26,04,47,14),"lit"); +des.region(selection.area(21,05,51,13),"lit"); +des.region(selection.area(19,06,54,12),"lit"); + +des.stair("up"); +des.stair("down"); + +des.non_diggable(); + +for i = 1,15 do + des.object(); +end + +for i = 1,6 do + des.trap(); +end + +for i = 1,28 do + des.monster(); +end diff --git a/dat/bigroom.des b/dat/bigroom.des deleted file mode 100644 index dcec9854b..000000000 --- a/dat/bigroom.des +++ /dev/null @@ -1,723 +0,0 @@ -# NetHack 3.6 bigroom.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1990 by M. Stephenson -# NetHack may be freely redistributed. See license for details. -# -# These are the bigroom levels: -# - -MAZE:"bigrm-1",' ' -GEOMETRY:center,center -MAP ---------------------------------------------------------------------------- -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| ---------------------------------------------------------------------------- -ENDMAP - -$terrains = TERRAIN:{'-', 'F', 'L', 'T', 'C'} -SHUFFLE:$terrains - -[50%]: SWITCH [ 4 ] { - CASE 0: - TERRAIN:line (10,8),(65, 8), $terrains[0] - BREAK - CASE 1: - TERRAIN:line (15,4),(15, 13), $terrains[0] - TERRAIN:line (59,4),(59, 13), $terrains[0] - BREAK - CASE 2: - TERRAIN:line (10,8),(38, 8), $terrains[0] - TERRAIN:line (37,8),(65, 8), $terrains[0] - TERRAIN:line (37,3),(37, 8), $terrains[0] - TERRAIN:line (37,8),(37,14), $terrains[0] - BREAK - CASE 3: - TERRAIN:rect (4,4,70,13), $terrains[0] - TERRAIN:line (25, 4),(50, 4), '.' - TERRAIN:line (25,13),(50,13), '.' - BREAK - DEFAULT: -} - -# Dungeon Description -REGION:(01,01,73,16),lit,"ordinary" -# Stairs -STAIR:random,up -STAIR:random,down -# Non diggable walls -NON_DIGGABLE:(00,00,74,17) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random - -# Here, just play with the lighting... - -MAZE:"bigrm-2",' ' -GEOMETRY:center,center -MAP ---------------------------------------------------------------------------- -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| ---------------------------------------------------------------------------- -ENDMAP -# Dungeon Description -REGION:(01,01,73,16),lit,"ordinary" -SWITCH [ 3 ] { - CASE 0: - REGION:(01,07,22,09),unlit,"ordinary" - REGION:(24,01,50,05),unlit,"ordinary" - REGION:(24,11,50,16),unlit,"ordinary" - REGION:(52,07,73,09),unlit,"ordinary" - BREAK - CASE 1: - REGION:(24,01,50,16),unlit,"ordinary" - BREAK - CASE 2: - REGION:(01,01,22,16),unlit,"ordinary" - REGION:(52,01,73,16),unlit,"ordinary" - BREAK -} -# Stairs -STAIR:random,up -STAIR:random,down -# Non diggable walls -NON_DIGGABLE:(00,00,74,17) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random - -# Now, let's get fancy... - -MAZE:"bigrm-3",' ' -GEOMETRY:center,center -MAP ---------------------------------------------------------------------------- -|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|..............---.......................................---..............| -|...............|.........................................|...............| -|.....|.|.|.|.|---|.|.|.|.|...................|.|.|.|.|.|---|.|.|.|.|.....| -|.....|-------- --------|...................|---------- --------|.....| -|.....|.|.|.|.|---|.|.|.|.|...................|.|.|.|.|.|---|.|.|.|.|.....| -|...............|.........................................|...............| -|..............---.......................................---..............| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.........................................................................| -|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.|.| ---------------------------------------------------------------------------- -ENDMAP -# Dungeon Description -REGION:(01,01,73,16),lit,"ordinary" -# Stairs -STAIR:random,up -STAIR:random,down -# Non diggable walls -NON_DIGGABLE:(00,00,74,17) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:random,(01,01) -MONSTER:random,(13,01) -MONSTER:random,(25,01) -MONSTER:random,(37,01) -MONSTER:random,(49,01) -MONSTER:random,(61,01) -MONSTER:random,(73,01) -MONSTER:random,(07,07) -MONSTER:random,(13,07) -MONSTER:random,(25,07) -MONSTER:random,(37,07) -MONSTER:random,(49,07) -MONSTER:random,(61,07) -MONSTER:random,(67,07) -MONSTER:random,(07,09) -MONSTER:random,(13,09) -MONSTER:random,(25,09) -MONSTER:random,(37,09) -MONSTER:random,(49,09) -MONSTER:random,(61,09) -MONSTER:random,(67,09) -MONSTER:random,(01,16) -MONSTER:random,(13,16) -MONSTER:random,(25,16) -MONSTER:random,(37,16) -MONSTER:random,(49,16) -MONSTER:random,(61,16) -MONSTER:random,(73,16) -MAZE:"bigrm-4",' ' -GEOMETRY:center,center -MAP ------------ ----------- -|.........| |.........| -|.........|-----------| |-----------|.........| -|-|...................|----------| |----------|...................|-| - -|.............................|-------|.............................|- - -|.................................................................|- - -|...............................................................|- - -|.............................................................|- - -|...........................................................|- - -|...........................................................|- - -|.............................................................|- - -|...............................................................|- - -|.................................................................|- - -|.............................|-------|.............................|- -|-|...................|----------| |----------|...................|-| -|.........|-----------| |-----------|.........| -|.........| |.........| ------------ ----------- -ENDMAP -# Dungeon Description -REGION:(01,01,73,16),lit,"ordinary" -# Stairs -STAIR:random,up -STAIR:random,down -# Non diggable walls -NON_DIGGABLE:(00,00,74,17) -# Fountains -FOUNTAIN:(05,02) -FOUNTAIN:(05,15) -FOUNTAIN:(69,02) -FOUNTAIN:(69,15) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random - -# Try an oval room... - -MAZE:"bigrm-5",' ' -GEOMETRY:center,center -MAP - ------------------ - ---------................--------- - -------................................------- - ------............................................------ - ----......................................................---- - ---............................................................--- - ---................................................................--- ----....................................................................--- -|........................................................................| -|........................................................................| -|........................................................................| ----....................................................................--- - ---................................................................--- - ---............................................................--- - ----......................................................---- - ------............................................------ - -------................................------- - ---------................--------- - ------------------ -ENDMAP -# Dungeon Description -REGION:(00,00,72,18),lit,"ordinary" -# Stairs -STAIR:random,up -STAIR:random,down -# Non diggable walls -NON_DIGGABLE:(00,00,72,18) -# Objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Random monsters. -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random - - -# The Four Circles - -LEVEL:"bigrm-6" -FLAGS:mazelevel -INIT_MAP:solidfill,' ' -GEOMETRY:center,center -MAP - --------- --------- --------- --------- - ---.......--- ---.......--- ---.......--- ---.......--- - --...........-- --...........-- --...........-- --...........-- - --.............-- --.............-- --.............-- --.............-- - -...............- -...............- -...............- -...............- -|-...............---...............---...............---...............-- -|.................-.................-.................-.................| -|........T.................T.................T.................T........| -|.......................................................................| -|......T.{.....................................................{.T......| -|.......................................................................| -|........T.................T.................T.................T........| -|.................-.................-.................-.................| ---...............---...............---...............---...............-- - -...............- -...............- -...............- -...............- - --.............-- --.............-- --.............-- --.............-- - --...........-- --...........-- --...........-- --...........-- - ---.......--- ---.......--- ---.......--- ---.......--- - --------- --------- --------- --------- -ENDMAP -REGION:(01,01,72,17),lit,"ordinary" - -STAIR:random,up -STAIR:random,down - -NON_DIGGABLE:(00,00,72,18) - -LOOP [15] { - OBJECT:random,random -} -LOOP [6] { - TRAP:random,random -} -LOOP [28] { - MONSTER:random,random -} - - - -# Let's tilt it a bit - -LEVEL:"bigrm-7" -FLAGS:mazelevel -INIT_MAP:solidfill,' ' -GEOMETRY:center,center -MAP - ----- - ---------...--- - ---------.........L...--- - ---------.......................--- - ---------.................................--- - ---------...........................................--- - ---------.....................................................--- -|--------...............................................................--| -|.........................................................................| -|.L.....................................................................L.| -|.........................................................................| -|--...............................................................--------| - ---.....................................................--------- - ---...........................................--------- - ---.................................--------- - ---.......................--------- - ---...L.........--------- - ---...--------- - ----- -ENDMAP - -$terrain = terrain:{ 'L', 'T', '{', '.' } -SHUFFLE:$terrain -REPLACE_TERRAIN:(00,00,74,18),'L',$terrain[0],100% - -REGION:(01,01,73,17),lit,"ordinary" - -STAIR:random,up -STAIR:random,down - -NON_DIGGABLE:(00,00,74,18) - -LOOP [15] { - OBJECT:random,random -} -LOOP [6] { - TRAP:random,random -} -LOOP [28] { - MONSTER:random,random -} - - -# Slanted - -LEVEL:"bigrm-8" -FLAGS:mazelevel -INIT_MAP:solidfill,' ' -GEOMETRY:center,center -MAP ----------------------------------------------- -|............................................--- ---.............................................--- - ---......................................FF.....--- - ---...................................FF........--- - ---................................FF...........--- - ---.............................FF..............--- - ---..........................FF.................--- - ---.......................FF....................--- - ---....................FF.......................--- - ---.................FF..........................--- - ---..............FF.............................--- - ---...........FF................................---- - ---........FF...................................--- - ---.....FF......................................--- - ---.............................................-- - ---............................................| - ---------------------------------------------- -ENDMAP - -IF [40%] { - $terrain = TERRAIN:{ 'L', '}', 'T', '.', '-', 'C' } - SHUFFLE:$terrain - REPLACE_TERRAIN:(0,0,74,17),'F', $terrain[0], 100% -} - -REGION:(01,01,73,16),lit,"ordinary" - -STAIR:random,up -STAIR:random,down - -NON_DIGGABLE:(00,00,74,17) - -LOOP [15] { - OBJECT:random,random -} -LOOP [6] { - TRAP:random,random -} -LOOP [28] { - MONSTER:random,random -} - - - -# The Eye - -LEVEL:"bigrm-9" -FLAGS:mazelevel -GEOMETRY:center,center -MAP -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}................................}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}............................................}}}}}}}}}}}}}}} -}}}}}}}}}}......................................................}}}}}}}}}} -}}}}}}}............................................................}}}}}}} -}}}}}.......................LLLLLLLLLLLLLLLLLL.......................}}}}} -}}}....................LLLLLLLLLLLLLLLLLLLLLLLLLLL.....................}}} -}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................} -}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................} -}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................} -}}}....................LLLLLLLLLLLLLLLLLLLLLLLLLLL.....................}}} -}}}}}.......................LLLLLLLLLLLLLLLLLL.......................}}}}} -}}}}}}}............................................................}}}}}}} -}}}}}}}}}}......................................................}}}}}}}}}} -}}}}}}}}}}}}}}}............................................}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}................................}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -ENDMAP - -# Unlit, except 3 mapgrids around the "pupil" -REGION:(00,00,73,18),unlit,"ordinary" -REGION:(26,04,47,14),lit,"ordinary" -REGION:(21,05,51,13),lit,"ordinary" -REGION:(19,06,54,12),lit,"ordinary" - -STAIR:random,up -STAIR:random,down - -LOOP [15] { - OBJECT:random,random -} -LOOP [6] { - TRAP:random,random -} -LOOP [28] { - MONSTER:random,random -} - - -# Fog Maze - -LEVEL:"bigrm-10" -FLAGS:mazelevel -GEOMETRY:center,center -MAP -....................................................................... -....................................................................... -....................................................................... -....................................................................... -...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... -...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... -...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... -...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... -...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... -...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... -...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... -...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... -...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... -...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... -...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C... -....................................................................... -....................................................................... -....................................................................... -....................................................................... -ENDMAP - -IF [33%] { - # occasionally it's not a fog maze - $terrain = TERRAIN:{ 'L', '}', 'T', '-', 'F' } - SHUFFLE:$terrain - # break it up a bit - REPLACE_TERRAIN:(0,0,70,18),'C', '.', 5% - REPLACE_TERRAIN:(0,0,70,18),'C', $terrain[0], 100% -} - -REGION:(00,00,70,18),lit,"ordinary" - -# when falling down on this level, never end up in the fog maze -TELEPORT_REGION:(00,00,70,18),(02,03,68,15),down - -LOOP [15] { - OBJECT:random,random -} -LOOP [6] { - TRAP:random,random -} -LOOP [28] { - MONSTER:random,random -} - -MAZEWALK:(4, 2), south, false - -# Stairs up, not in the fog maze -STAIR:(00,00,70,18),(02,03,68,15),up -STAIR:random,down - diff --git a/dat/castle.des b/dat/castle.des deleted file mode 100644 index dd63a1e40..000000000 --- a/dat/castle.des +++ /dev/null @@ -1,249 +0,0 @@ -# NetHack 3.6 castle.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# NetHack may be freely redistributed. See license for details. -# -# This is the stronghold level : -# there are several ways to enter it : -# - opening the drawbridge (wand of opening, knock spell, playing -# the appropriate tune) -# -# - enter via the back entry (this suppose a ring of levitation, boots -# of water walking, etc.) -# -# Note : If you don't play the right tune, you get indications like in the -# MasterMind game... -# -# To motivate the player : there are 4 storerooms (armors, weapons, food and -# gems) and a wand of wishing in one of the 4 towers... - -MAZE:"castle",random -FLAGS: noteleport -GEOMETRY:center,center -MAP -}}}}}}}}}.............................................}}}}}}}}} -}-------}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}-------} -}|.....|-----------------------------------------------|.....|} -}|.....+...............................................+.....|} -}-------------------------------+-----------------------------} -}}}}}}|........|..........+...........|.......S.S.......|}}}}}} -.....}|........|..........|...........|.......|.|.......|}..... -.....}|........------------...........---------S---------}..... -.....}|...{....+..........+.........\.S.................+...... -.....}|........------------...........---------S---------}..... -.....}|........|..........|...........|.......|.|.......|}..... -}}}}}}|........|..........+...........|.......S.S.......|}}}}}} -}-------------------------------+-----------------------------} -}|.....+...............................................+.....|} -}|.....|-----------------------------------------------|.....|} -}-------}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}-------} -}}}}}}}}}.............................................}}}}}}}}} -ENDMAP - -# Random registers initialisation -$object = object: { '[',')','*','%' } -SHUFFLE: $object - -$place = { (04,02),(58,02),(04,14),(58,14) } -SHUFFLE: $place - -$monster = monster: { 'L','N','E','H','M','O','R','T','X','Z' } -SHUFFLE: $monster - - -TELEPORT_REGION:levregion(01,00,10,20),(1,1,61,15),down -TELEPORT_REGION:levregion(69,00,79,20),(1,1,61,15),up -STAIR:levregion(01,00,10,20),(0,0,62,16),up -FOUNTAIN:(10,08) -# Doors -DOOR:closed,(07,03) -DOOR:closed,(55,03) -DOOR:locked,(32,04) -DOOR:locked,(26,05) -DOOR:locked,(46,05) -DOOR:locked,(48,05) -DOOR:locked,(47,07) -DOOR:closed,(15,08) -DOOR:closed,(26,08) -DOOR:locked,(38,08) -DOOR:locked,(56,08) -DOOR:locked,(47,09) -DOOR:locked,(26,11) -DOOR:locked,(46,11) -DOOR:locked,(48,11) -DOOR:locked,(32,12) -DOOR:closed,(07,13) -DOOR:closed,(55,13) -# The drawbridge -DRAWBRIDGE:(05,08),east,closed -# Storeroom number 1 -OBJECT:$object[0],(39,05) -OBJECT:$object[0],(40,05) -OBJECT:$object[0],(41,05) -OBJECT:$object[0],(42,05) -OBJECT:$object[0],(43,05) -OBJECT:$object[0],(44,05) -OBJECT:$object[0],(45,05) -OBJECT:$object[0],(39,06) -OBJECT:$object[0],(40,06) -OBJECT:$object[0],(41,06) -OBJECT:$object[0],(42,06) -OBJECT:$object[0],(43,06) -OBJECT:$object[0],(44,06) -OBJECT:$object[0],(45,06) -# Storeroom number 2 -OBJECT:$object[1],(49,05) -OBJECT:$object[1],(50,05) -OBJECT:$object[1],(51,05) -OBJECT:$object[1],(52,05) -OBJECT:$object[1],(53,05) -OBJECT:$object[1],(54,05) -OBJECT:$object[1],(55,05) -OBJECT:$object[1],(49,06) -OBJECT:$object[1],(50,06) -OBJECT:$object[1],(51,06) -OBJECT:$object[1],(52,06) -OBJECT:$object[1],(53,06) -OBJECT:$object[1],(54,06) -OBJECT:$object[1],(55,06) -# Storeroom number 3 -OBJECT:$object[2],(39,10) -OBJECT:$object[2],(40,10) -OBJECT:$object[2],(41,10) -OBJECT:$object[2],(42,10) -OBJECT:$object[2],(43,10) -OBJECT:$object[2],(44,10) -OBJECT:$object[2],(45,10) -OBJECT:$object[2],(39,11) -OBJECT:$object[2],(40,11) -OBJECT:$object[2],(41,11) -OBJECT:$object[2],(42,11) -OBJECT:$object[2],(43,11) -OBJECT:$object[2],(44,11) -OBJECT:$object[2],(45,11) -# Storeroom number 4 -OBJECT:$object[3],(49,10) -OBJECT:$object[3],(50,10) -OBJECT:$object[3],(51,10) -OBJECT:$object[3],(52,10) -OBJECT:$object[3],(53,10) -OBJECT:$object[3],(54,10) -OBJECT:$object[3],(55,10) -OBJECT:$object[3],(49,11) -OBJECT:$object[3],(50,11) -OBJECT:$object[3],(51,11) -OBJECT:$object[3],(52,11) -OBJECT:$object[3],(53,11) -OBJECT:$object[3],(54,11) -OBJECT:$object[3],(55,11) -# THE WAND OF WISHING in 1 of the 4 towers -CONTAINER:('(',"chest"),not_trapped,$place[0] { -OBJECT:('/',"wishing") -} -# Prevent monsters from eating it. (@'s never eat objects) -ENGRAVING:$place[0],burn,"Elbereth" -OBJECT:('?',"scare monster"),$place[0],cursed -# The treasure of the lord -OBJECT:('(',"chest"),(37,08) -# Traps -TRAP:"trap door",(40,08) -TRAP:"trap door",(44,08) -TRAP:"trap door",(48,08) -TRAP:"trap door",(52,08) -TRAP:"trap door",(55,08) -# Soldiers guarding the entry hall -MONSTER:('@',"soldier"),(08,06) -MONSTER:('@',"soldier"),(09,05) -MONSTER:('@',"soldier"),(11,05) -MONSTER:('@',"soldier"),(12,06) -MONSTER:('@',"soldier"),(08,10) -MONSTER:('@',"soldier"),(09,11) -MONSTER:('@',"soldier"),(11,11) -MONSTER:('@',"soldier"),(12,10) -MONSTER:('@',"lieutenant"),(09,08) -# Soldiers guarding the towers -MONSTER:('@',"soldier"),(03,02) -MONSTER:('@',"soldier"),(05,02) -MONSTER:('@',"soldier"),(57,02) -MONSTER:('@',"soldier"),(59,02) -MONSTER:('@',"soldier"),(03,14) -MONSTER:('@',"soldier"),(05,14) -MONSTER:('@',"soldier"),(57,14) -MONSTER:('@',"soldier"),(59,14) -# The four dragons that are guarding the storerooms -MONSTER:'D',(47,05) -MONSTER:'D',(47,06) -MONSTER:'D',(47,10) -MONSTER:'D',(47,11) -# Sea monsters in the moat -MONSTER:(';',"giant eel"),(05,07) -MONSTER:(';',"giant eel"),(05,09) -MONSTER:(';',"giant eel"),(57,07) -MONSTER:(';',"giant eel"),(57,09) -MONSTER:(';',"shark"),(05,00) -MONSTER:(';',"shark"),(05,16) -MONSTER:(';',"shark"),(57,00) -MONSTER:(';',"shark"),(57,16) -# The throne room and the court monsters -MONSTER:$monster[0],(27,05) -MONSTER:$monster[1],(30,05) -MONSTER:$monster[2],(33,05) -MONSTER:$monster[3],(36,05) -MONSTER:$monster[4],(28,06) -MONSTER:$monster[5],(31,06) -MONSTER:$monster[6],(34,06) -MONSTER:$monster[7],(37,06) -MONSTER:$monster[8],(27,07) -MONSTER:$monster[9],(30,07) -MONSTER:$monster[0],(33,07) -MONSTER:$monster[1],(36,07) -MONSTER:$monster[2],(28,08) -MONSTER:$monster[3],(31,08) -MONSTER:$monster[4],(34,08) -MONSTER:$monster[5],(27,09) -MONSTER:$monster[6],(30,09) -MONSTER:$monster[7],(33,09) -MONSTER:$monster[8],(36,09) -MONSTER:$monster[9],(28,10) -MONSTER:$monster[0],(31,10) -MONSTER:$monster[1],(34,10) -MONSTER:$monster[2],(37,10) -MONSTER:$monster[3],(27,11) -MONSTER:$monster[4],(30,11) -MONSTER:$monster[5],(33,11) -MONSTER:$monster[6],(36,11) -# MazeWalks -MAZEWALK:(00,10),west -MAZEWALK:(62,06),east -# Non diggable walls -NON_DIGGABLE:(00,00,62,16) -# Subrooms: -# Entire castle area -REGION:(00,00,62,16),unlit,"ordinary" -# Courtyards -REGION:(00,05,05,11),lit,"ordinary" -REGION:(57,05,62,11),lit,"ordinary" -# Throne room -REGION:(27,05,37,11),lit,"throne",unfilled -# Antechamber -REGION:(07,05,14,11),lit,"ordinary" -# Storerooms -REGION:(39,05,45,06),lit,"ordinary" -REGION:(39,10,45,11),lit,"ordinary" -REGION:(49,05,55,06),lit,"ordinary" -REGION:(49,10,55,11),lit,"ordinary" -# Corners -REGION:(02,02,06,03),lit,"ordinary" -REGION:(56,02,60,03),lit,"ordinary" -REGION:(02,13,06,14),lit,"ordinary" -REGION:(56,13,60,14),lit,"ordinary" -# Barracks -REGION:(16,05,25,06),lit,"barracks" -REGION:(16,10,25,11),lit,"barracks" -# Hallways -REGION:(08,03,54,03),unlit,"ordinary" -REGION:(08,13,54,13),unlit,"ordinary" -REGION:(16,08,25,08),unlit,"ordinary" -REGION:(39,08,55,08),unlit,"ordinary" -# Storeroom alcoves -REGION:(47,05,47,06),unlit,"ordinary" -REGION:(47,10,47,11),unlit,"ordinary" diff --git a/dat/castle.lua b/dat/castle.lua new file mode 100644 index 000000000..fcf3d25b6 --- /dev/null +++ b/dat/castle.lua @@ -0,0 +1,256 @@ +-- NetHack 3.6 castle.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- This is the stronghold level : +-- there are several ways to enter it : +-- - opening the drawbridge (wand of opening, knock spell, playing +-- the appropriate tune) +-- +-- - enter via the back entry (this suppose a ring of levitation, boots +-- of water walking, etc.) +-- +-- Note : If you don't play the right tune, you get indications like in the +-- MasterMind game... +-- +-- To motivate the player : there are 4 storerooms (armors, weapons, food and +-- gems) and a wand of wishing in one of the 4 towers... + +des.level_init({ style="mazegrid", bg ="-" }); + +des.level_flags("mazelevel", "noteleport") + +des.map([[ +}}}}}}}}}.............................................}}}}}}}}} +}-------}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}-------} +}|.....|-----------------------------------------------|.....|} +}|.....+...............................................+.....|} +}-------------------------------+-----------------------------} +}}}}}}|........|..........+...........|.......S.S.......|}}}}}} +.....}|........|..........|...........|.......|.|.......|}..... +.....}|........------------...........---------S---------}..... +.....}|...{....+..........+.........\.S.................+...... +.....}|........------------...........---------S---------}..... +.....}|........|..........|...........|.......|.|.......|}..... +}}}}}}|........|..........+...........|.......S.S.......|}}}}}} +}-------------------------------+-----------------------------} +}|.....+...............................................+.....|} +}|.....|-----------------------------------------------|.....|} +}-------}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}-------} +}}}}}}}}}.............................................}}}}}}}}} +]]); + +-- Random registers initialisation +local object = { "[", ")", "*", "%" }; +shuffle(object) + +local place = selection.new(); +place:set(04,02); +place:set(58,02); +place:set(04,14); +place:set(58,14); + +local monster = { "L", "N", "E", "H", "M", "O", "R", "T", "X", "Z" } +shuffle(monster) + +des.teleport_region({ region = {01,00,10,20}, region_islev=1, exclude={1,1,61,15}, dir="down" }) +des.teleport_region({ region = {69,00,79,20}, region_islev=1, exclude={1,1,61,15}, dir="up" }) +des.levregion({ region = {01,00,10,20}, region_islev=1, exclude={0,0,62,16}, type="stair-up" }) +des.feature("fountain", 10,08) +-- Doors +des.door("closed",07,03) +des.door("closed",55,03) +des.door("locked",32,04) +des.door("locked",26,05) +des.door("locked",46,05) +des.door("locked",48,05) +des.door("locked",47,07) +des.door("closed",15,08) +des.door("closed",26,08) +des.door("locked",38,08) +des.door("locked",56,08) +des.door("locked",47,09) +des.door("locked",26,11) +des.door("locked",46,11) +des.door("locked",48,11) +des.door("locked",32,12) +des.door("closed",07,13) +des.door("closed",55,13) +-- The drawbridge +des.drawbridge({ dir="east", state="closed", x=05,y=08}) +-- Storeroom number 1 +des.object(object[1],39,05) +des.object(object[1],40,05) +des.object(object[1],41,05) +des.object(object[1],42,05) +des.object(object[1],43,05) +des.object(object[1],44,05) +des.object(object[1],45,05) +des.object(object[1],39,06) +des.object(object[1],40,06) +des.object(object[1],41,06) +des.object(object[1],42,06) +des.object(object[1],43,06) +des.object(object[1],44,06) +des.object(object[1],45,06) +-- Storeroom number 2 +des.object(object[2],49,05) +des.object(object[2],50,05) +des.object(object[2],51,05) +des.object(object[2],52,05) +des.object(object[2],53,05) +des.object(object[2],54,05) +des.object(object[2],55,05) +des.object(object[2],49,06) +des.object(object[2],50,06) +des.object(object[2],51,06) +des.object(object[2],52,06) +des.object(object[2],53,06) +des.object(object[2],54,06) +des.object(object[2],55,06) +-- Storeroom number 3 +des.object(object[3],39,10) +des.object(object[3],40,10) +des.object(object[3],41,10) +des.object(object[3],42,10) +des.object(object[3],43,10) +des.object(object[3],44,10) +des.object(object[3],45,10) +des.object(object[3],39,11) +des.object(object[3],40,11) +des.object(object[3],41,11) +des.object(object[3],42,11) +des.object(object[3],43,11) +des.object(object[3],44,11) +des.object(object[3],45,11) +-- Storeroom number 4 +des.object(object[4],49,10) +des.object(object[4],50,10) +des.object(object[4],51,10) +des.object(object[4],52,10) +des.object(object[4],53,10) +des.object(object[4],54,10) +des.object(object[4],55,10) +des.object(object[4],49,11) +des.object(object[4],50,11) +des.object(object[4],51,11) +des.object(object[4],52,11) +des.object(object[4],53,11) +des.object(object[4],54,11) +des.object(object[4],55,11) +-- THE WAND OF WISHING in 1 of the 4 towers +local px, py = place:rndcoord(1); +des.object({ id = "chest", trapped = 0, x = px, y = py, + contents = function() + des.object("wishing"); + end +}); +-- Prevent monsters from eating it. (@'s never eat objects) +des.engraving({ x = px, y = py, type="burn", text="Elbereth" }) +des.object({ id = "scare monster", x = px, y = py, buc="cursed" }) +-- The treasure of the lord +des.object("chest",37,08) +-- Traps +des.trap("trap door",40,08) +des.trap("trap door",44,08) +des.trap("trap door",48,08) +des.trap("trap door",52,08) +des.trap("trap door",55,08) +-- Soldiers guarding the entry hall +des.monster("soldier",08,06) +des.monster("soldier",09,05) +des.monster("soldier",11,05) +des.monster("soldier",12,06) +des.monster("soldier",08,10) +des.monster("soldier",09,11) +des.monster("soldier",11,11) +des.monster("soldier",12,10) +des.monster("lieutenant",09,08) +-- Soldiers guarding the towers +des.monster("soldier",03,02) +des.monster("soldier",05,02) +des.monster("soldier",57,02) +des.monster("soldier",59,02) +des.monster("soldier",03,14) +des.monster("soldier",05,14) +des.monster("soldier",57,14) +des.monster("soldier",59,14) +-- The four dragons that are guarding the storerooms +des.monster("D",47,05) +des.monster("D",47,06) +des.monster("D",47,10) +des.monster("D",47,11) +-- Sea monsters in the moat +des.monster("giant eel",05,07) +des.monster("giant eel",05,09) +des.monster("giant eel",57,07) +des.monster("giant eel",57,09) +des.monster("shark",05,00) +des.monster("shark",05,16) +des.monster("shark",57,00) +des.monster("shark",57,16) +-- The throne room and the court monsters +des.monster(monster[10],27,05) +des.monster(monster[1],30,05) +des.monster(monster[2],33,05) +des.monster(monster[3],36,05) +des.monster(monster[4],28,06) +des.monster(monster[5],31,06) +des.monster(monster[6],34,06) +des.monster(monster[7],37,06) +des.monster(monster[8],27,07) +des.monster(monster[9],30,07) +des.monster(monster[10],33,07) +des.monster(monster[1],36,07) +des.monster(monster[2],28,08) +des.monster(monster[3],31,08) +des.monster(monster[4],34,08) +des.monster(monster[5],27,09) +des.monster(monster[6],30,09) +des.monster(monster[7],33,09) +des.monster(monster[8],36,09) +des.monster(monster[9],28,10) +des.monster(monster[10],31,10) +des.monster(monster[1],34,10) +des.monster(monster[2],37,10) +des.monster(monster[3],27,11) +des.monster(monster[4],30,11) +des.monster(monster[5],33,11) +des.monster(monster[6],36,11) +-- MazeWalks +des.mazewalk(00,10,"west") +des.mazewalk(62,06,"east") +-- Non diggable walls +des.non_diggable(selection.area(00,00,62,16)) +-- Subrooms: +-- Entire castle area +des.region(selection.area(00,00,62,16),"unlit") +-- Courtyards +des.region(selection.area(00,05,05,11),"lit") +des.region(selection.area(57,05,62,11),"lit") +-- Throne room +des.region({ region={27,05, 37,11},lit=1,type="throne", prefilled=1 }) +-- Antechamber +des.region(selection.area(07,05,14,11),"lit") +-- Storerooms +des.region(selection.area(39,05,45,06),"lit") +des.region(selection.area(39,10,45,11),"lit") +des.region(selection.area(49,05,55,06),"lit") +des.region(selection.area(49,10,55,11),"lit") +-- Corners +des.region(selection.area(02,02,06,03),"lit") +des.region(selection.area(56,02,60,03),"lit") +des.region(selection.area(02,13,06,14),"lit") +des.region(selection.area(56,13,60,14),"lit") +-- Barracks +des.region({ region={16,05, 25,06},lit=1,type="barracks", prefilled=0 }) +des.region({ region={16,10, 25,11},lit=1,type="barracks", prefilled=0 }) +-- Hallways +des.region(selection.area(08,03,54,03),"unlit") +des.region(selection.area(08,13,54,13),"unlit") +des.region(selection.area(16,08,25,08),"unlit") +des.region(selection.area(39,08,55,08),"unlit") +-- Storeroom alcoves +des.region(selection.area(47,05,47,06),"unlit") +des.region(selection.area(47,10,47,11),"unlit") diff --git a/dat/earth.lua b/dat/earth.lua new file mode 100644 index 000000000..62cb6da32 --- /dev/null +++ b/dat/earth.lua @@ -0,0 +1,130 @@ +-- NetHack 3.6 endgame.des $NHDT-Date: 1546303680 2019/01/01 00:48:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.14 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1992,1993 by Izchak Miller, David Cohrs, +-- and Timo Hakulinen +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- These are the ENDGAME levels: earth, air, fire, water, and astral. +-- The top-most level, the Astral Level, has 3 temples and shrines. +-- Players are supposed to sacrifice the Amulet of Yendor on the appropriate +-- shrine. + +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "shortsighted") + +des.message("Well done, mortal!") +des.message("But now thou must face the final Test...") +des.message("Prove thyself worthy or perish!") + +-- The player lands, upon arrival, in the +-- lower-right cavern. The location of the +-- portal to the next level is randomly chosen. +-- This map has no visible outer boundary, and +-- is mostly diggable "rock". +des.map([[ + + ... + .... .. + ..... ... .. + .... .... ... + .... ... .... ... . + .. .. ....... . .. + .. ... . + . .. . ... + .. .. . .. . + .. ... . + ... ... + .. ... .. + .... .. + .. ... + .. ..... + ... ... + .... + .. + +]]); + +des.replace_terrain({ region={0,0, 75,19}, fromterrain=" ", toterrain=".", lit=0, chance=5 }) + +-- Since there are no stairs, this forces the hero's initial placement +des.teleport_region({region = {69,16,69,16} }) +des.levregion({ region = {0,0,75,19}, exclude = {65,13,75,19}, type="portal", name="air" }) +-- Some helpful monsters. Making sure a +-- pick axe and at least one wand of digging +-- are available. +des.monster("Elvenking", 67,16) +des.monster("minotaur", 67,14) +-- An assortment of earth-appropriate nasties +-- in each cavern. +des.monster({ id = "earth elemental", x = 52, y = 13, peaceful = 0 }) +des.monster({ id = "earth elemental", x = 53, y = 13, peaceful = 0 }) +des.monster("rock troll", 53,12) +des.monster("stone giant", 54,12) +-- +des.monster("pit viper", 70,05) +des.monster("barbed devil", 69,06) +des.monster("stone giant", 69,08) +des.monster("stone golem", 71,08) +des.monster("pit fiend", 70,09) +des.monster({ id = "earth elemental", x = 70, y = 08, peaceful = 0 }) +-- +des.monster({ id = "earth elemental", x = 60, y = 03, peaceful = 0 }) +des.monster("stone giant", 61,04) +des.monster({ id = "earth elemental", x = 62, y = 04, peaceful = 0 }) +des.monster({ id = "earth elemental", x = 61, y = 05, peaceful = 0 }) +des.monster("scorpion", 62,05) +des.monster("rock piercer", 63,05) +-- +des.monster("umber hulk", 40,05) +des.monster("dust vortex", 42,05) +des.monster("rock troll", 38,06) +des.monster({ id = "earth elemental", x = 39, y = 06, peaceful = 0 }) +des.monster({ id = "earth elemental", x = 41, y = 06, peaceful = 0 }) +des.monster({ id = "earth elemental", x = 38, y = 07, peaceful = 0 }) +des.monster("stone giant", 39,07) +des.monster({ id = "earth elemental", x = 43, y = 07, peaceful = 0 }) +des.monster("stone golem", 37,08) +des.monster("pit viper", 43,08) +des.monster("pit viper", 43,09) +des.monster("rock troll", 44,10) +-- +des.monster({ id = "earth elemental", x = 02, y = 01, peaceful = 0 }) +des.monster({ id = "earth elemental", x = 03, y = 01, peaceful = 0 }) +des.monster("stone golem", 01,02) +des.monster({ id = "earth elemental", x = 02, y = 02, peaceful = 0 }) +des.monster("rock troll", 04,03) +des.monster("rock troll", 03,03) +des.monster("pit fiend", 03,04) +des.monster({ id = "earth elemental", x = 04, y = 05, peaceful = 0 }) +des.monster("pit viper", 05,06) +-- +des.monster({ id = "earth elemental", x = 21, y = 02, peaceful = 0 }) +des.monster({ id = "earth elemental", x = 21, y = 03, peaceful = 0 }) +des.monster("minotaur", 21,04) +des.monster({ id = "earth elemental", x = 21, y = 05, peaceful = 0 }) +des.monster("rock troll", 22,05) +des.monster({ id = "earth elemental", x = 22, y = 06, peaceful = 0 }) +des.monster({ id = "earth elemental", x = 23, y = 06, peaceful = 0 }) +-- +des.monster("pit viper", 14,08) +des.monster("barbed devil", 14,09) +des.monster({ id = "earth elemental", x = 13, y = 10, peaceful = 0 }) +des.monster("rock troll", 12,11) +des.monster({ id = "earth elemental", x = 14, y = 12, peaceful = 0 }) +des.monster({ id = "earth elemental", x = 15, y = 13, peaceful = 0 }) +des.monster("stone giant", 17,13) +des.monster("stone golem", 18,13) +des.monster("pit fiend", 18,12) +des.monster({ id = "earth elemental", x = 18, y = 11, peaceful = 0 }) +des.monster({ id = "earth elemental", x = 18, y = 10, peaceful = 0 }) +-- +des.monster("barbed devil", 02,16) +des.monster({ id = "earth elemental", x = 03, y = 16, peaceful = 0 }) +des.monster("rock troll", 02,17) +des.monster({ id = "earth elemental", x = 04, y = 17, peaceful = 0 }) +des.monster({ id = "earth elemental", x = 04, y = 18, peaceful = 0 }) + +des.object("boulder") + diff --git a/dat/endgame.des b/dat/endgame.des deleted file mode 100644 index ebd9049bd..000000000 --- a/dat/endgame.des +++ /dev/null @@ -1,655 +0,0 @@ -# NetHack 3.6 endgame.des $NHDT-Date: 1546303680 2019/01/01 00:48:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.14 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1992,1993 by Izchak Miller, David Cohrs, -# and Timo Hakulinen -# NetHack may be freely redistributed. See license for details. -# -# These are the ENDGAME levels: earth, air, fire, water, and astral. -# The top-most level, the Astral Level, has 3 temples and shrines. -# Players are supposed to sacrifice the Amulet of Yendor on the appropriate -# shrine. - -MAZE:"earth",' ' -FLAGS: noteleport,hardfloor,shortsighted -MESSAGE: "Well done, mortal!" -MESSAGE: "But now thou must face the final Test..." -MESSAGE: "Prove thyself worthy or perish!" - -GEOMETRY:center,center -# The player lands, upon arrival, in the -# lower-right cavern. The location of the -# portal to the next level is randomly chosen. -# This map has no visible outer boundary, and -# is mostly diggable "rock". -MAP - - ... - .... .. - ..... ... .. - .... .... ... - .... ... .... ... . - .. .. ....... . .. - .. ... . - . .. . ... - .. .. . .. . - .. ... . - ... ... - .. ... .. - .... .. - .. ... - .. ..... - ... ... - .... - .. - -ENDMAP - -REPLACE_TERRAIN:(0,0,75,19), ' ', ('.', unlit), 5% - -# Since there are no stairs, this forces the hero's initial placement -TELEPORT_REGION:(69,16,69,16),(0,0,0,0) -PORTAL:(0,0,75,19),(65,13,75,19),"air" -# Some helpful monsters. Making sure a -# pick axe and at least one wand of digging -# are available. -MONSTER:('@',"Elvenking"),(67,16) -MONSTER:('H',"minotaur"),(67,14) -# An assortment of earth-appropriate nasties -# in each cavern. -MONSTER:('E',"earth elemental"),(52,13),hostile -MONSTER:('E',"earth elemental"),(53,13),hostile -MONSTER:('T',"rock troll"),(53,12) -MONSTER:('H',"stone giant"),(54,12) -# -MONSTER:('S',"pit viper"),(70,05) -MONSTER:('&',"barbed devil"),(69,06) -MONSTER:('H',"stone giant"),(69,08) -MONSTER:(''',"stone golem"),(71,08) -MONSTER:('&',"pit fiend"),(70,09) -MONSTER:('E',"earth elemental"),(70,08),hostile -# -MONSTER:('E',"earth elemental"),(60,03),hostile -MONSTER:('H',"stone giant"),(61,04) -MONSTER:('E',"earth elemental"),(62,04),hostile -MONSTER:('E',"earth elemental"),(61,05),hostile -MONSTER:('s',"scorpion"),(62,05) -MONSTER:('p',"rock piercer"),(63,05) -# -MONSTER:('U',"umber hulk"),(40,05) -MONSTER:('v',"dust vortex"),(42,05) -MONSTER:('T',"rock troll"),(38,06) -MONSTER:('E',"earth elemental"),(39,06),hostile -MONSTER:('E',"earth elemental"),(41,06),hostile -MONSTER:('E',"earth elemental"),(38,07),hostile -MONSTER:('H',"stone giant"),(39,07) -MONSTER:('E',"earth elemental"),(43,07),hostile -MONSTER:(''',"stone golem"),(37,08) -MONSTER:('S',"pit viper"),(43,08) -MONSTER:('S',"pit viper"),(43,09) -MONSTER:('T',"rock troll"),(44,10) -# -MONSTER:('E',"earth elemental"),(02,01),hostile -MONSTER:('E',"earth elemental"),(03,01),hostile -MONSTER:(''',"stone golem"),(01,02) -MONSTER:('E',"earth elemental"),(02,02),hostile -MONSTER:('T',"rock troll"),(04,03) -MONSTER:('T',"rock troll"),(03,03) -MONSTER:('&',"pit fiend"),(03,04) -MONSTER:('E',"earth elemental"),(04,05),hostile -MONSTER:('S',"pit viper"),(05,06) -# -MONSTER:('E',"earth elemental"),(21,02),hostile -MONSTER:('E',"earth elemental"),(21,03),hostile -MONSTER:('H',"minotaur"),(21,04) -MONSTER:('E',"earth elemental"),(21,05),hostile -MONSTER:('T',"rock troll"),(22,05) -MONSTER:('E',"earth elemental"),(22,06),hostile -MONSTER:('E',"earth elemental"),(23,06),hostile -# -MONSTER:('S',"pit viper"),(14,08) -MONSTER:('&',"barbed devil"),(14,09) -MONSTER:('E',"earth elemental"),(13,10),hostile -MONSTER:('T',"rock troll"),(12,11) -MONSTER:('E',"earth elemental"),(14,12),hostile -MONSTER:('E',"earth elemental"),(15,13),hostile -MONSTER:('H',"stone giant"),(17,13) -MONSTER:(''',"stone golem"),(18,13) -MONSTER:('&',"pit fiend"),(18,12) -MONSTER:('E',"earth elemental"),(18,11),hostile -MONSTER:('E',"earth elemental"),(18,10),hostile -# -MONSTER:('&',"barbed devil"),(02,16) -MONSTER:('E',"earth elemental"),(03,16),hostile -MONSTER:('T',"rock troll"),(02,17) -MONSTER:('E',"earth elemental"),(04,17),hostile -MONSTER:('E',"earth elemental"),(04,18),hostile - -OBJECT:('`',"boulder"),random - - -MAZE:"air",' ' -FLAGS: noteleport,hardfloor,shortsighted -# The following messages are somewhat obtuse, to make then -# equally meaningful if the player can see or not. -MESSAGE: "What a strange feeling!" -MESSAGE: "You notice that there is no gravity here." -GEOMETRY:center,center -# The player lands, upon arrival, in the -# lower-left area. The location of the -# portal to the next level is randomly chosen. -# This map has no visible outer boundary, and -# is all "air". -MAP -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -ENDMAP -# Use up and down regions to partition the level into three parts; -# teleportation can't cross from one part into another. -# The up region is where you'll arrive after activating the portal from -# the preceding level; the exit portal is placed inside the down region. -TELEPORT_REGION:levregion(01,00,24,20),levregion(25,00,79,20),up -TELEPORT_REGION:levregion(56,00,79,20),levregion(01,00,55,20),down -PORTAL:levregion(57,01,78,19),(0,0,0,0),"fire" -REGION:(00,00,75,19),lit,"ordinary" -MONSTER:('E',"air elemental"),random,hostile -MONSTER:('E',"air elemental"),random,hostile -MONSTER:('E',"air elemental"),random,hostile -MONSTER:('E',"air elemental"),random,hostile -MONSTER:('E',"air elemental"),random,hostile -MONSTER:('E',"air elemental"),random,hostile -MONSTER:('E',"air elemental"),random,hostile -MONSTER:('E',"air elemental"),random,hostile -MONSTER:('E',"air elemental"),random,hostile -MONSTER:('E',"air elemental"),random,hostile -MONSTER:('E',"air elemental"),random,hostile - -MONSTER:('e',"floating eye"),random,hostile -MONSTER:('e',"floating eye"),random,hostile -MONSTER:('e',"floating eye"),random,hostile - -MONSTER:('y',"yellow light"),random,hostile -MONSTER:('y',"yellow light"),random,hostile -MONSTER:('y',"yellow light"),random,hostile - -MONSTER:('A',"couatl"),random - -MONSTER:'D',random -MONSTER:'D',random -MONSTER:'D',random -MONSTER:'D',random -MONSTER:'D',random - -MONSTER:'E',random -MONSTER:'E',random -MONSTER:'E',random -MONSTER:'J',random -MONSTER:'J',random - -MONSTER:('&',"djinni"),random,hostile -MONSTER:('&',"djinni"),random,hostile -MONSTER:('&',"djinni"),random,hostile - -MONSTER:('v',"fog cloud"),random,hostile -MONSTER:('v',"fog cloud"),random,hostile -MONSTER:('v',"fog cloud"),random,hostile -MONSTER:('v',"fog cloud"),random,hostile -MONSTER:('v',"fog cloud"),random,hostile -MONSTER:('v',"fog cloud"),random,hostile -MONSTER:('v',"fog cloud"),random,hostile -MONSTER:('v',"fog cloud"),random,hostile -MONSTER:('v',"fog cloud"),random,hostile -MONSTER:('v',"energy vortex"),random,hostile -MONSTER:('v',"energy vortex"),random,hostile -MONSTER:('v',"energy vortex"),random,hostile -MONSTER:('v',"energy vortex"),random,hostile -MONSTER:('v',"energy vortex"),random,hostile -MONSTER:('v',"steam vortex"),random,hostile -MONSTER:('v',"steam vortex"),random,hostile -MONSTER:('v',"steam vortex"),random,hostile -MONSTER:('v',"steam vortex"),random,hostile -MONSTER:('v',"steam vortex"),random,hostile - - -MAZE:"fire",' ' -FLAGS: noteleport,hardfloor,shortsighted -GEOMETRY:center,center -# The player lands, upon arrival, in the -# lower-right. The location of the -# portal to the next level is randomly chosen. -# This map has no visible outer boundary, and -# is mostly open area, with lava lakes and bunches of fire traps. -MAP -............................................................................ -....LLLLLLLL............L.......................LLL......................... -...LL...................L......................LLLL................LL....... -...L.............LLLL...LL....LL...............LLLLL.............LLL........ -.LLLL..............LL....L.....LLL..............LLLL..............LLLL...... -..........LLLL...LLLL...LLL....LLL......L........LLLL....LL........LLL...... -........LLLLLLL...LL.....L......L......LL.........LL......LL........LL...L.. -........LL..LLL..LL......LL......LLLL..L.........LL......LLL............LL.. -....L..LL....LLLLL.................LLLLLLL.......L......LL............LLLLLL -....L..L.....LL.LLLL.......L............L........LLLLL.LL......LL.........LL -....LL........L...LL......LL.............LLL.....L...LLL.......LLL.........L -.....LLLLLL........L.......LLL.............L....LL...L.LLL......LLLLLLL..... -..........LLLL............LL.L.............L....L...LL.........LLL..LLL..... -...........................LLLLL...........LL...L...L........LLLL..LLLLLL... -.....LLLL.............LL....LL.......LLL...LL.......L..LLL....LLLLLLL....... -.......LLL.........LLLLLLLLLLL......LLLLL...L...........LL...LL...LL........ -.........LL.......LL.........LL.......LLL....L..LLL....LL.........LL........ -..........LLLLLLLLL...........LL....LLL.......LLLLL.....LL........LL........ -.................L.............LLLLLL............LL...LLLL.........LL....... -.................................LL....................LL................... -ENDMAP -TELEPORT_REGION:(69,16,69,16),(0,0,0,0) -PORTAL:(0,0,75,19),(65,13,75,19),"water" - -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -TRAP:"fire",random -# An assortment of fire-appropriate nasties -MONSTER:('D',"red dragon"),random -MONSTER:('&',"balrog"),random -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('v',"fire vortex"),random -MONSTER:('d',"hell hound"),random -# -MONSTER:('H',"fire giant"),random -MONSTER:('&',"barbed devil"),random -MONSTER:('d',"hell hound"),random -MONSTER:(''',"stone golem"),random -MONSTER:('&',"pit fiend"),random -MONSTER:('E',"fire elemental"),random,hostile -# -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('d',"hell hound"),random -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('s',"scorpion"),random -MONSTER:('H',"fire giant"),random -# -MONSTER:('d',"hell hound"),random -MONSTER:('v',"dust vortex"),random -MONSTER:('v',"fire vortex"),random -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('d',"hell hound"),random -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:(''',"stone golem"),random -MONSTER:('S',"pit viper"),random -MONSTER:('S',"pit viper"),random -MONSTER:('v',"fire vortex"),random -# -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('H',"fire giant"),random -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('v',"fire vortex"),random -MONSTER:('v',"fire vortex"),random -MONSTER:('&',"pit fiend"),random -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('S',"pit viper"),random -# -MONSTER:(':',"salamander"),random,hostile -MONSTER:(':',"salamander"),random,hostile -MONSTER:('H',"minotaur"),random -MONSTER:(':',"salamander"),random,hostile -MONSTER:('v',"steam vortex"),random -MONSTER:(':',"salamander"),random,hostile -MONSTER:(':',"salamander"),random,hostile -# -MONSTER:('H',"fire giant"),random -MONSTER:('&',"barbed devil"),random -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('v',"fire vortex"),random -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('d',"hell hound"),random -MONSTER:('H',"fire giant"),random -MONSTER:('&',"pit fiend"),random -MONSTER:('E',"fire elemental"),random,hostile -MONSTER:('E',"fire elemental"),random,hostile -# -MONSTER:('&',"barbed devil"),random -MONSTER:(':',"salamander"),random,hostile -MONSTER:('v',"steam vortex"),random -MONSTER:(':',"salamander"),random,hostile -MONSTER:(':',"salamander"),random,hostile - -OBJECT:('`',"boulder"),random -OBJECT:('`',"boulder"),random -OBJECT:('`',"boulder"),random -OBJECT:('`',"boulder"),random -OBJECT:('`',"boulder"),random - - -MAZE:"water",' ' -FLAGS: noteleport,hardfloor,shortsighted -MESSAGE: "You find yourself suspended in an air bubble surrounded by water." -GEOMETRY:center,center -# The player lands upon arrival to an air bubble -# within the leftmost third of the level. The -# portal to the next level is randomly located in an air -# bubble within the rightmost third of the level. -# Bubbles are generated by special code in mkmaze.c for now. -MAP -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -ENDMAP -TELEPORT_REGION:(0,0,25,19),(0,0,0,0) -PORTAL:(51,0,75,19),(0,0,0,0),"astral" -# A fisherman's dream... -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"electric eel"),random -MONSTER:(';',"kraken"),random -MONSTER:(';',"kraken"),random -MONSTER:(';',"kraken"),random -MONSTER:(';',"kraken"),random -MONSTER:(';',"kraken"),random -MONSTER:(';',"kraken"),random -MONSTER:(';',"kraken"),random -MONSTER:(';',"kraken"),random -MONSTER:(';',"kraken"),random -MONSTER:(';',"shark"),random -MONSTER:(';',"shark"),random -MONSTER:(';',"shark"),random -MONSTER:(';',"shark"),random -MONSTER:(';',"piranha"),random -MONSTER:(';',"piranha"),random -MONSTER:(';',"piranha"),random -MONSTER:(';',"piranha"),random -MONSTER:(';',"jellyfish"),random -MONSTER:(';',"jellyfish"),random -MONSTER:(';',"jellyfish"),random -MONSTER:(';',"jellyfish"),random -MONSTER:';',random -MONSTER:';',random -MONSTER:';',random -MONSTER:';',random -# These guys feel like home here -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile -MONSTER:('E',"water elemental"),random,hostile - - -MAZE:"astral",' ' -FLAGS: noteleport,hardfloor,nommap,shortsighted,solidify -MESSAGE: "You arrive on the Astral Plane!" -MESSAGE: "Here the High Temple of %d is located." -MESSAGE: "You sense alarm, hostility, and excitement in the air!" -GEOMETRY:center,center -MAP - --------------- - |.............| - |..---------..| - |..|.......|..| ---------------- |..|.......|..| --------------- -|.............| |..|.......|..| |.............| -|..---------..-| |-------| |..|.......|..| |-------| |-..---------..| -|..|.......|...-| |-.......-| |..|.......|..| |-.......-| |-...|.......|..| -|..|.......|....-|-.........-||..----+----..||-.........-|-....|.......|..| -|..|.......+.....+...........||.............||...........+.....+.......|..| -|..|.......|....-|-.........-|--|.........|--|-.........-|-....|.......|..| -|..|.......|...-| |-.......-| -|---+---|- |-.......-| |-...|.......|..| -|..---------..-| |---+---| |-.......-| |---+---| |-..---------..| -|.............| |...|-----|-.........-|-----|...| |.............| ---------------- |.........|...........|.........| --------------- - -------...|-.........-|...------- - |....|-.......-|....| - ---...|---+---|...--- - |...............| - ----------------- -ENDMAP - -# chance to alter above map and turn the wings of the bottom-center into -# a pair of big (5x15) rooms -$loopindx = 0 -LOOP [2] { - $loopindx = $loopindx + 1 -# 3.6.[01]: 75% chance that both sides opened up, 25% that neither did; -# 3.6.2: 60% twice == 36% chance that both sides open up, 24% left side -# only, 24% right side only, 16% that neither side opens up - IF [60%] { - IF [$loopindx == 1] { - TERRAIN:fillrect (17,14, 30,18),'.' - WALLIFY -# temporarily close off the area to be filled so that it doesn't cover -# the entire entry area - TERRAIN:(33,18), '|' - $hall = selection:floodfill(30,16) -# re-connect the opened wing with the rest of the map - TERRAIN:(33,18), '.' - } ELSE { - TERRAIN:fillrect (44,14, 57,18),'.' - WALLIFY - TERRAIN:(41,18), '|' - $hall = selection:floodfill(44,16) - TERRAIN:(41,18), '.' - } -# extra monsters; was [6 + 3d4] when both wings were opened up at once - LOOP [3 + 2d3] { - MONSTER:('A',"Angel"),rndcoord($hall),noalign,hostile - [50%]: MONSTER:random,rndcoord($hall),hostile - } - } -} - -# Rider locations -$place = { (23,9),(37,14),(51,9) } -SHUFFLE: $place - -# Where the player will land on arrival -TELEPORT_REGION:(29,15,45,15),(30,15,44,15) -# Lit courts -REGION:(01,05,16,14),lit,"ordinary",filled,irregular -REGION:(31,01,44,10),lit,"ordinary",filled,irregular -REGION:(61,05,74,14),lit,"ordinary",filled,irregular -# A Sanctum for each alignment -# The shrines' alignments are shuffled for -# each game -REGION:(04,07,10,11),lit,"temple" -REGION:(34,03,40,07),lit,"temple" -REGION:(64,07,70,11),lit,"temple" -ALTAR:(07,09),align[0],sanctum -ALTAR:(37,05),align[1],sanctum -ALTAR:(67,09),align[2],sanctum -# Doors -DOOR:closed,(11,09) -DOOR:closed,(17,09) -DOOR:locked,(23,12) -DOOR:locked,(37,08) -DOOR:closed,(37,11) -DOOR:closed,(37,17) -DOOR:locked,(51,12) -DOOR:locked,(57,09) -DOOR:closed,(63,09) -# Non diggable and phazeable everywhere -NON_DIGGABLE:(00,00,74,19) -NON_PASSWALL:(00,00,74,19) -# Moloch's horde -# West round room -MONSTER:('@',"aligned priest"),(18,09),noalign,hostile -MONSTER:('@',"aligned priest"),(19,08),noalign,hostile -MONSTER:('@',"aligned priest"),(19,09),noalign,hostile -MONSTER:('@',"aligned priest"),(19,10),noalign,hostile -MONSTER:('A',"Angel"),(20,09),noalign,hostile -MONSTER:('A',"Angel"),(20,10),noalign,hostile -MONSTER:('&',"Pestilence"),$place[0],hostile -# South-central round room -MONSTER:('@',"aligned priest"),(36,12),noalign,hostile -MONSTER:('@',"aligned priest"),(37,12),noalign,hostile -MONSTER:('@',"aligned priest"),(38,12),noalign,hostile -MONSTER:('@',"aligned priest"),(36,13),noalign,hostile -MONSTER:('A',"Angel"),(38,13),noalign,hostile -MONSTER:('A',"Angel"),(37,13),noalign,hostile -MONSTER:('&',"Death"),$place[1],hostile -# East round room -MONSTER:('@',"aligned priest"),(56,09),noalign,hostile -MONSTER:('@',"aligned priest"),(55,08),noalign,hostile -MONSTER:('@',"aligned priest"),(55,09),noalign,hostile -MONSTER:('@',"aligned priest"),(55,10),noalign,hostile -MONSTER:('A',"Angel"),(54,09),noalign,hostile -MONSTER:('A',"Angel"),(54,10),noalign,hostile -MONSTER:('&',"Famine"),$place[2],hostile -# -# The aligned horde -# -# We do not know in advance the alignment of the -# player. The mpeaceful bit will need resetting -# when the level is created. The setting here is -# but a place holder. -# -# West court -MONSTER:('@',"aligned priest"),(12,07),chaos,hostile -MONSTER:('@',"aligned priest"),(13,07),chaos,peaceful -MONSTER:('@',"aligned priest"),(14,07),law,hostile -MONSTER:('@',"aligned priest"),(12,11),law,peaceful -MONSTER:('@',"aligned priest"),(13,11),neutral,hostile -MONSTER:('@',"aligned priest"),(14,11),neutral,peaceful -MONSTER:('A',"Angel"),(11,05),chaos,hostile -MONSTER:('A',"Angel"),(12,05),chaos,peaceful -MONSTER:('A',"Angel"),(13,05),law,hostile -MONSTER:('A',"Angel"),(11,13),law,peaceful -MONSTER:('A',"Angel"),(12,13),neutral,hostile -MONSTER:('A',"Angel"),(13,13),neutral,peaceful -# Central court -MONSTER:('@',"aligned priest"),(32,09),chaos,hostile -MONSTER:('@',"aligned priest"),(33,09),chaos,peaceful -MONSTER:('@',"aligned priest"),(34,09),law,hostile -MONSTER:('@',"aligned priest"),(40,09),law,peaceful -MONSTER:('@',"aligned priest"),(41,09),neutral,hostile -MONSTER:('@',"aligned priest"),(42,09),neutral,peaceful -MONSTER:('A',"Angel"),(31,08),chaos,hostile -MONSTER:('A',"Angel"),(32,08),chaos,peaceful -MONSTER:('A',"Angel"),(31,09),law,hostile -MONSTER:('A',"Angel"),(42,08),law,peaceful -MONSTER:('A',"Angel"),(43,08),neutral,hostile -MONSTER:('A',"Angel"),(43,09),neutral,peaceful -# East court -MONSTER:('@',"aligned priest"),(60,07),chaos,hostile -MONSTER:('@',"aligned priest"),(61,07),chaos,peaceful -MONSTER:('@',"aligned priest"),(62,07),law,hostile -MONSTER:('@',"aligned priest"),(60,11),law,peaceful -MONSTER:('@',"aligned priest"),(61,11),neutral,hostile -MONSTER:('@',"aligned priest"),(62,11),neutral,peaceful -MONSTER:('A',"Angel"),(61,05),chaos,hostile -MONSTER:('A',"Angel"),(62,05),chaos,peaceful -MONSTER:('A',"Angel"),(63,05),law,hostile -MONSTER:('A',"Angel"),(61,13),law,peaceful -MONSTER:('A',"Angel"),(62,13),neutral,hostile -MONSTER:('A',"Angel"),(63,13),neutral,peaceful -# -# Assorted nasties -MONSTER:'L',random,hostile -MONSTER:'L',random,hostile -MONSTER:'L',random,hostile -MONSTER:'V',random,hostile -MONSTER:'V',random,hostile -MONSTER:'V',random,hostile -MONSTER:'D',random,hostile -MONSTER:'D',random,hostile -MONSTER:'D',random,hostile diff --git a/dat/fakewiz1.lua b/dat/fakewiz1.lua new file mode 100644 index 000000000..856ac3161 --- /dev/null +++ b/dat/fakewiz1.lua @@ -0,0 +1,35 @@ +-- 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"); + +des.map([[ +......... +.}}}}}}}. +.}}---}}. +.}--.--}. +.}|...|}. +.}--.--}. +.}}---}}. +.}}}}}}}. +]]); +des.levregion({ region={01,00,79,20}, region_islev=1, exclude={0,0,8,7}, type="stair-up" }) +des.levregion({ region={01,00,79,20}, region_islev=1, exclude={0,0,8,7}, type="stair-down" }) +des.levregion({ region={01,00,79,20}, region_islev=1, exclude={0,0,8,7}, type="branch" }); +des.teleport_region({ region={01,00,79,20}, region_islev=1,exclude={2,2,6,6} }) +des.levregion({ region={4,4,4,4}, type="portal", name="wizard3" }) +des.mazewalk(08,05,"east") +des.region({ region={04,03,06,06},lit=0,type="ordinary",prefilled=0,irregular=1 }) +des.monster("L",04,04) +des.monster("vampire lord",03,04) +des.monster("kraken",06,06) +-- And to make things a little harder. +des.trap("board",04,03) +des.trap("board",04,05) +des.trap("board",03,04) +des.trap("board",05,04) + diff --git a/dat/fakewiz2.lua b/dat/fakewiz2.lua new file mode 100644 index 000000000..d8f73abb3 --- /dev/null +++ b/dat/fakewiz2.lua @@ -0,0 +1,35 @@ +-- 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"); + +des.map([[ +......... +.}}}}}}}. +.}}---}}. +.}--.--}. +.}|...|}. +.}--.--}. +.}}---}}. +.}}}}}}}. +]]); +des.levregion({ region={01,00,79,20}, region_islev=1, exclude={0,0,8,7}, type="stair-up" }) +des.levregion({ region={01,00,79,20}, region_islev=1, exclude={0,0,8,7}, type="stair-down" }) +des.levregion({ region={01,00,79,20}, region_islev=1, exclude={0,0,8,7}, type="branch" }); +des.teleport_region({ region={01,00,79,20}, region_islev=1,exclude={2,2,6,6} }) +des.mazewalk(08,05,"east") +des.region({ region={04,03,06,06},lit=0,type="ordinary",prefilled=0,irregular=1 }) +des.monster("L",04,04) +des.monster("vampire lord",03,04) +des.monster("kraken",06,06) +-- And to make things a little harder. +des.trap("board",04,03) +des.trap("board",04,05) +des.trap("board",03,04) +des.trap("board",05,04) +-- treasures +des.object("\"",04,04) diff --git a/dat/fire.lua b/dat/fire.lua new file mode 100644 index 000000000..105ca0fd0 --- /dev/null +++ b/dat/fire.lua @@ -0,0 +1,156 @@ +-- NetHack 3.6 endgame.des $NHDT-Date: 1546303680 2019/01/01 00:48:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.14 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1992,1993 by Izchak Miller, David Cohrs, +-- and Timo Hakulinen +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "shortsighted") +-- The player lands, upon arrival, in the +-- lower-right. The location of the +-- portal to the next level is randomly chosen. +-- This map has no visible outer boundary, and +-- is mostly open area, with lava lakes and bunches of fire traps. +des.map([[ +............................................................................ +....LLLLLLLL............L.......................LLL......................... +...LL...................L......................LLLL................LL....... +...L.............LLLL...LL....LL...............LLLLL.............LLL........ +.LLLL..............LL....L.....LLL..............LLLL..............LLLL...... +..........LLLL...LLLL...LLL....LLL......L........LLLL....LL........LLL...... +........LLLLLLL...LL.....L......L......LL.........LL......LL........LL...L.. +........LL..LLL..LL......LL......LLLL..L.........LL......LLL............LL.. +....L..LL....LLLLL.................LLLLLLL.......L......LL............LLLLLL +....L..L.....LL.LLLL.......L............L........LLLLL.LL......LL.........LL +....LL........L...LL......LL.............LLL.....L...LLL.......LLL.........L +.....LLLLLL........L.......LLL.............L....LL...L.LLL......LLLLLLL..... +..........LLLL............LL.L.............L....L...LL.........LLL..LLL..... +...........................LLLLL...........LL...L...L........LLLL..LLLLLL... +.....LLLL.............LL....LL.......LLL...LL.......L..LLL....LLLLLLL....... +.......LLL.........LLLLLLLLLLL......LLLLL...L...........LL...LL...LL........ +.........LL.......LL.........LL.......LLL....L..LLL....LL.........LL........ +..........LLLLLLLLL...........LL....LLL.......LLLLL.....LL........LL........ +.................L.............LLLLLL............LL...LLLL.........LL....... +.................................LL....................LL................... +]]); +des.teleport_region({ region = {69,16,69,16} }) +des.levregion({ region = {0,0,75,19}, exclude = {65,13,75,19}, type="portal", name="water" }) + +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("fire") +-- An assortment of fire-appropriate nasties +des.monster("red dragon") +des.monster("balrog") +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster("fire vortex") +des.monster("hell hound") +-- +des.monster("fire giant") +des.monster("barbed devil") +des.monster("hell hound") +des.monster("stone golem") +des.monster("pit fiend") +des.monster({ id = "fire elemental", peaceful = 0 }) +-- +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster("hell hound") +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster("scorpion") +des.monster("fire giant") +-- +des.monster("hell hound") +des.monster("dust vortex") +des.monster("fire vortex") +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster("hell hound") +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster("stone golem") +des.monster("pit viper") +des.monster("pit viper") +des.monster("fire vortex") +-- +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster("fire giant") +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster("fire vortex") +des.monster("fire vortex") +des.monster("pit fiend") +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster("pit viper") +-- +des.monster({ id = "salamander", peaceful = 0 }) +des.monster({ id = "salamander", peaceful = 0 }) +des.monster("minotaur") +des.monster({ id = "salamander", peaceful = 0 }) +des.monster("steam vortex") +des.monster({ id = "salamander", peaceful = 0 }) +des.monster({ id = "salamander", peaceful = 0 }) +-- +des.monster("fire giant") +des.monster("barbed devil") +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster("fire vortex") +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster("hell hound") +des.monster("fire giant") +des.monster("pit fiend") +des.monster({ id = "fire elemental", peaceful = 0 }) +des.monster({ id = "fire elemental", peaceful = 0 }) +-- +des.monster("barbed devil") +des.monster({ id = "salamander", peaceful = 0 }) +des.monster("steam vortex") +des.monster({ id = "salamander", peaceful = 0 }) +des.monster({ id = "salamander", peaceful = 0 }) + +des.object("boulder") +des.object("boulder") +des.object("boulder") +des.object("boulder") +des.object("boulder") + diff --git a/dat/gehennom.des b/dat/gehennom.des deleted file mode 100644 index 65fab4e28..000000000 --- a/dat/gehennom.des +++ /dev/null @@ -1,713 +0,0 @@ -# NetHack 3.6 gehennom.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ -# 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. -# - -MAZE: "valley", ' ' -FLAGS: noteleport,hardfloor,nommap -GEOMETRY:center,center -MAP ----------------------------------------------------------------------------- -|...S.|..|.....| |.....-| |................| |...............| |...| -|---|.|.--.---.| |......--- ----..........-----.-----....---........---.-.| -| |.|.|..| |.| --........| |.............| |.......---| |-...........--| -| |...S..| |.| |.......-----.......------| |--------..---......------- | -|----------- |.| |-......| |....|...-- |...-----................---- | -|.....S....---.| |.......| |....|...| |..............----------- | -|.....|.|......| |.....--- |......--- |....---.......| | -|.....|.|------| |....-- --....-- |-------- ----....--------------- | -|.....|--......---BBB-| |...-- |.......| |..................| | -|..........||........-| --...| |.......| |...||.............| | -|.....|...-||-........------....| |.......---- |...||.............-- | -|.....|--......---...........--------..........| |.......---------...-- | -|.....| |------| |--.......--| |..B......----- -----....| |.| |....--- | -|.....| |......--| ------..| |----..B......| |.--------.-- |-.....---| -|------ |........| |.|....| |.....----BBBB---------...........---.........| -| |........| |...|..| |.....| |-.............--------...........---| -| --.....-----------.| |....-----.....---------- |.........---- | -| |..|..B...........| |.|..........|.| |.|........| | ----------------------------------------------------------------------------- -ENDMAP - -# Make the path somewhat unpredictable -# If you get "lucky", you may have to go through all three graveyards. -IF [50%] { - TERRAIN:line (50,8),(53,8), '-' - TERRAIN:line (40,8),(43,8), 'B' -} -IF [50%] { - TERRAIN:(27,12),'|' - TERRAIN:line (27,3),(29,3), 'B' - TERRAIN:(28,2), '-' -} -IF [50%] { - TERRAIN:line (16,10),(16,11),'|' - TERRAIN:line (9,13),(14,13), 'B' -} - - -# Dungeon Description -# The shrine to Moloch. -REGION:(01,06,05,14),lit,"temple" -# The Morgues -REGION:(19,01,24,08),unlit,"morgue",filled,irregular -REGION:(09,14,16,18),unlit,"morgue",filled,irregular -REGION:(37,09,43,14),unlit,"morgue",filled,irregular -# Stairs -STAIR:(01,01),down -# Branch location -BRANCH:(66,17,66,17),(0,0,0,0) -TELEPORT_REGION:(58,09,72,18),(0,0,0,0),down - -# Secret Doors -DOOR:locked,(04,01) -DOOR:locked,(08,04) -DOOR:locked,(06,06) - -# The altar of Moloch. -ALTAR:(03,10),noalign,shrine - -# Non diggable walls - everywhere! -NON_DIGGABLE:(00,00,75,19) - -# Objects -# **LOTS** of dead bodies (all human). -# note: no priest(esse)s or monks - maybe Moloch has a *special* -# fate reserved for members of *those* classes. -# -OBJECT:('%',"corpse"),random,montype:"archeologist" -OBJECT:('%',"corpse"),random,montype:"archeologist" -OBJECT:('%',"corpse"),random,montype:"barbarian" -OBJECT:('%',"corpse"),random,montype:"barbarian" -OBJECT:('%',"corpse"),random,montype:"caveman" -OBJECT:('%',"corpse"),random,montype:"cavewoman" -OBJECT:('%',"corpse"),random,montype:"healer" -OBJECT:('%',"corpse"),random,montype:"healer" -OBJECT:('%',"corpse"),random,montype:"knight" -OBJECT:('%',"corpse"),random,montype:"knight" -OBJECT:('%',"corpse"),random,montype:"ranger" -OBJECT:('%',"corpse"),random,montype:"ranger" -OBJECT:('%',"corpse"),random,montype:"rogue" -OBJECT:('%',"corpse"),random,montype:"rogue" -OBJECT:('%',"corpse"),random,montype:"samurai" -OBJECT:('%',"corpse"),random,montype:"samurai" -OBJECT:('%',"corpse"),random,montype:"tourist" -OBJECT:('%',"corpse"),random,montype:"tourist" -OBJECT:('%',"corpse"),random,montype:"valkyrie" -OBJECT:('%',"corpse"),random,montype:"valkyrie" -OBJECT:('%',"corpse"),random,montype:"wizard" -OBJECT:('%',"corpse"),random,montype:"wizard" -# -# Some random weapons and armor. -# -OBJECT:'[',random -OBJECT:'[',random -OBJECT:'[',random -OBJECT:'[',random -OBJECT:')',random -OBJECT:')',random -OBJECT:')',random -OBJECT:')',random -# -# Some random loot. -# -OBJECT:('*',"ruby"),random -OBJECT:'*',random -OBJECT:'*',random -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'?',random -OBJECT:'?',random -OBJECT:'?',random -OBJECT:'/',random -OBJECT:'/',random -OBJECT:'=',random -OBJECT:'=',random -OBJECT:'+',random -OBJECT:'+',random -OBJECT:'(',random -OBJECT:'(',random -OBJECT:'(',random - -# (Not so) Random traps. -TRAP:"spiked pit", (05,02) -TRAP:"spiked pit", (14,05) -TRAP:"sleep gas", (03,01) -TRAP:"board", (21,12) -TRAP:"board", random -TRAP:"dart", (60,01) -TRAP:"dart", (26,17) -TRAP:"anti magic", random -TRAP:"anti magic", random -TRAP:"magic", random -TRAP:"magic", random - -# Random monsters. -# The ghosts. -MONSTER:(' ',"ghost"),random -MONSTER:(' ',"ghost"),random -MONSTER:(' ',"ghost"),random -MONSTER:(' ',"ghost"),random -MONSTER:(' ',"ghost"),random -MONSTER:(' ',"ghost"),random -# Add a few bats for atmosphere. -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -MONSTER:('B',"vampire bat"),random -# And a lich for good measure. -MONSTER:'L',random -# Some undead nasties for good measure -MONSTER:'V',random -MONSTER:'V',random -MONSTER:'V',random -MONSTER:'Z',random -MONSTER:'Z',random -MONSTER:'Z',random -MONSTER:'Z',random -MONSTER:'M',random -MONSTER:'M',random -MONSTER:'M',random -MONSTER:'M',random -# -# The Juiblex level -# -MAZE:"juiblex",' ' -FLAGS:noteleport,shortsighted -INIT_MAP:mines,'.','}',true,true,unlit,false -# guarantee at least one open spot to ensure successful stair placement -GEOMETRY:left,bottom -MAP -xxxxxxxx -xx...xxx -xxx...xx -xxxx.xxx -xxxxxxxx -ENDMAP -OBJECT:('`',"boulder"),random -GEOMETRY:right,top -MAP -xxxxxxxx -xxxx.xxx -xxx...xx -xx...xxx -xxxxxxxx -ENDMAP -OBJECT:('`',"boulder"),random -# lair -GEOMETRY:center,center -MAP -xx}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}xx -x}}}.}}}}}..}}}..}}}}}..}}}..}}}}}..}}}..}}}}}.}}}x -}}}...}}..}}.}.}}.}}.}}}...}}}.}}}..}}}..}}}}...}}} -x}}}.}}.}}}.}}.}}.}}...}}.}}.....}}.....}....}.}}}x -xx}}}..}}}.}}.}}.}}..}}.....}}.}}}.}}.}}}}}}}}}}}xx -x}}}..}}}}}.}}.}}.}}...}}}}}.....}}.}}}}}}.....}}}x -}}}..}}...}}..}}.}}}.}}}...}}}.}}}.}.}}}}..P.P..}}} -}}.}}}}...}}}}}.}...}}}..P..}}}.}.}}}.}}}}.....}}}} -}.}}}}.}}.}..}.}}}}}}}..P.P..}}}.}}}.}}..}}...}}}}x -x}}}}.}}}}....}}}}}.}}}..P..}}}.}}}}.}}..}}...}}}.} -}}}}..}}.}}..}}}}...}}}}...}}}.}}}}}.}}}}.}}}}}}.}} -}}}...}}...}}}..}}}}}}}}}}}}.....}}}}.}}...}..}.}}} -x}}}..}}.}}}}....}}..}}}..}}.....}}}}.}}}.}....}}}x -xx}}}.}}}}..}}..}}..}}..}}..}}.}}}..}.}..}}}..}}}xx -x}}}.}}}}....}}}}..}}....}}}}}}}...}}}....}}}}.}}}x -}}}...}}}....}}}..}}}....}}}..}}...}}}....}}}...}}} -x}}}.}}}}}..}}}..}}}}}..}}}..}}}}}..}}}..}}}}}.}}}x -xx}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}xx -ENDMAP -# Random registers -$monster = monster: { 'j','b','P','F' } -SHUFFLE: $monster - -$place = { (04,02),(46,02),(04,15),(46,15) } -SHUFFLE: $place - -# Dungeon description -REGION:(00,00,50,17),unlit,"swamp" -MAZEWALK:(00,09),west -MAZEWALK:(50,08),east -STAIR:levregion(01,00,11,20),(0,0,50,17),down -STAIR:levregion(69,00,79,20),(0,0,50,17),up -BRANCH:levregion(01,00,11,20),(0,0,50,17) -TELEPORT_REGION:levregion(01,00,11,20),(0,0,50,17),up -TELEPORT_REGION:levregion(69,00,79,20),(0,0,50,17),down -FOUNTAIN:$place[0] -MONSTER:('m',"giant mimic"),$place[1],m_feature "fountain" -MONSTER:('m',"giant mimic"),$place[2],m_feature "fountain" -MONSTER:('m',"giant mimic"),$place[3],m_feature "fountain" -# The demon of the swamp -MONSTER:('&',"Juiblex"),(25,08) -# And a couple demons -MONSTER:('i',"lemure"),(43,08) -MONSTER:('i',"lemure"),(44,08) -MONSTER:('i',"lemure"),(45,08) -# Some liquids and gems -OBJECT:'*',(43,06) -OBJECT:'*',(45,06) -OBJECT:'!',(43,09) -OBJECT:'!',(44,09) -OBJECT:'!',(45,09) -# And lots of blobby monsters -MONSTER:$monster[0],(25,06) -MONSTER:$monster[1],(24,07) -MONSTER:$monster[2],(26,07) -MONSTER:$monster[3],(23,08) -MONSTER:$monster[3],(27,08) -MONSTER:$monster[2],(24,09) -MONSTER:$monster[1],(26,09) -MONSTER:$monster[0],(25,10) -MONSTER:'j',random -MONSTER:'j',random -MONSTER:'j',random -MONSTER:'j',random -MONSTER:'P',random -MONSTER:'P',random -MONSTER:'P',random -MONSTER:'P',random -MONSTER:'b',random -MONSTER:'b',random -MONSTER:'b',random -MONSTER:'F',random -MONSTER:'F',random -MONSTER:'F',random -MONSTER:'m',random -MONSTER:'m',random -MONSTER:(';',"jellyfish"),random -MONSTER:(';',"jellyfish"),random -# Some random objects -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:('`',"boulder"),random -# Some traps -TRAP:"sleep gas",random -TRAP:"sleep gas",random -TRAP:"anti magic",random -TRAP:"anti magic",random -TRAP:"magic",random -TRAP:"magic",random -# -# The Orcus Level -# -MAZE:"orcus",random -FLAGS: noteleport,shortsighted -GEOMETRY:right,center -# A ghost town -MAP -.|....|....|....|..............|....|........ -.|....|....|....|..............|....|........ -.|....|....|....|--...-+-------|............. -.|....|....|....|..............+............. -.|.........|....|..............|....|........ -.--+-...-+----+--....-------...--------.-+--- -.....................|.....|................. -.....................|.....|................. -.--+----....-+---....|.....|...----------+--- -.|....|....|....|....---+---...|......|...... -.|.........|....|..............|......|...... -.----...---------.....-----....+......|...... -.|........................|....|......|...... -.----------+-...--+--|....|....----------+--- -.|....|..............|....+....|............. -.|....+.......|......|....|....|............. -.|....|.......|......|....|....|............. -ENDMAP -MAZEWALK:(00,06),west -# Entire main area -REGION:(01,00,44,16),unlit,"ordinary" -STAIR:(33,15),down -STAIR:levregion(01,00,12,20),levregion(20,01,70,20),up -BRANCH:levregion(01,00,12,20),levregion(20,01,70,20) -TELEPORT_REGION:levregion(01,00,12,20),levregion(20,01,70,20) -# Wall "ruins" -OBJECT:('`',"boulder"),(19,02) -OBJECT:('`',"boulder"),(20,02) -OBJECT:('`',"boulder"),(21,02) -OBJECT:('`',"boulder"),(36,02) -OBJECT:('`',"boulder"),(36,03) -OBJECT:('`',"boulder"),(06,04) -OBJECT:('`',"boulder"),(05,05) -OBJECT:('`',"boulder"),(06,05) -OBJECT:('`',"boulder"),(07,05) -OBJECT:('`',"boulder"),(39,05) -OBJECT:('`',"boulder"),(08,08) -OBJECT:('`',"boulder"),(09,08) -OBJECT:('`',"boulder"),(10,08) -OBJECT:('`',"boulder"),(11,08) -OBJECT:('`',"boulder"),(06,10) -OBJECT:('`',"boulder"),(05,11) -OBJECT:('`',"boulder"),(06,11) -OBJECT:('`',"boulder"),(07,11) -OBJECT:('`',"boulder"),(21,11) -OBJECT:('`',"boulder"),(21,12) -OBJECT:('`',"boulder"),(13,13) -OBJECT:('`',"boulder"),(14,13) -OBJECT:('`',"boulder"),(15,13) -OBJECT:('`',"boulder"),(14,14) -# Doors -DOOR:closed,(23,02) -DOOR:open,(31,03) -DOOR:nodoor,(03,05) -DOOR:closed,(09,05) -DOOR:closed,(14,05) -DOOR:closed,(41,05) -DOOR:open,(03,08) -DOOR:nodoor,(13,08) -DOOR:open,(41,08) -DOOR:closed,(24,09) -DOOR:closed,(31,11) -DOOR:open,(11,13) -DOOR:closed,(18,13) -DOOR:closed,(41,13) -DOOR:open,(26,14) -DOOR:closed,(06,15) -# Special rooms -ALTAR:(24,07),noalign,sanctum -REGION:(22,12,25,16),unlit,"morgue" -REGION:(32,09,37,12),lit,"shop" -REGION:(12,00,15,04),lit,"shop" -# Some traps. -TRAP:"spiked pit", random -TRAP:"sleep gas", random -TRAP:"anti magic", random -TRAP:"fire", random -TRAP:"fire", random -TRAP:"fire", random -TRAP:"magic", random -TRAP:"magic", random -# Some random objects -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# The resident nasty -MONSTER:('&',"Orcus"),(33,15) -# And its preferred companions -MONSTER:('Z',"human zombie"),(32,15) -MONSTER:(' ',"shade"),(32,14) -MONSTER:(' ',"shade"),(32,16) -MONSTER:('V',"vampire"),(35,16) -MONSTER:('V',"vampire"),(35,14) -MONSTER:('V',"vampire lord"),(36,14) -MONSTER:('V',"vampire lord"),(36,15) -# Randomly placed companions -MONSTER:('Z',"skeleton"),random -MONSTER:('Z',"skeleton"),random -MONSTER:('Z',"skeleton"),random -MONSTER:('Z',"skeleton"),random -MONSTER:('Z',"skeleton"),random -MONSTER:(' ',"shade"),random -MONSTER:(' ',"shade"),random -MONSTER:(' ',"shade"),random -MONSTER:(' ',"shade"),random -MONSTER:('Z',"giant zombie"),random -MONSTER:('Z',"giant zombie"),random -MONSTER:('Z',"giant zombie"),random -MONSTER:('Z',"ettin zombie"),random -MONSTER:('Z',"ettin zombie"),random -MONSTER:('Z',"ettin zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('Z',"human zombie"),random -MONSTER:('V',"vampire"),random -MONSTER:('V',"vampire"),random -MONSTER:('V',"vampire"),random -MONSTER:('V',"vampire lord"),random -MONSTER:('V',"vampire lord"),random -# A few more for the party -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -# -# The Asmodeus Level -# -MAZE:"asmodeus",random -FLAGS: noteleport -# First part -GEOMETRY:half-left,center -MAP ---------------------- -|.............|.....| -|.............S.....| -|---+------------...| -|.....|.........|-+-- -|..---|.........|.... -|..|..S.........|.... -|..|..|.........|.... -|..|..|.........|-+-- -|..|..-----------...| -|..S..........|.....| ---------------------- -ENDMAP -STAIR:levregion(01,00,6,20),levregion(6,1,70,16),up -BRANCH:levregion(01,00,6,20),levregion(6,1,70,16) -TELEPORT_REGION:levregion(01,00,6,20),levregion(6,1,70,16) - -# Doors -DOOR:closed,(04,03) -DOOR:locked,(18,04) -DOOR:closed,(18,08) -# -STAIR:(13,07),down -# Non diggable walls -NON_DIGGABLE:(00,00,20,11) -# Entire main area -REGION:(01,01,20,10),unlit,"ordinary" -# The fellow in residence -MONSTER:('&',"Asmodeus"),(12,07) -# Some random weapons and armor. -OBJECT:'[',random -OBJECT:'[',random -OBJECT:')',random -OBJECT:')',random -OBJECT:'*',random -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'?',random -OBJECT:'?',random -OBJECT:'?',random -# Some traps. -TRAP:"spiked pit", (05,02) -TRAP:"fire", (08,06) -TRAP:"sleep gas", random -TRAP:"anti magic", random -TRAP:"fire", random -TRAP:"magic", random -TRAP:"magic", random -# Random monsters. -MONSTER:(' ',"ghost"),(11,07) -MONSTER:('&',"horned devil"),(10,05) -MONSTER:'L',random -# Some Vampires for good measure -MONSTER:'V',random -MONSTER:'V',random -MONSTER:'V',random -# Second part -GEOMETRY:half-right,center -MAP ---------------------------------- -................................| -................................+ -................................| ---------------------------------- -ENDMAP -MAZEWALK:(32,02),east -# Non diggable walls -NON_DIGGABLE:(00,00,32,04) -DOOR:closed,(32,02) -MONSTER:'&',random -MONSTER:'&',random -MONSTER:'&',random -TRAP:"anti magic", random -TRAP:"fire", random -TRAP:"magic", random - -# -# The Baalzebub level -# -MAZE:"baalz",' ' -FLAGS: noteleport,corrmaze -GEOMETRY:right,center -# the two pools are fakes used to mark spots which need special wall fixups -# the two iron bars are eyes and spots to their left will be made diggable -MAP -------------------------------------------------- -| ---- ---- -| ---- | ----------- | -| ------ | ---------|.........|--P -| F....| -------|...........-------------- ----....|--|..................S............|---- -+...--....S..----------------|............S...| ----....|--|..................|............|---- -| F....| -------|...........-----S-------- -| ------ | ---------|.........|--P -| ---- | ----------- | -| ---- ---- -------------------------------------------------- -ENDMAP -STAIR:levregion(01,00,15,20),levregion(15,1,70,16),up -BRANCH:levregion(01,00,15,20),levregion(15,1,70,16) -TELEPORT_REGION:levregion(01,00,15,20),levregion(15,1,70,16) -# this actually leaves the farthest right column diggable -NON_DIGGABLE:(00,00,47,12) -MAZEWALK:(00,06),west -STAIR:(44,06),down -DOOR:locked,(00,06) -IF [50%] { - TERRAIN:(34,08),'-' - TERRAIN:(34,04),'S' - TERRAIN:(29,05),'|' - TERRAIN:(29,07),'S' -} -# The fellow in residence -MONSTER:('&',"Baalzebub"),(35,06) -# Some random weapons and armor. -OBJECT:'[',random -OBJECT:'[',random -OBJECT:')',random -OBJECT:')',random -OBJECT:'*',random -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'?',random -OBJECT:'?',random -OBJECT:'?',random -# Some traps. -TRAP:"spiked pit", random -TRAP:"fire", random -TRAP:"sleep gas", random -TRAP:"anti magic", random -TRAP:"fire", random -TRAP:"magic", random -TRAP:"magic", random -# Random monsters. -MONSTER:(' ',"ghost"),(37,07) -MONSTER:('&',"horned devil"),(32,05) -MONSTER:('&',"barbed devil"),(38,07) -MONSTER:'L',random -# Some Vampires for good measure -MONSTER:'V',random -MONSTER:'V',random -MONSTER:'V',random -# -# The Sanctum Level -# -MAZE:"sanctum", ' ' -FLAGS: noteleport,hardfloor,nommap -# This is outside the main map, below, so we must do it before adding -# that map and anchoring coordinates to it. This extends the invisible -# barrier up to the top row, which falls outside the drawn map. -NON_PASSWALL:(39,00,41,00) -GEOMETRY:center,center -MAP ----------------------------------------------------------------------------- -| -------------- | -| |............| ------- | -| -------............----- |.....| | -| |......................| --.....| --------- | -| ----......................---------|......---- |.......| | -| |........---------..........|......+.........| ------+---..| | -| ---........|.......|..........--S----|.........| |........|..| | -| |..........|.......|.............| |.........-------..---------- | -| |..........|.......|..........---- |..........|....|..|......| | -| |..........|.......|..........| --.......----+---S---S--..| | -| |..........---------..........| |.......|.............|..| | -| ---...........................| -----+-------S---------S--- | -| |...........................| |...| |......| |....|-- | -| ----.....................---- |...---....--- ---......| | -| |.....................| |..........| |.....---- | -| -------...........----- --...------- |.....| | -| |...........| |...| |.....| | -| ------------- ----- ------- | ----------------------------------------------------------------------------- -ENDMAP -REGION:(15,07,21,10),lit,"temple" -ALTAR:(18,08),noalign,sanctum -REGION:(41,06,48,11),unlit,"morgue",filled,irregular -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Invisible barrier separating the left & right halves of the level -NON_PASSWALL:(37,00,39,19) -# Doors -DOOR:closed,(40,06) -DOOR:locked,(62,06) -DOOR:closed,(46,12) -DOOR:closed,(53,10) -# Surround the temple with fire -TRAP:"fire",(13,05) -TRAP:"fire",(14,05) -TRAP:"fire",(15,05) -TRAP:"fire",(16,05) -TRAP:"fire",(17,05) -TRAP:"fire",(18,05) -TRAP:"fire",(19,05) -TRAP:"fire",(20,05) -TRAP:"fire",(21,05) -TRAP:"fire",(22,05) -TRAP:"fire",(23,05) -TRAP:"fire",(13,12) -TRAP:"fire",(14,12) -TRAP:"fire",(15,12) -TRAP:"fire",(16,12) -TRAP:"fire",(17,12) -TRAP:"fire",(18,12) -TRAP:"fire",(19,12) -TRAP:"fire",(20,12) -TRAP:"fire",(21,12) -TRAP:"fire",(22,12) -TRAP:"fire",(23,12) -TRAP:"fire",(13,06) -TRAP:"fire",(13,07) -TRAP:"fire",(13,08) -TRAP:"fire",(13,09) -TRAP:"fire",(13,10) -TRAP:"fire",(13,11) -TRAP:"fire",(23,06) -TRAP:"fire",(23,07) -TRAP:"fire",(23,08) -TRAP:"fire",(23,09) -TRAP:"fire",(23,10) -TRAP:"fire",(23,11) -# Some traps. -TRAP:"spiked pit", random -TRAP:"fire", random -TRAP:"sleep gas", random -TRAP:"anti magic", random -TRAP:"fire", random -TRAP:"magic", random -# Some random objects -OBJECT:'[',random -OBJECT:'[',random -OBJECT:'[',random -OBJECT:'[',random -OBJECT:')',random -OBJECT:')',random -OBJECT:'*',random -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'?',random -OBJECT:'?',random -OBJECT:'?',random -OBJECT:'?',random -OBJECT:'?',random -# Some monsters. -MONSTER:('&',"horned devil"),(14,12),hostile -MONSTER:('&',"barbed devil"),(18,08),hostile -MONSTER:('&',"erinys"),(10,04),hostile -MONSTER:('&',"marilith"),(07,09),hostile -MONSTER:('&',"nalfeshnee"),(27,08),hostile -# Moloch's horde -MONSTER:('@',"aligned priest"),(20,03),noalign,hostile -MONSTER:('@',"aligned priest"),(15,04),noalign,hostile -MONSTER:('@',"aligned priest"),(11,05),noalign,hostile -MONSTER:('@',"aligned priest"),(11,07),noalign,hostile -MONSTER:('@',"aligned priest"),(11,09),noalign,hostile -MONSTER:('@',"aligned priest"),(11,12),noalign,hostile -MONSTER:('@',"aligned priest"),(15,13),noalign,hostile -MONSTER:('@',"aligned priest"),(17,13),noalign,hostile -MONSTER:('@',"aligned priest"),(21,13),noalign,hostile -# A few nasties -MONSTER:'L',random -MONSTER:'L',random -MONSTER:'V',random -MONSTER:'V',random -MONSTER:'V',random -STAIR:(63,15),up -# Teleporting to this level is allowed after the invocation creates its -# entrance. Force arrival in that case to be on rightmost third of level. -TELEPORT_REGION:levregion(54,1,79,18),(0,0,0,0),down diff --git a/dat/juiblex.lua b/dat/juiblex.lua new file mode 100644 index 000000000..19c95e884 --- /dev/null +++ b/dat/juiblex.lua @@ -0,0 +1,125 @@ +-- NetHack 3.6 gehennom.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- 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 = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "shortsighted") +-- des.level_init(mines,'.','}',true,true,unlit,false) +des.level_init({ style = "mines", fg = ".", bg = "}", smoothed=1, joined=1, lit=0 }); +-- guarantee at least one open spot to ensure successful stair placement +des.map({ halign = "left", valign = "bottom", map = [[ +xxxxxxxx +xx...xxx +xxx...xx +xxxx.xxx +xxxxxxxx +]] }); +des.object("boulder") +des.map({ halign = "right", valign = "top", map = [[ +xxxxxxxx +xxxx.xxx +xxx...xx +xx...xxx +xxxxxxxx +]] }); +des.object("boulder") +-- lair +des.map([[ +xx}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}xx +x}}}.}}}}}..}}}..}}}}}..}}}..}}}}}..}}}..}}}}}.}}}x +}}}...}}..}}.}.}}.}}.}}}...}}}.}}}..}}}..}}}}...}}} +x}}}.}}.}}}.}}.}}.}}...}}.}}.....}}.....}....}.}}}x +xx}}}..}}}.}}.}}.}}..}}.....}}.}}}.}}.}}}}}}}}}}}xx +x}}}..}}}}}.}}.}}.}}...}}}}}.....}}.}}}}}}.....}}}x +}}}..}}...}}..}}.}}}.}}}...}}}.}}}.}.}}}}..P.P..}}} +}}.}}}}...}}}}}.}...}}}..P..}}}.}.}}}.}}}}.....}}}} +}.}}}}.}}.}..}.}}}}}}}..P.P..}}}.}}}.}}..}}...}}}}x +x}}}}.}}}}....}}}}}.}}}..P..}}}.}}}}.}}..}}...}}}.} +}}}}..}}.}}..}}}}...}}}}...}}}.}}}}}.}}}}.}}}}}}.}} +}}}...}}...}}}..}}}}}}}}}}}}.....}}}}.}}...}..}.}}} +x}}}..}}.}}}}....}}..}}}..}}.....}}}}.}}}.}....}}}x +xx}}}.}}}}..}}..}}..}}..}}..}}.}}}..}.}..}}}..}}}xx +x}}}.}}}}....}}}}..}}....}}}}}}}...}}}....}}}}.}}}x +}}}...}}}....}}}..}}}....}}}..}}...}}}....}}}...}}} +x}}}.}}}}}..}}}..}}}}}..}}}..}}}}}..}}}..}}}}}.}}}x +xx}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}xx +]]); +-- Random registers +local monster = { "j","b","P","F" } +shuffle(monster) + +local place = selection.new(); +place:set(04,02); +place:set(46,02); +place:set(04,15); +place:set(46,15); + +-- Dungeon description +des.region({ region={00,00,50,17}, lit=0, type="swamp" }) +des.mazewalk(00,09,"west") +des.mazewalk(50,08,"east") +des.levregion({ region = {01,00,11,20}, region_islev=1, exclude={0,0,50,17}, type="stair-down" }); +des.levregion({ region = {69,00,79,20}, region_islev=1, exclude={0,0,50,17}, type="stair-up" }); +des.levregion({ region = {01,00,11,20}, region_islev=1, exclude={0,0,50,17}, type="branch" }); +des.teleport_region({ region = {01,00,11,20}, region_islev=1, exclude={0,0,50,17},dir="up" }) +des.teleport_region({ region = {69,00,79,20}, region_islev=1, exclude={0,0,50,17},dir="down" }) +des.feature("fountain", place:rndcoord(1)) +des.monster({ id = "giant mimic", coord = { place:rndcoord(1) }, appear_as = "ter:fountain" }) +des.monster({ id = "giant mimic", coord = { place:rndcoord(1) }, appear_as = "ter:fountain" }) +des.monster({ id = "giant mimic", coord = { place:rndcoord(1) }, appear_as = "ter:fountain" }) +-- The demon of the swamp +des.monster("Juiblex",25,08) +-- And a couple demons +des.monster("lemure",43,08) +des.monster("lemure",44,08) +des.monster("lemure",45,08) +-- Some liquids and gems +des.object("*",43,06) +des.object("*",45,06) +des.object("!",43,09) +des.object("!",44,09) +des.object("!",45,09) +-- And lots of blobby monsters +des.monster(monster[4],25,06) +des.monster(monster[1],24,07) +des.monster(monster[2],26,07) +des.monster(monster[3],23,08) +des.monster(monster[3],27,08) +des.monster(monster[2],24,09) +des.monster(monster[1],26,09) +des.monster(monster[4],25,10) +des.monster("j") +des.monster("j") +des.monster("j") +des.monster("j") +des.monster("P") +des.monster("P") +des.monster("P") +des.monster("P") +des.monster("b") +des.monster("b") +des.monster("b") +des.monster("F") +des.monster("F") +des.monster("F") +des.monster("m") +des.monster("m") +des.monster("jellyfish") +des.monster("jellyfish") +-- Some random objects +des.object("!") +des.object("!") +des.object("!") +des.object("%") +des.object("%") +des.object("%") +des.object("boulder") +-- Some traps +des.trap("sleep gas") +des.trap("sleep gas") +des.trap("anti magic") +des.trap("anti magic") +des.trap("magic") +des.trap("magic") diff --git a/dat/knox.des b/dat/knox.des deleted file mode 100644 index 13a56035b..000000000 --- a/dat/knox.des +++ /dev/null @@ -1,153 +0,0 @@ -# NetHack 3.6 knox.des $NHDT-Date: 1547343821 2019/01/13 01:43:41 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.13 $ -# Copyright (c) 1989 by Jean-Christophe Collet -# Copyright (c) 1992 by Izchak Miller -# NetHack may be freely redistributed. See license for details. -# -MAZE:"knox",' ' -FLAGS: noteleport -GEOMETRY:center,center -# Fort's entry is via a secret door rather than a drawbridge; -# the moat must be manually circumvented. -MAP ----------------------------------------------------------------------------- -| |........|...............................................................| -| |........|.................................................------------..| -| --S----S--.................................................|..........|..| -| # |........}}}}}}}....................}}}}}}}..........|..........|..| -| # |........}-----}....................}-----}..........--+--+--...|..| -| # ---........}|...|}}}}}}}}}}}}}}}}}}}}}}|...|}.................|...|..| -| # |..........}---S------------------------S---}.................|...|..| -| # |..........}}}|...............|..........|}}}.................+...|..| -| --S----..........}|...............S..........|}...................|...|..| -| |.....|..........}|...............|......\...S}...................|...|..| -| |.....+........}}}|...............|..........|}}}.................+...|..| -| |.....|........}---S------------------------S---}.................|...|..| -| |.....|........}|...|}}}}}}}}}}}}}}}}}}}}}}|...|}.................|...|..| -| |..-S----......}-----}....................}-----}..........--+--+--...|..| -| |..|....|......}}}}}}}....................}}}}}}}..........|..........|..| -| |..|....|..................................................|..........|..| -| -----------................................................------------..| -| |..............................................................| ----------------------------------------------------------------------------- -ENDMAP -# Non diggable walls -NON_DIGGABLE:(00,00,75,19) -# Portal arrival point -BRANCH:(08,16,08,16),(0,0,0,0) -# accessible via ^V in wizard mode; arrive near the portal -TELEPORT_REGION:(06,15,09,16),(0,0,0,0),up -TELEPORT_REGION:(06,15,09,16),(0,0,0,0),down -# Throne room, with Croesus on the throne -REGION:(37,08,46,11),lit,"throne" -# 50% chance each to move throne and/or fort's entry secret door up one row -IF [50%] { - MONSTER:('@',"Croesus"),(43,10),hostile -} ELSE { - MONSTER:('@',"Croesus"),(43,09),hostile - TERRAIN:(43,09), '\' - TERRAIN:(43,10), '.' -} -IF [50%] { - TERRAIN:(47,09), 'S' - TERRAIN:(47,10), '|' -} -# The Vault -# Using unfilled morgue for -# identification in mkmaze.c -REGION:(21,08,35,11),lit,"morgue",unfilled -# Vault entrance also varies -IF [50%] { - TERRAIN:(36,09), '|' - TERRAIN:(36,10), 'S' -} -# Corner towers -REGION:(19,06,21,06),lit,"ordinary" -REGION:(46,06,48,06),lit,"ordinary" -REGION:(19,13,21,13),lit,"ordinary" -REGION:(46,13,48,13),lit,"ordinary" -# A welcoming committee -REGION:(03,10,07,13),lit,"zoo",filled,irregular -# arrival chamber; needs to be a real room to control migrating monsters, -# and `unfilled' is a kludge to force an ordinary room to remain a room -REGION:(06,15,09,16),unlit,"ordinary",unfilled - -# 3.6.2: Entering level carrying a lit candle would show the whole entry -# chamber except for its top right corner even though some of the revealed -# spots are farther away than that is. This is because the lit treasure zoo -# is forcing the walls around it to be lit too (see light_region(sp_lev.c)), -# and lit walls show up when light reaches the spot next to them. The unlit -# corner is beyond candle range and isn't flagged as lit so it doesn't show -# up until light reaches it rather than when light gets next to it. -# -# Force left and top walls of the arrival chamber to be unlit in order to -# hide this lighting quirk. -REGION:(05,14,05,17),unlit,"ordinary" -REGION:(05,14,09,14),unlit,"ordinary" -# (Entering the treasure zoo while blind and then regaining sight might -# expose the new oddity of these walls not appearing when on the lit side -# but that's even less likely to occur than the rare instance of entering -# the level with a candle. They'll almost always be mapped from the arrival -# side before entering the treasure zoo. -# -# A prior workaround lit the top right corner wall and then jumped through -# hoops to suppress the extra light in the 3x3 lit area that produced. -# This is simpler and makes the short range candle light behave more like -# it is expected to work.) - -# Barracks -REGION:(62,03,71,04),lit,"barracks",filled,irregular -# Doors -DOOR:closed,(06,14) -DOOR:closed,(09,03) -DOOR:open,(63,05) -DOOR:open,(66,05) -DOOR:open,(68,08) -DOOR:locked,(08,11) -DOOR:open,(68,11) -DOOR:closed,(63,14) -DOOR:closed,(66,14) -DOOR:closed,(04,03) -DOOR:closed,(04,09) -# Soldiers guarding the fort -MONSTER:('@',"soldier"),(12,14) -MONSTER:('@',"soldier"),(12,13) -MONSTER:('@',"soldier"),(11,10) -MONSTER:('@',"soldier"),(13,02) -MONSTER:('@',"soldier"),(14,03) -MONSTER:('@',"soldier"),(20,02) -MONSTER:('@',"soldier"),(30,02) -MONSTER:('@',"soldier"),(40,02) -MONSTER:('@',"soldier"),(30,16) -MONSTER:('@',"soldier"),(32,16) -MONSTER:('@',"soldier"),(40,16) -MONSTER:('@',"soldier"),(54,16) -MONSTER:('@',"soldier"),(54,14) -MONSTER:('@',"soldier"),(54,13) -MONSTER:('@',"soldier"),(57,10) -MONSTER:('@',"soldier"),(57,09) -MONSTER:('@',"lieutenant"),(15,08) -# Possible source of a boulder -MONSTER:('H',"stone giant"),(03,01) -# Four dragons guarding each side -MONSTER:'D',(18,09) -MONSTER:'D',(49,10) -MONSTER:'D',(33,05) -MONSTER:'D',(33,14) -# Eels in the moat -MONSTER:(';',"giant eel"),(17,08) -MONSTER:(';',"giant eel"),(17,11) -MONSTER:(';',"giant eel"),(48,08) -MONSTER:(';',"giant eel"),(48,11) -# The corner rooms treasures -OBJECT:('*',"diamond"),(19,06) -OBJECT:('*',"diamond"),(20,06) -OBJECT:('*',"diamond"),(21,06) -OBJECT:('*',"emerald"),(19,13) -OBJECT:('*',"emerald"),(20,13) -OBJECT:('*',"emerald"),(21,13) -OBJECT:('*',"ruby"),(46,06) -OBJECT:('*',"ruby"),(47,06) -OBJECT:('*',"ruby"),(48,06) -OBJECT:('*',"amethyst"),(46,13) -OBJECT:('*',"amethyst"),(47,13) -OBJECT:('*',"amethyst"),(48,13) diff --git a/dat/knox.lua b/dat/knox.lua new file mode 100644 index 000000000..360edce13 --- /dev/null +++ b/dat/knox.lua @@ -0,0 +1,154 @@ +-- NetHack 3.6 knox.des $NHDT-Date: 1547343821 2019/01/13 01:43:41 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.13 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1992 by Izchak Miller +-- NetHack may be freely redistributed. See license for details. +-- +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport") +-- Fort's entry is via a secret door rather than a drawbridge; +-- the moat must be manually circumvented. +des.map([[ +---------------------------------------------------------------------------- +| |........|...............................................................| +| |........|.................................................------------..| +| --S----S--.................................................|..........|..| +| # |........}}}}}}}....................}}}}}}}..........|..........|..| +| # |........}-----}....................}-----}..........--+--+--...|..| +| # ---........}|...|}}}}}}}}}}}}}}}}}}}}}}|...|}.................|...|..| +| # |..........}---S------------------------S---}.................|...|..| +| # |..........}}}|...............|..........|}}}.................+...|..| +| --S----..........}|...............S..........|}...................|...|..| +| |.....|..........}|...............|......\...S}...................|...|..| +| |.....+........}}}|...............|..........|}}}.................+...|..| +| |.....|........}---S------------------------S---}.................|...|..| +| |.....|........}|...|}}}}}}}}}}}}}}}}}}}}}}|...|}.................|...|..| +| |..-S----......}-----}....................}-----}..........--+--+--...|..| +| |..|....|......}}}}}}}....................}}}}}}}..........|..........|..| +| |..|....|..................................................|..........|..| +| -----------................................................------------..| +| |..............................................................| +---------------------------------------------------------------------------- +]]); +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Portal arrival point +des.levregion({ region = {08,16,08,16}, type="branch" }); +-- accessible via ^V in wizard mode; arrive near the portal +des.teleport_region({ region = {06,15,09,16}, dir="up" }) +des.teleport_region({ region = {06,15,09,16}, dir="down" }) +-- Throne room, with Croesus on the throne +des.region({ x1=37,y1=08,x2=46,y2=11, lit=1, type="throne", prefilled=0 }) +-- 50% chance each to move throne and/or fort's entry secret door up one row +if math.random(0, 99) < 50 then + des.monster({ id = "Croesus", x=43, y=10, peaceful = 0 }) +else + des.monster({ id = "Croesus", x=43, y=09, peaceful = 0 }) + des.terrain(43,09, "\\") + des.terrain(43,10, ".") +end +if math.random(0, 99) < 50 then + des.terrain(47,09, "S") + des.terrain(47,10, "|") +end +-- The Vault +-- Using unfilled morgue for +-- identification in mkmaze.c +des.region({ region={21,08,35,11}, lit=1, type="morgue", prefilled=1 }) +-- Vault entrance also varies +if math.random(0, 99) < 50 then + des.terrain(36,09, "|") + des.terrain(36,10, "S") +end +-- Corner towers +des.region(selection.area(19,06,21,06),"lit") +des.region(selection.area(46,06,48,06),"lit") +des.region(selection.area(19,13,21,13),"lit") +des.region(selection.area(46,13,48,13),"lit") +-- A welcoming committee +des.region({ region={03,10,07,13},lit=1,type="zoo",prefilled=0,irregular=1 }) +-- arrival chamber; needs to be a real room to control migrating monsters, +-- and `unfilled' is a kludge to force an ordinary room to remain a room +des.region({ region={06,15,09,16},lit=0,type="ordinary",prefilled=0 }) + +-- 3.6.2: Entering level carrying a lit candle would show the whole entry +-- chamber except for its top right corner even though some of the revealed +-- spots are farther away than that is. This is because the lit treasure zoo +-- is forcing the walls around it to be lit too (see light_region(sp_lev.c)), +-- and lit walls show up when light reaches the spot next to them. The unlit +-- corner is beyond candle range and isn't flagged as lit so it doesn't show +-- up until light reaches it rather than when light gets next to it. +-- +-- Force left and top walls of the arrival chamber to be unlit in order to +-- hide this lighting quirk. +des.region(selection.area(05,14,05,17),"unlit") +des.region(selection.area(05,14,09,14),"unlit") +-- (Entering the treasure zoo while blind and then regaining sight might +-- expose the new oddity of these walls not appearing when on the lit side +-- but that's even less likely to occur than the rare instance of entering +-- the level with a candle. They'll almost always be mapped from the arrival +-- side before entering the treasure zoo. +-- +-- A prior workaround lit the top right corner wall and then jumped through +-- hoops to suppress the extra light in the 3x3 lit area that produced. +-- This is simpler and makes the short range candle light behave more like +-- it is expected to work.) + +-- Barracks +des.region({ region={62,03,71,04},lit=1,type="barracks",prefilled=0,irregular=1 }) +-- Doors +des.door("closed",06,14) +des.door("closed",09,03) +des.door("open",63,05) +des.door("open",66,05) +des.door("open",68,08) +des.door("locked",08,11) +des.door("open",68,11) +des.door("closed",63,14) +des.door("closed",66,14) +des.door("closed",04,03) +des.door("closed",04,09) +-- Soldiers guarding the fort +des.monster("soldier",12,14) +des.monster("soldier",12,13) +des.monster("soldier",11,10) +des.monster("soldier",13,02) +des.monster("soldier",14,03) +des.monster("soldier",20,02) +des.monster("soldier",30,02) +des.monster("soldier",40,02) +des.monster("soldier",30,16) +des.monster("soldier",32,16) +des.monster("soldier",40,16) +des.monster("soldier",54,16) +des.monster("soldier",54,14) +des.monster("soldier",54,13) +des.monster("soldier",57,10) +des.monster("soldier",57,09) +des.monster("lieutenant",15,08) +-- Possible source of a boulder +des.monster("stone giant",03,01) +-- Four dragons guarding each side +des.monster("D",18,09) +des.monster("D",49,10) +des.monster("D",33,05) +des.monster("D",33,14) +-- Eels in the moat +des.monster("giant eel",17,08) +des.monster("giant eel",17,11) +des.monster("giant eel",48,08) +des.monster("giant eel",48,11) +-- The corner rooms treasures +des.object("diamond",19,06) +des.object("diamond",20,06) +des.object("diamond",21,06) +des.object("emerald",19,13) +des.object("emerald",20,13) +des.object("emerald",21,13) +des.object("ruby",46,06) +des.object("ruby",47,06) +des.object("ruby",48,06) +des.object("amethyst",46,13) +des.object("amethyst",47,13) +des.object("amethyst",48,13) diff --git a/dat/medusa-1.lua b/dat/medusa-1.lua new file mode 100644 index 000000000..635763a5b --- /dev/null +++ b/dat/medusa-1.lua @@ -0,0 +1,121 @@ +-- NetHack 3.6 medusa.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) 1990, 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- These are the Medusa's levels : +-- + +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport") + +des.map([[ +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}.}}}}}..}}}}}......}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}....}}}...}}}}} +}...}}.....}}}}}....}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}...............} +}....}}}}}}}}}}....}}}..}}}}}}}}}}}.......}}}}}}}}}}}}}}}}..}}.....}}}...}} +}....}}}}}}}}.....}}}}..}}}}}}.................}}}}}}}}}}}.}}}}.....}}...}} +}....}}}}}}}}}}}}.}}}}.}}}}}}.-----------------.}}}}}}}}}}}}}}}}}.........} +}....}}}}}}}}}}}}}}}}}}.}}}...|...............S...}}}}}}}}}}}}}}}}}}}....}} +}.....}.}}....}}}}}}}}}.}}....--------+--------....}}}}}}..}}}}}}}}}}}...}} +}......}}}}..}}}}}}}}}}}}}........|.......|........}}}}}....}}}}}}}}}}}}}}} +}.....}}}}}}}}}}}}}}}}}}}}........|.......|........}}}}}...}}}}}}}}}.}}}}}} +}.....}}}}}}}}}}}}}}}}}}}}....--------+--------....}}}}}}.}.}}}}}}}}}}}}}}} +}......}}}}}}}}}}}}}}}}}}}}...S...............|...}}}}}}}}}}}}}}}}}.}}}}}}} +}.......}}}}}}}..}}}}}}}}}}}}.-----------------.}}}}}}}}}}}}}}}}}....}}}}}} +}........}}.}}....}}}}}}}}}}}}.................}}}}}..}}}}}}}}}.......}}}}} +}.......}}}}}}}......}}}}}}}}}}}}}}.......}}}}}}}}}.....}}}}}}...}}..}}}}}} +}.....}}}}}}}}}}}.....}}}}}}}}}}}}}}}}}}}}}}.}}}}}}}..}}}}}}}}}}....}}}}}}} +}}..}}}}}}}}}}}}}....}}}}}}}}}}}}}}}}}}}}}}...}}..}}}}}}}.}}.}}}}..}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +]]); +-- Dungeon Description +des.region(selection.area(00,00,74,19),"lit") +des.region(selection.area(31,07,45,07),"unlit") +-- (must maintain one room definition; `filled=0' forces its room to be kept) +des.region({ region={35,09, 41,10}, lit = 0, type="ordinary", prefilled = 1 }) +des.region(selection.area(31,12,45,12),"unlit") +-- Teleport: down to up stairs island, up to Medusa's island +des.teleport_region({ region = {01,01,05,17}, dir="down" }) +des.teleport_region({ region = {26,04,50,15}, dir="up" }) +-- Stairs +des.stair("up", 05,14) +des.stair("down", 36,10) +-- Doors +des.door("closed",46,07) +des.door("locked",38,08) +des.door("locked",38,11) +des.door("closed",30,12) +-- Branch, not allowed inside Medusa's building. +des.levregion({ region = {01,00,79,20}, exclude = {30,06,46,13}, type = "branch" }) +-- Non diggable walls +des.non_diggable(selection.area(30,06,46,13)) +-- Objects +des.object({ id = "statue", x=36,y=10, buc="uncursed", + montype="knight", historic=1, male = 1, name="Perseus", + contents = function() + if math.random(0,99) < 75 then + des.object({ id = "shield of reflection", buc="cursed", spe=0 }) + end + if math.random(0,99) < 25 then + des.object({ id = "levitation boots", spe=0 }) + end + if math.random(0,99) < 50 then + des.object({ id = "scimitar", buc="blessed", spe=2 }) + end + if math.random(0,99) < 50 then + des.object("sack") + end + end +}); + +-- Specifying explicit contents forces them to be empty. +des.object({ id = "statue", contents = 0 }) +des.object({ id = "statue", contents = 0 }) +des.object({ id = "statue", contents = 0 }) +des.object({ id = "statue", contents = 0 }) +des.object({ id = "statue", contents = 0 }) +des.object({ id = "statue", contents = 0 }) +des.object({ id = "statue", contents = 0 }) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap("board",38,07) +des.trap("board",38,12) +-- Random monsters +des.monster({ id = "Medusa", x=36,y=10, asleep=1 }) +des.monster("giant eel",11,06) +des.monster("giant eel",23,13) +des.monster("giant eel",29,02) +des.monster("jellyfish",02,02) +des.monster("jellyfish",00,08) +des.monster("jellyfish",04,18) +des.monster("water troll",51,03) +des.monster("water troll",64,11) +des.monster({ class = 'S', x=38, y=07 }) +des.monster({ class = 'S', x=38, y=12 }) +des.monster() +des.monster() +des.monster() +des.monster() +des.monster() +des.monster() +des.monster() +des.monster() +des.monster() +des.monster() diff --git a/dat/medusa-2.lua b/dat/medusa-2.lua new file mode 100644 index 000000000..405627f63 --- /dev/null +++ b/dat/medusa-2.lua @@ -0,0 +1,126 @@ +-- NetHack 3.6 medusa.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) 1990, 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport") + +des.map([[ +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}------}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}-------}}}}}}}}--------------} +}|....|}}}}}}}}}..}.}}..}}}}}}}}}}}}}..}}}}}}-.....--}}}}}}}|............|} +}|....|.}}}}}}}}}}}.}...}}..}}}}}}}}}}}}}}}}}---......}}}}}.|............|} +}S....|.}}}}}}---}}}}}}}}}}}}}}}}}}}}}}}}}}---...|..-}}}}}}.S..----------|} +}|....|.}}}}}}-...}}}}}}}}}.}}...}.}}}}.}}}......----}}}}}}.|............|} +}|....|.}}}}}}-....--}}}}}}}}}}}}}}}}}}}}}}----...--}}}}}}}.|..--------+-|} +}|....|.}}}}}}}......}}}}...}}}}}}.}}}}}}}}}}}---..---}}}}}.|..|..S...|..|} +}|....|.}}}}}}-....-}}}}}}}------}}}}}}}}}}}}}}-...|.-}}}}}.|..|..|...|..|} +}|....|.}}}}}}}}}---}}}}}}}........}}}}}}}}}}---.|....}}}}}.|..|..|...|..|} +}|....|.}}}}}}}}}}}}}}}}}}-....|...-}}}}}}}}--...----.}}}}}.|..|..|...|..|} +}|....|.}}}}}}..}}}}}}}}}}---..--------}}}}}-..---}}}}}}}}}.|..|..-------|} +}|...}|...}}}.}}}}}}...}}}}}--..........}}}}..--}}}}}}}}}}}.|..|.........|} +}|...}S...}}.}}}}}}}}}}}}}}}-..--------}}}}}}}}}}}}}}...}}}.|..--------..S} +}|...}|...}}}}}}}..}}}}}}----..|....-}}}}}}}}}}}}}}}}}..}}}.|............|} +}|....|}}}}}....}}}}..}}.-.......----}}......}}}}}}.......}}|............|} +}------}}}}}}}}}}}}}}}}}}---------}}}}}}}}}}}}}}}}}}}}}}}}}}--------------} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +]]); +-- Dungeon Description +des.region(selection.area(00,00,74,19),"lit") +des.region(selection.area(02,03,05,16),"unlit") +des.region({ region={61,03, 72,16}, lit=0, type="ordinary", prefilled = 1,irregular = 1 }) +des.region(selection.area(71,08,72,11),"unlit") +des.region(selection.area(67,08,69,11),"lit") +-- Teleport: down to up stairs island, up to Medusa's island +des.teleport_region({ region = {02,03,05,16}, dir="down" }) +des.teleport_region({ region = {61,03,72,16}, dir="up" }) +-- Stairs +des.stair("up", 04,09) +des.stair("down", 68,10) +-- Doors +des.door("locked", 71,07) +-- Branch, not allowed on Medusa's island. +des.levregion({ type="branch", region = {01,00,79,20}, exclude = {59,01,73,17} }) +-- Non diggable walls +des.non_diggable(selection.area(01,02,06,17)) +des.non_diggable(selection.area(60,02,73,17)) +-- Objects +des.object({ id = "statue", x=68,y=10,buc="uncursed", + montype="knight", historic=1, male=1,name="Perseus", + contents = function() + if math.random(0,99) < 25 then + des.object({ id = "shield of reflection", buc="cursed", spe=0 }) + end + if math.random(0,99) < 75 then + des.object({ id = "levitation boots", spe=0 }) + end + if math.random(0,99) < 50 then + des.object({ id = "scimitar", buc="blessed", spe=2 }) + end + if math.random(0,99) < 50 then + des.object("sack") + end + end +}); +des.object({ id = "statue", x=64, y=08, contents=0 }) +des.object({ id = "statue", x=65, y=08, contents=0 }) +des.object({ id = "statue", x=64, y=09, contents=0 }) +des.object({ id = "statue", x=65, y=09, contents=0 }) +des.object({ id = "statue", x=64, y=10, contents=0 }) +des.object({ id = "statue", x=65, y=10, contents=0 }) +des.object({ id = "statue", x=64, y=11, contents=0 }) +des.object({ id = "statue", x=65, y=11, contents=0 }) +des.object("boulder",04,04) +des.object("/",52,09) +des.object("boulder",52,09) +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- Traps +des.trap("magic",03,12) +des.trap() +des.trap() +des.trap() +des.trap() +-- Monsters. +des.monster({ id="Medusa",x=68,y=10,asleep=1 }) +des.monster("gremlin",02,14) +des.monster("titan",02,05) +des.monster("electric eel",10,13) +des.monster("electric eel",11,13) +des.monster("electric eel",10,14) +des.monster("electric eel",11,14) +des.monster("electric eel",10,15) +des.monster("electric eel",11,15) +des.monster("jellyfish",01,01) +des.monster("jellyfish",00,08) +des.monster("jellyfish",04,19) +des.monster({ id = "stone golem",x=64,y=08,asleep=1 }) +des.monster({ id = "stone golem",x=65,y=08,asleep=1 }) +des.monster({ id = "stone golem",x=64,y=09,asleep=1 }) +des.monster({ id = "stone golem",x=65,y=09,asleep=1 }) +des.monster({ id = "cobra",x=64,y=10,asleep=1 }) +des.monster({ id = "cobra",x=65,y=10,asleep=1 }) +des.monster("A",72,08) +des.monster({ id = "yellow light",x=72,y=11,asleep=1 }) +des.monster({ x = 17, y = 07 }) +des.monster({ x = 28, y = 11 }) +des.monster({ x = 32, y = 13 }) +des.monster({ x = 49, y = 09 }) +des.monster({ x = 48, y = 07 }) +des.monster({ x = 65, y = 03 }) +des.monster({ x = 70, y = 04 }) +des.monster({ x = 70, y = 15 }) +des.monster({ x = 65, y = 16 }) +des.monster() +des.monster() +des.monster() +des.monster() + diff --git a/dat/medusa-3.lua b/dat/medusa-3.lua new file mode 100644 index 000000000..65961b5e5 --- /dev/null +++ b/dat/medusa-3.lua @@ -0,0 +1,115 @@ +-- NetHack 3.6 medusa.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) 1990, 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("noteleport", "mazelevel", "shortsighted") +-- +-- Here you disturb ravens nesting in the trees. +-- +des.map([[ +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}T..T.}}}}}}}}}}}}}}}}}}}}..}}}}}}}}.}}}...}}}}}}}.}}}}}......}}}}}}} +}}}}}}.......T.}}}}}}}}}}}..}}}}..T.}}}}}}...T...T..}}...T..}}..-----..}}}}} +}}}...-----....}}}}}}}}}}.T..}}}}}...}}}}}.....T..}}}}}......T..|...|.T..}}} +}}}.T.|...|...T.}}}}}}}.T......}}}}..T..}}.}}}.}}...}}}}}.T.....+...|...}}}} +}}}}..|...|.}}.}}}}}.....}}}T.}}}}.....}}}}}}.T}}}}}}}}}}}}}..T.|...|.}}}}}} +}}}}}.|...|.}}}}}}..T..}}}}}}}}}}}}}T.}}}}}}}}..}}}}}}}}}}}.....-----.}}}}}} +}}}}}.--+--..}}}}}}...}}}}}}}}}}}}}}}}}}}T.}}}}}}}}}}}}}}}}.T.}........}}}}} +}}}}}.......}}}}}}..}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}.}}.T.}}}}}} +}}.T...T...}}}}T}}}}}}}}}}}....}}}}}}}}}}T}}}}}.T}}...}}}}}}}}}}}}}}...}}}}} +}}}...T}}}}}}}..}}}}}}}}}}}.T...}}}}}}}}.T.}.T.....T....}}}}}}}}}}}}}.}}}}}} +}}}}}}}}}}}}}}}....}}}}}}}...}}.}}}}}}}}}}............T..}}}}}.T.}}}}}}}}}}} +}}}}}}}}}}}}}}}}..T..}}}}}}}}}}}}}}..}}}}}..------+--...T.}}}....}}}}}}}}}}} +}}}}.}..}}}}}}}.T.....}}}}}}}}}}}..T.}}}}.T.|...|...|....}}}}}.}}}}}...}}}}} +}}}.T.}...}..}}}}T.T.}}}}}}.}}}}}}}....}}...|...+...|.}}}}}}}}}}}}}..T...}}} +}}}}..}}}.....}}...}}}}}}}...}}}}}}}}}}}}}T.|...|...|}}}}}}}}}}}....T..}}}}} +}}}}}..}}}.T..}}}.}}}}}}}}.T..}}}}}}}}}}}}}}---S-----}}}}}}}}}}}}}....}}}}}} +}}}}}}}}}}}..}}}}}}}}}}}}}}}.}}}}}}}}}}}}}}}}}T..T}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +]]); + +local place = selection.new(); +place:set(08,06); +place:set(66,05); +place:set(46,15); + +des.region(selection.area(00,00,74,19),"lit") +des.region({ region={49,14, 51,16}, lit=-1, type="ordinary", prefilled = 1 }); +des.region(selection.area(07,05,09,07),"unlit") +des.region(selection.area(65,04,67,06),"unlit") +des.region(selection.area(45,14,47,16),"unlit") +-- Non diggable walls +-- 4th room has diggable walls as Medusa is never placed there +des.non_diggable(selection.area(06,04,10,08)) +des.non_diggable(selection.area(64,03,68,07)) +des.non_diggable(selection.area(44,13,48,17)) +-- All places are accessible also with jumping, so don't bother +-- restricting the placement when teleporting from levels below this. +des.teleport_region({ region = {33,02,38,07}, dir="down" }) +des.levregion({ region = {32,01,39,07}, type="stair-up" }); +local mx, my = place:rndcoord(1); +des.stair("down", mx, my) +des.door("locked",08,08) +des.door("locked",64,05) +des.door("random",50,13) +des.door("locked",48,15) +-- +local px, py = place:rndcoord(1); +des.feature("fountain", px,py); +-- +local px, py = place:rndcoord(1); +des.object({ id="statue",x=px, y=py, buc="uncursed", + montype="knight", historic=1, male=1,name="Perseus", + contents = function() + if math.random(0,99) < 75 then + des.object({ id = "shield of reflection", buc="cursed", spe=0 }) + end + if math.random(0,99) < 25 then + des.object({ id = "levitation boots", spe=0 }) + end + if math.random(0,99) < 50 then + des.object({ id = "scimitar", buc="blessed", spe=2 }) + end + if math.random(0,99) < 50 then + des.object("sack") + end + end +}); +-- +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) + +for i=1,8 do + des.object() +end +des.object("blank paper",48,18) +des.object("blank paper",48,18) +-- +des.trap("rust") +des.trap("rust") +des.trap("board") +des.trap("board") +des.trap() +-- +des.monster({ id = "Medusa", x=mx, y=my, asleep=1 }) +des.monster("giant eel") +des.monster("giant eel") +des.monster("jellyfish") +des.monster("jellyfish") +des.monster("wood nymph") +des.monster("wood nymph") +des.monster("water nymph") +des.monster("water nymph") + +for i=1,30 do + des.monster({ id = "raven", hostile = 1 }) +end + diff --git a/dat/medusa-4.lua b/dat/medusa-4.lua new file mode 100644 index 000000000..b30540c51 --- /dev/null +++ b/dat/medusa-4.lua @@ -0,0 +1,129 @@ +-- NetHack 3.6 medusa.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) 1990, 1991 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); +des.level_flags("noteleport", "mazelevel") +-- +-- Here the Medusa rules some slithery monsters from her 'palace', with +-- a yellow dragon nesting in the backyard. +-- +des.map([[ +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +}}}}}}}}}}}}}}........}}}}}}}}}}}}}}}}}}}}}}}..}}}.....}}}}}}}}}}}----|}}}}} +}}}}}}..----------F-.....}}}}}}}}}}}}}}}}..---...}}}}....T.}}}}}}}....|}}}}} +}}}.....|...F......S}}}}....}}}}}}}...}}.....|}}.}}}}}}}......}}}}|......}}} +}}}.....+...|..{...|}}}}}}}}}}}}.....}}}}|...|}}}}}}}}}}}.}}}}}}}}----.}}}}} +}}......|...|......|}}}}}}}}}......}}}}}}|.......}}}}}}}}}}}}}..}}}}}...}}}} +}}|-+--F|-+--....|F|-|}}}}}....}}}....}}}-----}}.....}}}}}}}......}}}}.}}}}} +}}|...}}|...|....|}}}|}}}}}}}..}}}}}}}}}}}}}}}}}}}}....}}}}}}}}....T.}}}}}}} +}}|...}}F...+....F}}}}}}}..}}}}}}}}}}}}}}...}}}}}}}}}}}}}}}}}}}}}}....}}..}} +}}|...}}|...|....|}}}|}....}}}}}}....}}}...}}}}}...}}}}}}}}}}}}}}}}}.....}}} +}}--+--F|-+--....-F|-|....}}}}}}}}}}.T...}}}}....---}}}}}}}}}}}}}}}}}}}}}}}} +}}......|...|......|}}}}}.}}}}}}}}}....}}}}}}}.....|}}}}}}}}}.}}}}}}}}}}}}}} +}}}}....+...|..{...|.}}}}}}}}}}}}}}}}}}}}}}}}}}.|..|}}}}}}}......}}}}...}}}} +}}}}}}..|...F......|...}}}}}}}}}}..---}}}}}}}}}}--.-}}}}}....}}}}}}....}}}}} +}}}}}}}}-----S----F|....}}}}}}}}}|...|}}}}}}}}}}}}...}}}}}}...}}}}}}..}}}}}} +}}}}}}}}}..............T...}}}}}.|.......}}}}}}}}}}}}}}..}...}.}}}}....}}}}} +}}}}}}}}}}....}}}}...}...}}}}}.......|.}}}}}}}}}}}}}}.......}}}}}}}}}...}}}} +}}}}}}}}}}..}}}}}}}}}}.}}}}}}}}}}-..--.}}}}}}}}..}}}}}}..T...}}}..}}}}}}}}}} +}}}}}}}}}...}}}}}}}}}}}}}}}}}}}}}}}...}}}}}}}....}}}}}}}.}}}..}}}...}}}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}}}}....}}}}}}}}}}}}}}}}}}}...}}}}}} +}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} +]]); +-- +local place = selection.new(); +place:set(04,08); +place:set(10,04); +place:set(10,08); +place:set(10,12); +-- +des.region(selection.area(00,00,74,19),"lit") +des.region({ region={13,03, 18,13}, lit=1, type="ordinary", prefilled=1 }) +-- +des.teleport_region({ region = {64,01,74,17}, dir="down" }); +des.teleport_region({ region = {02,02,18,13}, dir="up" }); +-- +des.levregion({ region = {67,01,74,20}, type="stair-up" }); +local mx, my = place:rndcoord(1); +des.stair("down", mx, my) +-- +des.door("locked",04,06) +des.door("locked",04,10) +des.door("locked",08,04) +des.door("locked",08,12) +des.door("locked",10,06) +des.door("locked",10,10) +des.door("locked",12,08) +-- +des.levregion({ region = {27,00,79,20}, type="branch" }); +-- +des.non_diggable(selection.area(01,01,22,14)); +-- +des.object("crystal ball", 07,08) +-- +local px, py = place:rndcoord(1); +des.object({ id="statue",x=px, y=py, buc="uncursed", + montype="knight", historic=1, male=1,name="Perseus", + contents = function() + if math.random(0,99) < 75 then + des.object({ id = "shield of reflection", buc="cursed", spe=0 }) + end + if math.random(0,99) < 25 then + des.object({ id = "levitation boots", spe=0 }) + end + if math.random(0,99) < 50 then + des.object({ id = "scimitar", buc="blessed", spe=2 }) + end + if math.random(0,99) < 50 then + des.object("sack") + end + end +}); +-- +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +des.object({ id = "statue", contents=0 }) +for i=1,8 do + des.object() +end +-- +for i=1,7 do + des.trap() +end +-- +des.monster("Medusa", mx, my) +des.monster("kraken", 07,07) +-- +-- the nesting dragon +des.monster({ id = "yellow dragon", x=05, y=04, asleep=1 }) +if math.random(0,99) < 50 then + des.monster({ id = "baby yellow dragon", x=04,y=04, asleep=1 }) +end +if math.random(0,99) < 25 then + des.monster({ id = "baby yellow dragon", x=04, y=05, asleep=1 }) +end +des.object({ id = "egg", x=05, y=04, montype="yellow dragon" }); +if math.random(0,99) < 50 then + des.object({ id = "egg", x=05, y=04, montype="yellow dragon" }); +end +if math.random(0,99) < 25 then + des.object({ id = "egg", x=05, y=04, montype="yellow dragon" }); +end +-- +des.monster("giant eel") +des.monster("giant eel") +des.monster("jellyfish") +des.monster("jellyfish") +for i=1,14 do + des.monster("S") +end +for i=1,4 do + des.monster("black naga hatchling") + des.monster("black naga") +end diff --git a/dat/medusa.des b/dat/medusa.des deleted file mode 100644 index b449a29e2..000000000 --- a/dat/medusa.des +++ /dev/null @@ -1,416 +0,0 @@ -# NetHack 3.6 medusa.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) 1990, 1991 by M. Stephenson -# NetHack may be freely redistributed. See license for details. -# -# These are the Medusa's levels : -# - -MAZE:"medusa-1",' ' -FLAGS: noteleport -GEOMETRY:center,center -MAP -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}.}}}}}..}}}}}......}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}....}}}...}}}}} -}...}}.....}}}}}....}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}...............} -}....}}}}}}}}}}....}}}..}}}}}}}}}}}.......}}}}}}}}}}}}}}}}..}}.....}}}...}} -}....}}}}}}}}.....}}}}..}}}}}}.................}}}}}}}}}}}.}}}}.....}}...}} -}....}}}}}}}}}}}}.}}}}.}}}}}}.-----------------.}}}}}}}}}}}}}}}}}.........} -}....}}}}}}}}}}}}}}}}}}.}}}...|...............S...}}}}}}}}}}}}}}}}}}}....}} -}.....}.}}....}}}}}}}}}.}}....--------+--------....}}}}}}..}}}}}}}}}}}...}} -}......}}}}..}}}}}}}}}}}}}........|.......|........}}}}}....}}}}}}}}}}}}}}} -}.....}}}}}}}}}}}}}}}}}}}}........|.......|........}}}}}...}}}}}}}}}.}}}}}} -}.....}}}}}}}}}}}}}}}}}}}}....--------+--------....}}}}}}.}.}}}}}}}}}}}}}}} -}......}}}}}}}}}}}}}}}}}}}}...S...............|...}}}}}}}}}}}}}}}}}.}}}}}}} -}.......}}}}}}}..}}}}}}}}}}}}.-----------------.}}}}}}}}}}}}}}}}}....}}}}}} -}........}}.}}....}}}}}}}}}}}}.................}}}}}..}}}}}}}}}.......}}}}} -}.......}}}}}}}......}}}}}}}}}}}}}}.......}}}}}}}}}.....}}}}}}...}}..}}}}}} -}.....}}}}}}}}}}}.....}}}}}}}}}}}}}}}}}}}}}}.}}}}}}}..}}}}}}}}}}....}}}}}}} -}}..}}}}}}}}}}}}}....}}}}}}}}}}}}}}}}}}}}}}...}}..}}}}}}}.}}.}}}}..}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -ENDMAP -# Dungeon Description -# (must maintain one room definition; `unfilled' forces its room to be kept) -REGION:(00,00,74,19),lit,"ordinary" -REGION:(31,07,45,07),unlit,"ordinary" -REGION:(35,09,41,10),unlit,"ordinary",unfilled -REGION:(31,12,45,12),unlit,"ordinary" -# Teleport: down to up stairs island, up to Medusa's island -TELEPORT_REGION:(01,01,05,17),(0,0,0,0),down -TELEPORT_REGION:(26,04,50,15),(0,0,0,0),up -# Stairs -STAIR:(05,14),up -STAIR:(36,10),down -# Doors -DOOR:closed,(46,07) -DOOR:locked,(38,08) -DOOR:locked,(38,11) -DOOR:closed,(30,12) -# Branch, not allowed inside Medusa's building. -BRANCH:levregion(01,00,79,20),(30,06,46,13) -# Non diggable walls -NON_DIGGABLE:(30,06,46,13) -# Objects -CONTAINER:('`',"statue"),(36,10),uncursed,montype:"knight",3,name:"Perseus" { - [75%]: OBJECT:('[',"shield of reflection"),cursed,+0 - [25%]: OBJECT:('[',"levitation boots"),+0 - [50%]: OBJECT:(')',"scimitar"),blessed,+2 - [50%]: OBJECT:('(',"sack") -} -# These aren't really containers, but specifying CONTAINER forces them to be -# empty, since CONTAINERs contain only what is explicitly specified. -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Random traps -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:"board",(38,07) -TRAP:"board",(38,12) -# Random monsters -MONSTER:('@',"Medusa"),(36,10),asleep -MONSTER:(';',"giant eel"),(11,06) -MONSTER:(';',"giant eel"),(23,13) -MONSTER:(';',"giant eel"),(29,02) -MONSTER:(';',"jellyfish"),(02,02) -MONSTER:(';',"jellyfish"),(00,08) -MONSTER:(';',"jellyfish"),(04,18) -MONSTER:('T',"water troll"),(51,03) -MONSTER:('T',"water troll"),(64,11) -MONSTER:'S',(38,07) -MONSTER:'S',(38,12) -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random - -MAZE:"medusa-2",' ' -FLAGS: noteleport -GEOMETRY:center,center -MAP -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}------}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}-------}}}}}}}}--------------} -}|....|}}}}}}}}}..}.}}..}}}}}}}}}}}}}..}}}}}}-.....--}}}}}}}|............|} -}|....|.}}}}}}}}}}}.}...}}..}}}}}}}}}}}}}}}}}---......}}}}}.|............|} -}S....|.}}}}}}---}}}}}}}}}}}}}}}}}}}}}}}}}}---...|..-}}}}}}.S..----------|} -}|....|.}}}}}}-...}}}}}}}}}.}}...}.}}}}.}}}......----}}}}}}.|............|} -}|....|.}}}}}}-....--}}}}}}}}}}}}}}}}}}}}}}----...--}}}}}}}.|..--------+-|} -}|....|.}}}}}}}......}}}}...}}}}}}.}}}}}}}}}}}---..---}}}}}.|..|..S...|..|} -}|....|.}}}}}}-....-}}}}}}}------}}}}}}}}}}}}}}-...|.-}}}}}.|..|..|...|..|} -}|....|.}}}}}}}}}---}}}}}}}........}}}}}}}}}}---.|....}}}}}.|..|..|...|..|} -}|....|.}}}}}}}}}}}}}}}}}}-....|...-}}}}}}}}--...----.}}}}}.|..|..|...|..|} -}|....|.}}}}}}..}}}}}}}}}}---..--------}}}}}-..---}}}}}}}}}.|..|..-------|} -}|...}|...}}}.}}}}}}...}}}}}--..........}}}}..--}}}}}}}}}}}.|..|.........|} -}|...}S...}}.}}}}}}}}}}}}}}}-..--------}}}}}}}}}}}}}}...}}}.|..--------..S} -}|...}|...}}}}}}}..}}}}}}----..|....-}}}}}}}}}}}}}}}}}..}}}.|............|} -}|....|}}}}}....}}}}..}}.-.......----}}......}}}}}}.......}}|............|} -}------}}}}}}}}}}}}}}}}}}---------}}}}}}}}}}}}}}}}}}}}}}}}}}--------------} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -ENDMAP -# Dungeon Description -REGION:(00,00,74,19),lit,"ordinary" -REGION:(02,03,05,16),unlit,"ordinary" -REGION:(61,03,72,16),unlit,"ordinary",unfilled,irregular -REGION:(71,08,72,11),unlit,"ordinary" -REGION:(67,08,69,11),lit,"ordinary" -# Teleport: down to up stairs island, up to Medusa's island -TELEPORT_REGION:(02,03,05,16),(0,0,0,0),down -TELEPORT_REGION:(61,03,72,16),(0,0,0,0),up -# Stairs -STAIR:(04,09),up -STAIR:(68,10),down -# Doors -DOOR:locked,(71,07) -# Branch, not allowed on Medusa's island. -BRANCH:levregion(01,00,79,20),(59,01,73,17) -# Non diggable walls -NON_DIGGABLE:(01,02,06,17) -NON_DIGGABLE:(60,02,73,17) -# Objects -CONTAINER:('`',"statue"),(68,10),uncursed,montype:"knight",3,name:"Perseus" { - [25%]: OBJECT:('[',"shield of reflection"),cursed,+0 - [75%]: OBJECT:('[',"levitation boots"),+0 - [50%]: OBJECT:(')',"scimitar"),blessed,+2 - [50%]: OBJECT:('(',"sack") -} -CONTAINER:('`',"statue"),(64,08) { } -CONTAINER:('`',"statue"),(65,08) { } -CONTAINER:('`',"statue"),(64,09) { } -CONTAINER:('`',"statue"),(65,09) { } -CONTAINER:('`',"statue"),(64,10) { } -CONTAINER:('`',"statue"),(65,10) { } -CONTAINER:('`',"statue"),(64,11) { } -CONTAINER:('`',"statue"),(65,11) { } -OBJECT:('`',"boulder"),(04,04) -OBJECT:'/',(52,09) -OBJECT:('`',"boulder"),(52,09) -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -OBJECT:random,random -# Traps -TRAP:"magic",(03,12) -TRAP:random,random -TRAP:random,random -TRAP:random,random -TRAP:random,random -# Monsters. -MONSTER:('@',"Medusa"),(68,10),asleep -MONSTER:('g',"gremlin"),(02,14) -MONSTER:('H',"titan"),(02,05) -MONSTER:(';',"electric eel"),(10,13) -MONSTER:(';',"electric eel"),(11,13) -MONSTER:(';',"electric eel"),(10,14) -MONSTER:(';',"electric eel"),(11,14) -MONSTER:(';',"electric eel"),(10,15) -MONSTER:(';',"electric eel"),(11,15) -MONSTER:(';',"jellyfish"),(01,01) -MONSTER:(';',"jellyfish"),(00,08) -MONSTER:(';',"jellyfish"),(04,19) -MONSTER:(''',"stone golem"),(64,08),asleep -MONSTER:(''',"stone golem"),(65,08),asleep -MONSTER:(''',"stone golem"),(64,09),asleep -MONSTER:(''',"stone golem"),(65,09),asleep -MONSTER:('S',"cobra"),(64,10),asleep -MONSTER:('S',"cobra"),(65,10),asleep -MONSTER:'A',(72,08) -MONSTER:('y',"yellow light"),(72,11),asleep -MONSTER:random,(17,07) -MONSTER:random,(28,11) -MONSTER:random,(32,13) -MONSTER:random,(49,09) -MONSTER:random,(48,07) -MONSTER:random,(65,03) -MONSTER:random,(70,04) -MONSTER:random,(70,15) -MONSTER:random,(65,16) -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random - - -LEVEL:"medusa-3" -FLAGS: noteleport,mazelevel,shortsighted -INIT_MAP:solidfill,' ' -GEOMETRY:center,center -# -# Here you disturb ravens nesting in the trees. -# -MAP -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}T..T.}}}}}}}}}}}}}}}}}}}}..}}}}}}}}.}}}...}}}}}}}.}}}}}......}}}}}}} -}}}}}}.......T.}}}}}}}}}}}..}}}}..T.}}}}}}...T...T..}}...T..}}..-----..}}}}} -}}}...-----....}}}}}}}}}}.T..}}}}}...}}}}}.....T..}}}}}......T..|...|.T..}}} -}}}.T.|...|...T.}}}}}}}.T......}}}}..T..}}.}}}.}}...}}}}}.T.....+...|...}}}} -}}}}..|...|.}}.}}}}}.....}}}T.}}}}.....}}}}}}.T}}}}}}}}}}}}}..T.|...|.}}}}}} -}}}}}.|...|.}}}}}}..T..}}}}}}}}}}}}}T.}}}}}}}}..}}}}}}}}}}}.....-----.}}}}}} -}}}}}.--+--..}}}}}}...}}}}}}}}}}}}}}}}}}}T.}}}}}}}}}}}}}}}}.T.}........}}}}} -}}}}}.......}}}}}}..}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}.}}.T.}}}}}} -}}.T...T...}}}}T}}}}}}}}}}}....}}}}}}}}}}T}}}}}.T}}...}}}}}}}}}}}}}}...}}}}} -}}}...T}}}}}}}..}}}}}}}}}}}.T...}}}}}}}}.T.}.T.....T....}}}}}}}}}}}}}.}}}}}} -}}}}}}}}}}}}}}}....}}}}}}}...}}.}}}}}}}}}}............T..}}}}}.T.}}}}}}}}}}} -}}}}}}}}}}}}}}}}..T..}}}}}}}}}}}}}}..}}}}}..------+--...T.}}}....}}}}}}}}}}} -}}}}.}..}}}}}}}.T.....}}}}}}}}}}}..T.}}}}.T.|...|...|....}}}}}.}}}}}...}}}}} -}}}.T.}...}..}}}}T.T.}}}}}}.}}}}}}}....}}...|...+...|.}}}}}}}}}}}}}..T...}}} -}}}}..}}}.....}}...}}}}}}}...}}}}}}}}}}}}}T.|...|...|}}}}}}}}}}}....T..}}}}} -}}}}}..}}}.T..}}}.}}}}}}}}.T..}}}}}}}}}}}}}}---S-----}}}}}}}}}}}}}....}}}}}} -}}}}}}}}}}}..}}}}}}}}}}}}}}}.}}}}}}}}}}}}}}}}}T..T}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -ENDMAP -$place = { (08,06),(66,05),(46,15) } -SHUFFLE: $place -REGION:(00,00,74,19),lit,"ordinary" -REGION:(49,14,51,16),random,"ordinary",unfilled -REGION:(07,05,09,07),unlit,"ordinary" -REGION:(65,04,67,06),unlit,"ordinary" -REGION:(45,14,47,16),unlit,"ordinary" -# Non diggable walls -# 4th room has diggable walls as Medusa is never placed there -NON_DIGGABLE:(06,04,10,08) -NON_DIGGABLE:(64,03,68,07) -NON_DIGGABLE:(44,13,48,17) -# All places are accessible also with jumping, so don't bother -# restricting the placement when teleporting from levels below this. -TELEPORT_REGION:(33,02,38,07),(0,0,0,0),down -STAIR:(32,01,39,07),(0,0,0,0),up -STAIR:$place[0],down -DOOR:locked,(08,08) -DOOR:locked,(64,05) -DOOR:random,(50,13) -DOOR:locked,(48,15) -# -FOUNTAIN:$place[1] -# -CONTAINER:('`',"statue"),$place[2],uncursed,montype:"knight",3,name:"Perseus" { - [75%]: OBJECT: ('[',"shield of reflection"),cursed,+0 - [25%]: OBJECT: ('[',"levitation boots"),+0 - [50%]: OBJECT: (')',"scimitar"),blessed,+2 - [50%]: OBJECT: ('(',"sack") -} -# -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } - -LOOP [8] { - OBJECT:random,random -} -OBJECT:('?',"blank paper"),(48,18) -OBJECT:('?',"blank paper"),(48,18) -# -TRAP:"rust",random -TRAP:"rust",random -TRAP:"board",random -TRAP:"board",random -TRAP:random,random -# -MONSTER:('@',"Medusa"),$place[0] -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"jellyfish"),random -MONSTER:(';',"jellyfish"),random -MONSTER:('n',"wood nymph"),random -MONSTER:('n',"wood nymph"),random -MONSTER:('n',"water nymph"),random -MONSTER:('n',"water nymph"),random - -LOOP [30] { - MONSTER:('B',"raven"),random,hostile -} - - -LEVEL:"medusa-4" -FLAGS: noteleport,mazelevel -INIT_MAP:solidfill,' ' -GEOMETRY:center,center -# -# Here the Medusa rules some slithery monsters from her 'palace', with -# a yellow dragon nesting in the backyard. -# -MAP -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -}}}}}}}}}}}}}}........}}}}}}}}}}}}}}}}}}}}}}}..}}}.....}}}}}}}}}}}----|}}}}} -}}}}}}..----------F-.....}}}}}}}}}}}}}}}}..---...}}}}....T.}}}}}}}....|}}}}} -}}}.....|...F......S}}}}....}}}}}}}...}}.....|}}.}}}}}}}......}}}}|......}}} -}}}.....+...|..{...|}}}}}}}}}}}}.....}}}}|...|}}}}}}}}}}}.}}}}}}}}----.}}}}} -}}......|...|......|}}}}}}}}}......}}}}}}|.......}}}}}}}}}}}}}..}}}}}...}}}} -}}|-+--F|-+--....|F|-|}}}}}....}}}....}}}-----}}.....}}}}}}}......}}}}.}}}}} -}}|...}}|...|....|}}}|}}}}}}}..}}}}}}}}}}}}}}}}}}}}....}}}}}}}}....T.}}}}}}} -}}|...}}F...+....F}}}}}}}..}}}}}}}}}}}}}}...}}}}}}}}}}}}}}}}}}}}}}....}}..}} -}}|...}}|...|....|}}}|}....}}}}}}....}}}...}}}}}...}}}}}}}}}}}}}}}}}.....}}} -}}--+--F|-+--....-F|-|....}}}}}}}}}}.T...}}}}....---}}}}}}}}}}}}}}}}}}}}}}}} -}}......|...|......|}}}}}.}}}}}}}}}....}}}}}}}.....|}}}}}}}}}.}}}}}}}}}}}}}} -}}}}....+...|..{...|.}}}}}}}}}}}}}}}}}}}}}}}}}}.|..|}}}}}}}......}}}}...}}}} -}}}}}}..|...F......|...}}}}}}}}}}..---}}}}}}}}}}--.-}}}}}....}}}}}}....}}}}} -}}}}}}}}-----S----F|....}}}}}}}}}|...|}}}}}}}}}}}}...}}}}}}...}}}}}}..}}}}}} -}}}}}}}}}..............T...}}}}}.|.......}}}}}}}}}}}}}}..}...}.}}}}....}}}}} -}}}}}}}}}}....}}}}...}...}}}}}.......|.}}}}}}}}}}}}}}.......}}}}}}}}}...}}}} -}}}}}}}}}}..}}}}}}}}}}.}}}}}}}}}}-..--.}}}}}}}}..}}}}}}..T...}}}..}}}}}}}}}} -}}}}}}}}}...}}}}}}}}}}}}}}}}}}}}}}}...}}}}}}}....}}}}}}}.}}}..}}}...}}}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}}}}....}}}}}}}}}}}}}}}}}}}...}}}}}} -}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -ENDMAP -# -$place = { (04,08),(10,04),(10,08),(10,12) } -SHUFFLE: $place -# -REGION:(00,00,74,19),lit,"ordinary" -REGION:(13,03,18,13),lit,"ordinary",unfilled -# -TELEPORT_REGION:(64,01,74,17),(0,0,0,0),down -TELEPORT_REGION:(02,02,18,13),(0,0,0,0),up -# -STAIR:(67,01,74,20),(0,0,0,0),up -STAIR:$place[0],down -# -DOOR:locked,(04,06) -DOOR:locked,(04,10) -DOOR:locked,(08,04) -DOOR:locked,(08,12) -DOOR:locked,(10,06) -DOOR:locked,(10,10) -DOOR:locked,(12,08) -# -BRANCH:levregion(27,00,79,20),(0,0,0,0) -# -NON_DIGGABLE:(01,01,22,14) -# -OBJECT:('(',"crystal ball"),(07,08) -# -CONTAINER:('`',"statue"),$place[1],uncursed,montype:"knight",3,name:"Perseus" { - [75%]: OBJECT: ('[',"shield of reflection"),cursed,+0 - [25%]: OBJECT: ('[',"levitation boots"),+0 - [50%]: OBJECT: (')',"scimitar"),blessed,+2 - [50%]: OBJECT: ('(',"sack") -} -# -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -CONTAINER:('`',"statue"),random { } -LOOP [8] { - OBJECT:random,random -} -# -LOOP [7] { - TRAP:random,random -} -# -MONSTER:('@',"Medusa"),$place[0] -MONSTER:(';',"kraken"),(07,07) -# -# the nesting dragon -MONSTER:('D',"yellow dragon"), (05,04), asleep -[50%]: MONSTER: ('D',"baby yellow dragon"), (04,04), asleep -[25%]: MONSTER: ('D',"baby yellow dragon"), (04,05), asleep -OBJECT:('%',"egg"), (05,04), montype:"yellow dragon" -[50%]: OBJECT: ('%',"egg"), (05,04), montype:"yellow dragon" -[25%]: OBJECT: ('%',"egg"), (05,04), montype:"yellow dragon" -# -MONSTER:(';',"giant eel"),random -MONSTER:(';',"giant eel"),random -MONSTER:(';',"jellyfish"),random -MONSTER:(';',"jellyfish"),random -LOOP [14] { - MONSTER:'S',random -} -LOOP [4] { - MONSTER:('N',"black naga hatchling"), random - MONSTER:('N',"black naga"), random -} diff --git a/dat/minefill.lua b/dat/minefill.lua new file mode 100644 index 000000000..be738098a --- /dev/null +++ b/dat/minefill.lua @@ -0,0 +1,50 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- + +-- The "fill" level for the mines. +-- +-- This level is used to fill out any levels not occupied by +-- specific levels. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.level_init({ style="mines", fg=".", bg=" ", smoothed=true ,joined=true, lit="random", walled=true }) + +-- +des.stair("up") +des.stair("down") +-- +des.object("*") +des.object("*") +des.object("*") +des.object("(") +des.object() +des.object() +des.object() +-- +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome lord") +des.monster("dwarf") +des.monster("dwarf") +des.monster("G") +des.monster("G") +des.monster("h") +-- +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() diff --git a/dat/minend-1.lua b/dat/minend-1.lua new file mode 100644 index 000000000..109cc0737 --- /dev/null +++ b/dat/minend-1.lua @@ -0,0 +1,118 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- Mine end level variant 1 +-- "Mimic of the Mines" + +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ +------------------------------------------------------------------ ------ +| |.......| |.......-...| |.....|. | +| --------- ----.......-------...........| ---...-S- | +| |.......| |..........................-S- --.......| | +| |......------- ---........................|. |.......-- | +| |..--........-----..........................|. -.-..---- | +| --..--.-----........-.....................--- --..-- | +| --..--..| -----------..................---.----------..-- | +| |...--.| |..S...S..............---................-- | +| ----..----- ------------........--- ------------...--- | +| |.........-- ---------- ---...-- ----- | +| --.....---..-- -------- --...---...-- | +| ----..-..-- --..--------------------- --......-- ---........| | +|--....----- --..-..................--- |........| |.......-- | +|.......| --......................S.. --......-- ---..---- | +|--.--.-- ----.................--- ------..------...-- | +| |....S.. |...............-..| ..S...........| | +-------- -------------------- ------------------------ +]]); + +-- Dungeon Description +local place = { {08,16},{13,07},{21,08},{41,14},{50,04},{50,16},{66,01} } +shuffle(place) + +des.region({ region={26,01,32,01},lit=0,type="ordinary",prefilled=0,irregular=1 }) +des.region(selection.area(20,08,21,08),"unlit") +des.region(selection.area(23,08,25,08),"unlit"); +-- Secret doors +des.door("locked",07,16) +des.door("locked",22,08) +des.door("locked",26,08) +des.door("locked",40,14) +des.door("locked",50,03) +des.door("locked",51,16) +des.door("locked",66,02) +-- Stairs +des.stair("up", 36,04) +-- Non diggable walls +des.non_diggable(selection.area(00,00,74,17)) +-- Niches +-- Note: place[6] empty +des.object("diamond",place[7]) +des.object("emerald",place[7]) +des.object("worthless piece of violet glass",place[7]) +des.monster({ class="m", coord=place[7], appear_as="obj:luckstone" }) +des.object("worthless piece of white glass",place[1]) +des.object("emerald",place[1]) +des.object("amethyst",place[1]) +des.monster({ class="m", coord=place[1], appear_as="obj:loadstone" }) +des.object("diamond",place[2]) +des.object("worthless piece of green glass",place[2]) +des.object("amethyst",place[2]) +des.monster({ class="m", coord=place[2], appear_as="obj:flint" }) +des.object("worthless piece of white glass",place[3]) +des.object("emerald",place[3]) +des.object("worthless piece of violet glass",place[3]) +des.monster({ class="m", coord=place[3], appear_as="obj:touchstone" }) +des.object("worthless piece of red glass",place[4]) +des.object("ruby",place[4]) +des.object("loadstone",place[4]) +des.object("ruby",place[5]) +des.object("worthless piece of red glass",place[5]) +des.object("luckstone",place[5]) +-- Random objects +des.object("*") +des.object("*") +des.object("*") +des.object("*") +des.object("*") +des.object("*") +des.object("*") +des.object("(") +des.object("(") +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters +des.monster("gnome king") +des.monster("gnome lord") +des.monster("gnome lord") +des.monster("gnome lord") +des.monster("gnomish wizard") +des.monster("gnomish wizard") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("hobbit") +des.monster("hobbit") +des.monster("dwarf") +des.monster("dwarf") +des.monster("dwarf") +des.monster("h") diff --git a/dat/minend-2.lua b/dat/minend-2.lua new file mode 100644 index 000000000..d8370d102 --- /dev/null +++ b/dat/minend-2.lua @@ -0,0 +1,152 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- Mine end level variant 2 +-- "Gnome King's Wine Cellar" + +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ +--------------------------------------------------------------------------- +|...................................................| | +|.|---------S--.--|...|--------------------------|..| | +|.||---| |.||-| |...|..........................|..| | +|.||...| |-|.|.|---...|.............................| .. | +|.||...|-|.....|....|-|..........................|..|. .. | +|.||.....|-S|..|....|............................|..|.. | +|.||--|..|..|..|-|..|----------------------------|..|-. | +|.| |..|..|....|..................................|... | +|.| |..|..|----|..-----------------------------|..|.... | +|.|---|..|--|.......|----------------------------|..|..... | +|...........|----.--|......................| |..|....... | +|-----------|...|.| |------------------|.|.|-----|..|.....|.. | +|-----------|.{.|.|--------------------|.|..........|.....|.... | +|...............|.S......................|-------------..-----... | +|.--------------|.|--------------------|.|......................... | +|.................| |.....................|........ | +--------------------------------------------------------------------------- +]]); + +if math.random(0, 99) < 50 then + des.terrain({55,14},"-") + des.terrain({56,14},"-") + des.terrain({61,15},"|") + des.terrain({52,5}, "S") + des.door("locked", 52,5) +end +if math.random(0, 99) < 50 then + des.terrain({18,1}, "|") + des.terrain(selection.area(7,12, 8,13), ".") +end +if math.random(0, 99) < 50 then + des.terrain({49,4}, "|") + des.terrain({21,5}, ".") +end +if math.random(0, 99) < 50 then + if math.random(0, 99) < 50 then + des.terrain({22,1}, "|") + else + des.terrain({50,7}, "-") + des.terrain({51,7}, "-") + end +end + + +-- Dungeon Description +des.feature("fountain", {14,13}) +des.region(selection.area(23,03,48,06),"lit") +des.region(selection.area(21,06,22,06),"lit") +des.region(selection.area(14,04,14,04),"unlit") +des.region(selection.area(10,05,14,08),"unlit") +des.region(selection.area(10,09,11,09),"unlit") +des.region(selection.area(15,08,16,08),"unlit") +-- Secret doors +des.door("locked",12,02) +des.door("locked",11,06) +-- Stairs +des.stair("up", 36,04) +-- Non diggable walls +des.non_diggable(selection.area(00,00,52,17)) +des.non_diggable(selection.area(53,00,74,00)) +des.non_diggable(selection.area(53,17,74,17)) +des.non_diggable(selection.area(74,01,74,16)) +des.non_diggable(selection.area(53,07,55,07)) +des.non_diggable(selection.area(53,14,61,14)) +-- The Gnome King's wine cellar. +-- the Trespassers sign is a long-running joke +des.engraving({12,03},"engrave","You are now entering the Gnome King's wine cellar.") +des.engraving({12,04},"engrave","Trespassers will be persecuted!") +des.object("booze", 10, 07) +des.object("booze", 10, 07) +des.object("!", 10, 07) +des.object("booze", 10, 08) +des.object("booze", 10, 08) +des.object("!", 10, 08) +des.object("booze", 10, 09) +des.object("booze", 10, 09) +des.object("object detection", 10, 09) +-- Objects +-- The Treasure chamber... +des.object("diamond", 69, 04) +des.object("*", 69, 04) +des.object("diamond", 69, 04) +des.object("*", 69, 04) +des.object("emerald", 70, 04) +des.object("*", 70, 04) +des.object("emerald", 70, 04) +des.object("*", 70, 04) +des.object("emerald", 69, 05) +des.object("*", 69, 05) +des.object("ruby", 69, 05) +des.object("*", 69, 05) +des.object("ruby", 70, 05) +des.object("amethyst", 70, 05) +des.object("*", 70, 05) +des.object("amethyst", 70, 05) +des.object("luckstone", 70, 05) +-- Scattered gems... +des.object("*") +des.object("*") +des.object("*") +des.object("*") +des.object("*") +des.object("*") +des.object("*") +des.object("(") +des.object("(") +des.object() +des.object() +des.object() +-- Random traps +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- Random monsters. +des.monster("gnome king") +des.monster("gnome lord") +des.monster("gnome lord") +des.monster("gnome lord") +des.monster("gnomish wizard") +des.monster("gnomish wizard") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("hobbit") +des.monster("hobbit") +des.monster("dwarf") +des.monster("dwarf") +des.monster("dwarf") +des.monster("h") diff --git a/dat/minend-3.lua b/dat/minend-3.lua new file mode 100644 index 000000000..a40d7448a --- /dev/null +++ b/dat/minend-3.lua @@ -0,0 +1,107 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- "Catacombs" by Kelly Bailey +-- Relies on some very specific behavior of MAZEWALK. + +des.level_init({ style = "solidfill", fg = "-" }); + +des.level_flags("mazelevel", "nommap") + +des.map({ halign = "center", valign = "bottom", map = [[ + - - - - - - - - - - -- -- - - . - - - - - - - - - -- - - -- - - - - . - - | +------...---------.-----------...-----.-------.------- ----------------| + - - - - - - - - - - - . - - - . - - - - - - - - - - -- - -- - . - - - - - | +------------.---------...-------------------------.--- ------------------| + - - - - - - - - - - . . - - --- - . - - - - - - - - -- -- - - - - |.....| | +--.---------------.......------------------------------- ----------|.....S-| + - - - - |.. ..| - ....... . - - - - |.........| - - - --- - - - - |.....| | +----.----|.....|------.......--------|.........|--------------.------------| + - - - - |..{..| - - -.... . --- - -.S.........S - - - - - - - - - - - - - | +---------|.....|--.---...------------|.........|---------------------------| + - - - - |.. ..| - - - . - - - - - - |.........| - --- . - - - - - - - - - | +----------------------...-------.---------------------...------------------| +---..| - - - - - - - - . --- - - - - - - - - - - - - - . - - --- - - --- - | +-.S..|----.-------.------- ---------.-----------------...----- -----.------- +---..| - - - - - - - -- - - -- . - - - - - . - - - . - . - - -- -- - - - -- +-.S..|--------.---.--- -...---------------...{.--------- --------- +--|. - - - - - - - -- - - - -- . - - - --- - - - . . - - - - -- - - - - - - +]] }); + +local place = { {1,15},{68,6},{1,13} } +shuffle(place) + +des.non_diggable(selection.area(67,3,73,7)) +des.non_diggable(selection.area(0,12,2,16)) +des.feature("fountain", {12,08}) +des.feature("fountain", {51,15}) +des.region(selection.area(0,0,75,16),"unlit") +des.region(selection.area(38,6,46,10),"lit") +des.door("closed",37,8) +des.door("closed",47,8) +des.door("closed",73,5) +des.door("closed",2,15) +des.mazewalk({ x=36, y=8, dir="west", stocked=false }) +des.stair("up", 42,8) +des.wallify() + +-- Objects +des.object("diamond") +des.object("*") +des.object("diamond") +des.object("*") +des.object("emerald") +des.object("*") +des.object("emerald") +des.object("*") +des.object("emerald") +des.object("*") +des.object("ruby") +des.object("*") +des.object("ruby") +des.object("amethyst") +des.object("*") +des.object("amethyst") +des.object("luckstone",place[2]) +des.object("flint",place[1]) +des.object("?") +des.object("?") +des.object("?") +des.object("?") +des.object("?") +des.object("+") +des.object("+") +des.object("+") +des.object("+") +des.object() +des.object() +des.object() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +des.trap() +-- One-time annoyance factor +des.trap("level teleport",place[2]) +des.trap("level teleport",place[1]) +des.monster("M") +des.monster("M") +des.monster("M") +des.monster("M") +des.monster("M") +des.monster("ettin mummy") +des.monster("V") +des.monster("Z") +des.monster("Z") +des.monster("Z") +des.monster("Z") +des.monster("Z") +des.monster("V") +des.monster("e") +des.monster("e") +des.monster("e") +des.monster("e") diff --git a/dat/minetn-1.lua b/dat/minetn-1.lua new file mode 100644 index 000000000..c9cab0732 --- /dev/null +++ b/dat/minetn-1.lua @@ -0,0 +1,145 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- A tragic accident has occurred in Frontier Town.... +-- +-- Minetown variant 1 +-- Orcish Town - a variant of Frontier Town that has been +-- overrun by orcs. Note the barricades (iron bars). + +des.level_flags("mazelevel") + +des.level_init({ style="mines", fg=".", bg=" ", smoothed=true ,joined=true, lit="random", walled=true }) + +des.map([[ +..................................... +.----------------F------------------. +.|.................................|. +.|.-------------......------------.|. +.|.|...|...|...|......|..|...|...|.|. +.F.|...|...|...|......|..|...|...|.|. +.|.|...|...|...|......|..|...|...|.F. +.|.|...|...|----......------------.|. +.|.---------.......................|. +.|.................................|. +.|.---------.....--...--...........|. +.|.|...|...|----.|.....|.---------.|. +.|.|...|...|...|.|.....|.|..|....|.|. +.|.|...|...|...|.|.....|.|..|....|.|. +.|.|...|...|...|.|.....|.|..|....|.|. +.|.-------------.-------.---------.|. +.|.................................F. +.-----------F------------F----------. +..................................... +]]); + +-- Don't let the player fall into his likely death +des.teleport_region({ region={01,01,20,19}, region_islev=1, exclude={20,00,70,19}, exclude_islev=1 }) +des.region(selection.area(00,00,36,16),"lit") +des.levregion({ type="stair-up", region={01,03,20,19}, region_islev=1, exclude={00,00,36,15}, exclude_islev=1 }); +des.levregion({ type="stair-down", region={61,03,75,19}, region_islev=1, exclude={00,00,36,15} }) + +-- shame we can't make polluted fountains +des.feature("fountain",16,09) +des.feature("fountain",25,09) + +-- the altar's defiled; useful for BUC but never coaligned +des.altar({ x=20,y=13,align="noalign", type="shrine" }) + +-- set up the shop doors; could be broken down +des.door("random",5,8) +des.door("random",9,8) +des.door("random",13,7) +des.door("random",22,5) +des.door("random",27,7) +des.door("random",31,7) +des.door("random",5,10) +des.door("random",9,10) +des.door("random",15,13) +des.door("random",25,13) +des.door("random",31,11) + +-- knock a few holes in the shop interior walls +des.replace_terrain({ region={07,04,11,06}, fromterrain="|", toterrain=".", chance=18 }) +des.replace_terrain({ region={25,04,29,06}, fromterrain="|", toterrain=".", chance=18 }) +des.replace_terrain({ region={07,12,11,14}, fromterrain="|", toterrain=".", chance=18 }) +des.replace_terrain({ region={28,12,28,14}, fromterrain="|", toterrain=".", chance=33 }) + +-- One spot each in most shops... +local place = { {05,04},{09,05},{13,04},{26,04},{31,05},{30,14},{05,14},{10,13},{26,14},{27,13} } +shuffle(place); + +-- scatter some bodies +des.object({ id = "corpse", x=20,y=12, montype="aligned priest" }) +des.object({ id = "corpse", coord = place[1], montype="shopkeeper" }) +des.object({ id = "corpse", coord = place[2], montype="shopkeeper" }) +des.object({ id = "corpse", coord = place[3], montype="shopkeeper" }) +des.object({ id = "corpse", coord = place[4], montype="shopkeeper" }) +des.object({ id = "corpse", coord = place[5], montype="shopkeeper" }) +des.object({ id = "corpse", montype="watchman" }) +des.object({ id = "corpse", montype="watchman" }) +des.object({ id = "corpse", montype="watchman" }) +des.object({ id = "corpse", montype="watchman" }) +des.object({ id = "corpse", montype="watch captain" }) + +-- Rubble! +for i=1,9 + math.random(2 - 1,2*5) do + if math.random(0,99) < 90 then + des.object("boulder") + end + des.object("rock") +end + +-- Guarantee 7 candles since we won't have Izchak available +des.object({ id = "wax candle", coord = place[4], quantity = math.random(1,2) }) + +des.object({ id = "wax candle", coord = place[1], quantity = math.random(2,4) }) +des.object({ id = "wax candle", coord = place[2], quantity = math.random(1,2) }) +des.object({ id = "tallow candle", coord = place[3], quantity = math.random(1,3) }) +des.object({ id = "tallow candle", coord = place[2], quantity = math.random(1,2) }) +des.object({ id = "tallow candle", coord = place[4], quantity = math.random(1,2) }) + +-- go ahead and leave a lamp next to one corpse to be suggestive +-- and some empty wands... +des.object("oil lamp",place[2]) +des.object({ id = "striking", coord = place[1], buc="uncursed", spe=0 }) +des.object({ id = "striking", coord = place[3], buc="uncursed", spe=0 }) +des.object({ id = "striking", coord = place[4], buc="uncursed", spe=0 }) +des.object({ id = "magic missile", coord = place[4], buc="uncursed", spe=0 }) +des.object({ id = "magic missile", coord = place[5], buc="uncursed", spe=0 }) + +-- the Orcish Army + +local inside = selection.floodfill(selection.new(), 18,8) +local near_temple = selection.area(selection.new(), 17,8, 23,14) & inside + +for i=1,5 + math.random(1 - 1,1*10) do + if math.random(0, 99) < 50 then + des.monster({ id = "orc-captain", coord = { inside:rndcoord(1) }, peaceful=0 }); + else + if math.random(0, 99) < 80 then + des.monster({ id = "Uruk-hai", coord = { inside:rndcoord(1) }, peaceful=0 }) + else + des.monster({ id = "Mordor orc", coord = { inside:rndcoord(1) }, peaceful=0 }) + end + end +end +-- shamans can be hanging out in/near the temple +for i=1,math.random(2 - 1,2*3) do + des.monster({ id = "orc shaman", coord = { near_temple:rndcoord(0) }, peaceful=0 }); +end +-- these are not such a big deal +-- to run into outside the bars +for i=1,9 + math.random(2 - 1,2*5) do + if math.random(0, 99) < 90 then + des.monster({ id = "hill orc", peaceful = 0 }) + else + des.monster({ id = "goblin", peaceful = 0 }) + end +end + +-- Hack to force full-level wallification + +des.wallify() diff --git a/dat/minetn-2.lua b/dat/minetn-2.lua new file mode 100644 index 000000000..7031c280f --- /dev/null +++ b/dat/minetn-2.lua @@ -0,0 +1,182 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- Minetown variant 2 +-- "Town Square" + +des.room({ type = "ordinary", lit=1, x=3, y=3, + xalign="center", yalign="center", w=31, h=15, + contents = function() + des.feature("fountain", 17, 5) + des.feature("fountain", 13, 8) + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", x=2,y=0, w=2,h=2, + contents = function() + des.door({ state="closed", wall="west" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", lit=0, x=5,y=0, w=2,h=2, + contents = function() + des.door({ state="closed", wall="south" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", x=8,y=0, w=2,h=2, + contents = function() + des.door({ state="closed", wall="east" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", lit=1, x=16,y=0, w=2,h=2, + contents = function() + des.door({ state="closed", wall="west" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", lit=0, x=19,y=0, w=2,h=2, + contents = function() + des.door({ state="closed", wall="south" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", x=22,y=0, w=2,h=2, + contents = function() + des.door({ state="closed", wall="south" }) + des.monster("gnome") + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", lit=0, x=25,y=0, w=2,h=2, + contents = function() + des.door({ state="closed", wall="east" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", lit=1, x=2,y=5, w=2,h=2, + contents = function() + des.door({ state="closed", wall="north" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", lit=1, x=5,y=5, w=2,h=2, + contents = function() + des.door({ state="closed", wall="south" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", x=8,y=5, w=2,h=2, + contents = function() + des.door({ state="locked", wall="north" }) + des.monster("gnome") + end + }) + end + + des.room({ type="shop", chance=90, lit=1, x=2,y=10, w=4,h=3, + contents = function() + des.door({ state="closed", wall="west" }) + end + }); + + des.room({ type = "tool shop", chance=90, lit=1, x=23,y=10, w=4,h=3, + contents = function() + des.door({ state="closed", wall="east" }) + end + }); + + des.room({ type = "food shop", chance=90, lit=1, x=24,y=5, w=3,h=4, + contents = function() + des.door({ state="closed", wall="north" }) + end + }); + + des.room({ type = "candle shop", lit=1, x=11,y=10, w=4,h=3, + contents = function() + des.door({ state="closed", wall="east" }) + end + }); + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", lit=0, x=7,y=10, w=3,h=3, + contents = function() + des.door({ state="locked", wall="north" }) + des.monster("gnome") + end + }); + end + + des.room({ type = "temple", lit=1, x=19,y=5, w=4,h=4, + contents = function() + des.door({ state="closed", wall="north" }) + des.altar({ x=02, y=02, align=align[1],type="shrine" }) + des.monster("gnomish wizard") + des.monster("gnomish wizard") + end + }); + + if math.random(0,99) < 75 then + des.room({ type = "ordinary", lit=1, x=18,y=10, w=4,h=3, + contents = function() + des.door({ state="locked", wall="west" }) + des.monster("gnome lord") + end + }); + end + + -- The Town Watch + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watch captain", peaceful = 1 }) + end +}); + +des.room({ contents = function() + des.stair("up") + end +}); + +des.room({ contents = function() + des.stair("down") + des.trap() + des.monster("gnome") + des.monster("gnome") + end +}); + +des.room({ contents = function() + des.monster("dwarf") + end +}); + +des.room({ contents = function() + des.trap() + des.monster("gnome") + end +}); + +des.random_corridors() + diff --git a/dat/minetn-3.lua b/dat/minetn-3.lua new file mode 100644 index 000000000..6217d174e --- /dev/null +++ b/dat/minetn-3.lua @@ -0,0 +1,150 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- Minetown variant 3 by Kelly Bailey +-- "Alley Town" + +des.room({ type = "ordinary",lit=1,x=3,y=3, + xalign="center",yalign="center",w=31,h=15, + contents = function() + des.feature("fountain", 01,06) + des.feature("fountain", 29,13) + + des.room({ type = "ordinary",x=2,y=2,w=2,h=2, + contents = function() + des.door({ state="closed", wall="south" }) + end + }); + + des.room({ type = "tool shop", chance=30, lit=1,x=5,y=3,w=2,h=3, + contents = function() + des.door({ state="closed", wall="south" }) + end + }) + + des.room({ type = "ordinary",x=2,y=10,w=2,h=3, + contents = function() + des.door({ state ="locked", wall="north" }) + des.monster("G") + end + }) + + des.room({ type = "ordinary", x=5,y=9,w=2,h=2, + contents = function() + des.door({ state="closed", wall="north" }) + end + }) + + des.room({ type = "temple",lit=1,x=10,y=2,w=3,h=4, + contents = function() + des.door({ state="closed", wall="east" }) + des.altar({ x=1, y=1, align = align[1], type="shrine" }) + des.monster("gnomish wizard") + des.monster("gnomish wizard") + end + }) + + des.room({ type = "ordinary",x=11,y=7,w=2,h=2, + contents = function() + des.door({ state="closed", wall="west" }) + end + }) + + des.room({ type = "shop",lit=1,x=10,y=10,w=3,h=3, + contents = function() + des.door({ state="closed", wall="west" }) + end + }) + + des.room({ type = "ordinary",random,x=14,y=8,w=2,h=2, + contents = function() + des.door({ state="locked", wall="north" }) + des.monster("G") + end + }) + + des.room({ type = "ordinary",random,x=14,y=11,w=2,h=2, + contents = function() + des.door({ state="closed", wall="south" }) + end + }) + + des.room({ type = "tool shop", chance=40,lit=1,x=17,y=10,w=3,h=3, + contents = function() + des.door({ state="closed", wall="north" }) + end + }) + + des.room({ type = "ordinary",x=21,y=11,w=2,h=2, + contents = function() + des.door({ state="locked", wall="east" }) + des.monster("G") + end + }) + + des.room({ type = "food shop", chance=90,lit=1,x=26,y=8,w=3,h=2, + contents = function() + des.door({ state="closed", wall="west" }) + end + }) + + des.room({ type = "ordinary",random,x=16,y=2,w=2,h=2, + contents = function() + des.door({ state="closed", wall="west" }) + end + }) + + des.room({ type = "ordinary",random,x=19,y=2,w=2,h=2, + contents = function() + des.door({ state="closed", wall="north" }) + end + }) + + des.room({ type = "wand shop", chance=30,lit=1,x=19,y=5,w=3,h=2, + contents = function() + des.door({ state="closed", wall="west" }) + end + }) + + des.room({ type = "candle shop",lit=1,x=25,y=2,w=3,h=3, + contents = function() + des.door({ state="closed", wall="south" }) + end + }) + + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watch captain", peaceful = 1 }) + + end +}) + +des.room({ type = "ordinary", contents = function() + des.stair("up") + end +}) + +des.room({ type = "ordinary", contents = function() + des.stair("down") + des.trap() + des.monster("gnome") + des.monster("gnome") + end +}) + +des.room({ type = "ordinary", contents = function() + des.monster("dwarf") + end +}) + +des.room({ type = "ordinary", contents = function() + des.trap() + des.monster("gnome") + end +}) + +des.random_corridors() diff --git a/dat/minetn-4.lua b/dat/minetn-4.lua new file mode 100644 index 000000000..717185d67 --- /dev/null +++ b/dat/minetn-4.lua @@ -0,0 +1,133 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1548631704 2019/01/27 23:28:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.30 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- Minetown variant 4 by Kelly Bailey +-- "College Town" + +des.room({ type = "ordinary", lit=1, x=3,y=3, + xalign="center", yalign="center", w=30, h=15, + contents = function() + des.feature("fountain", 08,07) + des.feature("fountain", 18,07) + + des.room({ type = "book shop", lit=1, x=4, y=2, w=3, h=3, + contents = function() + des.door({ state = "closed", wall="south" }) + end + }) + + des.room({ type = "ordinary", x=8, y=2, w=2, h=2, + contents = function() + des.door({ state = "closed", wall="south" }) + end + }) + + des.room({ type = "temple", lit=1, x=11, y=3, w=5, h=4, + contents = function() + des.door({ state = "closed", wall="south" }) + des.altar({ x=2,y=1,align=align[1], type="shrine" }) + des.monster("gnomish wizard") + des.monster("gnomish wizard") + end + }) + + des.room({ type = "ordinary", x=19, y=2, w=2, h=2, + contents = function() + des.door({ state = "closed", wall="south" }) + des.monster("G") + end + }) + + des.room({ type = "candle shop", lit=1, x=22, y=2, w=3, h=3, + contents = function() + des.door({ state = "closed", wall="south" }) + end + }) + + des.room({ type = "ordinary", x=26, y=2, w=2, h=2, + contents = function() + des.door({ state = "locked", wall="east" }) + des.monster("G") + end + }) + + des.room({ type = "tool shop", chance=90, lit=1, x=4,y=10, w=3,h=3, + contents = function() + des.door({ state = "closed", wall="north" }) + end + }) + + des.room({ type = "ordinary", x=8, y=11, w=2, h=2, + contents = function() + des.door({ state = "locked", wall="south" }) + des.monster("kobold shaman") + des.monster("kobold shaman") + des.monster("kitten") + des.monster("f") + end + }) + + des.room({ type = "food shop", chance=90, lit=1, x=11, y=11, w=3, h=2, + contents = function() + des.door({ state = "closed", wall="east" }) + end + }) + + des.room({ type = "ordinary", x=17, y=11, w=2, h=2, + contents = function() + des.door({ state = "closed", wall="west" }) + end + }) + + des.room({ type = "ordinary", x=20, y=10, w=2, h=2, + contents = function() + des.door({ state = "locked", wall="north" }) + des.monster("G") + end + }) + + des.room({ type = "shop", chance=90, lit=1, x=23, y=10, w=3, h=3, + contents = function() + des.door({ state = "closed", wall="north" }) + end + }) + + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watch captain", peaceful = 1 }) + end +}) + +des.room({ type = "ordinary", + contents = function() + des.stair("up") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.stair("down") + des.trap() + des.monster("gnome") + des.monster("gnome") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.monster("dwarf") + end +}) + +des.room({ type = "ordinary", + contents = function() + des.trap() + des.monster("gnome") + end +}) + +des.random_corridors() diff --git a/dat/minetn-5.lua b/dat/minetn-5.lua new file mode 100644 index 000000000..1f5974864 --- /dev/null +++ b/dat/minetn-5.lua @@ -0,0 +1,137 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1548631704 2019/01/27 23:28:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.30 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- "Grotto Town" by Kelly Bailey + +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel"); + +des.map([[ +----- --------- +|...--- ------.......-- ------- --------------- +|.....----.........--..| |.....| ------- |.............| +--..-....-.----------..| |.....| |.....| --+---+--.----+- + --.--.....---- ---- |.....| ------ --....---- |..-...--.-.+..| + ---.........---- ----- ---+--- |..+.| ---..-..----..---+-..---..| + ----.-....|..----...-- |.| |..|.| ---+-.....-+--........--+- + -----..|....-.....---- |.| |..|.------......--................| + ------ |..|.............---.-- ----.+..|-.......--..--------+--..-- + |....| --......---...........----- |.|..|-...{....---|.........|..-- + |....| |........-...-...........----.|..|--.......| |.........|...| + ---+--------....-------...---......--.-------....---- -----------...| + ------.---...--...--..-..--...-..---...|.--..-...-....------- |.......-- + |..|-.........-..---..-..---.....--....|........---...-|....| |.------- + |..+...............-+---+-----..--..........--....--...+....| |.|...S. +-----.....{....----...............-...........--...-...-|....| |.|...| +|..............-- --+--.---------.........--..-........------- |.--+------- +-+-----.........| |...|.|....| --.......------...|....---------.....|....| +|...| --..------- |...|.+....| ---...--- --..|...--......-...{..+..-+| +|...| ---- ------|....| ----- -----.....----........|..|.| +----- ------ ------- --------------- +]]); + +if math.random(0, 99) < 75 then + if math.random(0, 99) < 50 then + des.terrain(selection.line(25,8, 25,9), "|") + else + des.terrain(selection.line(16,13, 17,13), "-") + end +end +if math.random(0, 99) < 75 then + if math.random(0, 99) < 50 then + des.terrain(selection.line(36,10, 36,11), "|") + else + des.terrain(selection.line(32,15, 33,15), "-") + end +end +if math.random(0, 99) < 50 then + des.terrain(selection.area(21,4, 22,5), ".") + des.terrain(selection.line(14,9, 14,10), "|") +end +if math.random(0, 99) < 50 then + des.terrain({46,13}, "|") + des.terrain(selection.line(43,5, 47,5), "-") + des.terrain(selection.line(42,6, 46,6), ".") + des.terrain(selection.line(46,7, 47,7), ".") +end +if math.random(0,99) < 50 then + des.terrain(selection.area(69,11, 71,11), "-") +end + +des.stair("up", 01,01) +des.stair("down", 46,03) +des.feature("fountain", 50,09) +des.feature("fountain", 10,15) +des.feature("fountain", 66,18) + +des.region(selection.area(00,00,74,20),"unlit") +des.region(selection.area(09,13,11,17),"lit") +des.region(selection.area(08,14,12,16),"lit") +des.region(selection.area(49,07,51,11),"lit") +des.region(selection.area(48,08,52,10),"lit") +des.region(selection.area(64,17,68,19),"lit") +des.region(selection.area(37,13,39,17),"lit") +des.region(selection.area(36,14,40,17),"lit") +des.region(selection.area(59,02,72,10),"lit") + +des.monster({ id = "watchman", peaceful = 1 }) +des.monster({ id = "watchman", peaceful = 1 }) +des.monster({ id = "watchman", peaceful = 1 }) +des.monster({ id = "watchman", peaceful = 1 }) +des.monster({ id = "watch captain", peaceful = 1 }) +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome lord") +des.monster("gnome lord") +des.monster("dwarf") +des.monster("dwarf") +des.monster("dwarf") + +-- The shops +des.region({ region={25,17, 28,19}, lit=1, type="candle shop", prefilled=0 }) +des.door("closed",24,18) +des.region({ region={59, 9, 67,10}, lit=1, type="shop", prefilled=0 }) +des.door("closed",66,08) +des.region({ region={57,13, 60,15}, lit=1, type="tool shop", prefilled=0 }) +des.door("closed",56,14) +des.region({ region={05,09, 08,10}, lit=1, type="food shop", prefilled=0 }) +des.door("closed",07,11) +-- Gnome homes +des.door("closed",04,14) +des.door("locked",01,17) +des.monster("gnomish wizard", 02, 19) +des.door("locked",20,16) +des.monster("G", 20, 18) +des.door("random",21,14) +des.door("random",25,14) +des.door("random",42,08) +des.door("locked",40,05) +des.monster("G", 38, 07) +des.door("random",59,03) +des.door("random",58,06) +des.door("random",63,03) +des.door("random",63,05) +des.door("locked",71,03) +des.door("locked",71,06) +des.door("closed",69,04) +des.door("closed",67,16) +des.monster("gnomish wizard", 67, 14) +des.object("=", 70, 14) +des.door("locked",69,18) +des.monster("gnome lord", 71, 19) +des.door("locked",73,18) +des.object("chest", 73, 19) +des.door("locked",50,06) +des.object("(", 50, 03) +des.object({ id = "statue", x=38, y=15, montype="gnome king", historic=1 }) +-- Temple +des.region({ region={29,02, 33,04}, lit=1, type="temple" }) +des.door("closed",31,05) +des.altar({ x=31,y=03, align=align[1], type="shrine" }) diff --git a/dat/minetn-6.lua b/dat/minetn-6.lua new file mode 100644 index 000000000..758ce320b --- /dev/null +++ b/dat/minetn-6.lua @@ -0,0 +1,83 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1548631704 2019/01/27 23:28:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.30 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- "Bustling Town" by Kelly Bailey + +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "inaccessibles") + +des.level_init({ style="mines", fg=".", bg="-", smoothed=true, joined=true,lit=1,walled=true }) + +des.map({ halign = "center", valign = "top", map = [[ +.-----................----------------.- +.|...|................|...|..|...|...|.. +.|...+..--+--.........|...|..|...|...|.. +.|...|..|...|..-----..|...|..|-+---+--.. +.-----..|...|--|...|..--+---+-.........| +........|...|..|...+.............-----.. +........-----..|...|......--+-...|...|.. +.----...|...|+------..{...|..|...+...|.. +.|..+...|...|.............|..|...|...|.. +.|..|...|...|-+-.....---+-------------.| +.----...--+--..|..-+-|.................. +...|........|..|..|..|----....---------. +...|..T.....----..|..|...+....|......|-. +...|-....{........|..|...|....+......|-. +...--..-....T.....--------....|......|-. +.......--.....................---------- +]] }); + +des.region(selection.area(00,00,38,15),"lit") +des.levregion({ type="stair-up", region={01,03,20,19}, region_islev=1, exclude={0,0,39,15} }) +des.levregion({ type="stair-down", region={61,03,75,19}, region_islev=1, exclude={0,0,39,15} }) +des.feature("fountain" ,22,07) +des.feature("fountain", 09,13) +des.region(selection.area(13,5,14,6),"unlit") +des.region({ region={09,07, 11,09}, lit=1, type="candle shop", prefilled=0 }) +des.region({ region={16,04, 18,06}, lit=1, type="tool shop", prefilled=0 }) +des.region({ region={23,01, 25,03}, lit=1, type="shop", prefilled=0 }) +des.region({ region={22,12, 24,13}, lit=1, type="food shop", prefilled=0 }) +des.region({ region={31,12, 36,14}, lit=1, type="temple", prefilled=0 }) +des.altar({ x=35,y=13,align=align[1],type="shrine"}) + +des.door("closed",5,2) +des.door("locked",4,8) +des.door("closed",10,2) +des.door("closed",10,10) +des.door("locked",13,7) +des.door("locked",14,9) +des.door("closed",19,5) +des.door("closed",19,10) +des.door("closed",24,4) +des.door("closed",24,9) +des.door("closed",25,12) +des.door("closed",28,4) +des.door("locked",28,6) +des.door("closed",30,13) +des.door("closed",31,3) +des.door("closed",35,3) +des.door("closed",33,7) + +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome") +des.monster("gnome", 14, 6) +des.monster("gnome lord", 14, 5) +des.monster("gnome", 27, 8) +des.monster("gnome lord") +des.monster("gnome lord") +des.monster("dwarf") +des.monster("dwarf") +des.monster("dwarf") +des.monster({ id = "watchman", peaceful = 1 }) +des.monster({ id = "watchman", peaceful = 1 }) +des.monster({ id = "watchman", peaceful = 1 }) +des.monster({ id = "watch captain", peaceful = 1 }) +des.monster({ id = "watch captain", peaceful = 1 }) + diff --git a/dat/minetn-7.lua b/dat/minetn-7.lua new file mode 100644 index 000000000..dae4a9148 --- /dev/null +++ b/dat/minetn-7.lua @@ -0,0 +1,198 @@ +-- NetHack 3.6 mines.des $NHDT-Date: 1548631704 2019/01/27 23:28:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.30 $ +-- Copyright (c) 1989-95 by Jean-Christophe Collet +-- Copyright (c) 1991-95 by M. Stephenson +-- NetHack may be freely redistributed. See license for details. +-- +-- "Bazaar Town" by Kelly Bailey + +des.room({ type="ordinary", lit=1, x=3,y=3, + xalign="center",yalign="center", w=30,h=15, + contents = function() + des.feature("fountain", 12, 07) + des.feature("fountain", 11, 13) + + if math.random(0,99) < 75 then + des.room({ type="ordinary", x=2,y=2, w=4,h=2, + contents = function() + des.door({ state = "closed", wall="south" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type="ordinary", x=7,y=2, w=2,h=2, + contents = function() + des.door({ state = "closed", wall="north" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type="ordinary", x=7,y=5, w=2,h=2, + contents = function() + des.door({ state = "closed", wall="south" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type="ordinary", lit=1, x=10,y=2, w=3,h=4, + contents = function() + des.monster("gnome") + des.monster("monkey") + des.monster("monkey") + des.monster("monkey") + des.door({ state = "closed", wall="south" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type="ordinary", x=14,y=2, w=4,h=2, + contents = function() + des.door({ state = "closed", wall="south", pos=0 }) + des.monster("n") + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type="ordinary", x=16,y=5, w=2,h=2, + contents = function() + des.door({ state = "closed", wall="south" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type="ordinary", lit=0, x=19,y=2, w=2,h=2, + contents = function() + des.door({ state = "locked", wall="east" }) + des.monster("gnome king") + end + }) + end + + des.room({ type="food shop", chance=50, lit=1, x=19,y=5, w=2,h=3, + contents = function() + des.door({ state = "closed", wall="south" }) + end + }) + + if math.random(0,99) < 75 then + des.room({ type="ordinary", x=2,y=7, w=2,h=2, + contents = function() + des.door({ state = "closed", wall="east" }) + end + }) + end + + des.room({ type="tool shop", chance=50, lit=1, x=2,y=10, w=2,h=3, + contents = function() + des.door({ state = "closed", wall="south" }) + end + }) + + des.room({ type="candle shop", lit=1, x=5,y=10, w=3,h=3, + contents = function() + des.door({ state = "closed", wall="north" }) + end + }) + + if math.random(0,99) < 75 then + des.room({ type="ordinary", x=11,y=10, w=2,h=2, + contents = function() + des.door({ state = "locked", wall="west" }) + des.monster("G") + end + }) + end + + des.room({ type="shop", chance=60, lit=1, x=14,y=10, w=2,h=3, + contents = function() + des.door({ state = "closed", wall="north" }) + end + }) + + if math.random(0,99) < 75 then + des.room({ type="ordinary", x=17,y=11, w=4,h=2, + contents = function() + des.door({ state = "closed", wall="north" }) + end + }) + end + + if math.random(0,99) < 75 then + des.room({ type="ordinary", x=22,y=11, w=2,h=2, + contents = function() + des.door({ state = "closed", wall="south" }) + des.feature("sink", 00,00) + end + }) + end + + des.room({ type="food shop", chance=50, lit=1, x=25,y=11, w=3,h=2, + contents = function() + des.door({ state = "closed", wall="east" }) + end + }) + + des.room({ type="tool shop", chance=30, lit=1, x=25,y=2, w=3,h=3, + contents = function() + des.door({ state = "closed", wall="west" }) + end + }) + + des.room({ type="temple", lit=1, x=24,y=6, w=4,h=4, + contents = function() + des.door({ state = "closed", wall = "west" }) + des.altar({ x=02, y=01, align=align[1], type="shrine" }) + des.monster("gnomish wizard") + des.monster("gnomish wizard") + end + }) + + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ id = "watch captain", peaceful = 1 }) + des.monster("gnome") + des.monster("gnome") + des.monster("gnome") + des.monster("gnome lord") + des.monster("monkey") + des.monster("monkey") + + end +}) + +des.room({ type="ordinary", + contents = function() + des.stair("up") + end +}) + +des.room({ type="ordinary", + contents = function() + des.stair("down") + des.trap() + des.monster("gnome") + des.monster("gnome") + end +}) + +des.room({ type="ordinary", + contents = function() + des.monster("dwarf") + end +}) + +des.room({ type="ordinary", + contents = function() + des.trap() + des.monster("gnome") + end +}) + +des.random_corridors() diff --git a/dat/nhlib.lua b/dat/nhlib.lua new file mode 100644 index 000000000..5cd1e6cf2 --- /dev/null +++ b/dat/nhlib.lua @@ -0,0 +1,12 @@ + +math.randomseed( os.time() ) + +function shuffle(list) + for i = #list, 2, -1 do + local j = math.random(i) + list[i], list[j] = list[j], list[i] + end +end + +align = { "law", "neutral", "chaos" }; +shuffle(align); diff --git a/dat/oracle.des b/dat/oracle.des deleted file mode 100644 index 64603a935..000000000 --- a/dat/oracle.des +++ /dev/null @@ -1,65 +0,0 @@ -# NetHack 3.6 oracle.des $NHDT-Date: 1524689580 2018/04/25 20:53:00 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.10 $ -# Copyright (c) 2015 by Pasi Kallinen -# NetHack may be freely redistributed. See license for details. -# -# Oracle level -# - -LEVEL: "oracle" - -ROOM: "ordinary" , lit, (3,3), (center,center), (11,9) { - OBJECT:('`',"statue"),(0,0),montype:'C',1 - OBJECT:('`',"statue"),(0,8),montype:'C',1 - OBJECT:('`',"statue"),(10,0),montype:'C',1 - OBJECT:('`',"statue"),(10,8),montype:'C',1 - OBJECT:('`',"statue"),(5,1),montype:'C',1 - OBJECT:('`',"statue"),(5,7),montype:'C',1 - OBJECT:('`',"statue"),(2,4),montype:'C',1 - OBJECT:('`',"statue"),(8,4),montype:'C',1 - - SUBROOM: "delphi" , lit , (4,3) , (3,3) { - FOUNTAIN: (0, 1) - FOUNTAIN: (1, 0) - FOUNTAIN: (1, 2) - FOUNTAIN: (2, 1) - MONSTER: ('@', "Oracle"), (1,1) - ROOMDOOR: false , nodoor , random, random - } - - MONSTER: random, random - MONSTER: random, random - -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up - OBJECT: random,random -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - OBJECT: random, random - TRAP: random, random - MONSTER: random, random - MONSTER: random, random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - OBJECT: random, random - MONSTER: random, random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - MONSTER: random, random -} - -ROOM: "ordinary" , random, random, random, random { - OBJECT: random, random - TRAP: random, random - MONSTER: random, random -} - -RANDOM_CORRIDORS diff --git a/dat/oracle.lua b/dat/oracle.lua new file mode 100644 index 000000000..1158a18d0 --- /dev/null +++ b/dat/oracle.lua @@ -0,0 +1,63 @@ + +des.room({ type = "ordinary", lit=1, x=3,y=3, xalign="center",yalign="center", w=11,h=9, contents = function() + des.object({ id = "statue", x = 0, y = 0, montype = "C", historic = true }); + des.object({ id = "statue", x = 0, y = 8, montype = "C", historic = true }); + des.object({ id = "statue", x =10, y = 0, montype = "C", historic = true }); + des.object({ id = "statue", x =10, y = 8, montype = "C", historic = true }); + des.object({ id = "statue", x = 5, y = 1, montype = "C", historic = true }); + des.object({ id = "statue", x = 5, y = 7, montype = "C", historic = true }); + des.object({ id = "statue", x = 2, y = 4, montype = "C", historic = true }); + des.object({ id = "statue", x = 8, y = 4, montype = "C", historic = true }); + + des.room({ type = "delphi", lit = 1, x=4,y=3, w=3,h=3, contents = function() + des.feature("fountain", 0, 1); + des.feature("fountain", 1, 0); + des.feature("fountain", 1, 2); + des.feature("fountain", 2, 1); + des.monster("Oracle", 1, 1); + des.door({ state="nodoor", wall="all" }); + end + }); + + des.monster(); + des.monster(); + end +}); + +des.room({ contents = function() + des.stair("up"); + des.object(); + end +}); + +des.room({ contents = function() + des.stair("down"); + des.object(); + des.trap(); + des.monster(); + des.monster(); + end +}); + +des.room({ contents = function() + des.object(); + des.object(); + des.monster(); + end +}); + +des.room({ contents = function() + des.object(); + des.trap(); + des.monster(); + end +}); + +des.room({ contents = function() + des.object(); + des.trap(); + des.monster(); + end +}); + +des.random_corridors(); diff --git a/dat/orcus.lua b/dat/orcus.lua new file mode 100644 index 000000000..203899959 --- /dev/null +++ b/dat/orcus.lua @@ -0,0 +1,142 @@ +-- NetHack 3.6 gehennom.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- 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", "shortsighted") +-- A ghost town +des.map({ halign = "right", valign = "center", map = [[ +.|....|....|....|..............|....|........ +.|....|....|....|..............|....|........ +.|....|....|....|--...-+-------|............. +.|....|....|....|..............+............. +.|.........|....|..............|....|........ +.--+-...-+----+--....-------...--------.-+--- +.....................|.....|................. +.....................|.....|................. +.--+----....-+---....|.....|...----------+--- +.|....|....|....|....---+---...|......|...... +.|.........|....|..............|......|...... +.----...---------.....-----....+......|...... +.|........................|....|......|...... +.----------+-...--+--|....|....----------+--- +.|....|..............|....+....|............. +.|....+.......|......|....|....|............. +.|....|.......|......|....|....|............. +]] }); +des.mazewalk(00,06,"west") +-- Entire main area +des.region(selection.area(01,00,44,16),"unlit") +des.stair("down", 33,15) +des.levregion({ region={01,00,12,20}, region_islev=1, exclude={20,01,70,20}, exclude_islev=1, type="stair-up" }); +des.levregion({ region={01,00,12,20}, region_islev=1, exclude={20,01,70,20}, exclude_islev=1, type="branch" }); +des.teleport_region({ region={01,00,12,20}, region_islev=1, exclude={20,01,70,20}, exclude_islev=1 }); +-- Wall "ruins" +des.object("boulder",19,02) +des.object("boulder",20,02) +des.object("boulder",21,02) +des.object("boulder",36,02) +des.object("boulder",36,03) +des.object("boulder",06,04) +des.object("boulder",05,05) +des.object("boulder",06,05) +des.object("boulder",07,05) +des.object("boulder",39,05) +des.object("boulder",08,08) +des.object("boulder",09,08) +des.object("boulder",10,08) +des.object("boulder",11,08) +des.object("boulder",06,10) +des.object("boulder",05,11) +des.object("boulder",06,11) +des.object("boulder",07,11) +des.object("boulder",21,11) +des.object("boulder",21,12) +des.object("boulder",13,13) +des.object("boulder",14,13) +des.object("boulder",15,13) +des.object("boulder",14,14) +-- Doors +des.door("closed",23,02) +des.door("open",31,03) +des.door("nodoor",03,05) +des.door("closed",09,05) +des.door("closed",14,05) +des.door("closed",41,05) +des.door("open",03,08) +des.door("nodoor",13,08) +des.door("open",41,08) +des.door("closed",24,09) +des.door("closed",31,11) +des.door("open",11,13) +des.door("closed",18,13) +des.door("closed",41,13) +des.door("open",26,14) +des.door("closed",06,15) +-- Special rooms +des.altar({ x=24,y=07,align="noalign",type="sanctum" }) +des.region({ region={22,12,25,16},lit=0,type="morgue", prefilled=0 }) +des.region({ region={32,09,37,12},lit=1,type="shop",prefilled=0 }) +des.region({ region={12,00,15,04},lit=1,type="shop",prefilled=0 }) +-- Some traps. +des.trap("spiked pit") +des.trap("sleep gas") +des.trap("anti magic") +des.trap("fire") +des.trap("fire") +des.trap("fire") +des.trap("magic") +des.trap("magic") +-- Some random objects +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +des.object() +-- The resident nasty +des.monster("Orcus",33,15) +-- And its preferred companions +des.monster("human zombie",32,15) +des.monster("shade",32,14) +des.monster("shade",32,16) +des.monster("vampire",35,16) +des.monster("vampire",35,14) +des.monster("vampire lord",36,14) +des.monster("vampire lord",36,15) +-- Randomly placed companions +des.monster("skeleton") +des.monster("skeleton") +des.monster("skeleton") +des.monster("skeleton") +des.monster("skeleton") +des.monster("shade") +des.monster("shade") +des.monster("shade") +des.monster("shade") +des.monster("giant zombie") +des.monster("giant zombie") +des.monster("giant zombie") +des.monster("ettin zombie") +des.monster("ettin zombie") +des.monster("ettin zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("human zombie") +des.monster("vampire") +des.monster("vampire") +des.monster("vampire") +des.monster("vampire lord") +des.monster("vampire lord") +-- A few more for the party +des.monster() +des.monster() +des.monster() +des.monster() +des.monster() diff --git a/dat/sanctum.lua b/dat/sanctum.lua new file mode 100644 index 000000000..bc669a7cd --- /dev/null +++ b/dat/sanctum.lua @@ -0,0 +1,131 @@ +-- NetHack 3.6 gehennom.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- 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 = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "nommap") +-- This is outside the main map, below, so we must do it before adding +-- that map and anchoring coordinates to it. This extends the invisible +-- barrier up to the top row, which falls outside the drawn map. +des.non_passwall(selection.area(39,00,41,00)) +des.map([[ +---------------------------------------------------------------------------- +| -------------- | +| |............| ------- | +| -------............----- |.....| | +| |......................| --.....| --------- | +| ----......................---------|......---- |.......| | +| |........---------..........|......+.........| ------+---..| | +| ---........|.......|..........--S----|.........| |........|..| | +| |..........|.......|.............| |.........-------..---------- | +| |..........|.......|..........---- |..........|....|..|......| | +| |..........|.......|..........| --.......----+---S---S--..| | +| |..........---------..........| |.......|.............|..| | +| ---...........................| -----+-------S---------S--- | +| |...........................| |...| |......| |....|-- | +| ----.....................---- |...---....--- ---......| | +| |.....................| |..........| |.....---- | +| -------...........----- --...------- |.....| | +| |...........| |...| |.....| | +| ------------- ----- ------- | +---------------------------------------------------------------------------- +]]); +des.region({ region={15,07, 21,10}, lit=1, type="temple" }) +des.altar({ x=18, y=08, align="noalign", type="sanctum" }) +des.region({ region={41,06, 48,11}, lit=0, type="morgue", prefilled=0, irregular=1 }) +-- Non diggable walls +des.non_diggable(selection.area(00,00,75,19)) +-- Invisible barrier separating the left & right halves of the level +des.non_passwall(selection.area(37,00,39,19)) +-- Doors +des.door("closed",40,06) +des.door("locked",62,06) +des.door("closed",46,12) +des.door("closed",53,10) +-- Surround the temple with fire +des.trap("fire",13,05) +des.trap("fire",14,05) +des.trap("fire",15,05) +des.trap("fire",16,05) +des.trap("fire",17,05) +des.trap("fire",18,05) +des.trap("fire",19,05) +des.trap("fire",20,05) +des.trap("fire",21,05) +des.trap("fire",22,05) +des.trap("fire",23,05) +des.trap("fire",13,12) +des.trap("fire",14,12) +des.trap("fire",15,12) +des.trap("fire",16,12) +des.trap("fire",17,12) +des.trap("fire",18,12) +des.trap("fire",19,12) +des.trap("fire",20,12) +des.trap("fire",21,12) +des.trap("fire",22,12) +des.trap("fire",23,12) +des.trap("fire",13,06) +des.trap("fire",13,07) +des.trap("fire",13,08) +des.trap("fire",13,09) +des.trap("fire",13,10) +des.trap("fire",13,11) +des.trap("fire",23,06) +des.trap("fire",23,07) +des.trap("fire",23,08) +des.trap("fire",23,09) +des.trap("fire",23,10) +des.trap("fire",23,11) +-- Some traps. +des.trap("spiked pit") +des.trap("fire") +des.trap("sleep gas") +des.trap("anti magic") +des.trap("fire") +des.trap("magic") +-- Some random objects +des.object("[") +des.object("[") +des.object("[") +des.object("[") +des.object(")") +des.object(")") +des.object("*") +des.object("!") +des.object("!") +des.object("!") +des.object("!") +des.object("?") +des.object("?") +des.object("?") +des.object("?") +des.object("?") +-- Some monsters. +des.monster({ id = "horned devil", x=14,y=12,peaceful=0 }) +des.monster({ id = "barbed devil", x=18,y=08,peaceful=0 }) +des.monster({ id = "erinys", x=10,y=04,peaceful=0 }) +des.monster({ id = "marilith", x=07,y=09,peaceful=0 }) +des.monster({ id = "nalfeshnee", x=27,y=08,peaceful=0 }) +-- Moloch's horde +des.monster({ id = "aligned priest", x=20,y=03,align="noalign",peaceful=0 }) +des.monster({ id = "aligned priest", x=15,y=04,align="noalign",peaceful=0 }) +des.monster({ id = "aligned priest", x=11,y=05,align="noalign",peaceful=0 }) +des.monster({ id = "aligned priest", x=11,y=07,align="noalign",peaceful=0 }) +des.monster({ id = "aligned priest", x=11,y=09,align="noalign",peaceful=0 }) +des.monster({ id = "aligned priest", x=11,y=12,align="noalign",peaceful=0 }) +des.monster({ id = "aligned priest", x=15,y=13,align="noalign",peaceful=0 }) +des.monster({ id = "aligned priest", x=17,y=13,align="noalign",peaceful=0 }) +des.monster({ id = "aligned priest", x=21,y=13,align="noalign",peaceful=0 }) +-- A few nasties +des.monster("L") +des.monster("L") +des.monster("V") +des.monster("V") +des.monster("V") +des.stair("up", 63,15) +-- Teleporting to this level is allowed after the invocation creates its +-- entrance. Force arrival in that case to be on rightmost third of level. +des.teleport_region({ region = {54,1,79,18}, region_islev=1, dir="down" }) diff --git a/dat/soko1-1.lua b/dat/soko1-1.lua new file mode 100644 index 000000000..efcb3dd13 --- /dev/null +++ b/dat/soko1-1.lua @@ -0,0 +1,107 @@ +-- NetHack 3.6 sokoban.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- Copyright (c) 1998-1999 by Kevin Hugo +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "premapped", "solidify"); +des.map([[ +-------------------------- +|........................| +|.......|---------------.| +-------.------ |.| + |...........| |.| + |...........| |.| +--------.----- |.| +|............| |.| +|............| |.| +-----.-------- ------|.| + |..........| --|.....|.| + |..........| |.+.....|.| + |.........|- |-|.....|.| +-------.---- |.+.....+.| +|........| |-|.....|-- +|........| |.+.....| +|...|----- --|.....| +----- ------- +]]); + +place = selection.new(); +place:set(16,11); +place:set(16,13); +place:set(16,15); + +des.stair("down", 01, 01); +des.region(selection.area(00,00,25,17),"lit"); +des.non_diggable(selection.area(00,00,25,17)); +des.non_passwall(selection.area(00,00,25,17)); + +-- Boulders +des.object("boulder", 03, 05); +des.object("boulder", 05, 05); +des.object("boulder", 07, 05); +des.object("boulder", 09, 05); +des.object("boulder", 11, 05); +-- +des.object("boulder", 04, 07); +des.object("boulder", 04, 08); +des.object("boulder", 06, 07); +des.object("boulder", 09, 07); +des.object("boulder", 11, 07); +-- +des.object("boulder", 03, 12); +des.object("boulder", 04, 10); +des.object("boulder", 05, 12); +des.object("boulder", 06, 10); +des.object("boulder", 07, 11); +des.object("boulder", 08, 10); +des.object("boulder", 09, 12); +-- +des.object("boulder", 03, 14); + +-- Traps +des.trap("hole", 08, 01); +des.trap("hole", 09, 01); +des.trap("hole", 10, 01); +des.trap("hole", 11, 01); +des.trap("hole", 12, 01); +des.trap("hole", 13, 01); +des.trap("hole", 14, 01); +des.trap("hole", 15, 01); +des.trap("hole", 16, 01); +des.trap("hole", 17, 01); +des.trap("hole", 18, 01); +des.trap("hole", 19, 01); +des.trap("hole", 20, 01); +des.trap("hole", 21, 01); +des.trap("hole", 22, 01); +des.trap("hole", 23, 01); + +des.monster({ id = "giant mimic", appear_as = "obj:boulder" }); +des.monster({ id = "giant mimic", appear_as = "obj:boulder" }); + +-- Random objects +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "=" }); +des.object({ class = "/" }); + +-- Rewards +des.door("locked", 23, 13); +des.door("closed", 17, 11); +des.door("closed", 17, 13); +des.door("closed", 17, 15); + +des.region({ region={18,10, 22,16}, lit = 1, type = "zoo", prefilled = 0, irregular = 1 }); + +px, py = selection.rndcoord(place); +if math.random(0, 99) < 50 then + des.object("bag of holding", px, py); +else + des.object("amulet of reflection", px, py); +end +des.engraving({ x = px, y = py, type = "burn", text = "Elbereth" }); +des.object({ id = "scare monster", x = px, y = py, buc = "cursed" }); + diff --git a/dat/soko1-2.lua b/dat/soko1-2.lua new file mode 100644 index 000000000..6a6361d53 --- /dev/null +++ b/dat/soko1-2.lua @@ -0,0 +1,108 @@ +-- NetHack 3.6 sokoban.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- Copyright (c) 1998-1999 by Kevin Hugo +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "premapped", "solidify"); + +des.map([[ + ------------------------ + |......................| + |..-------------------.| +----.| ----- |.| +|..|.-- --...| |.| +|.....|--|....| |.| +|.....|..|....| |.| +--....|......-- |.| + |.......|...| ------|.| + |....|..|...| --|.....|.| + |....|--|...| |.+.....|.| + |.......|..-- |-|.....|.| + ----....|.-- |.+.....+.| + ---.--.| |-|.....|-- + |.....| |.+.....| + |..|..| --|.....| + ------- ------- +]]); + +local place = selection.new(); +place:set(16,10); +place:set(16,12); +place:set(16,14); + +des.stair("down", 06,15); +des.region(selection.area(00,00,25,16),"lit"); +des.non_diggable(selection.area(00,00,25,16)); +des.non_passwall(selection.area(00,00,25,16)); + +-- Boulders +des.object("boulder",04,04); +des.object("boulder",02,06); +des.object("boulder",03,06); +des.object("boulder",04,07); +des.object("boulder",05,07); +des.object("boulder",02,08); +des.object("boulder",05,08); +des.object("boulder",03,09); +des.object("boulder",04,09); +des.object("boulder",03,10); +des.object("boulder",05,10); +des.object("boulder",06,12); +-- +des.object("boulder",07,14); +-- +des.object("boulder",11,05); +des.object("boulder",12,06); +des.object("boulder",10,07); +des.object("boulder",11,07); +des.object("boulder",10,08); +des.object("boulder",12,09); +des.object("boulder",11,10); + +-- Traps +des.trap("hole",05,01) +des.trap("hole",06,01) +des.trap("hole",07,01) +des.trap("hole",08,01) +des.trap("hole",09,01) +des.trap("hole",10,01) +des.trap("hole",11,01) +des.trap("hole",12,01) +des.trap("hole",13,01) +des.trap("hole",14,01) +des.trap("hole",15,01) +des.trap("hole",16,01) +des.trap("hole",17,01) +des.trap("hole",18,01) +des.trap("hole",19,01) +des.trap("hole",20,01) +des.trap("hole",21,01) +des.trap("hole",22,01) + +des.monster({ id = "giant mimic", appear_as = "obj:boulder" }); +des.monster({ id = "giant mimic", appear_as = "obj:boulder" }); + +-- Random objects +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "=" }); +des.object({ class = "/" }); + +-- Rewards +des.door("locked",23,12) +des.door("closed",17,10) +des.door("closed",17,12) +des.door("closed",17,14) +des.region({ region={18,09, 22,15}, lit = 1, type = "zoo", prefilled = 0, irregular = 1 }); + +px, py = selection.rndcoord(place); +if math.random(0, 99) < 50 then + des.object("bag of holding",px,py); +else + des.object("amulet of reflection",px,py); +end +des.engraving({ x = px, y = py, type = "burn", text = "Elbereth" }); +des.object({ id = "scare monster", x = px, y = py, buc = "cursed" }); diff --git a/dat/soko2-1.lua b/dat/soko2-1.lua new file mode 100644 index 000000000..9934819f7 --- /dev/null +++ b/dat/soko2-1.lua @@ -0,0 +1,67 @@ +-- NetHack 3.6 sokoban.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- Copyright (c) 1998-1999 by Kevin Hugo +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "premapped", "solidify"); + +des.map([[ +-------------------- +|........|...|.....| +|.....-..|.-.|.....| +|..|.....|...|.....| +|-.|..-..|.-.|.....| +|...--.......|.....| +|...|...-...-|.....| +|...|..|...--|.....| +|-..|..|----------+| +|..................| +|...|..|------------ +-------- +]]); +des.stair("down", 06,10); +des.stair("up", 16,04); +des.door("locked", 18,08); +des.region(selection.area(00,00, 19,11), "lit"); +des.non_diggable(selection.area(00,00,19,11)); +des.non_passwall(selection.area(00,00,19,11)); + +-- Boulders +des.object("boulder",02,02) +des.object("boulder",03,02) +-- +des.object("boulder",05,03) +des.object("boulder",07,03) +des.object("boulder",07,02) +des.object("boulder",08,02) +-- +des.object("boulder",10,03) +des.object("boulder",11,03) +-- +des.object("boulder",02,07) +des.object("boulder",02,08) +des.object("boulder",03,09) +-- +des.object("boulder",05,07) +des.object("boulder",06,06) + +-- Traps +des.trap("hole",08,09) +des.trap("hole",09,09) +des.trap("hole",10,09) +des.trap("hole",11,09) +des.trap("hole",12,09) +des.trap("hole",13,09) +des.trap("hole",14,09) +des.trap("hole",15,09) +des.trap("hole",16,09) +des.trap("hole",17,09) + +-- Random objects +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "=" }); +des.object({ class = "/" }); diff --git a/dat/soko2-2.lua b/dat/soko2-2.lua new file mode 100644 index 000000000..bb931c15f --- /dev/null +++ b/dat/soko2-2.lua @@ -0,0 +1,68 @@ +-- NetHack 3.6 sokoban.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- Copyright (c) 1998-1999 by Kevin Hugo +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "premapped", "solidify"); + +des.map([[ + -------- +--|.|....| +|........|---------- +|.-...-..|.|.......| +|...-......|.......| +|.-....|...|.......| +|....-.--.-|.......| +|..........|.......| +|.--...|...|.......| +|....-.|---|.......| +--|....|----------+| + |................| + ------------------ +]]); +des.stair("down", 06,11) +des.stair("up", 15,06) +des.door("locked",18,10) +des.region(selection.area(00,00,19,12), "lit"); +des.non_diggable(selection.area(00,00,19,12)); +des.non_passwall(selection.area(00,00,19,12)); + +-- Boulders +des.object("boulder",04,02) +des.object("boulder",04,03) +des.object("boulder",05,03) +des.object("boulder",07,03) +des.object("boulder",08,03) +des.object("boulder",02,04) +des.object("boulder",03,04) +des.object("boulder",05,05) +des.object("boulder",06,06) +des.object("boulder",09,06) +des.object("boulder",03,07) +des.object("boulder",04,07) +des.object("boulder",07,07) +des.object("boulder",06,09) +des.object("boulder",05,10) +des.object("boulder",05,11) + +-- Traps +des.trap("hole",07,11) +des.trap("hole",08,11) +des.trap("hole",09,11) +des.trap("hole",10,11) +des.trap("hole",11,11) +des.trap("hole",12,11) +des.trap("hole",13,11) +des.trap("hole",14,11) +des.trap("hole",15,11) +des.trap("hole",16,11) +des.trap("hole",17,11) + +-- Random objects +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "=" }); +des.object({ class = "/" }); diff --git a/dat/soko3-1.lua b/dat/soko3-1.lua new file mode 100644 index 000000000..cec5eec8b --- /dev/null +++ b/dat/soko3-1.lua @@ -0,0 +1,79 @@ +-- NetHack 3.6 sokoban.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- Copyright (c) 1998-1999 by Kevin Hugo +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "premapped", "solidify"); + +des.map([[ +----------- ----------- +|....|....|-- |.........| +|....|......| |.........| +|.........|-- |.........| +|....|....| |.........| +|-.--------- |.........| +|....|.....| |.........| +|....|.....| |.........| +|..........| |.........| +|....|.....|---------------+| +|....|......................| +----------------------------- +]]); +des.stair("down", 11,02) +des.stair("up", 23,04) +des.door("locked", 27,09) +des.region(selection.area(00,00,28,11), "lit") +des.non_diggable(selection.area(00,00,28,11)) +des.non_passwall(selection.area(00,00,28,11)) + +-- Boulders +des.object("boulder",03,02) +des.object("boulder",04,02) +-- +des.object("boulder",06,02) +des.object("boulder",06,03) +des.object("boulder",07,02) +-- +des.object("boulder",03,06) +des.object("boulder",02,07) +des.object("boulder",03,07) +des.object("boulder",03,08) +des.object("boulder",02,09) +des.object("boulder",03,09) +des.object("boulder",04,09) +-- +des.object("boulder",06,07) +des.object("boulder",06,09) +des.object("boulder",08,07) +des.object("boulder",08,10) +des.object("boulder",09,08) +des.object("boulder",09,09) +des.object("boulder",10,07) +des.object("boulder",10,10) + +-- Traps +des.trap("hole",12,10) +des.trap("hole",13,10) +des.trap("hole",14,10) +des.trap("hole",15,10) +des.trap("hole",16,10) +des.trap("hole",17,10) +des.trap("hole",18,10) +des.trap("hole",19,10) +des.trap("hole",20,10) +des.trap("hole",21,10) +des.trap("hole",22,10) +des.trap("hole",23,10) +des.trap("hole",24,10) +des.trap("hole",25,10) +des.trap("hole",26,10) + +-- Random objects +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "=" }); +des.object({ class = "/" }); + diff --git a/dat/soko3-2.lua b/dat/soko3-2.lua new file mode 100644 index 000000000..fa15d8ba6 --- /dev/null +++ b/dat/soko3-2.lua @@ -0,0 +1,71 @@ +-- NetHack 3.6 sokoban.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- Copyright (c) 1998-1999 by Kevin Hugo +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "premapped", "solidify"); + +des.map([[ + ---- ----------- +-|..|------- |.........| +|..........| |.........| +|..-----.-.| |.........| +|..|...|...| |.........| +|.........-| |.........| +|.......|..| |.........| +|.----..--.| |.........| +|........|.-- |.........| +|.---.-.....------------+| +|...|...-................| +|.........---------------- +----|..|..| + ------- +]]); +des.stair("down", 03,01) +des.stair("up", 20,04) +des.door("locked",24,09) +des.region(selection.area(00,00,25,13), "lit") +des.non_diggable(selection.area(00,00,25,13)) +des.non_passwall(selection.area(00,00,25,13)) + +-- Boulders +des.object("boulder",02,03) +des.object("boulder",08,03) +des.object("boulder",09,04) +des.object("boulder",02,05) +des.object("boulder",04,05) +des.object("boulder",09,05) +des.object("boulder",02,06) +des.object("boulder",05,06) +des.object("boulder",06,07) +des.object("boulder",03,08) +des.object("boulder",07,08) +des.object("boulder",05,09) +des.object("boulder",10,09) +des.object("boulder",07,10) +des.object("boulder",10,10) +des.object("boulder",03,11) + +-- Traps +des.trap("hole",12,10) +des.trap("hole",13,10) +des.trap("hole",14,10) +des.trap("hole",15,10) +des.trap("hole",16,10) +des.trap("hole",17,10) +des.trap("hole",18,10) +des.trap("hole",19,10) +des.trap("hole",20,10) +des.trap("hole",21,10) +des.trap("hole",22,10) +des.trap("hole",23,10) + +-- Random objects +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "=" }); +des.object({ class = "/" }); + diff --git a/dat/soko4-1.lua b/dat/soko4-1.lua new file mode 100644 index 000000000..3257986de --- /dev/null +++ b/dat/soko4-1.lua @@ -0,0 +1,97 @@ +-- NetHack 3.6 sokoban.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- Copyright (c) 1998-1999 by Kevin Hugo +-- NetHack may be freely redistributed. See license for details. +-- +-- +-- In case you haven't played the game Sokoban, you'll learn +-- quickly. This branch isn't particularly difficult, just time +-- consuming. Some players may wish to skip this branch. +-- +-- The following actions are currently permitted without penalty: +-- Carrying or throwing a boulder already in inventory +-- (player or nonplayer). +-- Teleporting boulders. +-- Digging in the floor. +-- The following actions are permitted, but with a luck penalty: +-- Breaking boulders. +-- Stone-to-fleshing boulders. +-- Creating new boulders (e.g., with a scroll of earth). +-- Jumping. +-- Being pulled by a thrown iron ball. +-- Hurtling through the air from Newton's 3rd law. +-- Squeezing past boulders when naked or as a giant. +-- These actions are not permitted: +-- Moving diagonally between two boulders and/or walls. +-- Pushing a boulder diagonally. +-- Picking up boulders (player or nonplayer). +-- Digging or walking through walls. +-- Teleporting within levels or between levels of this branch. +-- Using cursed potions of gain level. +-- Escaping a pit/hole (e.g., by flying, levitation, or +-- passing a dexterity check). +-- Bones files are not permitted. + + +--## Bottom (first) level of Sokoban ### +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "premapped", "solidify"); + +des.map([[ +------ ----- +|....| |...| +|....----...| +|...........| +|..|-|.|-|..| +---------|.--- +|......|.....| +|..----|.....| +--.| |.....| + |.|---|.....| + |...........| + |..|--------- + ---- +]]); +des.levregion({ region = {06,04,06,04}, type = "branch" }) +des.stair("up", 06,06) +des.region(selection.area(00,00,13,12), "lit") +des.non_diggable(selection.area(00,00,13,12)) +des.non_passwall(selection.area(00,00,13,12)) + +-- Boulders +des.object("boulder",02,02) +des.object("boulder",02,03) +-- +des.object("boulder",10,02) +des.object("boulder",09,03) +des.object("boulder",10,04) +-- +des.object("boulder",08,07) +des.object("boulder",09,08) +des.object("boulder",09,09) +des.object("boulder",08,10) +des.object("boulder",10,10) + +-- Traps +des.trap("pit",03,06) +des.trap("pit",04,06) +des.trap("pit",05,06) +des.trap("pit",02,08) +des.trap("pit",02,09) +des.trap("pit",04,10) +des.trap("pit",05,10) +des.trap("pit",06,10) +des.trap("pit",07,10) + +-- A little help +des.object("earth",02,11) +des.object("earth",03,11) + +-- Random objects +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "=" }); +des.object({ class = "/" }); + diff --git a/dat/soko4-2.lua b/dat/soko4-2.lua new file mode 100644 index 000000000..e9df5c050 --- /dev/null +++ b/dat/soko4-2.lua @@ -0,0 +1,68 @@ +-- NetHack 3.6 sokoban.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- Copyright (c) 1998-1999 by Kevin Hugo +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "premapped", "solidify"); + +des.map([[ +-------- ------ +|.|....|-|....| +|.|-..........| +|.||....|.....| +|.||....|.....| +|.|-----|.----- +|.| |......| +|.-----|......| +|.............| +|..|---|......| +---- -------- +]]); +des.levregion({ region = {03,01,03,01}, type = "branch" }) +des.stair("up", 01,01) +des.region(selection.area(00,00,14,10),"lit") +des.non_diggable(selection.area(00,00,14,10)) +des.non_passwall(selection.area(00,00,14,10)) + +-- Boulders +des.object("boulder",05,02) +des.object("boulder",06,02) +des.object("boulder",06,03) +des.object("boulder",07,03) +-- +des.object("boulder",09,05) +des.object("boulder",10,03) +des.object("boulder",11,02) +des.object("boulder",12,03) +-- +des.object("boulder",07,08) +des.object("boulder",08,08) +des.object("boulder",09,08) +des.object("boulder",10,08) + +-- Traps +des.trap("pit",01,02) +des.trap("pit",01,03) +des.trap("pit",01,04) +des.trap("pit",01,05) +des.trap("pit",01,06) +des.trap("pit",01,07) +des.trap("pit",03,08) +des.trap("pit",04,08) +des.trap("pit",05,08) +des.trap("pit",06,08) + +-- A little help +des.object("earth",01,09) +des.object("earth",02,09) + +-- Random objects +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "%" }); +des.object({ class = "=" }); +des.object({ class = "/" }); + + diff --git a/dat/sokoban.des b/dat/sokoban.des deleted file mode 100644 index c4983451d..000000000 --- a/dat/sokoban.des +++ /dev/null @@ -1,637 +0,0 @@ -# NetHack 3.6 sokoban.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ -# Copyright (c) 1998-1999 by Kevin Hugo -# NetHack may be freely redistributed. See license for details. -# -# In case you haven't played the game Sokoban, you'll learn -# quickly. This branch isn't particularly difficult, just time -# consuming. Some players may wish to skip this branch. -# -# The following actions are currently permitted without penalty: -# Carrying or throwing a boulder already in inventory -# (player or nonplayer). -# Teleporting boulders. -# Digging in the floor. -# The following actions are permitted, but with a luck penalty: -# Breaking boulders. -# Stone-to-fleshing boulders. -# Creating new boulders (e.g., with a scroll of earth). -# Jumping. -# Being pulled by a thrown iron ball. -# Hurtling through the air from Newton's 3rd law. -# Squeezing past boulders when naked or as a giant. -# These actions are not permitted: -# Moving diagonally between two boulders and/or walls. -# Pushing a boulder diagonally. -# Picking up boulders (player or nonplayer). -# Digging or walking through walls. -# Teleporting within levels or between levels of this branch. -# Using cursed potions of gain level. -# Escaping a pit/hole (e.g., by flying, levitation, or -# passing a dexterity check). -# Bones files are not permitted. - - -### Bottom (first) level of Sokoban ### -MAZE:"soko4-1",' ' -FLAGS:noteleport,hardfloor,premapped,solidify -GEOMETRY:center,center -#12345678901234567890123456789012345678901234567890 -MAP ------- ----- -|....| |...| -|....----...| -|...........| -|..|-|.|-|..| ----------|.--- -|......|.....| -|..----|.....| ---.| |.....| - |.|---|.....| - |...........| - |..|--------- - ---- -ENDMAP -BRANCH:(06,04,06,04),(0,0,0,0) -STAIR:(06,06),up -REGION:(00,00,13,12),lit,"ordinary" -NON_DIGGABLE:(00,00,13,12) -NON_PASSWALL:(00,00,13,12) - -# Boulders -OBJECT:('`',"boulder"),(02,02) -OBJECT:('`',"boulder"),(02,03) -# -OBJECT:('`',"boulder"),(10,02) -OBJECT:('`',"boulder"),(09,03) -OBJECT:('`',"boulder"),(10,04) -# -OBJECT:('`',"boulder"),(08,07) -OBJECT:('`',"boulder"),(09,08) -OBJECT:('`',"boulder"),(09,09) -OBJECT:('`',"boulder"),(08,10) -OBJECT:('`',"boulder"),(10,10) - -# Traps -TRAP:"pit",(03,06) -TRAP:"pit",(04,06) -TRAP:"pit",(05,06) -TRAP:"pit",(02,08) -TRAP:"pit",(02,09) -TRAP:"pit",(04,10) -TRAP:"pit",(05,10) -TRAP:"pit",(06,10) -TRAP:"pit",(07,10) - -# A little help -OBJECT:('?',"earth"),(02,11) -OBJECT:('?',"earth"),(03,11) - -# Random objects -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'=',random -OBJECT:'/',random - - -MAZE:"soko4-2",' ' -FLAGS:noteleport,hardfloor,premapped,solidify -GEOMETRY:center,center -#12345678901234567890123456789012345678901234567890 -MAP --------- ------ -|.|....|-|....| -|.|-..........| -|.||....|.....| -|.||....|.....| -|.|-----|.----- -|.| |......| -|.-----|......| -|.............| -|..|---|......| ----- -------- -ENDMAP -BRANCH:(03,01,03,01),(0,0,0,0) -STAIR:(01,01),up -REGION:(00,00,14,10),lit,"ordinary" -NON_DIGGABLE:(00,00,14,10) -NON_PASSWALL:(00,00,14,10) - -# Boulders -OBJECT:('`',"boulder"),(05,02) -OBJECT:('`',"boulder"),(06,02) -OBJECT:('`',"boulder"),(06,03) -OBJECT:('`',"boulder"),(07,03) -# -OBJECT:('`',"boulder"),(09,05) -OBJECT:('`',"boulder"),(10,03) -OBJECT:('`',"boulder"),(11,02) -OBJECT:('`',"boulder"),(12,03) -# -OBJECT:('`',"boulder"),(07,08) -OBJECT:('`',"boulder"),(08,08) -OBJECT:('`',"boulder"),(09,08) -OBJECT:('`',"boulder"),(10,08) - -# Traps -TRAP:"pit",(01,02) -TRAP:"pit",(01,03) -TRAP:"pit",(01,04) -TRAP:"pit",(01,05) -TRAP:"pit",(01,06) -TRAP:"pit",(01,07) -TRAP:"pit",(03,08) -TRAP:"pit",(04,08) -TRAP:"pit",(05,08) -TRAP:"pit",(06,08) - -# A little help -OBJECT:('?',"earth"),(01,09) -OBJECT:('?',"earth"),(02,09) - -# Random objects -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'=',random -OBJECT:'/',random - - -### Second level ### -MAZE:"soko3-1",' ' -FLAGS:noteleport,premapped,solidify -GEOMETRY:center,center -#12345678901234567890123456789012345678901234567890 -MAP ------------ ----------- -|....|....|-- |.........| -|....|......| |.........| -|.........|-- |.........| -|....|....| |.........| -|-.--------- |.........| -|....|.....| |.........| -|....|.....| |.........| -|..........| |.........| -|....|.....|---------------+| -|....|......................| ------------------------------ -ENDMAP -STAIR:(11,02),down -STAIR:(23,04),up -DOOR:locked,(27,09) -REGION:(00,00,28,11),lit,"ordinary" -NON_DIGGABLE:(00,00,28,11) -NON_PASSWALL:(00,00,28,11) - -# Boulders -OBJECT:('`',"boulder"),(03,02) -OBJECT:('`',"boulder"),(04,02) -# -OBJECT:('`',"boulder"),(06,02) -OBJECT:('`',"boulder"),(06,03) -OBJECT:('`',"boulder"),(07,02) -# -OBJECT:('`',"boulder"),(03,06) -OBJECT:('`',"boulder"),(02,07) -OBJECT:('`',"boulder"),(03,07) -OBJECT:('`',"boulder"),(03,08) -OBJECT:('`',"boulder"),(02,09) -OBJECT:('`',"boulder"),(03,09) -OBJECT:('`',"boulder"),(04,09) -# -OBJECT:('`',"boulder"),(06,07) -OBJECT:('`',"boulder"),(06,09) -OBJECT:('`',"boulder"),(08,07) -OBJECT:('`',"boulder"),(08,10) -OBJECT:('`',"boulder"),(09,08) -OBJECT:('`',"boulder"),(09,09) -OBJECT:('`',"boulder"),(10,07) -OBJECT:('`',"boulder"),(10,10) - -# Traps -TRAP:"hole",(12,10) -TRAP:"hole",(13,10) -TRAP:"hole",(14,10) -TRAP:"hole",(15,10) -TRAP:"hole",(16,10) -TRAP:"hole",(17,10) -TRAP:"hole",(18,10) -TRAP:"hole",(19,10) -TRAP:"hole",(20,10) -TRAP:"hole",(21,10) -TRAP:"hole",(22,10) -TRAP:"hole",(23,10) -TRAP:"hole",(24,10) -TRAP:"hole",(25,10) -TRAP:"hole",(26,10) - -# Random objects -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'=',random -OBJECT:'/',random - - -MAZE:"soko3-2",' ' -FLAGS:noteleport,premapped,solidify -GEOMETRY:center,center -#12345678901234567890123456789012345678901234567890 -MAP - ---- ----------- --|..|------- |.........| -|..........| |.........| -|..-----.-.| |.........| -|..|...|...| |.........| -|.........-| |.........| -|.......|..| |.........| -|.----..--.| |.........| -|........|.-- |.........| -|.---.-.....------------+| -|...|...-................| -|.........---------------- -----|..|..| - ------- -ENDMAP -STAIR:(03,01),down -STAIR:(20,04),up -DOOR:locked,(24,09) -REGION:(00,00,25,13),lit,"ordinary" -NON_DIGGABLE:(00,00,25,13) -NON_PASSWALL:(00,00,25,13) - -# Boulders -OBJECT:('`',"boulder"),(02,03) -OBJECT:('`',"boulder"),(08,03) -OBJECT:('`',"boulder"),(09,04) -OBJECT:('`',"boulder"),(02,05) -OBJECT:('`',"boulder"),(04,05) -OBJECT:('`',"boulder"),(09,05) -OBJECT:('`',"boulder"),(02,06) -OBJECT:('`',"boulder"),(05,06) -OBJECT:('`',"boulder"),(06,07) -OBJECT:('`',"boulder"),(03,08) -OBJECT:('`',"boulder"),(07,08) -OBJECT:('`',"boulder"),(05,09) -OBJECT:('`',"boulder"),(10,09) -OBJECT:('`',"boulder"),(07,10) -OBJECT:('`',"boulder"),(10,10) -OBJECT:('`',"boulder"),(03,11) - -# Traps -TRAP:"hole",(12,10) -TRAP:"hole",(13,10) -TRAP:"hole",(14,10) -TRAP:"hole",(15,10) -TRAP:"hole",(16,10) -TRAP:"hole",(17,10) -TRAP:"hole",(18,10) -TRAP:"hole",(19,10) -TRAP:"hole",(20,10) -TRAP:"hole",(21,10) -TRAP:"hole",(22,10) -TRAP:"hole",(23,10) - -# Random objects -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'=',random -OBJECT:'/',random - - -### Third level ### -MAZE:"soko2-1",' ' -FLAGS:noteleport,premapped,solidify -GEOMETRY:center,center -#12345678901234567890123456789012345678901234567890 -MAP --------------------- -|........|...|.....| -|.....-..|.-.|.....| -|..|.....|...|.....| -|-.|..-..|.-.|.....| -|...--.......|.....| -|...|...-...-|.....| -|...|..|...--|.....| -|-..|..|----------+| -|..................| -|...|..|------------ --------- -ENDMAP -STAIR:(06,10),down -STAIR:(16,04),up -DOOR:locked,(18,08) -REGION:(00,00,19,11),lit,"ordinary" -NON_DIGGABLE:(00,00,19,11) -NON_PASSWALL:(00,00,19,11) - -# Boulders -OBJECT:('`',"boulder"),(02,02) -OBJECT:('`',"boulder"),(03,02) -# -OBJECT:('`',"boulder"),(05,03) -OBJECT:('`',"boulder"),(07,03) -OBJECT:('`',"boulder"),(07,02) -OBJECT:('`',"boulder"),(08,02) -# -OBJECT:('`',"boulder"),(10,03) -OBJECT:('`',"boulder"),(11,03) -# -OBJECT:('`',"boulder"),(02,07) -OBJECT:('`',"boulder"),(02,08) -OBJECT:('`',"boulder"),(03,09) -# -OBJECT:('`',"boulder"),(05,07) -OBJECT:('`',"boulder"),(06,06) - -# Traps -TRAP:"hole",(08,09) -TRAP:"hole",(09,09) -TRAP:"hole",(10,09) -TRAP:"hole",(11,09) -TRAP:"hole",(12,09) -TRAP:"hole",(13,09) -TRAP:"hole",(14,09) -TRAP:"hole",(15,09) -TRAP:"hole",(16,09) -TRAP:"hole",(17,09) - -# Random objects -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'=',random -OBJECT:'/',random - - -MAZE:"soko2-2",' ' -FLAGS:noteleport,premapped,solidify -GEOMETRY:center,center -#12345678901234567890123456789012345678901234567890 -MAP - -------- ---|.|....| -|........|---------- -|.-...-..|.|.......| -|...-......|.......| -|.-....|...|.......| -|....-.--.-|.......| -|..........|.......| -|.--...|...|.......| -|....-.|---|.......| ---|....|----------+| - |................| - ------------------ -ENDMAP -STAIR:(06,11),down -STAIR:(15,06),up -DOOR:locked,(18,10) -REGION:(00,00,19,12),lit,"ordinary" -NON_DIGGABLE:(00,00,19,12) -NON_PASSWALL:(00,00,19,12) - -# Boulders -OBJECT:('`',"boulder"),(04,02) -OBJECT:('`',"boulder"),(04,03) -OBJECT:('`',"boulder"),(05,03) -OBJECT:('`',"boulder"),(07,03) -OBJECT:('`',"boulder"),(08,03) -OBJECT:('`',"boulder"),(02,04) -OBJECT:('`',"boulder"),(03,04) -OBJECT:('`',"boulder"),(05,05) -OBJECT:('`',"boulder"),(06,06) -OBJECT:('`',"boulder"),(09,06) -OBJECT:('`',"boulder"),(03,07) -OBJECT:('`',"boulder"),(04,07) -OBJECT:('`',"boulder"),(07,07) -OBJECT:('`',"boulder"),(06,09) -OBJECT:('`',"boulder"),(05,10) -OBJECT:('`',"boulder"),(05,11) - -# Traps -TRAP:"hole",(07,11) -TRAP:"hole",(08,11) -TRAP:"hole",(09,11) -TRAP:"hole",(10,11) -TRAP:"hole",(11,11) -TRAP:"hole",(12,11) -TRAP:"hole",(13,11) -TRAP:"hole",(14,11) -TRAP:"hole",(15,11) -TRAP:"hole",(16,11) -TRAP:"hole",(17,11) - -# Random objects -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'=',random -OBJECT:'/',random - - -### Top (last) level of Sokoban ### -MAZE:"soko1-1",' ' -FLAGS:noteleport,premapped,solidify -GEOMETRY:center,center -#12345678901234567890123456789012345678901234567890 -MAP --------------------------- -|........................| -|.......|---------------.| --------.------ |.| - |...........| |.| - |...........| |.| ---------.----- |.| -|............| |.| -|............| |.| ------.-------- ------|.| - |..........| --|.....|.| - |..........| |.+.....|.| - |.........|- |-|.....|.| --------.---- |.+.....+.| -|........| |-|.....|-- -|........| |.+.....| -|...|----- --|.....| ------ ------- -ENDMAP -$place = { (16,11),(16,13),(16,15) } -SHUFFLE: $place - -STAIR:(01,01),down -REGION:(00,00,25,17),lit,"ordinary" -NON_DIGGABLE:(00,00,25,17) -NON_PASSWALL:(00,00,25,17) - -# Boulders -OBJECT:('`',"boulder"),(03,05) -OBJECT:('`',"boulder"),(05,05) -OBJECT:('`',"boulder"),(07,05) -OBJECT:('`',"boulder"),(09,05) -OBJECT:('`',"boulder"),(11,05) -# -OBJECT:('`',"boulder"),(04,07) -OBJECT:('`',"boulder"),(04,08) -OBJECT:('`',"boulder"),(06,07) -OBJECT:('`',"boulder"),(09,07) -OBJECT:('`',"boulder"),(11,07) -# -OBJECT:('`',"boulder"),(03,12) -OBJECT:('`',"boulder"),(04,10) -OBJECT:('`',"boulder"),(05,12) -OBJECT:('`',"boulder"),(06,10) -OBJECT:('`',"boulder"),(07,11) -OBJECT:('`',"boulder"),(08,10) -OBJECT:('`',"boulder"),(09,12) -# -OBJECT:('`',"boulder"),(03,14) - -# Traps -TRAP:"hole",(08,01) -TRAP:"hole",(09,01) -TRAP:"hole",(10,01) -TRAP:"hole",(11,01) -TRAP:"hole",(12,01) -TRAP:"hole",(13,01) -TRAP:"hole",(14,01) -TRAP:"hole",(15,01) -TRAP:"hole",(16,01) -TRAP:"hole",(17,01) -TRAP:"hole",(18,01) -TRAP:"hole",(19,01) -TRAP:"hole",(20,01) -TRAP:"hole",(21,01) -TRAP:"hole",(22,01) -TRAP:"hole",(23,01) - -MONSTER:('m',"giant mimic"), random, m_object "boulder" -MONSTER:('m',"giant mimic"), random, m_object "boulder" - -# Random objects -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'=',random -OBJECT:'/',random - -# Rewards -DOOR:locked,(23,13) -DOOR:closed,(17,11) -DOOR:closed,(17,13) -DOOR:closed,(17,15) -REGION:(18,10,22,16),lit,"zoo",filled,irregular -IF [50%] { - OBJECT:('(',"bag of holding"),$place[0] -} ELSE { - OBJECT:('"',"amulet of reflection"),$place[0] -} -ENGRAVING:$place[0],burn,"Elbereth" -OBJECT:('?', "scare monster"),$place[0],cursed - - -MAZE:"soko1-2",' ' -FLAGS:noteleport,premapped,solidify -GEOMETRY:center,center -#12345678901234567890123456789012345678901234567890 -MAP - ------------------------ - |......................| - |..-------------------.| -----.| ----- |.| -|..|.-- --...| |.| -|.....|--|....| |.| -|.....|..|....| |.| ---....|......-- |.| - |.......|...| ------|.| - |....|..|...| --|.....|.| - |....|--|...| |.+.....|.| - |.......|..-- |-|.....|.| - ----....|.-- |.+.....+.| - ---.--.| |-|.....|-- - |.....| |.+.....| - |..|..| --|.....| - ------- ------- -ENDMAP -$place = { (16,10),(16,12),(16,14) } -SHUFFLE: $place - -STAIR:(06,15),down -REGION:(00,00,25,16),lit,"ordinary" -NON_DIGGABLE:(00,00,25,16) -NON_PASSWALL:(00,00,25,16) - -# Boulders -OBJECT:('`',"boulder"),(04,04) -OBJECT:('`',"boulder"),(02,06) -OBJECT:('`',"boulder"),(03,06) -OBJECT:('`',"boulder"),(04,07) -OBJECT:('`',"boulder"),(05,07) -OBJECT:('`',"boulder"),(02,08) -OBJECT:('`',"boulder"),(05,08) -OBJECT:('`',"boulder"),(03,09) -OBJECT:('`',"boulder"),(04,09) -OBJECT:('`',"boulder"),(03,10) -OBJECT:('`',"boulder"),(05,10) -OBJECT:('`',"boulder"),(06,12) -# -OBJECT:('`',"boulder"),(07,14) -# -OBJECT:('`',"boulder"),(11,05) -OBJECT:('`',"boulder"),(12,06) -OBJECT:('`',"boulder"),(10,07) -OBJECT:('`',"boulder"),(11,07) -OBJECT:('`',"boulder"),(10,08) -OBJECT:('`',"boulder"),(12,09) -OBJECT:('`',"boulder"),(11,10) - -# Traps -TRAP:"hole",(05,01) -TRAP:"hole",(06,01) -TRAP:"hole",(07,01) -TRAP:"hole",(08,01) -TRAP:"hole",(09,01) -TRAP:"hole",(10,01) -TRAP:"hole",(11,01) -TRAP:"hole",(12,01) -TRAP:"hole",(13,01) -TRAP:"hole",(14,01) -TRAP:"hole",(15,01) -TRAP:"hole",(16,01) -TRAP:"hole",(17,01) -TRAP:"hole",(18,01) -TRAP:"hole",(19,01) -TRAP:"hole",(20,01) -TRAP:"hole",(21,01) -TRAP:"hole",(22,01) - -MONSTER:('m',"giant mimic"), random, m_object "boulder" -MONSTER:('m',"giant mimic"), random, m_object "boulder" - -# Random objects -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'%',random -OBJECT:'=',random -OBJECT:'/',random - -# Rewards -DOOR:locked,(23,12) -DOOR:closed,(17,10) -DOOR:closed,(17,12) -DOOR:closed,(17,14) -REGION:(18,09,22,15),lit,"zoo",filled,irregular -IF [50%] { - OBJECT:('(',"bag of holding"),$place[0] -} ELSE { - OBJECT:('"',"amulet of reflection"),$place[0] -} -ENGRAVING:$place[0],burn,"Elbereth" -OBJECT:('?', "scare monster"),$place[0],cursed diff --git a/dat/tower.des b/dat/tower.des deleted file mode 100644 index c58fb8b5e..000000000 --- a/dat/tower.des +++ /dev/null @@ -1,147 +0,0 @@ -# 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 -MAZE:"tower1",' ' -FLAGS: noteleport,hardfloor,solidify -GEOMETRY:half-left,center -MAP - --- --- --- - |.| |.| |.| ----S---S---S--- -|.......+.+...| ----+-----.----- - |...\.|.+.| ----+-----.----- -|.......+.+...| ----S---S---S--- - |.| |.| |.| - --- --- --- -ENDMAP -$niches = { (03,01), (03,09), (07,01), (07,09), (11,01), (11,09) } -SHUFFLE: $niches -LADDER:(11,05),down -# The lord and his court -MONSTER:('V',"Vlad the Impaler"),(06,05) -MONSTER:'V',$niches[0] -MONSTER:'V',$niches[1] -MONSTER:'V',$niches[2] -MONSTER:'V',$niches[3] -MONSTER:'V',$niches[4] -MONSTER:'V',$niches[5] -# The doors -DOOR:closed,(08,03) -DOOR:closed,(10,03) -DOOR:closed,(03,04) -DOOR:locked,(10,05) -DOOR:locked,(08,07) -DOOR:locked,(10,07) -DOOR:closed,(03,06) -# treasures -OBJECT:('(',"chest"),(07,05) - -OBJECT:('(',"chest"),$niches[0] -OBJECT:('(',"chest"),$niches[1] -OBJECT:('(',"chest"),$niches[2] -OBJECT:('(',"chest"),$niches[3] -CONTAINER:('(',"chest"),$niches[4] { - OBJECT:('(', "wax candle"), quantity:4d2 -} -CONTAINER:('(',"chest"),$niches[5] { - OBJECT:('(', "tallow candle"), quantity:4d2 -} -# We have to protect the tower against outside attacks -NON_DIGGABLE:(00,00,14,10) - - -# Intermediate stage of Vlad's tower -MAZE:"tower2",' ' -FLAGS: noteleport,hardfloor,solidify -GEOMETRY:half-left,center -MAP - --- --- --- - |.| |.| |.| ----S---S---S--- -|.S.........S.| ----.------+---- - |......|..| ---------.------ -|.S......+..S.| ----S---S---S--- - |.| |.| |.| - --- --- --- -ENDMAP -# Random places are the 10 niches -$place = { (03,01),(07,01),(11,01),(01,03),(13,03), - (01,07),(13,07),(03,09),(07,09),(11,09) } -SHUFFLE: $place -LADDER:(11,05),up -LADDER:(03,07),down -DOOR:locked,(10,04) -DOOR:locked,(09,07) -MONSTER:'&',$place[0] -MONSTER:'&',$place[1] -MONSTER:('d',"hell hound pup"),$place[2] -MONSTER:('d',"hell hound pup"),$place[3] -MONSTER:('d',"winter wolf"),$place[4] -CONTAINER:('(',"chest"),$place[5] { - OBJECT:('"',"amulet of life saving") -} -CONTAINER:('(',"chest"),$place[6] { - OBJECT:('"',"amulet of strangulation") -} -OBJECT:('[',"water walking boots"),$place[7] -OBJECT:('[',"crystal plate mail"),$place[8] -OBJECT:('+',"invisibility"),$place[9] -# Walls in the tower are non diggable -NON_DIGGABLE:(00,00,14,10) - - -# Bottom most stage of Vlad's tower -MAZE:"tower3",' ' -FLAGS: noteleport,hardfloor,solidify -GEOMETRY:half-left,center -MAP - --- --- --- - |.| |.| |.| - ---S---S---S--- - |.S.........S.| ------.........----- -|...|.........+...| -|.---.........---.| -|.|.S.........S.|.| -|.---S---S---S---.| -|...|.|.|.|.|.|...| ----.---.---.---.--- - |.............| - --------------- -ENDMAP -# Random places are the 10 niches -$place = { (05,01),(09,01),(13,01),(03,03),(15,03), - (03,07),(15,07),(05,09),(09,09),(13,09) } -SHUFFLE: $place -BRANCH:(02,05,02,05),(00,00,00,00) -LADDER:(05,07),up -# Entry door is, of course, locked -DOOR:locked,(14,05) -# Let's put a dragon behind the door, just for the fun... -MONSTER:'D',(13,05) -MONSTER:random,(12,04) -MONSTER:random,(12,06) -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -MONSTER:random,random -OBJECT:(')',"long sword"),$place[0] -TRAP:random,$place[0] -OBJECT:('(',"lock pick"),$place[1] -TRAP:random,$place[1] -OBJECT:('[',"elven cloak"),$place[2] -TRAP:random,$place[2] -OBJECT:('(',"blindfold"),$place[3] -TRAP:random,$place[3] -# Walls in the tower are non diggable -NON_DIGGABLE:(00,00,18,12) diff --git a/dat/tower1.lua b/dat/tower1.lua new file mode 100644 index 000000000..dcd84f1f6 --- /dev/null +++ b/dat/tower1.lua @@ -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)) diff --git a/dat/tower2.lua b/dat/tower2.lua new file mode 100644 index 000000000..0376ec51c --- /dev/null +++ b/dat/tower2.lua @@ -0,0 +1,50 @@ +-- 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)) + diff --git a/dat/tower3.lua b/dat/tower3.lua new file mode 100644 index 000000000..345c5a9c2 --- /dev/null +++ b/dat/tower3.lua @@ -0,0 +1,50 @@ +-- 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 = { {05,01},{09,01},{13,01},{03,03},{15,03}, + {03,07},{15,07},{05,09},{09,09},{13,09} } + +des.levregion({ type="branch", region={02,05,02,05} }) +des.ladder("up", 05,07) +-- Entry door is, of course, locked +des.door("locked",14,05) +-- Let's put a dragon behind the door, just for the fun... +des.monster("D", 13, 05) +des.monster({ x=12, y=04 }) +des.monster({ x=12, y=06 }) +des.monster() +des.monster() +des.monster() +des.monster() +des.monster() +des.monster() +des.object("long sword",place[4]) +des.trap({ coord = place[4] }) +des.object("lock pick",place[1]) +des.trap({ coord = place[1] }) +des.object("elven cloak",place[2]) +des.trap({ coord = place[2] }) +des.object("blindfold",place[3]) +des.trap({ coord = place[3] }) +-- Walls in the tower are non diggable +des.non_diggable(selection.area(00,00,18,12)) diff --git a/dat/valley.lua b/dat/valley.lua new file mode 100644 index 000000000..5e78e71be --- /dev/null +++ b/dat/valley.lua @@ -0,0 +1,174 @@ +-- NetHack 3.6 gehennom.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- 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 = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "nommap"); + +des.map([[ +---------------------------------------------------------------------------- +|...S.|..|.....| |.....-| |................| |...............| |...| +|---|.|.--.---.| |......--- ----..........-----.-----....---........---.-.| +| |.|.|..| |.| --........| |.............| |.......---| |-...........--| +| |...S..| |.| |.......-----.......------| |--------..---......------- | +|----------- |.| |-......| |....|...-- |...-----................---- | +|.....S....---.| |.......| |....|...| |..............----------- | +|.....|.|......| |.....--- |......--- |....---.......| | +|.....|.|------| |....-- --....-- |-------- ----....--------------- | +|.....|--......---BBB-| |...-- |.......| |..................| | +|..........||........-| --...| |.......| |...||.............| | +|.....|...-||-........------....| |.......---- |...||.............-- | +|.....|--......---...........--------..........| |.......---------...-- | +|.....| |------| |--.......--| |..B......----- -----....| |.| |....--- | +|.....| |......--| ------..| |----..B......| |.--------.-- |-.....---| +|------ |........| |.|....| |.....----BBBB---------...........---.........| +| |........| |...|..| |.....| |-.............--------...........---| +| --.....-----------.| |....-----.....---------- |.........---- | +| |..|..B...........| |.|..........|.| |.|........| | +---------------------------------------------------------------------------- +]]); + +-- Make the path somewhat unpredictable +-- If you get "lucky", you may have to go through all three graveyards. +if math.random(0, 99) < 50 then + des.terrain(selection.line(50,8, 53,8), '-') + des.terrain(selection.line(40,8, 43,8), 'B') +end +if math.random(0, 99) < 50 then + des.terrain({ x=27, y=12, typ='|' }) + des.terrain(selection.line(27,3, 29,3), 'B') + des.terrain({ x=28, y=2, typ='-' }) +end +if math.random(0, 99) < 50 then + des.terrain(selection.line(16,10, 16,11), '|') + des.terrain(selection.line(9,13, 14,13), 'B') +end + + +-- Dungeon Description +-- The shrine to Moloch. +des.region({ region={01,06, 05,14},lit=1,type="temple" }) +-- The Morgues +des.region({ region={19,01, 24,08},lit=0,type="morgue",prefilled=0,irregular=1 }) +des.region({ region={09,14, 16,18},lit=0,type="morgue",prefilled=0,irregular=1 }) +des.region({ region={37,09, 43,14},lit=0,type="morgue",prefilled=0,irregular=1 }) +-- Stairs +des.stair("down", 01,01) +-- Branch location +des.levregion({ type="branch", region={66,17,66,17} }) +des.teleport_region({ region = {58,09,72,18}, dir="down" }) + +-- Secret Doors +des.door("locked",04,01) +des.door("locked",08,04) +des.door("locked",06,06) + +-- The altar of Moloch. +des.altar({ x=03,y=10,align="noalign", type="shrine" }) + +-- Non diggable walls - everywhere! +des.non_diggable(selection.area(00,00,75,19)) + +-- Objects +-- **LOTS** of dead bodies (all human). +-- note: no priest(esse)s or monks - maybe Moloch has a *special* +-- fate reserved for members of *those* classes. +-- +des.object({ id="corpse",montype="archeologist" }) +des.object({ id="corpse",montype="archeologist" }) +des.object({ id="corpse",montype="barbarian" }) +des.object({ id="corpse",montype="barbarian" }) +des.object({ id="corpse",montype="caveman" }) +des.object({ id="corpse",montype="cavewoman" }) +des.object({ id="corpse",montype="healer" }) +des.object({ id="corpse",montype="healer" }) +des.object({ id="corpse",montype="knight" }) +des.object({ id="corpse",montype="knight" }) +des.object({ id="corpse",montype="ranger" }) +des.object({ id="corpse",montype="ranger" }) +des.object({ id="corpse",montype="rogue" }) +des.object({ id="corpse",montype="rogue" }) +des.object({ id="corpse",montype="samurai" }) +des.object({ id="corpse",montype="samurai" }) +des.object({ id="corpse",montype="tourist" }) +des.object({ id="corpse",montype="tourist" }) +des.object({ id="corpse",montype="valkyrie" }) +des.object({ id="corpse",montype="valkyrie" }) +des.object({ id="corpse",montype="wizard" }) +des.object({ id="corpse",montype="wizard" }) +-- +-- Some random weapons and armor. +-- +des.object("[") +des.object("[") +des.object("[") +des.object("[") +des.object(")") +des.object(")") +des.object(")") +des.object(")") +-- +-- Some random loot. +-- +des.object("ruby") +des.object("*") +des.object("*") +des.object("!") +des.object("!") +des.object("!") +des.object("?") +des.object("?") +des.object("?") +des.object("/") +des.object("/") +des.object("=") +des.object("=") +des.object("+") +des.object("+") +des.object("(") +des.object("(") +des.object("(") + +-- (Not so) Random traps. +des.trap("spiked pit", 05,02) +des.trap("spiked pit", 14,05) +des.trap("sleep gas", 03,01) +des.trap("board", 21,12) +des.trap("board") +des.trap("dart", 60,01) +des.trap("dart", 26,17) +des.trap("anti magic") +des.trap("anti magic") +des.trap("magic") +des.trap("magic") + +-- Random monsters. +-- The ghosts. +des.monster("ghost") +des.monster("ghost") +des.monster("ghost") +des.monster("ghost") +des.monster("ghost") +des.monster("ghost") +-- Add a few bats for atmosphere. +des.monster("vampire bat") +des.monster("vampire bat") +des.monster("vampire bat") +-- And a lich for good measure. +des.monster("L") +-- Some undead nasties for good measure +des.monster("V") +des.monster("V") +des.monster("V") +des.monster("Z") +des.monster("Z") +des.monster("Z") +des.monster("Z") +des.monster("M") +des.monster("M") +des.monster("M") +des.monster("M") diff --git a/dat/water.lua b/dat/water.lua new file mode 100644 index 000000000..fdf6a5586 --- /dev/null +++ b/dat/water.lua @@ -0,0 +1,102 @@ +-- NetHack 3.6 endgame.des $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ +-- Copyright (c) 1989 by Jean-Christophe Collet +-- Copyright (c) 1992,1993 by Izchak Miller, David Cohrs, +-- and Timo Hakulinen +-- NetHack may be freely redistributed. See license for details. +-- +des.level_init({ style = "solidfill", fg = " " }); + +des.level_flags("mazelevel", "noteleport", "hardfloor", "shortsighted") +des.message("You find yourself suspended in an air bubble surrounded by water.") +-- The player lands upon arrival to an air bubble +-- within the leftmost third of the level. The +-- portal to the next level is randomly located in an air +-- bubble within the rightmost third of the level. +-- Bubbles are generated by special code in mkmaze.c for now. +des.map([[ +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW +]]); +des.teleport_region({ region = {0,0,25,19} }) +des.levregion({ type="portal", region={51,0,75,19}, name="astral" }) +-- A fisherman's dream... +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("giant eel") +des.monster("electric eel") +des.monster("electric eel") +des.monster("electric eel") +des.monster("electric eel") +des.monster("electric eel") +des.monster("electric eel") +des.monster("electric eel") +des.monster("electric eel") +des.monster("kraken") +des.monster("kraken") +des.monster("kraken") +des.monster("kraken") +des.monster("kraken") +des.monster("kraken") +des.monster("kraken") +des.monster("kraken") +des.monster("kraken") +des.monster("shark") +des.monster("shark") +des.monster("shark") +des.monster("shark") +des.monster("piranha") +des.monster("piranha") +des.monster("piranha") +des.monster("piranha") +des.monster("jellyfish") +des.monster("jellyfish") +des.monster("jellyfish") +des.monster("jellyfish") +des.monster(";") +des.monster(";") +des.monster(";") +des.monster(";") +-- These guys feel like home here +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) +des.monster({ id = "water elemental", peaceful = 0 }) + diff --git a/dat/wizard1.lua b/dat/wizard1.lua new file mode 100644 index 000000000..a34f20df5 --- /dev/null +++ b/dat/wizard1.lua @@ -0,0 +1,92 @@ +-- 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. +-- +-- +-- The top (real) wizard level. +-- Keeping the Moat for old-time's sake +des.level_init({ style="mazegrid", bg ="-" }); + +des.level_flags("mazelevel", "noteleport", "hardfloor") +des.map([[ +----------------------------. +|.......|..|.........|.....|. +|.......S..|.}}}}}}}.|.....|. +|..--S--|..|.}}---}}.|---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} }) +-- Make it a morgue for rm id in mkmaze.c +-- for the purpose of random sdoor placement +des.region({ region={12,01, 20,09}, lit=0, type="morgue", prefilled=1 }) +-- another region to constrain monster arrival +des.region({ region={01,01, 10,11}, lit=0, type="ordinary", prefilled=0 }) +des.mazewalk(28,05,"east") +des.ladder("down", 06,05) +-- Non diggable walls +-- Walls inside the moat stay diggable +des.non_diggable(selection.area(00,00,11,12)) +des.non_diggable(selection.area(11,00,21,00)) +des.non_diggable(selection.area(11,10,27,12)) +des.non_diggable(selection.area(21,00,27,10)) +-- Non passable walls +des.non_passwall(selection.area(00,00,11,12)) +des.non_passwall(selection.area(11,00,21,00)) +des.non_passwall(selection.area(11,10,27,12)) +des.non_passwall(selection.area(21,00,27,10)) +-- The wizard and his guards +des.monster({ id = "Wizard of Yendor", x=16, y=05, asleep=1 }) +des.monster("hell hound", 15, 05) +des.monster("vampire lord", 17, 05) +-- The local treasure +des.object("Book of the Dead", 16, 05) +-- Surrounding terror +des.monster("kraken", 14, 02) +des.monster("giant eel", 17, 02) +des.monster("kraken", 13, 04) +des.monster("giant eel", 13, 06) +des.monster("kraken", 19, 04) +des.monster("giant eel", 19, 06) +des.monster("kraken", 15, 08) +des.monster("giant eel", 17, 08) +des.monster("piranha", 15, 02) +des.monster("piranha", 19, 08) +-- Random monsters +des.monster("D") +des.monster("H") +des.monster("&") +des.monster("&") +des.monster("&") +des.monster("&") +-- And to make things a little harder. +des.trap("board",16,04) +des.trap("board",16,06) +des.trap("board",15,05) +des.trap("board",17,05) +-- Random traps. +des.trap("spiked pit") +des.trap("sleep gas") +des.trap("anti magic") +des.trap("magic") +-- Some random loot. +des.object("ruby") +des.object("!") +des.object("!") +des.object("?") +des.object("?") +des.object("+") +des.object("+") +des.object("+") + diff --git a/dat/wizard2.lua b/dat/wizard2.lua new file mode 100644 index 000000000..9bcd4ab3b --- /dev/null +++ b/dat/wizard2.lua @@ -0,0 +1,55 @@ +-- 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|.........|........|. +|..|....|.........|------S-|. +|..|....|.........|.....|..|. +|-S-----|.........|.....|..|. +|.......|.........|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} }) +-- entire tower in a region, constrains monster migration +des.region({ region={01,01, 26,11}, lit=0, type="ordinary", prefilled=1 }) +des.region({ region={09,03, 17,09}, lit=0, type="zoo", prefilled=0 }) +des.door("closed",15,02) +des.door("closed",11,10) +des.mazewalk(28,05,"east") +des.ladder("up", 12,01) +des.ladder("down", 14,11) +-- Non diggable walls everywhere +des.non_diggable(selection.area(00,00,27,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)) +-- Random traps. +des.trap("spiked pit") +des.trap("sleep gas") +des.trap("anti magic") +des.trap("magic") +-- Some random loot. +des.object("!") +des.object("!") +des.object("?") +des.object("?") +des.object("+") +-- treasures +des.object("\"", 04, 06) diff --git a/dat/wizard3.lua b/dat/wizard3.lua new file mode 100644 index 000000000..f5da68944 --- /dev/null +++ b/dat/wizard3.lua @@ -0,0 +1,81 @@ +-- 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) diff --git a/dat/yendor.des b/dat/yendor.des deleted file mode 100644 index 34b780988..000000000 --- a/dat/yendor.des +++ /dev/null @@ -1,281 +0,0 @@ -# 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. -# -# The top (real) wizard level. -# Keeping the Moat for old-time's sake -MAZE:"wizard1",random -FLAGS:noteleport,hardfloor -GEOMETRY:center,center -MAP -----------------------------. -|.......|..|.........|.....|. -|.......S..|.}}}}}}}.|.....|. -|..--S--|..|.}}---}}.|---S-|. -|..|....|..|.}--.--}.|..|..|. -|..|....|..|.}|...|}.|..|..|. -|..--------|.}--.--}.|..|..|. -|..|.......|.}}---}}.|..|..|. -|..S.......|.}}}}}}}.|..|..|. -|..|.......|.........|..|..|. -|..|.......|-----------S-S-|. -|..|.......S...............|. -----------------------------. -ENDMAP -STAIR:levregion(01,00,79,20),(0,0,28,12),up -STAIR:levregion(01,00,79,20),(0,0,28,12),down -BRANCH:levregion(01,00,79,20),(0,0,28,12) -TELEPORT_REGION:levregion(01,00,79,20),(0,0,27,12) -# Make it a morgue for rm id in mkmaze.c -# for the purpose of random sdoor placement -REGION:(12,01,20,09),unlit,"morgue",unfilled -# another region to constrain monster arrival -REGION:(01,01,10,11),unlit,"ordinary",unfilled -MAZEWALK:(28,05),east -LADDER:(06,05),down -# Non diggable walls -# Walls inside the moat stay diggable -NON_DIGGABLE:(00,00,11,12) -NON_DIGGABLE:(11,00,21,00) -NON_DIGGABLE:(11,10,27,12) -NON_DIGGABLE:(21,00,27,10) -# Non passable walls -NON_PASSWALL:(00,00,11,12) -NON_PASSWALL:(11,00,21,00) -NON_PASSWALL:(11,10,27,12) -NON_PASSWALL:(21,00,27,10) -# The wizard and his guards -MONSTER:('@',"Wizard of Yendor"),(16,05),asleep -MONSTER:('d',"hell hound"),(15,05) -MONSTER:('V',"vampire lord"),(17,05) -# The local treasure -OBJECT:('+',"Book of the Dead"),(16,05) -# Surrounding terror -MONSTER:(';',"kraken"),(14,02) -MONSTER:(';',"giant eel"),(17,02) -MONSTER:(';',"kraken"),(13,04) -MONSTER:(';',"giant eel"),(13,06) -MONSTER:(';',"kraken"),(19,04) -MONSTER:(';',"giant eel"),(19,06) -MONSTER:(';',"kraken"),(15,08) -MONSTER:(';',"giant eel"),(17,08) -MONSTER:(';',"piranha"),(15,02) -MONSTER:(';',"piranha"),(19,08) -# Random monsters -MONSTER:'D',random -MONSTER:'H',random -MONSTER:'&',random -MONSTER:'&',random -MONSTER:'&',random -MONSTER:'&',random -# And to make things a little harder. -TRAP:"board",(16,04) -TRAP:"board",(16,06) -TRAP:"board",(15,05) -TRAP:"board",(17,05) -# Random traps. -TRAP:"spiked pit",random -TRAP:"sleep gas",random -TRAP:"anti magic",random -TRAP:"magic",random -# Some random loot. -OBJECT:('*',"ruby"),random -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'?',random -OBJECT:'?',random -OBJECT:'+',random -OBJECT:'+',random -OBJECT:'+',random - - -# The middle wizard level. -MAZE:"wizard2",random -FLAGS:noteleport,hardfloor -GEOMETRY:center,center -MAP -----------------------------. -|.....|.S....|.............|. -|.....|.-------S--------S--|. -|.....|.|.........|........|. -|..-S--S|.........|........|. -|..|....|.........|------S-|. -|..|....|.........|.....|..|. -|-S-----|.........|.....|..|. -|.......|.........|S--S--..|. -|.......|.........|.|......|. -|-----S----S-------.|......|. -|............|....S.|......|. -----------------------------. -ENDMAP -STAIR:levregion(01,00,79,20),(0,0,28,12),up -STAIR:levregion(01,00,79,20),(0,0,28,12),down -BRANCH:levregion(01,00,79,20),(0,0,28,12) -TELEPORT_REGION:levregion(01,00,79,20),(0,0,27,12) -# entire tower in a region, constrains monster migration -REGION:(01,01,26,11),unlit,"ordinary",unfilled -REGION:(09,03,17,09),unlit,"zoo" -DOOR:closed,(15,02) -DOOR:closed,(11,10) -MAZEWALK:(28,05),east -LADDER:(12,01),up -LADDER:(14,11),down -# Non diggable walls everywhere -NON_DIGGABLE:(00,00,27,12) -# -NON_PASSWALL:(00,00,06,12) -NON_PASSWALL:(06,00,27,02) -NON_PASSWALL:(16,02,27,12) -NON_PASSWALL:(06,12,16,12) -# Random traps. -TRAP:"spiked pit",random -TRAP:"sleep gas",random -TRAP:"anti magic",random -TRAP:"magic",random -# Some random loot. -OBJECT:'!',random -OBJECT:'!',random -OBJECT:'?',random -OBJECT:'?',random -OBJECT:'+',random -# treasures -OBJECT:'"',(04,06) - - -# The bottom wizard level. -# Memorialize the fakewiz setup. -MAZE:"wizard3",random -FLAGS:noteleport,hardfloor -GEOMETRY:center,center -MAP -----------------------------. -|..|............S..........|. -|..|..------------------S--|. -|..|..|.........|..........|. -|..S..|.}}}}}}}.|..........|. -|..|..|.}}---}}.|-S--------|. -|..|..|.}--.--}.|..|.......|. -|..|..|.}|...|}.|..|.......|. -|..---|.}--.--}.|..|.......|. -|.....|.}}---}}.|..|.......|. -|.....S.}}}}}}}.|..|.......|. -|.....|.........|..|.......|. -----------------------------. -ENDMAP -STAIR:levregion(01,00,79,20),(0,0,28,12),up -STAIR:levregion(01,00,79,20),(0,0,28,12),down -BRANCH:levregion(01,00,79,20),(0,0,28,12) -TELEPORT_REGION:levregion(01,00,79,20),(0,0,27,12) -PORTAL:(25,11,25,11),(0,0,0,0),"fakewiz1" -MAZEWALK:(28,09),east -REGION:(07,03,15,11),unlit,"morgue",unfilled -REGION:(17,06,18,11),unlit,"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 -REGION:(20,06,26,11),unlit,"ordinary",unfilled { - ROOMDOOR:true, closed, north|west, random -} -DOOR:closed,(18,05) -LADDER:(11,07),up -# Non diggable walls -# Walls inside the moat stay diggable -NON_DIGGABLE:(00,00,06,12) -NON_DIGGABLE:(06,00,27,02) -NON_DIGGABLE:(16,02,27,12) -NON_DIGGABLE:(06,12,16,12) -# -NON_PASSWALL:(00,00,06,12) -NON_PASSWALL:(06,00,27,02) -NON_PASSWALL:(16,02,27,12) -NON_PASSWALL:(06,12,16,12) -# -MONSTER:'L',(10,07) -MONSTER:('V',"vampire lord"),(12,07) -# Some surrounding horrors -MONSTER:(';',"kraken"),(08,05) -MONSTER:(';',"giant eel"),(08,08) -MONSTER:(';',"kraken"),(14,05) -MONSTER:(';',"giant eel"),(14,08) -# Other monsters -MONSTER:'L',random -MONSTER:'D',random -MONSTER:'D',(26,09) -MONSTER:'&',random -MONSTER:'&',random -MONSTER:'&',random -# And to make things a little harder. -TRAP:"board",(10,07) -TRAP:"board",(12,07) -TRAP:"board",(11,06) -TRAP:"board",(11,08) -# Some loot -OBJECT:')',random -OBJECT:'!',random -OBJECT:'?',random -OBJECT:'?',random -OBJECT:'(',random -# treasures -OBJECT:'"',(11,07) - - -# The former decoy wizard levels. -# There are two of these, and we need to -# distinguish between them for the portal. -MAZE:"fakewiz1",random -GEOMETRY:center,center -MAP -......... -.}}}}}}}. -.}}---}}. -.}--.--}. -.}|...|}. -.}--.--}. -.}}---}}. -.}}}}}}}. -ENDMAP -STAIR:levregion(01,00,79,20),(0,0,8,7),up -STAIR:levregion(01,00,79,20),(0,0,8,7),down -BRANCH:levregion(01,00,79,20),(0,0,8,7) -TELEPORT_REGION:levregion(01,00,79,20),(2,2,6,6) -PORTAL:(4,4,4,4),(0,0,0,0),"wizard3" -MAZEWALK:(08,05),east -REGION:(04,03,06,06),unlit,"ordinary",unfilled,irregular -MONSTER:'L',(04,04) -MONSTER:('V',"vampire lord"),(03,04) -MONSTER:(';',"kraken"),(06,06) -# And to make things a little harder. -TRAP:"board",(04,03) -TRAP:"board",(04,05) -TRAP:"board",(03,04) -TRAP:"board",(05,04) - - -MAZE:"fakewiz2",random -GEOMETRY:center,center -MAP -......... -.}}}}}}}. -.}}---}}. -.}--.--}. -.}|...|}. -.}--.--}. -.}}---}}. -.}}}}}}}. -ENDMAP -STAIR:levregion(01,00,79,20),(0,0,8,7),up -STAIR:levregion(01,00,79,20),(0,0,8,7),down -BRANCH:levregion(01,00,79,20),(0,0,8,7) -TELEPORT_REGION:levregion(01,00,79,20),(2,2,6,6) -MAZEWALK:(08,05),east -REGION:(04,03,06,06),unlit,"ordinary",unfilled,irregular -MONSTER:'L',(04,04) -MONSTER:('V',"vampire lord"),(03,04) -MONSTER:(';',"kraken"),(06,06) -# And to make things a little harder. -TRAP:"board",(04,03) -TRAP:"board",(04,05) -TRAP:"board",(03,04) -TRAP:"board",(05,04) -# treasures -OBJECT:'"',(04,04) diff --git a/doc/lev_comp.6 b/doc/lev_comp.6 deleted file mode 100644 index fdb1945a7..000000000 --- a/doc/lev_comp.6 +++ /dev/null @@ -1,588 +0,0 @@ -.TH LEV_COMP 6 "25 May 2015" NETHACK -.de ND -.ds Nd \\$3 -.. -.de NB -.ds Nb \\$2 -.. -.de NR -.ds Nr \\$2 -.. -.ND $NHDT-Date: 1524689549 2018/04/25 20:52:29 $ -.NB $NHDT-Branch: NetHack-3.6.0 $ -.NR $NHDT-Revision: 1.7 $ -.ds Na Kenneth Lorber -.SH NAME -lev_comp \- NetHack special levels compiler -.SH SYNOPSIS -.B lev_comp -[ -.B \-w -] -[ -.I files -] -.PP -If no arguments are given, it reads standard input. -.SH DESCRIPTION -.PP -.I Lev_comp -is a special level compiler for NetHack version 3.2 and higher. It -takes description files as arguments and produces level files that can -be loaded by NetHack at runtime. -.PP -The purpose of this tool is to provide NetHack administrators and -implementors with a convenient way for adding special levels to the -game, or modifying existing ones, without having to recompile the -entire world. -.PP -The -.B \-w -option causes -.I lev_comp -to perform extra checks on the level and display extra warnings, however -these warnings are sometimes superfluous, so they are not normally displayed. - -.SH GRAMMAR -.PP -.LP -.nf -.ta +8n +8n +8n +8n - -file : /* nothing */ - | levels - ; - -levels : level - | level levels - ; - -level : maze_level - | room_level - ; - -maze_level : maze_def flags lev_init messages regions - ; - -room_level : level_def flags lev_init messages rreg_init rooms corridors_def - ; - -level_def : LEVEL_ID ':' string - ; - -lev_init : /* nothing */ - | LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled - ; - -walled : BOOLEAN - | RANDOM_TYPE - ; - -flags : /* nothing */ - | FLAGS_ID ':' flag_list - ; - -flag_list : FLAG_TYPE ',' flag_list - | FLAG_TYPE - ; - -messages : /* nothing */ - | message messages - ; - -message : MESSAGE_ID ':' STRING - ; - -rreg_init : /* nothing */ - | rreg_init init_rreg - ; - -init_rreg : RANDOM_OBJECTS_ID ':' object_list - | RANDOM_MONSTERS_ID ':' monster_list - ; - -rooms : /* Nothing - dummy room for use with INIT_MAP */ - | roomlist - ; - -roomlist : aroom - | aroom roomlist - ; - -corridors_def : random_corridors - | corridors - ; - -random_corridors: RAND_CORRIDOR_ID - ; - -corridors : /* nothing */ - | corridors corridor - ; - -corridor : CORRIDOR_ID ':' corr_spec ',' corr_spec - | CORRIDOR_ID ':' corr_spec ',' INTEGER - ; - -corr_spec : '(' INTEGER ',' DIRECTION ',' door_pos ')' - ; - -aroom : room_def room_details - | subroom_def room_details - ; - -subroom_def : SUBROOM_ID ':' room_type ',' light_state ',' subroom_pos ',' room_size ',' string roomfill - ; - -room_def : ROOM_ID ':' room_type ',' light_state ',' room_pos ',' room_align ',' room_size roomfill - ; - -roomfill : /* nothing */ - | ',' BOOLEAN - ; - -room_pos : '(' INTEGER ',' INTEGER ')' - | RANDOM_TYPE - ; - -subroom_pos : '(' INTEGER ',' INTEGER ')' - | RANDOM_TYPE - ; - -room_align : '(' h_justif ',' v_justif ')' - | RANDOM_TYPE - ; - -room_size : '(' INTEGER ',' INTEGER ')' - | RANDOM_TYPE - ; - -room_details : /* nothing */ - | room_details room_detail - ; - -room_detail : room_name - | room_chance - | room_door - | monster_detail - | object_detail - | trap_detail - | altar_detail - | fountain_detail - | sink_detail - | pool_detail - | gold_detail - | engraving_detail - | stair_detail - ; - -room_name : NAME_ID ':' string - ; - -room_chance : CHANCE_ID ':' INTEGER - ; - -room_door : DOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos - ; - -secret : BOOLEAN - | RANDOM_TYPE - ; - -door_wall : DIRECTION - | RANDOM_TYPE - ; - -door_pos : INTEGER - | RANDOM_TYPE - ; - -maze_def : MAZE_ID ':' string ',' filling - ; - -filling : CHAR - | RANDOM_TYPE - ; - -regions : aregion - | aregion regions - ; - -aregion : map_definition reg_init map_details - ; - -map_definition : NOMAP_ID - | map_geometry MAP_ID - ; - -map_geometry : GEOMETRY_ID ':' h_justif ',' v_justif - ; - -h_justif : LEFT_OR_RIGHT - | CENTER - ; - -v_justif : TOP_OR_BOT - | CENTER - ; - -reg_init : /* nothing */ - | reg_init init_reg - ; - -init_reg : RANDOM_OBJECTS_ID ':' object_list - | RANDOM_PLACES_ID ':' place_list - | RANDOM_MONSTERS_ID ':' monster_list - ; - -object_list : object - | object ',' object_list - ; - -monster_list : monster - | monster ',' monster_list - ; - -place_list : place - | place ',' place_list - ; - -map_details : /* nothing */ - | map_details map_detail - ; - -map_detail : monster_detail - | object_detail - | door_detail - | trap_detail - | drawbridge_detail - | region_detail - | stair_region - | portal_region - | teleprt_region - | branch_region - | altar_detail - | fountain_detail - | mazewalk_detail - | wallify_detail - | ladder_detail - | stair_detail - | gold_detail - | engraving_detail - | diggable_detail - | passwall_detail - ; - -monster_detail : MONSTER_ID chance ':' monster_c ',' m_name ',' coordinate - monster_infos - ; - -monster_infos : /* nothing */ - | monster_infos monster_info - ; - -monster_info : ',' string - | ',' MON_ATTITUDE - | ',' MON_ALERTNESS - | ',' alignment - | ',' MON_APPEARANCE string - ; - -object_detail : OBJECT_ID object_desc - | COBJECT_ID object_desc - ; - -object_desc : chance ':' object_c ',' o_name ',' object_where object_infos - ; - -object_where : coordinate - | CONTAINED - ; - -object_infos : /* nothing */ - | ',' curse_state ',' monster_id ',' enchantment optional_name - | ',' curse_state ',' enchantment optional_name - | ',' monster_id ',' enchantment optional_name - ; - -curse_state : RANDOM_TYPE - | CURSE_TYPE - ; - -monster_id : STRING - ; - -enchantment : RANDOM_TYPE - | INTEGER - ; - -optional_name : /* nothing */ - | ',' NONE - | ',' STRING - ; - -door_detail : DOOR_ID ':' door_state ',' coordinate - ; - -trap_detail : TRAP_ID chance ':' trap_name ',' coordinate - ; - -drawbridge_detail: DRAWBRIDGE_ID ':' coordinate ',' DIRECTION ',' door_state - ; - -mazewalk_detail : MAZEWALK_ID ':' coordinate ',' DIRECTION - ; - -wallify_detail : WALLIFY_ID - ; - -ladder_detail : LADDER_ID ':' coordinate ',' UP_OR_DOWN - ; - -stair_detail : STAIR_ID ':' coordinate ',' UP_OR_DOWN - ; - -stair_region : STAIR_ID ':' lev_region ',' lev_region ',' UP_OR_DOWN - ; - -portal_region : PORTAL_ID ':' lev_region ',' lev_region ',' string - ; - -teleprt_region : TELEPRT_ID ':' lev_region ',' lev_region teleprt_detail - ; - -branch_region : BRANCH_ID ':' lev_region ',' lev_region - ; - -teleprt_detail : /* empty */ - | ',' UP_OR_DOWN - ; - -lev_region : region - | LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' - ; - -fountain_detail : FOUNTAIN_ID ':' coordinate - ; - -sink_detail : SINK_ID ':' coordinate - ; - -pool_detail : POOL_ID ':' coordinate - ; - -diggable_detail : NON_DIGGABLE_ID ':' region - ; - -passwall_detail : NON_PASSWALL_ID ':' region - ; - -region_detail : REGION_ID ':' region ',' light_state ',' room_type prefilled - ; - -altar_detail : ALTAR_ID ':' coordinate ',' alignment ',' altar_type - ; - -gold_detail : GOLD_ID ':' amount ',' coordinate - ; - -engraving_detail: ENGRAVING_ID ':' coordinate ',' engraving_type ',' string - ; - -monster_c : monster - | RANDOM_TYPE - | m_register - ; - -object_c : object - | RANDOM_TYPE - | o_register - ; - -m_name : string - | RANDOM_TYPE - ; - -o_name : string - | RANDOM_TYPE - ; - -trap_name : string - | RANDOM_TYPE - ; - -room_type : string - | RANDOM_TYPE - ; - -prefilled : /* empty */ - | ',' FILLING - | ',' FILLING ',' BOOLEAN - ; - -coordinate : coord - | p_register - | RANDOM_TYPE - ; - -door_state : DOOR_STATE - | RANDOM_TYPE - ; - -light_state : LIGHT_STATE - | RANDOM_TYPE - ; - -alignment : ALIGNMENT - | a_register - | RANDOM_TYPE - ; - -altar_type : ALTAR_TYPE - | RANDOM_TYPE - ; - -p_register : P_REGISTER '[' INTEGER ']' - ; - -o_register : O_REGISTER '[' INTEGER ']' - ; - -m_register : M_REGISTER '[' INTEGER ']' - ; - -a_register : A_REGISTER '[' INTEGER ']' - ; - -place : coord - ; - -monster : CHAR - ; - -object : CHAR - ; - -string : STRING - ; - -amount : INTEGER - | RANDOM_TYPE - ; - -chance : /* empty */ - | PERCENT - ; - -engraving_type : ENGRAVING_TYPE - | RANDOM_TYPE - ; - -coord : '(' INTEGER ',' INTEGER ')' - ; - -region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' - ; -.fi -.PP -.I NOTE: -.br -Lines beginning with '#' are considered comments. -.PP -The contents of a "MAP" description of a maze is a rectangle showing the exact -level map that should be used for the given part of a maze. -Each character in the map corresponds to a location on the screen. -Different location types are denoted using different ASCII characters. -The following characters are recognized. -To give an idea of how these are used, see the EXAMPLE, below. -The maximum size of a map is normally 76 columns by 21 rows. -.LP -.nf -.ta +8n +8n +8n -\&'-' horizontal wall -\&'|' vertical wall -\&'+' a doorway (state is specified in a DOOR declaration) -\&'A' open air -\&'B' boundary room location (for bounding unwalled irregular regions) -\&'C' cloudy air -\&'I' ice -\&'S' a secret door -\&'H' a secret corridor -\&'{' a fountain -\&'\\' a throne -\&'K' a sink -\&'}' a part of a moat or other deep water -\&'P' a pool -\&'L' lava -\&'W' water (yes, different from a pool) -\&'T' a tree -\&'F' iron bars -\&'#' a corridor -\&'.' a normal room location (unlit unless lit in a REGION declaration) -\&' ' stone -.fi -.SH EXAMPLE -.PP -Here is an example of a description file (a very simple one): -.LP -.nf -.ta +8n +8n +8n -MAZE : "fortress", random -GEOMETRY : center , center -MAP -}}}}}}}}} -}}}|-|}}} -}}|-.-|}} -}|-...-|} -}|.....|} -}|-...-|} -}}|-.-|}} -}}}|-|}}} -}}}}}}}}} -ENDMAP -MONSTER: '@', "Wizard of Yendor", (4,4) -OBJECT: '"', "Amulet of Yendor", (4,4) -# a hell hound flanking the Wiz on a random side -RANDOM_PLACES: (4,3), (4,5), (3,4), (5,4) -MONSTER: 'd', "hell hound", place[0] -# a chest on another random side -OBJECT: '(', "chest", place[1] -# a sack on a random side, with a diamond and maybe a ruby in it -CONTAINER: '(', "sack", place[2] -OBJECT: '*', "diamond", contained -OBJECT[50%]: '*', "ruby", contained -# a random dragon somewhere -MONSTER: 'D', random, random -# 3 out of 4 chance for a random trap in the EAST end -TRAP[75%]: random, (6,4) -# an electric eel below the SOUTH end -MONSTER: ';', "electric eel", (4,8) -# make the walls non-diggable -NON_DIGGABLE: (0,0,8,8) -TELEPORT_REGION: levregion(0,0,79,20), (0,0,8,8) -.fi -.PP -This example will produce a file named "fortress" that can be integrated into -one of the numerous mazes of the game. -.PP -Note especially the final, TELEPORT_REGION specification. This says -that level teleports or other non-stairway arrivals on this level can -land anywhere on the level except the area of the map. This shows the -use of the ``levregion'' prefix allowed in certain region specifications. -Normally, regions apply only to the most recent MAP specification, but -when prefixed with ``levregion'', one can refer to any area of the -level, regardless of the placement of the current MAP in the level. -.SH AUTHOR -.PP -Jean-Christophe Collet, David Cohrs. -.SH "SEE ALSO" -.PP -dgn_comp(6), nethack(6) -.SH BUGS -.PP -Probably infinite. -Most importantly, still needs additional bounds checking. -.SH COPYRIGHT -This file is Copyright (C) \*(Na and was last modified \*(Nd (version -\*(Nb:\*(Nr). -NetHack may be freely redistributed. See license for details. diff --git a/doc/lev_comp.txt b/doc/lev_comp.txt deleted file mode 100644 index 4a28fcea6..000000000 --- a/doc/lev_comp.txt +++ /dev/null @@ -1,726 +0,0 @@ - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - -NAME - lev_comp - NetHack special levels compiler - -SYNOPSIS - lev_comp [ -w ] [ files ] - - If no arguments are given, it reads standard input. - -DESCRIPTION - Lev_comp is a special level compiler for NetHack version 3.2 - and higher. It takes description files as arguments and - produces level files that can be loaded by NetHack at run- - time. - - The purpose of this tool is to provide NetHack administra- - tors and implementors with a convenient way for adding spe- - cial levels to the game, or modifying existing ones, without - having to recompile the entire world. - - The -w option causes lev_comp to perform extra checks on the - level and display extra warnings, however these warnings are - sometimes superfluous, so they are not normally displayed. - - -GRAMMAR - file : /* nothing */ - | levels - ; - - levels : level - | level levels - ; - - level : maze_level - | room_level - ; - - maze_level : maze_def flags lev_init messages regions - ; - - room_level : level_def flags lev_init messages rreg_init rooms corridors_def - ; - - level_def : LEVEL_ID ':' string - ; - - lev_init : /* nothing */ - | LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled - ; - - walled : BOOLEAN - | RANDOM_TYPE - - - -May Last change: 16 1 - - - - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - - ; - - flags : /* nothing */ - | FLAGS_ID ':' flag_list - ; - - flag_list : FLAG_TYPE ',' flag_list - | FLAG_TYPE - ; - - messages : /* nothing */ - | message messages - ; - - message : MESSAGE_ID ':' STRING - ; - - rreg_init : /* nothing */ - | rreg_init init_rreg - ; - - init_rreg : RANDOM_OBJECTS_ID ':' object_list - | RANDOM_MONSTERS_ID ':' monster_list - ; - - rooms : /* Nothing - dummy room for use with INIT_MAP */ - | roomlist - ; - - roomlist : aroom - | aroom roomlist - ; - - corridors_def : random_corridors - | corridors - ; - - random_corridors: RAND_CORRIDOR_ID - ; - - corridors : /* nothing */ - | corridors corridor - ; - - corridor : CORRIDOR_ID ':' corr_spec ',' corr_spec - | CORRIDOR_ID ':' corr_spec ',' INTEGER - ; - - corr_spec : '(' INTEGER ',' DIRECTION ',' door_pos ')' - ; - - aroom : room_def room_details - - - -May Last change: 16 2 - - - - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - - | subroom_def room_details - ; - - subroom_def : SUBROOM_ID ':' room_type ',' light_state ',' subroom_pos ',' room_size ',' string roomfill - ; - - room_def : ROOM_ID ':' room_type ',' light_state ',' room_pos ',' room_align ',' room_size roomfill - ; - - roomfill : /* nothing */ - | ',' BOOLEAN - ; - - room_pos : '(' INTEGER ',' INTEGER ')' - | RANDOM_TYPE - ; - - subroom_pos : '(' INTEGER ',' INTEGER ')' - | RANDOM_TYPE - ; - - room_align : '(' h_justif ',' v_justif ')' - | RANDOM_TYPE - ; - - room_size : '(' INTEGER ',' INTEGER ')' - | RANDOM_TYPE - ; - - room_details : /* nothing */ - | room_details room_detail - ; - - room_detail : room_name - | room_chance - | room_door - | monster_detail - | object_detail - | trap_detail - | altar_detail - | fountain_detail - | sink_detail - | pool_detail - | gold_detail - | engraving_detail - | stair_detail - ; - - room_name : NAME_ID ':' string - ; - - room_chance : CHANCE_ID ':' INTEGER - - - -May Last change: 16 3 - - - - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - - ; - - room_door : DOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos - ; - - secret : BOOLEAN - | RANDOM_TYPE - ; - - door_wall : DIRECTION - | RANDOM_TYPE - ; - - door_pos : INTEGER - | RANDOM_TYPE - ; - - maze_def : MAZE_ID ':' string ',' filling - ; - - filling : CHAR - | RANDOM_TYPE - ; - - regions : aregion - | aregion regions - ; - - aregion : map_definition reg_init map_details - ; - - map_definition : NOMAP_ID - | map_geometry MAP_ID - ; - - map_geometry : GEOMETRY_ID ':' h_justif ',' v_justif - ; - - h_justif : LEFT_OR_RIGHT - | CENTER - ; - - v_justif : TOP_OR_BOT - | CENTER - ; - - reg_init : /* nothing */ - | reg_init init_reg - ; - - init_reg : RANDOM_OBJECTS_ID ':' object_list - | RANDOM_PLACES_ID ':' place_list - - - -May Last change: 16 4 - - - - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - - | RANDOM_MONSTERS_ID ':' monster_list - ; - - object_list : object - | object ',' object_list - ; - - monster_list : monster - | monster ',' monster_list - ; - - place_list : place - | place ',' place_list - ; - - map_details : /* nothing */ - | map_details map_detail - ; - - map_detail : monster_detail - | object_detail - | door_detail - | trap_detail - | drawbridge_detail - | region_detail - | stair_region - | portal_region - | teleprt_region - | branch_region - | altar_detail - | fountain_detail - | mazewalk_detail - | wallify_detail - | ladder_detail - | stair_detail - | gold_detail - | engraving_detail - | diggable_detail - | passwall_detail - ; - - monster_detail : MONSTER_ID chance ':' monster_c ',' m_name ',' coordinate - monster_infos - ; - - monster_infos : /* nothing */ - | monster_infos monster_info - ; - - monster_info : ',' string - | ',' MON_ATTITUDE - | ',' MON_ALERTNESS - - - -May Last change: 16 5 - - - - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - - | ',' alignment - | ',' MON_APPEARANCE string - ; - - object_detail : OBJECT_ID object_desc - | COBJECT_ID object_desc - ; - - object_desc : chance ':' object_c ',' o_name ',' object_where object_infos - ; - - object_where : coordinate - | CONTAINED - ; - - object_infos : /* nothing */ - | ',' curse_state ',' monster_id ',' enchantment optional_name - | ',' curse_state ',' enchantment optional_name - | ',' monster_id ',' enchantment optional_name - ; - - curse_state : RANDOM_TYPE - | CURSE_TYPE - ; - - monster_id : STRING - ; - - enchantment : RANDOM_TYPE - | INTEGER - ; - - optional_name : /* nothing */ - | ',' NONE - | ',' STRING - ; - - door_detail : DOOR_ID ':' door_state ',' coordinate - ; - - trap_detail : TRAP_ID chance ':' trap_name ',' coordinate - ; - - drawbridge_detail: DRAWBRIDGE_ID ':' coordinate ',' DIRECTION ',' door_state - ; - - mazewalk_detail : MAZEWALK_ID ':' coordinate ',' DIRECTION - ; - - wallify_detail : WALLIFY_ID - ; - - - - -May Last change: 16 6 - - - - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - - ladder_detail : LADDER_ID ':' coordinate ',' UP_OR_DOWN - ; - - stair_detail : STAIR_ID ':' coordinate ',' UP_OR_DOWN - ; - - stair_region : STAIR_ID ':' lev_region ',' lev_region ',' UP_OR_DOWN - ; - - portal_region : PORTAL_ID ':' lev_region ',' lev_region ',' string - ; - - teleprt_region : TELEPRT_ID ':' lev_region ',' lev_region teleprt_detail - ; - - branch_region : BRANCH_ID ':' lev_region ',' lev_region - ; - - teleprt_detail : /* empty */ - | ',' UP_OR_DOWN - ; - - lev_region : region - | LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' - ; - - fountain_detail : FOUNTAIN_ID ':' coordinate - ; - - sink_detail : SINK_ID ':' coordinate - ; - - pool_detail : POOL_ID ':' coordinate - ; - - diggable_detail : NON_DIGGABLE_ID ':' region - ; - - passwall_detail : NON_PASSWALL_ID ':' region - ; - - region_detail : REGION_ID ':' region ',' light_state ',' room_type prefilled - ; - - altar_detail : ALTAR_ID ':' coordinate ',' alignment ',' altar_type - ; - - gold_detail : GOLD_ID ':' amount ',' coordinate - ; - - engraving_detail: ENGRAVING_ID ':' coordinate ',' engraving_type ',' string - ; - - - -May Last change: 16 7 - - - - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - - monster_c : monster - | RANDOM_TYPE - | m_register - ; - - object_c : object - | RANDOM_TYPE - | o_register - ; - - m_name : string - | RANDOM_TYPE - ; - - o_name : string - | RANDOM_TYPE - ; - - trap_name : string - | RANDOM_TYPE - ; - - room_type : string - | RANDOM_TYPE - ; - - prefilled : /* empty */ - | ',' FILLING - | ',' FILLING ',' BOOLEAN - ; - - coordinate : coord - | p_register - | RANDOM_TYPE - ; - - door_state : DOOR_STATE - | RANDOM_TYPE - ; - - light_state : LIGHT_STATE - | RANDOM_TYPE - ; - - alignment : ALIGNMENT - | a_register - | RANDOM_TYPE - ; - - altar_type : ALTAR_TYPE - | RANDOM_TYPE - ; - - - -May Last change: 16 8 - - - - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - - p_register : P_REGISTER '[' INTEGER ']' - ; - - o_register : O_REGISTER '[' INTEGER ']' - ; - - m_register : M_REGISTER '[' INTEGER ']' - ; - - a_register : A_REGISTER '[' INTEGER ']' - ; - - place : coord - ; - - monster : CHAR - ; - - object : CHAR - ; - - string : STRING - ; - - amount : INTEGER - | RANDOM_TYPE - ; - - chance : /* empty */ - | PERCENT - ; - - engraving_type : ENGRAVING_TYPE - | RANDOM_TYPE - ; - - coord : '(' INTEGER ',' INTEGER ')' - ; - - region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' - ; - - NOTE: - Lines beginning with '#' are considered comments. - - The contents of a "MAP" description of a maze is a rectangle - showing the exact level map that should be used for the - given part of a maze. Each character in the map corresponds - to a location on the screen. Different location types are - denoted using different ASCII characters. The following - characters are recognized. To give an idea of how these are - used, see the EXAMPLE, below. The maximum size of a map is - - - -May Last change: 16 9 - - - - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - - normally 76 columns by 21 rows. - - '-' horizontal wall - '|' vertical wall - '+' a doorway (state is specified in a DOOR declaration) - 'A' open air - 'B' boundary room location (for bounding unwalled irregular regions) - 'C' cloudy air - 'I' ice - 'S' a secret door - 'H' a secret corridor - '{' a fountain - '\' a throne - 'K' a sink (if SINKS is defined, else a room location) - '}' a part of a moat or other deep water - 'P' a pool - 'L' lava - 'W' water (yes, different from a pool) - 'T' a tree - 'F' iron bars - '#' a corridor - '.' a normal room location (unlit unless lit in a REGION declaration) - ' ' stone - -EXAMPLE - Here is an example of a description file (a very simple - one): - - MAZE : "fortress", random - GEOMETRY : center , center - MAP - }}}}}}}}} - }}}|-|}}} - }}|-.-|}} - }|-...-|} - }|.....|} - }|-...-|} - }}|-.-|}} - }}}|-|}}} - }}}}}}}}} - ENDMAP - MONSTER: '@', "Wizard of Yendor", (4,4) - OBJECT: '"', "Amulet of Yendor", (4,4) - # a hell hound flanking the Wiz on a random side - RANDOM_PLACES: (4,3), (4,5), (3,4), (5,4) - MONSTER: 'd', "hell hound", place[0] - # a chest on another random side - OBJECT: '(', "chest", place[1] - # a sack on a random side, with a diamond and maybe a ruby in it - CONTAINER: '(', "sack", place[2] - OBJECT: '*', "diamond", contained - OBJECT[50%]: '*', "ruby", contained - - - -May Last change: 16 10 - - - - - - -LEV_COMP(6) 1996 LEV_COMP(6) - - - - # a random dragon somewhere - MONSTER: 'D', random, random - # 3 out of 4 chance for a random trap in the EAST end - TRAP[75%]: random, (6,4) - # an electric eel below the SOUTH end - MONSTER: ';', "electric eel", (4,8) - # make the walls non-diggable - NON_DIGGABLE: (0,0,8,8) - TELEPORT_REGION: levregion(0,0,79,20), (0,0,8,8) - - This example will produce a file named "fortress" that can - be integrated into one of the numerous mazes of the game. - - Note especially the final, TELEPORT_REGION specification. - This says that level teleports or other non-stairway - arrivals on this level can land anywhere on the level except - the area of the map. This shows the use of the ``levre- - gion'' prefix allowed in certain region specifications. - Normally, regions apply only to the most recent MAP specifi- - cation, but when prefixed with ``levregion'', one can refer - to any area of the level, regardless of the placement of the - current MAP in the level. - -AUTHOR - Jean-Christophe Collet, David Cohrs. - -SEE ALSO - dgn_comp(6), nethack(6) - -BUGS - Probably infinite. Most importantly, still needs additional - bounds checking. - - - - - - - - - - - - - - - - - - - - - - - -May Last change: 16 11 - - - diff --git a/include/align.h b/include/align.h index 1c5d40872..47ad97f5d 100644 --- a/include/align.h +++ b/include/align.h @@ -33,6 +33,7 @@ typedef struct align { /* alignment & record */ #define AM_SPLEV_CO 3 #define AM_SPLEV_NONCO 7 +#define AM_SPLEV_RANDOM 8 #define Amask2align(x) \ ((aligntyp)((!(x)) ? A_NONE : ((x) == AM_LAWFUL) ? A_LAWFUL \ diff --git a/include/decl.h b/include/decl.h index 1ff73009c..92262b274 100644 --- a/include/decl.h +++ b/include/decl.h @@ -417,12 +417,9 @@ E struct restore_info restoreinfo; E NEARDATA struct savefile_info sfcap, sfrestinfo, sfsaveinfo; -struct opvar { - xchar spovartyp; /* one of SPOVAR_foo */ - union { - char *str; - long l; - } vardata; +struct selectionvar { + int wid, hei; + char *map; }; struct autopickup_exception { @@ -867,7 +864,7 @@ struct instance_globals { d_level save_dlevel; /* do_name.c */ - struct opvar *gloc_filter_map; + struct selectionvar *gloc_filter_map; int gloc_filter_floodfill_match_glyph; int via_naming; @@ -1178,6 +1175,7 @@ struct instance_globals { int num_lregions; /* positions touched by level elements explicitly defined in the des-file */ char SpLev_Map[COLNO][ROWNO]; + struct sp_coder *coder; xchar xstart, ystart; char xsize, ysize; boolean splev_init_present; @@ -1187,7 +1185,6 @@ struct instance_globals { struct obj *container_obj[MAX_CONTAINMENT]; int container_idx; struct monst *invent_carrying_monster; - aligntyp ralign[3]; /* spells.c */ int spl_sortmode; /* index into spl_sortchoices[] */ diff --git a/include/extern.h b/include/extern.h index 829a65b52..694b2214a 100644 --- a/include/extern.h +++ b/include/extern.h @@ -254,6 +254,7 @@ E void NDECL(sanity_check); E char* FDECL(key2txt, (UCHAR_P, char *)); E char FDECL(yn_function, (const char *, const char *, CHAR_P)); E boolean FDECL(paranoid_query, (BOOLEAN_P, const char *)); +E void FDECL(makemap_prepost, (BOOLEAN_P, BOOLEAN_P)); /* ### dbridge.c ### */ @@ -915,8 +916,10 @@ E char *FDECL(mungspaces, (char *)); E char *FDECL(trimspaces, (char *)); E char *FDECL(strip_newline, (char *)); E char *FDECL(stripchars, (char *, const char *, const char *)); +E char *FDECL(stripdigits, (char *)); E char *FDECL(eos, (char *)); E boolean FDECL(str_end_is, (const char *, const char *)); +E int FDECL(str_lines_maxlen, (const char *)); E char *FDECL(strkitten, (char *, CHAR_P)); E void FDECL(copynchars, (char *, const char *, int)); E char FDECL(chrcasecpy, (int, int)); @@ -1262,6 +1265,7 @@ E void FDECL(add_subroom, (struct mkroom *, int, int, int, int, BOOLEAN_P, SCHAR_P, BOOLEAN_P)); E void NDECL(makecorridors); E void FDECL(add_door, (int, int, struct mkroom *)); +E void NDECL(clear_level_structures); E void NDECL(mklev); #ifdef SPECIALIZATION E void FDECL(topologize, (struct mkroom *, BOOLEAN_P)); @@ -1646,6 +1650,28 @@ E void NDECL(init_lan_features); E char *NDECL(lan_username); #endif +/* ### nhlsel.c ### */ +E struct selectionvar *FDECL(l_selection_check, (lua_State *, int)); +E int FDECL(l_selection_register, (lua_State *)); + +/* ### nhlua.c ### */ +E boolean FDECL(load_lua, (const char *)); +E void FDECL(nhl_error, (lua_State *, const char *)); +E void FDECL(lcheck_param_table, (lua_State *)); +E schar FDECL(get_table_mapchr, (lua_State *, const char *)); +E schar FDECL(get_table_mapchr_opt, (lua_State *, const char *, SCHAR_P)); +E schar FDECL(splev_chr2typ, (CHAR_P)); +E schar FDECL(check_mapchr, (const char *)); +E int FDECL(get_table_int, (lua_State *, const char *)); +E int FDECL(get_table_int_opt, (lua_State *, const char *, int)); +E char *FDECL(get_table_str, (lua_State *, const char *)); +E char *FDECL(get_table_str_opt, (lua_State *, const char *, char *)); +E int FDECL(get_table_boolean, (lua_State *, const char *)); +E int FDECL(get_table_boolean_opt, (lua_State *, const char *, int)); +E int FDECL(get_table_option, (lua_State *, const char *, const char *, const char *const *)); +E int FDECL(str_lines_max_width, (const char *)); +E char *FDECL(stripdigits, (char *)); + /* ### nhregex.c ### */ E struct nhregex *NDECL(regex_init); E boolean FDECL(regex_compile, (const char *, struct nhregex *)); @@ -2371,11 +2397,26 @@ E boolean FDECL(dig_corridor, (coord *, coord *, BOOLEAN_P, SCHAR_P, SCHAR_P)); E void FDECL(fill_room, (struct mkroom *, BOOLEAN_P)); E boolean FDECL(load_special, (const char *)); -E xchar FDECL(selection_getpoint, (int, int, struct opvar *)); -E struct opvar *FDECL(selection_opvar, (char *)); -E void FDECL(opvar_free_x, (struct opvar *)); +E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *)); +E struct selectionvar *NDECL(selection_new); +E void FDECL(selection_free, (struct selectionvar *)); +#if !defined(IN_SP_LEV_C) E void FDECL(set_selection_floodfillchk, (int FDECL((*), (int,int)))); -E void FDECL(selection_floodfill, (struct opvar *, int, int, BOOLEAN_P)); +#endif +E void FDECL(selection_floodfill, (struct selectionvar *, int, int, BOOLEAN_P)); +E void FDECL(get_location_coord, (schar *, schar *, int, struct mkroom *, long)); +E void FDECL(selection_setpoint, (int, int, struct selectionvar *, XCHAR_P)); +E struct selectionvar * FDECL(selection_not, (struct selectionvar *)); +E void FDECL(selection_filter_percent, (struct selectionvar *, int)); +E int FDECL(selection_rndcoord, (struct selectionvar *, schar *, schar *, BOOLEAN_P)); +E void FDECL(selection_do_grow, (struct selectionvar *, int)); +E void FDECL(selection_do_line, (SCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, struct selectionvar *)); +E void FDECL(selection_do_randline, (SCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, struct selectionvar *)); +E struct selectionvar *FDECL(selection_filter_mapchar, (struct selectionvar *, XCHAR_P, int)); +E void FDECL(set_floodfillchk_match_under, (XCHAR_P)); +E void FDECL(selection_do_ellipse, (struct selectionvar *, int, int, int, int, int)); +E void NDECL(update_croom); +E void FDECL(l_register_des, (lua_State *)); /* ### spell.c ### */ diff --git a/include/global.h b/include/global.h index e6f0ec4a4..98d5265df 100644 --- a/include/global.h +++ b/include/global.h @@ -46,7 +46,7 @@ #define ENGRAVEFILE "engrave" /* random engravings on the floor */ #define BOGUSMONFILE "bogusmon" /* hallucinatory monsters */ #define TRIBUTEFILE "tribute" /* 3.6 tribute to Terry Pratchett */ -#define LEV_EXT ".lev" /* extension for special level files */ +#define LEV_EXT ".lua" /* extension for special level files */ /* Assorted definitions that may depend on selections in config.h. */ diff --git a/include/ntconf.h b/include/ntconf.h index c2b0b3af0..b3ec581bd 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -284,4 +284,9 @@ extern void FDECL(nhassert_failed, (const char * exp, const char * file, #define nethack_enter(argc, argv) nethack_enter_winnt() extern void FDECL(nethack_exit, (int)) NORETURN; extern boolean FDECL(file_exists, (const char *)); + +#ifndef SYSTEM_H +#include "system.h" +#endif + #endif /* NTCONF_H */ diff --git a/include/sp_lev.h b/include/sp_lev.h index f3ffe6a94..060be4400 100644 --- a/include/sp_lev.h +++ b/include/sp_lev.h @@ -42,148 +42,9 @@ enum lvlinit_types { LVLINIT_ROGUE }; -/* max. # of random registers */ -#define MAX_REGISTERS 10 - /* max. nested depth of subrooms */ #define MAX_NESTED_ROOMS 5 -/* max. # of opcodes per special level */ -#define SPCODER_MAX_RUNTIME 65536 - -/* Opcodes for creating the level - * If you change these, also change opcodestr[] in util/lev_main.c - */ -enum opcode_defs { - SPO_NULL = 0, - SPO_MESSAGE, - SPO_MONSTER, - SPO_OBJECT, - SPO_ENGRAVING, - SPO_ROOM, - SPO_SUBROOM, - SPO_DOOR, - SPO_STAIR, - SPO_LADDER, - SPO_ALTAR, - SPO_FOUNTAIN, - SPO_SINK, - SPO_POOL, - SPO_TRAP, - SPO_GOLD, - SPO_CORRIDOR, - SPO_LEVREGION, - SPO_DRAWBRIDGE, - SPO_MAZEWALK, - SPO_NON_DIGGABLE, - SPO_NON_PASSWALL, - SPO_WALLIFY, - SPO_MAP, - SPO_ROOM_DOOR, - SPO_REGION, - SPO_MINERALIZE, - SPO_CMP, - SPO_JMP, - SPO_JL, - SPO_JLE, - SPO_JG, - SPO_JGE, - SPO_JE, - SPO_JNE, - SPO_TERRAIN, - SPO_REPLACETERRAIN, - SPO_EXIT, - SPO_ENDROOM, - SPO_POP_CONTAINER, - SPO_PUSH, - SPO_POP, - SPO_RN2, - SPO_DEC, - SPO_INC, - SPO_MATH_ADD, - SPO_MATH_SUB, - SPO_MATH_MUL, - SPO_MATH_DIV, - SPO_MATH_MOD, - SPO_MATH_SIGN, - SPO_COPY, - SPO_END_MONINVENT, - SPO_GRAVE, - SPO_FRAME_PUSH, - SPO_FRAME_POP, - SPO_CALL, - SPO_RETURN, - SPO_INITLEVEL, - SPO_LEVEL_FLAGS, - SPO_VAR_INIT, /* variable_name data */ - SPO_SHUFFLE_ARRAY, - SPO_DICE, - - SPO_SEL_ADD, - SPO_SEL_POINT, - SPO_SEL_RECT, - SPO_SEL_FILLRECT, - SPO_SEL_LINE, - SPO_SEL_RNDLINE, - SPO_SEL_GROW, - SPO_SEL_FLOOD, - SPO_SEL_RNDCOORD, - SPO_SEL_ELLIPSE, - SPO_SEL_FILTER, - SPO_SEL_GRADIENT, - SPO_SEL_COMPLEMENT, - - MAX_SP_OPCODES -}; - -/* MONSTER and OBJECT can take a variable number of parameters, - * they also pop different # of values from the stack. So, - * first we pop a value that tells what the _next_ value will - * mean. - */ -/* MONSTER */ -enum sp_mon_var_flags { - SP_M_V_PEACEFUL = 0, - SP_M_V_ALIGN, - SP_M_V_ASLEEP, - SP_M_V_APPEAR, - SP_M_V_NAME, - SP_M_V_FEMALE, - SP_M_V_INVIS, - SP_M_V_CANCELLED, - SP_M_V_REVIVED, - SP_M_V_AVENGE, - SP_M_V_FLEEING, - SP_M_V_BLINDED, - SP_M_V_PARALYZED, - SP_M_V_STUNNED, - SP_M_V_CONFUSED, - SP_M_V_SEENTRAPS, - - SP_M_V_END -}; - -/* OBJECT */ -enum sp_obj_var_flags { - SP_O_V_SPE = 0, - SP_O_V_CURSE, - SP_O_V_CORPSENM, - SP_O_V_NAME, - SP_O_V_QUAN, - SP_O_V_BURIED, - SP_O_V_LIT, - SP_O_V_ERODED, - SP_O_V_LOCKED, - SP_O_V_TRAPPED, - SP_O_V_RECHARGED, - SP_O_V_INVIS, - SP_O_V_GREASED, - SP_O_V_BROKEN, - SP_O_V_COORD, - - SP_O_V_END -}; - /* When creating objects, we need to know whether * it's a container and/or contents. */ @@ -199,25 +60,6 @@ enum sp_obj_var_flags { #define SEL_GRADIENT_RADIAL 0 #define SEL_GRADIENT_SQUARE 1 -/* variable types */ -#define SPOVAR_NULL 0x00 -#define SPOVAR_INT 0x01 /* l */ -#define SPOVAR_STRING 0x02 /* str */ -#define SPOVAR_VARIABLE 0x03 /* str (contains the variable name) */ -#define SPOVAR_COORD \ - 0x04 /* coordinate, encoded in l; use SP_COORD_X() and SP_COORD_Y() */ -#define SPOVAR_REGION 0x05 /* region, encoded in l; use SP_REGION_X1() etc \ - */ -#define SPOVAR_MAPCHAR 0x06 /* map char, in l */ -#define SPOVAR_MONST \ - 0x07 /* monster class & specific monster, encoded in l; use SP_MONST_... \ - */ -#define SPOVAR_OBJ \ - 0x08 /* object class & specific object type, encoded in l; use \ - SP_OBJ_... */ -#define SPOVAR_SEL 0x09 /* selection. char[COLNO][ROWNO] in str */ -#define SPOVAR_ARRAY 0x40 /* used in splev_var & lc_vardefs, not in opvar */ - #define SP_COORD_IS_RANDOM 0x01000000L /* Humidity flags for get_location() and friends, used with * SP_COORD_PACK_RANDOM() */ @@ -234,76 +76,18 @@ enum sp_obj_var_flags { #define SP_COORD_PACK(x, y) (((x) & 0xff) + (((y) & 0xff) << 16)) #define SP_COORD_PACK_RANDOM(f) (SP_COORD_IS_RANDOM | (f)) -#define SP_REGION_X1(l) (l & 0xff) -#define SP_REGION_Y1(l) ((l >> 8) & 0xff) -#define SP_REGION_X2(l) ((l >> 16) & 0xff) -#define SP_REGION_Y2(l) ((l >> 24) & 0xff) -#define SP_REGION_PACK(x1, y1, x2, y2) \ - (((x1) & 0xff) + (((y1) & 0xff) << 8) + (((x2) & 0xff) << 16) \ - + (((y2) & 0xff) << 24)) - -/* permonst index, object index, and lit value might be negative; - * add 10 to accept -1 through -9 while forcing non-negative for bit shift - */ -#define SP_MONST_CLASS(l) ((l) & 0xff) -#define SP_MONST_PM(l) ((((l) >> 8) & 0xffff) - 10) -#define SP_MONST_PACK(pm, cls) (((10 + (pm)) << 8) | ((cls) & 0xff)) - -#define SP_OBJ_CLASS(l) ((l) & 0xff) -#define SP_OBJ_TYP(l) ((((l) >> 8) & 0xffff) - 10) -#define SP_OBJ_PACK(ob, cls) (((10 + (ob)) << 8) | ((cls) & 0xff)) - -#define SP_MAPCHAR_TYP(l) ((l) & 0xff) -#define SP_MAPCHAR_LIT(l) ((((l) >> 8) & 0xffff) - 10) -#define SP_MAPCHAR_PACK(typ, lit) (((10 + (lit)) << 8) | ((typ) & 0xff)) - -struct splev_var { - struct splev_var *next; - char *name; - xchar svtyp; /* SPOVAR_foo */ - union { - struct opvar *value; - struct opvar **arrayvalues; - } data; - long array_len; -}; - -struct splevstack { - long depth; - long depth_alloc; - struct opvar **stackdata; -}; - -struct sp_frame { - struct sp_frame *next; - struct splevstack *stack; - struct splev_var *variables; - long n_opcode; -}; - struct sp_coder { - struct splevstack *stack; - struct sp_frame *frame; int premapped; boolean solidify; struct mkroom *croom; + int room_stack; struct mkroom *tmproomlist[MAX_NESTED_ROOMS + 1]; boolean failed_room[MAX_NESTED_ROOMS + 1]; int n_subroom; - boolean exit_script; int lvl_is_joined; boolean check_inaccessibles; - - int opcode; /* current opcode */ - struct opvar *opdat; /* current push data (req. opcode == SPO_PUSH) */ }; -/* special level coder CPU flags */ -#define SP_CPUFLAG_LT 1 -#define SP_CPUFLAG_GT 2 -#define SP_CPUFLAG_EQ 4 -#define SP_CPUFLAG_ZERO 8 - /* * Structures manipulated by the special levels loader & compiler */ @@ -315,15 +99,6 @@ typedef struct { int x, y; } unpacked_coord; -typedef struct { - int cmp_what; - int cmp_val; -} opcmp; - -typedef struct { - long jmp_target; -} opjmp; - typedef struct { xchar init_style; /* one of LVLINIT_foo */ long flags; @@ -416,122 +191,4 @@ typedef struct { char **map; } mazepart; -typedef struct { - int opcode; - struct opvar *opdat; -} _opcode; - -typedef struct { - _opcode *opcodes; - long n_opcodes; -} sp_lev; - -typedef struct { - xchar x, y, direction, count, lit; - char typ; -} spill; - -/* only used by lev_comp */ -struct lc_funcdefs_parm { - char *name; - char parmtype; - struct lc_funcdefs_parm *next; -}; - -struct lc_funcdefs { - struct lc_funcdefs *next; - char *name; - long addr; - sp_lev code; - long n_called; - struct lc_funcdefs_parm *params; - long n_params; -}; - -struct lc_vardefs { - struct lc_vardefs *next; - char *name; - long var_type; /* SPOVAR_foo */ - long n_used; -}; - -struct lc_breakdef { - struct lc_breakdef *next; - struct opvar *breakpoint; - int break_depth; -}; - -/* - * Quick! Avert your eyes while you still have a chance! - */ -#ifdef SPEC_LEV -/* compiling lev_comp rather than nethack */ -/* clang format off */ -#ifdef USE_OLDARGS -#ifndef VA_TYPE -typedef const char *vA; -#define VA_TYPE -#endif -/* hack to avoid "warning: cast to 'vA' (aka 'const char *') from smaller - integer type 'int' [-Wint-to-pointer-cast]" */ -#define vA_(a) ((vA) (long) a) -#undef VA_ARGS /* redefine with the maximum number actually used */ -#undef VA_SHIFT /* ditto */ -#undef VA_PASS1 -#define VA_ARGS \ - arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, \ - arg12, arg13, arg14 -/* Unlike in the core, lev_comp's VA_SHIFT should be completely safe, - because callers always pass all these arguments. */ -#define VA_SHIFT() \ - (arg1 = arg2, arg2 = arg3, arg3 = arg4, arg4 = arg5, arg5 = arg6, \ - arg6 = arg7, arg7 = arg8, arg8 = arg9, arg9 = arg10, arg10 = arg11, \ - arg11 = arg12, arg12 = arg13, arg13 = arg14, arg14 = 0) -/* standard NULL may be either (void *)0 or plain 0, both of - which would need to be explicitly cast to (char *) here */ -#define VA_PASS1(a1) \ - vA_(a1), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), \ - vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) -#define VA_PASS2(a1,a2) \ - vA_(a1), vA_(a2), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), \ - vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) -#define VA_PASS3(a1,a2,a3) \ - vA_(a1), vA_(a2), vA_(a3), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), \ - vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) -#define VA_PASS4(a1,a2,a3,a4) \ - vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(0), vA_(0), vA_(0), vA_(0), \ - vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) -#define VA_PASS5(a1,a2,a3,a4,a5) \ - vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(0), vA_(0), vA_(0), \ - vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) -#define VA_PASS7(a1,a2,a3,a4,a5,a6,a7) \ - vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(0), \ - vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) -#define VA_PASS8(a1,a2,a3,a4,a5,a6,a7,a8) \ - vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(a8), \ - vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) -#define VA_PASS9(a1,a2,a3,a4,a5,a6,a7,a8,a9) \ - vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(a8), \ - vA_(a9), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) -#define VA_PASS14(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \ - vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(a8), \ - vA_(a9), vA_(a10), vA_(a11), vA_(a12), vA_(a13), vA_(a14) -#else /*!USE_OLDARGS*/ -/* USE_STDARG and USE_VARARGS don't need to pass dummy arguments - or cast real ones */ -#define VA_PASS1(a1) a1 -#define VA_PASS2(a1,a2) a1, a2 -#define VA_PASS3(a1,a2,a3) a1, a2, a3 -#define VA_PASS4(a1,a2,a3,a4) a1, a2, a3, a4 -#define VA_PASS5(a1,a2,a3,a4,a5) a1, a2, a3, a4, a5 -#define VA_PASS7(a1,a2,a3,a4,a5,a6,a7) a1, a2, a3, a4, a5, a6, a7 -#define VA_PASS8(a1,a2,a3,a4,a5,a6,a7,a8) a1, a2, a3, a4, a5, a6, a7, a8 -#define VA_PASS9(a1,a2,a3,a4,a5,a6,a7,a8,a9) a1, a2, a3, a4, a5, a6, a7, a8, a9 -#define VA_PASS14(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \ - a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14 -#endif /*?USE_OLDARGS*/ -/* clang format on */ -/* You were warned to avert your eyes.... */ -#endif /*SPEC_LEV*/ - #endif /* SP_LEV_H */ diff --git a/include/system.h b/include/system.h index a2cb51f40..bb0ee071d 100644 --- a/include/system.h +++ b/include/system.h @@ -6,8 +6,8 @@ #ifndef SYSTEM_H #define SYSTEM_H +#if !defined(WIN32) #if !defined(__cplusplus) && !defined(__GO32__) - #define E extern /* some old may not define off_t and size_t; if your system is @@ -339,7 +339,7 @@ E int FDECL(memcmp, (const void *, const void *, size_t)); E void *FDECL(memcpy, (void *, const void *, size_t)); E void *FDECL(memset, (void *, int, size_t)); #else -#if defined(AZTEC_50) || defined(NHSTDC) || defined(WIN32) +#if defined(AZTEC_50) || defined(NHSTDC)) E int FDECL(memcmp, (const void *, const void *, size_t)); E void *FDECL(memcpy, (void *, const void *, size_t)); E void *FDECL(memset, (void *, int, size_t)); @@ -453,7 +453,7 @@ E char *FDECL(rindex, (const char *, int)); * If your system defines sprintf, et al, in stdio.h, add to the initial * #if. */ -#if defined(ULTRIX) || defined(__DECC) || defined(__SASC_60) || defined(WIN32) +#if defined(ULTRIX) || defined(__DECC) || defined(__SASC_60) #define SPRINTF_PROTO #endif #if (defined(SUNOS4) && defined(__STDC__)) || defined(_AIX32) @@ -567,5 +567,10 @@ E int FDECL(atoi, (const char *)); #undef E #endif /* !__cplusplus && !__GO32__ */ +#endif /* WIN32 */ + +#include "lua.h" +#include "lualib.h" +#include "lauxlib.h" #endif /* SYSTEM_H */ diff --git a/src/cmd.c b/src/cmd.c index 0b7471715..51d2f0577 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -148,6 +148,7 @@ STATIC_PTR int NDECL(wiz_where); STATIC_PTR int NDECL(wiz_detect); STATIC_PTR int NDECL(wiz_panic); STATIC_PTR int NDECL(wiz_polyself); +STATIC_PTR int NDECL(wiz_load_lua); STATIC_PTR int NDECL(wiz_level_tele); STATIC_PTR int NDECL(wiz_level_change); STATIC_PTR int NDECL(wiz_show_seenv); @@ -785,16 +786,14 @@ wiz_identify(VOID_ARGS) return 0; } -/* #wizmakemap - discard current dungeon level and replace with a new one */ -STATIC_PTR int -wiz_makemap(VOID_ARGS) +void +makemap_prepost(pre, wiztower) +boolean pre, wiztower; { NHFILE tmpnhfp; + struct monst *mtmp; - if (wizard) { - struct monst *mtmp; - boolean was_in_W_tower = In_W_tower(u.ux, u.uy, &u.uz); - + if (pre) { rm_mapseen(ledger_no(&u.uz)); for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (mtmp->isgd) { /* vault is going away; get rid of guard */ @@ -844,14 +843,14 @@ wiz_makemap(VOID_ARGS) angel on Astral or setting off alarm on Ft.Ludios are handled by goto_level(do.c) so won't occur for replacement levels */ mklev(); - + } else { vision_reset(); g.vision_full_recalc = 1; cls(); /* was using safe_teleds() but that doesn't honor arrival region on levels which have such; we don't force stairs, just area */ u_on_rndspot((u.uhave.amulet ? 1 : 0) /* 'going up' flag */ - | (was_in_W_tower ? 2 : 0)); + | (wiztower ? 2 : 0)); losedogs(); /* u_on_rndspot() might pick a spot that has a monster, or losedogs() might pick the hero's spot (only if there isn't already a monster @@ -870,6 +869,21 @@ wiz_makemap(VOID_ARGS) #ifdef INSURANCE save_currentstate(); #endif + } +} + +/* #wizmakemap - discard current dungeon level and replace with a new one */ +STATIC_PTR int +wiz_makemap(VOID_ARGS) +{ + if (wizard) { + boolean was_in_W_tower = In_W_tower(u.ux, u.uy, &u.uz); + makemap_prepost(TRUE, was_in_W_tower); + /* create a new level; various things like bestowing a guardian + angel on Astral or setting off alarm on Ft.Ludios are handled + by goto_level(do.c) so won't occur for replacement levels */ + mklev(); + makemap_prepost(FALSE, was_in_W_tower); } else { pline(unavailcmd, "#wizmakemap"); } @@ -930,6 +944,70 @@ wiz_detect(VOID_ARGS) return 0; } +STATIC_PTR int +wiz_load_lua(VOID_ARGS) +{ + if (wizard) { + char buf[BUFSZ]; + getlin("Load which lua file?", buf); + if (buf[0] == '\033' || buf[0] == '\0') + return 0; + if (!strchr(buf, '.')) + strcat(buf, ".lua"); + (void) load_lua(buf); + } else + pline("Unavailable command 'wiz_load_lua'."); + return 0; +} + +STATIC_PTR int +wiz_load_splua(VOID_ARGS) +{ + if (wizard) { + boolean was_in_W_tower = In_W_tower(u.ux, u.uy, &u.uz); + char buf[BUFSZ]; + int ridx; + + getlin("Load which des lua file?", buf); + if (buf[0] == '\033' || buf[0] == '\0') + return 0; + if (!strchr(buf, '.')) + strcat(buf, ".lua"); + makemap_prepost(TRUE, was_in_W_tower); + + /* TODO: need to split some of this out of mklev(), makelevel(), makemaz() */ + g.in_mklev = TRUE; + oinit(); /* assign level dependent obj probabilities */ + clear_level_structures(); + + (void) load_special(buf); + + bound_digging(); + mineralize(-1, -1, -1, -1, FALSE); + g.in_mklev = FALSE; + if (g.level.flags.has_morgue) + g.level.flags.graveyard = 1; + if (!g.level.flags.is_maze_lev) { + struct mkroom *croom; + for (croom = &g.rooms[0]; croom != &g.rooms[g.nroom]; croom++) +#ifdef SPECIALIZATION + topologize(croom, FALSE); +#else + topologize(croom); +#endif + } + set_wall_state(); + /* for many room types, g.rooms[].rtype is zeroed once the room has been + entered; g.rooms[].orig_rtype always retains original rtype value */ + for (ridx = 0; ridx < SIZE(g.rooms); ridx++) + g.rooms[ridx].orig_rtype = g.rooms[ridx].rtype; + + makemap_prepost(FALSE, was_in_W_tower); + } else + pline("Unavailable command 'wiz_load_splua'."); + return 0; +} + /* ^V command - level teleport */ STATIC_PTR int wiz_level_tele(VOID_ARGS) @@ -3452,6 +3530,10 @@ struct ext_func_tab extcmdlist[] = { wiz_intrinsic, IFBURIED | AUTOCOMPLETE | WIZMODECMD }, { C('v'), "wizlevelport", "teleport to another level", wiz_level_tele, IFBURIED | AUTOCOMPLETE | WIZMODECMD }, + { '\0', "wizloaddes", "load and execute a des-file lua script", + wiz_load_splua, IFBURIED | WIZMODECMD }, + { '\0', "wizloadlua", "load and execute a lua script", + wiz_load_lua, IFBURIED | WIZMODECMD }, { '\0', "wizmakemap", "recreate the current level", wiz_makemap, IFBURIED | WIZMODECMD }, { C('f'), "wizmap", "map the level", diff --git a/src/decl.c b/src/decl.c index d24e9937a..56ee65810 100644 --- a/src/decl.c +++ b/src/decl.c @@ -617,7 +617,8 @@ const struct instance_globals g_init = { NULL, /* lev_message */ NULL, /* lregions */ 0, /* num_lregions */ - UNDEFINED_VALUES, /* SplLev_Map */ + UNDEFINED_VALUES, /* SpLev_Map */ + NULL, /* coder */ UNDEFINED_VALUE, /* xstart */ UNDEFINED_VALUE, /* ystart */ UNDEFINED_VALUE, /* xsize */ @@ -629,7 +630,6 @@ const struct instance_globals g_init = { { UNDEFINED_PTR }, /* container_obj */ 0, /* container_idx */ NULL, /* invent_carrying_monster */ - { AM_CHAOTIC, AM_NEUTRAL, AM_LAWFUL }, /* ralign */ /* spells.c */ 0, /* spl_sortmode */ diff --git a/src/do_name.c b/src/do_name.c index 0200cbba5..a0cc25fa0 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -306,7 +306,7 @@ gloc_filter_init() { if (iflags.getloc_filter == GFILTER_AREA) { if (!g.gloc_filter_map) { - g.gloc_filter_map = selection_opvar((char *) 0); + g.gloc_filter_map = selection_new(); } /* special case: if we're in a doorway, try to figure out which direction we're moving, and use that side of the doorway */ @@ -326,8 +326,8 @@ void gloc_filter_done() { if (g.gloc_filter_map) { - opvar_free_x(g.gloc_filter_map); - g.gloc_filter_map = (struct opvar *) 0; + selection_free(g.gloc_filter_map); + g.gloc_filter_map = (struct selectionvar *) 0; } } diff --git a/src/hacklib.c b/src/hacklib.c index 48d6a4254..ac4527018 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -22,8 +22,10 @@ char * trimspaces (char *) char * strip_newline (char *) char * stripchars (char *, const char *, const char *) + char * stripdigits (char *) char * eos (char *) boolean str_end_is (const char *, const char *) + int str_lines_maxlen (const char *) char * strkitten (char *,char) void copynchars (char *,const char *,int) char chrcasecpy (int,int) @@ -224,6 +226,31 @@ const char *str, *chkstr; return FALSE; } +/* return the max line length from buffer comprising of newline-separated strings */ +int +str_lines_maxlen(str) +const char *str; +{ + const char *s1, *s2; + int len, max_len = 0; + + s1 = str; + while (s1 && *s1) { + s2 = index(s1, '\n'); + if (s2) { + len = (int) (s2 - s1); + s1 = s2 + 1; + } else { + len = (int) strlen(s1); + s1 = (char *) 0; + } + if (len > max_len) + max_len = len; + } + + return max_len; +} + /* append a character to a string (in place): strcat(s, {c,'\0'}); */ char * strkitten(s, c) @@ -468,6 +495,21 @@ const char *stuff_to_strip, *orig; return bp; } +/* remove digits from string */ +char * +stripdigits(s) +char *s; +{ + char *s1, *s2; + + for (s1 = s2 = s; *s1; s1++) + if (*s1 < '0' || *s1 > '9') + *s2++ = *s1; + *s2 = '\0'; + + return s; +} + /* substitute a word or phrase in a string (in place) */ /* caller is responsible for ensuring that bp points to big enough buffer */ char * diff --git a/src/mklev.c b/src/mklev.c index a0903be9d..631a908b1 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -14,7 +14,6 @@ STATIC_DCL void FDECL(mksink, (struct mkroom *)); STATIC_DCL void FDECL(mkaltar, (struct mkroom *)); STATIC_DCL void FDECL(mkgrave, (struct mkroom *)); STATIC_DCL void NDECL(makevtele); -STATIC_DCL void NDECL(clear_level_structures); STATIC_DCL void NDECL(makelevel); STATIC_DCL boolean FDECL(bydoor, (XCHAR_P, XCHAR_P)); STATIC_DCL struct mkroom *FDECL(find_branch_room, (coord *)); @@ -354,6 +353,14 @@ register struct mkroom *aroom; register int tmp; int i; + if (aroom->doorct) { + for (i = 0; i < aroom->doorct; i++) { + tmp = aroom->fdoor + i; + if (g.doors[tmp].x == x && g.doors[tmp].y == y) + return; + } + } + if (aroom->doorct == 0) aroom->fdoor = g.doorindex; @@ -573,7 +580,7 @@ makevtele() * special) but it's easier to put it all in one place than make sure * each type initializes what it needs to separately. */ -STATIC_OVL void +void clear_level_structures() { static struct rm zerorm = { cmap_to_glyph(S_stone), @@ -637,6 +644,14 @@ clear_level_structures() xdnladder = ydnladder = xupladder = yupladder = 0; g.made_branch = FALSE; clear_regions(); + g.xstart = 1; + g.ystart = 0; + g.xsize = COLNO - 1; + g.ysize = ROWNO; + if (g.lev_message) { + free(g.lev_message); + g.lev_message = (char *) 0; + } } STATIC_OVL void diff --git a/src/mkmap.c b/src/mkmap.c index 59eec1949..832f4f4fe 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -28,8 +28,10 @@ schar bg_typ; register int i, j; for (i = 1; i < COLNO; i++) - for (j = 0; j < ROWNO; j++) + for (j = 0; j < ROWNO; j++) { levl[i][j].typ = bg_typ; + levl[i][j].lit = FALSE; + } } STATIC_OVL void diff --git a/src/nhlsel.c b/src/nhlsel.c new file mode 100644 index 000000000..73ea5003b --- /dev/null +++ b/src/nhlsel.c @@ -0,0 +1,723 @@ +/* NetHack 3.6 nhlua.c $NHDT-Date: 1524287226 2018/04/21 05:07:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.98 $ */ +/* Copyright (c) 2018 by Pasi Kallinen */ +/* NetHack may be freely redistributed. See license for details. */ + +#include "hack.h" +#include "sp_lev.h" + +/* lua_CFunction prototypes */ +STATIC_DCL int FDECL(l_selection_new, (lua_State *)); +STATIC_DCL int FDECL(l_selection_clone, (lua_State *)); +STATIC_DCL int FDECL(l_selection_getpoint, (lua_State *)); +STATIC_DCL int FDECL(l_selection_setpoint, (lua_State *)); +STATIC_DCL int FDECL(l_selection_not, (lua_State *)); +STATIC_DCL int FDECL(l_selection_filter_percent, (lua_State *)); +STATIC_DCL int FDECL(l_selection_rndcoord, (lua_State *)); +STATIC_DCL int FDECL(l_selection_line, (lua_State *)); +STATIC_DCL int FDECL(l_selection_randline, (lua_State *)); +STATIC_DCL int FDECL(l_selection_rect, (lua_State *)); +STATIC_DCL int FDECL(l_selection_fillrect, (lua_State *)); +STATIC_DCL int FDECL(l_selection_fillrect, (lua_State *)); +STATIC_DCL int FDECL(l_selection_grow, (lua_State *)); +STATIC_DCL int FDECL(l_selection_filter_mapchar, (lua_State *)); +STATIC_DCL int FDECL(l_selection_flood, (lua_State *)); +STATIC_DCL int FDECL(l_selection_circle, (lua_State *)); +STATIC_DCL int FDECL(l_selection_ellipse, (lua_State *)); +STATIC_DCL int FDECL(l_selection_gradient, (lua_State *)); +STATIC_DCL int FDECL(l_selection_iterate, (lua_State *)); +STATIC_DCL int FDECL(l_selection_gc, (lua_State *)); +STATIC_DCL int FDECL(l_selection_not, (lua_State *)); +STATIC_DCL int FDECL(l_selection_and, (lua_State *)); +STATIC_DCL int FDECL(l_selection_or, (lua_State *)); +STATIC_DCL int FDECL(l_selection_xor, (lua_State *)); +STATIC_DCL int FDECL(l_selection_not, (lua_State *)); +STATIC_DCL int FDECL(l_selection_add, (lua_State *)); +STATIC_DCL int FDECL(l_selection_sub, (lua_State *)); +STATIC_DCL int FDECL(l_selection_ipairs, (lua_State *)); + +struct selectionvar * +l_selection_check(L, index) +lua_State *L; +int index; +{ + struct selectionvar *sel; + + luaL_checktype(L, index, LUA_TUSERDATA); + sel = (struct selectionvar *)luaL_checkudata(L, index, "selection"); + if (!sel) + nhl_error(L, "Selection error"); + return sel; +} + +static int +l_selection_gc(L) +lua_State *L; +{ + struct selectionvar *sel = l_selection_check(L, 1); + if (sel) + selection_free(sel); + return 0; +} + +static struct selectionvar * +l_selection_to(L, index) +lua_State *L; +int index; +{ + struct selectionvar *sel = (struct selectionvar *)lua_touserdata(L, index); + if (!sel) + nhl_error(L, "Selection error"); + return sel; +} + +static struct selectionvar * +l_selection_push(L) +lua_State *L; +{ + struct selectionvar *tmp = selection_new(); + struct selectionvar *sel = (struct selectionvar *)lua_newuserdata(L, sizeof(struct selectionvar)); + luaL_getmetatable(L, "selection"); + lua_setmetatable(L, -2); + + sel->wid = tmp->wid; + sel->hei = tmp->hei; + sel->map = dupstr(tmp->map); + selection_free(tmp); + + return sel; +} + +/* local sel = selection.new(); */ +static int +l_selection_new(L) +lua_State *L; +{ + (void) l_selection_push(L); + return 1; +} + +/* local sel = selection.clone(sel); */ +static int +l_selection_clone(L) +lua_State *L; +{ + struct selectionvar *sel = l_selection_check(L, 1); + struct selectionvar *tmp; + /* int x,y; */ /* REVIEW: unreferenced */ + lua_pop(L, 1); + (void) l_selection_new(L); + tmp = l_selection_check(L, 1); + if (tmp->map) + free(tmp->map); + tmp->map = dupstr(sel->map); + tmp->wid = sel->wid; + tmp->hei = sel->hei; + return 1; +} + +/* selection.set(sel, x, y); */ +/* selection.set(sel, x, y, value); */ +/* local sel = selection.set(); */ +/* local sel = sel:set(); */ +/* local sel = selection.set(sel); */ +/* TODO: allow setting multiple coordinates at once: set({x,y}, {x,y}, ...); */ +static int +l_selection_setpoint(L) +lua_State *L; +{ + struct selectionvar *sel = (struct selectionvar *) 0; + /* REVIEW: initializer added */ + schar x = -1, y = -1; + int val = 1; + int argc = lua_gettop(L); + long coord; + + if (argc == 0) { + (void) l_selection_new(L); + } else if (argc == 1) { + sel = l_selection_check(L, 1); + } else if (argc == 2) { + x = (schar) luaL_checkinteger(L, 1); + y = (schar) luaL_checkinteger(L, 2); + lua_pop(L, 2); + (void) l_selection_new(L); + sel = l_selection_check(L, 1); + } else { + sel = l_selection_check(L, 1); + x = (schar) luaL_checkinteger(L, 2); + y = (schar) luaL_checkinteger(L, 3); + val = (int) luaL_optinteger(L, 4, 1); + } + + if (!sel || !sel->map) { + nhl_error(L, "Selection setpoint error"); + return 0; + } + + if (x == -1 && y == -1) + coord = SP_COORD_PACK_RANDOM(0); + else + coord = SP_COORD_PACK(x,y); + get_location_coord(&x, &y, ANY_LOC, g.coder ? g.coder->croom : NULL, coord); + selection_setpoint(x, y, sel, val); + lua_settop(L, 1); + return 1; +} + +/* local value = selection.get(sel, x, y); */ +static int +l_selection_getpoint(L) +lua_State *L; +{ + struct selectionvar *sel = l_selection_check(L, 1); + schar x = (schar) luaL_checkinteger(L, 2); + schar y = (schar) luaL_checkinteger(L, 3); + int val; + long coord; + + if (x == -1 && y == -1) + coord = SP_COORD_PACK_RANDOM(0); + else + coord = SP_COORD_PACK(x,y); + get_location_coord(&x, &y, ANY_LOC, g.coder ? g.coder->croom : NULL, coord); + + val = selection_getpoint(x, y, sel); + lua_settop(L, 0); + lua_pushnumber(L, val); + return 1; +} + +/* local s = selection.negate(sel); */ +/* local s = selection.negate(); */ +static int +l_selection_not(L) +lua_State *L; +{ + int argc = lua_gettop(L); + struct selectionvar *sel; + + if (argc == 0) + (void) l_selection_new(L); + sel = l_selection_check(L, 1); + selection_not(sel); + lua_settop(L, 1); + return 1; +} + +/* local sel = selection.area(4,5, 40,10) & selection.rect(7,8, 60,14); */ +static int +l_selection_and(L) +lua_State *L; +{ + int x,y; + struct selectionvar *sela = l_selection_check(L, 1); + struct selectionvar *selb = l_selection_check(L, 2); + + for (x = 0; x < sela->wid; x++) + for (y = 0; y < sela->hei; y++) { + int val = selection_getpoint(x, y, sela) & selection_getpoint(x, y, selb); + selection_setpoint(x, y, sela, val); + } + + lua_settop(L, 1); + return 1; +} + +/* local sel = selection.area(4,5, 40,10) | selection.rect(7,8, 60,14); */ +static int +l_selection_or(L) +lua_State *L; +{ + int x,y; + struct selectionvar *sela = l_selection_check(L, 1); + struct selectionvar *selb = l_selection_check(L, 2); + + for (x = 0; x < sela->wid; x++) + for (y = 0; y < sela->hei; y++) { + int val = selection_getpoint(x, y, sela) | selection_getpoint(x, y, selb); + selection_setpoint(x, y, sela, val); + } + + lua_settop(L, 1); + return 1; +} + +/* local sel = selection.area(4,5, 40,10) ~ selection.rect(7,8, 60,14); */ +static int +l_selection_xor(L) +lua_State *L; +{ + int x,y; + struct selectionvar *sela = l_selection_check(L, 1); + struct selectionvar *selb = l_selection_check(L, 2); + + for (x = 0; x < sela->wid; x++) + for (y = 0; y < sela->hei; y++) { + int val = selection_getpoint(x, y, sela) ^ selection_getpoint(x, y, selb); + selection_setpoint(x, y, sela, val); + } + + lua_settop(L, 1); + return 1; +} + + +/* local s = selection.percentage(sel, 50); */ +static int +l_selection_filter_percent(L) +lua_State *L; +{ + struct selectionvar *sel = l_selection_check(L, 1); + int p = (int) luaL_checkinteger(L, 2); + selection_filter_percent(sel, p); + lua_settop(L, 1); + return 1; +} + +/* local x,y = selection.rndcoord(sel); */ +/* local x,y = selection.rndcoord(sel, 1); */ +static int +l_selection_rndcoord(L) +lua_State *L; +{ + struct selectionvar *sel = l_selection_check(L, 1); + int removeit = (int) luaL_optinteger(L, 2, 0); + schar x, y; + selection_rndcoord(sel, &x, &y, removeit); + update_croom(); + if (g.coder && g.coder->croom) { + x -= g.coder->croom->lx; + y -= g.coder->croom->ly; + } else { + x -= g.xstart; + y -= g.ystart; + } + lua_settop(L, 0); + lua_pushnumber(L, x); + lua_pushnumber(L, y); + return 2; +} + +/* local s = selection.line(sel, x1,y1, x2,y2); */ +/* local s = selection.line(x1,y1, x2,y2); */ +/* s:line(x1,y1, x2,y2); */ +static int +l_selection_line(L) +lua_State *L; +{ + int argc = lua_gettop(L); + struct selectionvar *sel; + schar x1; + schar y1; + schar x2; + schar y2; + + if (argc == 4) { + (void) l_selection_new(L); + x1 = (schar) luaL_checkinteger(L, 1); + y1 = (schar) luaL_checkinteger(L, 2); + x2 = (schar) luaL_checkinteger(L, 3); + y2 = (schar) luaL_checkinteger(L, 4); + sel = l_selection_check(L, 5); + lua_remove(L, 1); + lua_remove(L, 1); + lua_remove(L, 1); + lua_remove(L, 1); + } else { + sel = l_selection_check(L, 1); + x1 = (schar) luaL_checkinteger(L, 2); + y1 = (schar) luaL_checkinteger(L, 3); + x2 = (schar) luaL_checkinteger(L, 4); + y2 = (schar) luaL_checkinteger(L, 5); + } + + get_location_coord(&x1, &y1, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x1,y1)); + get_location_coord(&x2, &y2, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x2,y2)); + + selection_do_line(x1,y1,x2,y2, sel); + lua_settop(L, 1); + return 1; +} + +/* local s = selection.rect(sel, x1,y1, x2,y2); */ +static int +l_selection_rect(L) +lua_State *L; +{ + int argc = lua_gettop(L); + struct selectionvar *sel; + schar x1; + schar y1; + schar x2; + schar y2; + + if (argc == 4) { + (void) l_selection_new(L); + x1 = (schar) luaL_checkinteger(L, 1); + y1 = (schar) luaL_checkinteger(L, 2); + x2 = (schar) luaL_checkinteger(L, 3); + y2 = (schar) luaL_checkinteger(L, 4); + sel = l_selection_check(L, 5); + lua_remove(L, 1); + lua_remove(L, 1); + lua_remove(L, 1); + lua_remove(L, 1); + } else { + sel = l_selection_check(L, 1); + x1 = (schar) luaL_checkinteger(L, 2); + y1 = (schar) luaL_checkinteger(L, 3); + x2 = (schar) luaL_checkinteger(L, 4); + y2 = (schar) luaL_checkinteger(L, 5); + } + + get_location_coord(&x1, &y1, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x1,y1)); + get_location_coord(&x2, &y2, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x2,y2)); + + selection_do_line(x1,y1,x2,y1, sel); + selection_do_line(x1,y1,x1,y2, sel); + selection_do_line(x2,y1,x2,y2, sel); + selection_do_line(x1,y2,x2,y2, sel); + lua_settop(L, 1); + return 1; +} + +/* local s = selection.fillrect(sel, x1,y1, x2,y2); */ +/* local s = selection.fillrect(x1,y1, x2,y2); */ +/* s:fillrect(x1,y1, x2,y2); */ +/* selection.area(x1,y1, x2,y2); */ +static int +l_selection_fillrect(L) +lua_State *L; +{ + int argc = lua_gettop(L); + struct selectionvar *sel; + int y; + schar x1; + schar y1; + schar x2; + schar y2; + + if (argc == 4) { + (void) l_selection_new(L); + x1 = (schar) luaL_checkinteger(L, 1); + y1 = (schar) luaL_checkinteger(L, 2); + x2 = (schar) luaL_checkinteger(L, 3); + y2 = (schar) luaL_checkinteger(L, 4); + sel = l_selection_check(L, 5); + lua_remove(L, 1); + lua_remove(L, 1); + lua_remove(L, 1); + lua_remove(L, 1); + } else { + sel = l_selection_check(L, 1); + x1 = (schar) luaL_checkinteger(L, 2); + y1 = (schar) luaL_checkinteger(L, 3); + x2 = (schar) luaL_checkinteger(L, 4); + y2 = (schar) luaL_checkinteger(L, 5); + } + + get_location_coord(&x1, &y1, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x1,y1)); + get_location_coord(&x2, &y2, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x2,y2)); + + if (x1 == x2) { + for (y = y1; y <= y2; y++) + selection_setpoint(x1, y, sel, 1); + } else { + for (y = y1; y <= y2; y++) + selection_do_line(x1,y,x2,y, sel); + } + lua_settop(L, 1); + return 1; +} + +/* local s = selection.randline(sel, x1,y1, x2,y2, roughness); */ +/* local s = selection.randline(x1,y1, x2,y2, roughness); */ +/* TODO: selection.randline(x1,y1, x2,y2, roughness); */ +/* TODO: selection.randline({x1,y1}, {x2,y2}, roughness); */ +static int +l_selection_randline(L) +lua_State *L; +{ + int argc = lua_gettop(L); + struct selectionvar *sel = (struct selectionvar *) 0; + /* REVIEW: initializer added */ + schar x1, y1, x2, y2; + int roughness = 7; + + if (argc == 6) { + sel = l_selection_check(L, 1); + x1 = (schar) luaL_checkinteger(L, 2); + y1 = (schar) luaL_checkinteger(L, 3); + x2 = (schar) luaL_checkinteger(L, 4); + y2 = (schar) luaL_checkinteger(L, 5); + roughness = (int) luaL_checkinteger(L, 6); + } else if (argc == 5 && lua_type(L, 1) == LUA_TNUMBER) { + x1 = (schar) luaL_checkinteger(L, 1); + y1 = (schar) luaL_checkinteger(L, 2); + x2 = (schar) luaL_checkinteger(L, 3); + y2 = (schar) luaL_checkinteger(L, 4); + roughness = (int) luaL_checkinteger(L, 5); + lua_pop(L, 5); + (void) l_selection_new(L); + sel = l_selection_check(L, 1); + } + + get_location_coord(&x1, &y1, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x1,y1)); + get_location_coord(&x2, &y2, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x2,y2)); + + selection_do_randline(x1,y1, x2,y2, roughness, 12, sel); + lua_settop(L, 1); + return 1; +} + +/* local s = selection.grow(sel); */ +/* local s = selection.grow(sel, "north"); */ +static int +l_selection_grow(L) +lua_State *L; +{ + const char *const growdirs[] = { "all", "random", "north", "west", "east", "south", NULL }; + const int growdirs2i[] = { W_ANY, -1, W_NORTH, W_WEST, W_EAST, W_SOUTH, 0 }; + + struct selectionvar *sel = l_selection_check(L, 1); + int dir = growdirs2i[luaL_checkoption(L, 2, "all", growdirs)]; + selection_do_grow(sel, dir); + lua_settop(L, 1); + return 1; +} + + +/* local s = selection.filter_mapchar(sel, mapchar, lit); */ +static int +l_selection_filter_mapchar(L) +lua_State *L; +{ + struct selectionvar *sel = l_selection_check(L, 1); + char *mapchr = dupstr(luaL_checkstring(L, 2)); + xchar typ = check_mapchr(mapchr); + int lit = (int) luaL_optinteger(L, 3, -2); /* TODO: special lit values */ + struct selectionvar *tmp = selection_filter_mapchar(sel, typ, lit); + + if (typ == INVALID_TYPE) + nhl_error(L, "Erroneous map char"); + + if (sel->map) + free(sel->map); + sel->map = tmp->map; + if (tmp) + free(tmp); + if (mapchr) + free(mapchr); + + lua_settop(L, 1); + return 1; +} + + +/* local s = selection.floodfill(sel, x, y); */ +/* local s = selection.floodfill(x,y); */ +static int +l_selection_flood(L) +lua_State *L; +{ + int argc = lua_gettop(L); + struct selectionvar *sel = (struct selectionvar *) 0; + /* REVIEW: initializer added */ + schar x, y; + + if (argc == 3) { + sel = l_selection_check(L, 1); + x = (schar) luaL_checkinteger(L, 2); + y = (schar) luaL_checkinteger(L, 3); + } else if (argc == 2) { + x = (schar) luaL_checkinteger(L, 1); + y = (schar) luaL_checkinteger(L, 2); + lua_pop(L, 2); + (void) l_selection_new(L); + sel = l_selection_check(L, 1); + } else { + nhl_error(L, "wrong parameters"); + } + + get_location_coord(&x, &y, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x,y)); + + if (isok(x,y)) { + set_floodfillchk_match_under(levl[x][y].typ); + selection_floodfill(sel, x, y, FALSE); + } + lua_settop(L, 1); + return 1; +} + + +/* local s = selection.circle(x,y, radius); */ +/* local s = selection.circle(x, y, radius, filled); */ +/* local s = selection.circle(sel, x, y, radius); */ +/* local s = selection.circle(sel, x, y, radius, filled); */ +static int +l_selection_circle(L) +lua_State *L; +{ + int argc = lua_gettop(L); + struct selectionvar *sel = (struct selectionvar *) 0; + /* REVIEW: initializer added */ + schar x, y; + int r, filled = 0; + + if (argc == 3) { + x = (schar) luaL_checkinteger(L, 1); + y = (schar) luaL_checkinteger(L, 2); + r = (int) luaL_checkinteger(L, 3); + lua_pop(L, 3); + (void) l_selection_new(L); + sel = l_selection_check(L, 1); + filled = 0; + } else if (argc == 4 && lua_type(L, 1) == LUA_TNUMBER) { + x = (schar) luaL_checkinteger(L, 1); + y = (schar) luaL_checkinteger(L, 2); + r = (int) luaL_checkinteger(L, 3); + filled = (int) luaL_checkinteger(L, 4); /* TODO: boolean*/ + lua_pop(L, 4); + (void) l_selection_new(L); + sel = l_selection_check(L, 1); + } else if (argc == 4 || argc == 5) { + sel = l_selection_check(L, 1); + x = (schar) luaL_checkinteger(L, 2); + y = (schar) luaL_checkinteger(L, 3); + r = (int) luaL_checkinteger(L, 4); + filled = (int) luaL_optinteger(L, 5, 0); /* TODO: boolean */ + } else { + nhl_error(L, "wrong parameters"); + } + + get_location_coord(&x, &y, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x,y)); + + selection_do_ellipse(sel, x,y, r,r, !filled); + + lua_settop(L, 1); + return 1; +} + +/* local s = selection.ellipse(x, y, radius1, radius2); */ +/* local s = selection.ellipse(x, y, radius1, radius2, filled); */ +/* local s = selection.ellipse(sel, x, y, radius1, radius2); */ +/* local s = selection.ellipse(sel, x, y, radius1, radius2, filled); */ +static int +l_selection_ellipse(L) +lua_State *L; +{ + int argc = lua_gettop(L); + struct selectionvar *sel = (struct selectionvar *) 0; + /* REVIEW: initializer added */ + schar x, y; + int r1, r2, filled = 0; + + if (argc == 4) { + x = (schar) luaL_checkinteger(L, 1); + y = (schar) luaL_checkinteger(L, 2); + r1 = (int) luaL_checkinteger(L, 3); + r2 = (int) luaL_checkinteger(L, 4); + lua_pop(L, 4); + (void) l_selection_new(L); + sel = l_selection_check(L, 1); + filled = 0; + } else if (argc == 5 && lua_type(L, 1) == LUA_TNUMBER) { + x = (schar) luaL_checkinteger(L, 1); + y = (schar) luaL_checkinteger(L, 2); + r1 = (int) luaL_checkinteger(L, 3); + r2 = (int) luaL_checkinteger(L, 4); + filled = (int) luaL_optinteger(L, 5, 0); /* TODO: boolean */ + lua_pop(L, 5); + (void) l_selection_new(L); + sel = l_selection_check(L, 1); + } else if (argc == 5 || argc == 6) { + sel = l_selection_check(L, 1); + x = (schar) luaL_checkinteger(L, 2); + y = (schar) luaL_checkinteger(L, 3); + r1 = (int) luaL_checkinteger(L, 4); + r2 = (int) luaL_checkinteger(L, 5); + filled = (int) luaL_optinteger(L, 6, 0); /* TODO: boolean */ + } else { + nhl_error(L, "wrong parameters"); + } + + get_location_coord(&x, &y, ANY_LOC, g.coder ? g.coder->croom : NULL, SP_COORD_PACK(x,y)); + + selection_do_ellipse(sel, x,y, r1,r2, !filled); + + lua_settop(L, 1); + return 1; +} + + +static const struct luaL_Reg l_selection_methods[] = { + { "new", l_selection_new }, + { "clone", l_selection_clone }, + { "get", l_selection_getpoint }, + { "set", l_selection_setpoint }, + { "negate", l_selection_not }, + { "percentage", l_selection_filter_percent }, + { "rndcoord", l_selection_rndcoord }, + { "line", l_selection_line }, + { "randline", l_selection_randline }, + { "rect", l_selection_rect }, + { "fillrect", l_selection_fillrect }, + { "area", l_selection_fillrect }, + { "grow", l_selection_grow }, + { "filter_mapchar", l_selection_filter_mapchar }, + { "floodfill", l_selection_flood }, + { "circle", l_selection_circle }, + { "ellipse", l_selection_ellipse }, + /* TODO: + { "gradient", l_selection_gradient }, + { "iterate", l_selection_iterate }, + */ + { NULL, NULL } +}; + +static const luaL_Reg l_selection_meta[] = { + { "__gc", l_selection_gc }, + { "__unm", l_selection_not }, + { "__band", l_selection_and }, + { "__bor", l_selection_or }, + { "__bxor", l_selection_xor }, + { "__bnot", l_selection_not }, + /* TODO: http://lua-users.org/wiki/MetatableEvents + { "__add", l_selection_add }, + { "__sub", l_selection_sub }, + { "__ipairs", l_selection_ipairs }, + */ + { NULL, NULL } +}; + +int +l_selection_register(L) +lua_State *L; +{ + int lib_id, meta_id; + + /* newclass = {} */ + lua_createtable(L, 0, 0); + lib_id = lua_gettop(L); + + /* metatable = {} */ + luaL_newmetatable(L, "selection"); + meta_id = lua_gettop(L); + luaL_setfuncs(L, l_selection_meta, 0); + + /* metatable.__index = _methods */ + luaL_newlib(L, l_selection_methods); + lua_setfield(L, meta_id, "__index"); + + /* metatable.__metatable = _meta */ + luaL_newlib(L, l_selection_meta); + lua_setfield(L, meta_id, "__metatable"); + + /* class.__metatable = metatable */ + lua_setmetatable(L, lib_id); + + /* _G["selection"] = newclass */ + lua_setglobal(L, "selection"); + + return 0; +} diff --git a/src/nhlua.c b/src/nhlua.c new file mode 100644 index 000000000..609b6ecf5 --- /dev/null +++ b/src/nhlua.c @@ -0,0 +1,883 @@ +/* NetHack 3.6 nhlua.c $NHDT-Date: 1524287226 2018/04/21 05:07:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.98 $ */ +/* Copyright (c) 2018 by Pasi Kallinen */ +/* NetHack may be freely redistributed. See license for details. */ + +#include "hack.h" +#include "dlb.h" + +/* +#- include +#- include +#- include +*/ + +/* */ + +/* lua_CFunction prototypes */ +STATIC_DCL int FDECL(nhl_test, (lua_State *)); +STATIC_DCL int FDECL(nhl_getmap, (lua_State *)); +STATIC_DCL int FDECL(nhl_setmap, (lua_State *)); +STATIC_DCL int FDECL(nhl_pline, (lua_State *)); +STATIC_DCL int FDECL(nhl_verbalize, (lua_State *)); +STATIC_DCL int FDECL(nhl_menu, (lua_State *)); +STATIC_DCL int FDECL(nhl_getlin, (lua_State *)); +STATIC_DCL int FDECL(nhl_makeplural, (lua_State *)); +STATIC_DCL int FDECL(nhl_makesingular, (lua_State *)); +STATIC_DCL int FDECL(nhl_s_suffix, (lua_State *)); +STATIC_DCL int FDECL(nhl_ing_suffix, (lua_State *)); +STATIC_DCL int FDECL(nhl_an, (lua_State *)); +STATIC_DCL int FDECL(nhl_meta_u_index, (lua_State *)); +STATIC_DCL int FDECL(nhl_meta_u_newindex, (lua_State *)); +STATIC_DCL int FDECL(traceback_handler, (lua_State *)); + +void +nhl_error(L, msg) +lua_State *L; +const char *msg; +{ + lua_Debug ar; + char buf[BUFSZ]; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "lS", &ar); + Sprintf(buf, "%s (line %i%s)", msg, ar.currentline, ar.source); + lua_pushstring(L, buf); + lua_error(L); +} + +/* Check that parameters are nothing but single table, + or if no parameters given, put empty table there */ +void +lcheck_param_table(L) +lua_State *L; +{ + int argc = lua_gettop(L); + + if (argc < 1) + lua_createtable(L, 0, 0); + + /* discard any extra arguments passed in */ + lua_settop(L, 1); + + luaL_checktype(L, 1, LUA_TTABLE); +} + +schar +get_table_mapchr(L, name) +lua_State *L; +const char *name; +{ + char *ter; + xchar typ; + + ter = get_table_str(L, name); + typ = check_mapchr(ter); + if (typ == INVALID_TYPE) + nhl_error(L, "Erroneous map char"); + if (ter) + free(ter); + return typ; +} + +schar +get_table_mapchr_opt(L, name, defval) +lua_State *L; +const char *name; +schar defval; +{ + char *ter; + xchar typ; + + ter = get_table_str_opt(L, name, ""); + if (name && *ter) { + typ = check_mapchr(ter); + if (typ == INVALID_TYPE) + nhl_error(L, "Erroneous map char"); + } else + typ = defval; + if (ter) + free(ter); + return typ; +} + +void +nhl_add_table_entry_int(L, name, value) +lua_State *L; +const char *name; +int value; +{ + lua_pushstring(L, name); + lua_pushinteger(L, value); + lua_rawset(L, -3); +} + +void +nhl_add_table_entry_str(L, name, value) +lua_State *L; +const char *name; +const char *value; +{ + lua_pushstring(L, name); + lua_pushstring(L, dupstr(value)); + lua_rawset(L, -3); +} +void +nhl_add_table_entry_bool(L, name, value) +lua_State *L; +const char *name; +boolean value; +{ + lua_pushstring(L, name); + lua_pushboolean(L, value); + lua_rawset(L, -3); +} + +/* converting from special level "map character" to levl location type + and back. order here is important. */ +const struct { + char ch; + schar typ; +} char2typ[] = { + { ' ', STONE }, + { '#', CORR }, + { '.', ROOM }, + { '-', HWALL }, + { '-', TLCORNER }, + { '-', TRCORNER }, + { '-', BLCORNER }, + { '-', BRCORNER }, + { '-', CROSSWALL }, + { '-', TUWALL }, + { '-', TDWALL }, + { '-', TLWALL }, + { '-', TRWALL }, + { '-', DBWALL }, + { '|', VWALL }, + { '+', DOOR }, + { 'A', AIR }, + { 'C', CLOUD }, + { 'S', SDOOR }, + { 'H', SCORR }, + { '{', FOUNTAIN }, + { '\\', THRONE }, + { 'K', SINK }, + { '}', MOAT }, + { 'P', POOL }, + { 'L', LAVAPOOL }, + { 'I', ICE }, + { 'W', WATER }, + { 'T', TREE }, + { 'F', IRONBARS }, /* Fe = iron */ + { 'x', MAX_TYPE }, /* "see-through" */ + { 'B', CROSSWALL }, /* hack: boundary location */ + { '\0', STONE }, +}; + +schar +splev_chr2typ(c) +char c; +{ + int i; + + for (i = 0; char2typ[i].ch; i++) + if (c == char2typ[i].ch) + return char2typ[i].typ; + return (INVALID_TYPE); +} + +schar +check_mapchr(s) +const char *s; +{ + if (s && strlen(s) == 1) + return splev_chr2typ(s[0]); + return INVALID_TYPE; +} + +char +splev_typ2chr(typ) +schar typ; +{ + int i; + + for (i = 0; char2typ[i].typ < MAX_TYPE; i++) + if (typ == char2typ[i].typ) + return char2typ[i].ch; + return 'x'; +} + +/* local loc = getmap(x,y) */ +static int +nhl_getmap(L) +lua_State *L; +{ + int argc = lua_gettop(L); + + if (argc == 2) { + int x = (int) lua_tonumber(L, 1); + int y = (int) lua_tonumber(L, 2); + + if (x >= 0 && x < COLNO && y >= 0 && y < ROWNO) { + char buf[BUFSZ]; + lua_newtable(L); + + /* FIXME: some should be boolean values */ + nhl_add_table_entry_int(L, "glyph", levl[x][y].glyph); + nhl_add_table_entry_int(L, "typ", levl[x][y].typ); + Sprintf(buf, "%c", splev_typ2chr(levl[x][y].typ)); + nhl_add_table_entry_str(L, "mapchr", buf); + nhl_add_table_entry_int(L, "seenv", levl[x][y].seenv); + nhl_add_table_entry_bool(L, "horizontal", levl[x][y].horizontal); + nhl_add_table_entry_bool(L, "lit", levl[x][y].lit); + nhl_add_table_entry_bool(L, "waslit", levl[x][y].waslit); + nhl_add_table_entry_int(L, "roomno", levl[x][y].roomno); + nhl_add_table_entry_bool(L, "edge", levl[x][y].edge); + nhl_add_table_entry_bool(L, "candig", levl[x][y].candig); + + /* TODO: FIXME: levl[x][y].flags */ + + lua_pushliteral(L, "flags"); + lua_newtable(L); + + if (IS_DOOR(levl[x][y].typ)) { + nhl_add_table_entry_bool(L, "nodoor", (levl[x][y].flags & D_NODOOR)); + nhl_add_table_entry_bool(L, "broken", (levl[x][y].flags & D_BROKEN)); + nhl_add_table_entry_bool(L, "isopen", (levl[x][y].flags & D_ISOPEN)); + nhl_add_table_entry_bool(L, "closed", (levl[x][y].flags & D_CLOSED)); + nhl_add_table_entry_bool(L, "locked", (levl[x][y].flags & D_LOCKED)); + nhl_add_table_entry_bool(L, "trapped", (levl[x][y].flags & D_TRAPPED)); + } else if (IS_ALTAR(levl[x][y].typ)) { + /* TODO: bits 0, 1, 2 */ + nhl_add_table_entry_bool(L, "shrine", (levl[x][y].flags & AM_SHRINE)); + } else if (IS_THRONE(levl[x][y].typ)) { + nhl_add_table_entry_bool(L, "looted", (levl[x][y].flags & T_LOOTED)); + } else if (levl[x][y].typ == TREE) { + nhl_add_table_entry_bool(L, "looted", (levl[x][y].flags & TREE_LOOTED)); + nhl_add_table_entry_bool(L, "swarm", (levl[x][y].flags & TREE_SWARM)); + } else if (IS_FOUNTAIN(levl[x][y].typ)) { + nhl_add_table_entry_bool(L, "looted", (levl[x][y].flags & F_LOOTED)); + nhl_add_table_entry_bool(L, "warned", (levl[x][y].flags & F_WARNED)); + } else if (IS_SINK(levl[x][y].typ)) { + nhl_add_table_entry_bool(L, "pudding", (levl[x][y].flags & S_LPUDDING)); + nhl_add_table_entry_bool(L, "dishwasher", (levl[x][y].flags & S_LDWASHER)); + nhl_add_table_entry_bool(L, "ring", (levl[x][y].flags & S_LRING)); + } + /* TODO: drawbridges, walls, ladders, room=>ICED_xxx */ + + lua_settable(L, -3); + + return 1; + } else { + /* TODO: return zerorm instead? */ + nhl_error(L, "Coordinates out of range"); + return 0; + } + } else { + nhl_error(L, "Incorrect arguments"); + return 0; + } + return 1; +} + +/* pline("It hits!") */ +static int +nhl_pline(L) +lua_State *L; +{ + int argc = lua_gettop(L); + + if (argc == 1) + pline("%s", luaL_checkstring(L, 1)); + else + nhl_error(L, "Wrong args"); + + return 0; +} + +/* verbalize("Fool!") */ +static int +nhl_verbalize(L) +lua_State *L; +{ + int argc = lua_gettop(L); + + if (argc == 1) + verbalize("%s", luaL_checkstring(L, 1)); + else + nhl_error(L, "Wrong args"); + + return 0; +} + +/* + str = getlin("What do you want to call this dungeon level?"); + */ +static int +nhl_getlin(L) +lua_State *L; +{ + int argc = lua_gettop(L); + + if (argc == 1) { + const char *prompt = luaL_checkstring(L, 1); + char buf[BUFSZ]; + + getlin(prompt, buf); + lua_pushstring(L, buf); + return 1; + } + + nhl_error(L, "Wrong args"); + return 0; +} + +/* + selected = menu("prompt", default, pickX, { "a" = "option a", "b" = "option b", ...}) + pickX = 0,1,2, or "none", "one", "any" (PICK_X in code) + + selected = menu("prompt", default, pickX, + { {key:"a", text:"option a"}, {key:"b", text:"option b"}, ... } ) */ +static int +nhl_menu(L) +lua_State *L; +{ + int argc = lua_gettop(L); + const char *prompt; + const char *defval = ""; + const char *const pickX[] = {"none", "one", "any"}; /* PICK_NONE, PICK_ONE, PICK_ANY */ + int pick = PICK_ONE, pick_cnt; + winid tmpwin; + anything any; + menu_item *picks = (menu_item *) 0; + + if (argc < 2 || argc > 4) { + nhl_error(L, "Wrong args"); + return 0; + } + + prompt = luaL_checkstring(L, 1); + if (lua_isstring(L, 2)) + defval = luaL_checkstring(L, 2); + if (lua_isstring(L, 3)) + pick = luaL_checkoption(L, 3, "one", pickX); + luaL_checktype(L, argc, LUA_TTABLE); + + tmpwin = create_nhwindow(NHW_MENU); + start_menu(tmpwin); + + lua_pushnil(L); /* first key */ + while (lua_next(L, argc) != 0) { + const char *str = ""; + const char *key = ""; + + /* key @ index -2, value @ index -1 */ + if (lua_istable(L, -1)) { + lua_pushliteral(L, "key"); + lua_gettable(L, -2); + key = lua_tostring(L, -1); + lua_pop(L, 1); + + lua_pushliteral(L, "text"); + lua_gettable(L, -2); + str = lua_tostring(L, -1); + lua_pop(L, 1); + + /* TODO: glyph, attr, accel, group accel (all optional) */ + } else if (lua_isstring(L, -1)) { + str = luaL_checkstring(L, -1); + key = luaL_checkstring(L, -2); + } + + any = cg.zeroany; + if (*key) + any.a_char = key[0]; + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, str, + (*defval && *key && defval[0] == key[0]) ? MENU_SELECTED : MENU_UNSELECTED); + + lua_pop(L, 1); /* removes 'value'; keeps 'key' for next iteration */ + } + + end_menu(tmpwin, prompt); + pick_cnt = select_menu(tmpwin, pick, &picks); + destroy_nhwindow(tmpwin); + + if (pick_cnt > 0) { + char buf[2]; + buf[0] = picks[0].item.a_char; + + if (pick == PICK_ONE && pick_cnt > 1 && *defval && defval[0] == picks[0].item.a_char) + buf[0] = picks[1].item.a_char; + + buf[1] = '\0'; + lua_pushstring(L, buf); + /* TODO: pick any */ + } else { + char buf[2]; + buf[0] = defval[0]; + buf[1] = '\0'; + lua_pushstring(L, buf); + } + + return 1; +} + +/* makeplural("zorkmid") */ +static int +nhl_makeplural(L) +lua_State *L; +{ + int argc = lua_gettop(L); + + if (argc == 1) + lua_pushstring(L, makeplural(luaL_checkstring(L, 1))); + else + nhl_error(L, "Wrong args"); + + return 1; +} + +/* makesingular("zorkmids") */ +static int +nhl_makesingular(L) +lua_State *L; +{ + int argc = lua_gettop(L); + + if (argc == 1) + lua_pushstring(L, makesingular(luaL_checkstring(L, 1))); + else + nhl_error(L, "Wrong args"); + + return 1; +} + +/* s_suffix("foo") */ +static int +nhl_s_suffix(L) +lua_State *L; +{ + int argc = lua_gettop(L); + + if (argc == 1) + lua_pushstring(L, s_suffix(luaL_checkstring(L, 1))); + else + nhl_error(L, "Wrong args"); + + return 1; +} + +/* ing_suffix("foo") */ +static int +nhl_ing_suffix(L) +lua_State *L; +{ + int argc = lua_gettop(L); + + if (argc == 1) + lua_pushstring(L, ing_suffix(luaL_checkstring(L, 1))); + else + nhl_error(L, "Wrong args"); + + return 1; +} + +/* an("foo") */ +static int +nhl_an(L) +lua_State *L; +{ + int argc = lua_gettop(L); + + if (argc == 1) + lua_pushstring(L, an(luaL_checkstring(L, 1))); + else + nhl_error(L, "Wrong args"); + + return 1; +} + +/* get mandatory integer value from table */ +int +get_table_int(L, name) +lua_State *L; +const char *name; +{ + int ret; + + lua_getfield(L, 1, name); + ret = (int) luaL_checkinteger(L, -1); + lua_pop(L, 1); + return ret; +} + +/* get optional integer value from table */ +int +get_table_int_opt(L, name, defval) +lua_State *L; +const char *name; +int defval; +{ + int ret = defval; + + lua_getfield(L, 1, name); + if (!lua_isnil(L, -1)) { + ret = (int) luaL_checkinteger(L, -1); + } + lua_pop(L, 1); + return ret; +} + +char * +get_table_str(L, name) +lua_State *L; +const char *name; +{ + char *ret; + + lua_getfield(L, 1, name); + ret = dupstr(luaL_checkstring(L, -1)); + lua_pop(L, 1); + return ret; +} + +/* get optional string value from table. + return value must be freed by caller. */ +char * +get_table_str_opt(L, name, defval) +lua_State *L; +const char *name; +char *defval; +{ + const char *ret; + + lua_getfield(L, 1, name); + ret = luaL_optstring(L, -1, defval); + lua_pop(L, 1); + return ret ? dupstr(ret) : NULL; +} + +int +get_table_boolean(L, name) +lua_State *L; +const char *name; +{ + int ltyp; + int ret = -1; + + lua_getfield(L, 1, name); + ltyp = lua_type(L, -1); + if (ltyp == LUA_TSTRING) { + const char *const boolstr[] = { "true", "false", "yes", "no", NULL }; + const int boolstr2i[] = { TRUE, FALSE, TRUE, FALSE, -1 }; + ret = luaL_checkoption(L, -1, NULL, boolstr); + } else if (ltyp == LUA_TBOOLEAN) { + ret = lua_toboolean(L, -1); + } else if (ltyp == LUA_TNUMBER) { + ret = (int) luaL_checkinteger(L, -1); + if ( ret < 0 || ret > 1) + ret = -1; + } + lua_pop(L, 1); + if (ret == -1) + nhl_error(L, "Expected a boolean"); + return ret; +} + +int +get_table_boolean_opt(L, name, defval) +lua_State *L; +const char *name; +int defval; +{ + int ret = defval; + + lua_getfield(L, 1, name); + if (lua_type(L, -1) != LUA_TNIL) { + lua_pop(L, 1); + return get_table_boolean(L, name); + } + lua_pop(L, 1); + return ret; +} + +int +get_table_option(L, name, defval, opts) +lua_State *L; +const char *name; +const char *defval; +const char *const opts[]; /* NULL-terminated list */ +{ + int ret; + + lua_getfield(L, 1, name); + ret = luaL_checkoption(L, -1, defval, opts); + lua_pop(L, 1); + return ret; +} + +/* + test( { x = 123, y = 456 } ); +*/ +static int +nhl_test(L) +lua_State *L; +{ + /* discard any extra arguments passed in */ + lua_settop(L, 1); + + luaL_checktype(L, 1, LUA_TTABLE); + + int x = get_table_int(L, "x"); + int y = get_table_int(L, "y"); + char *name = get_table_str_opt(L, "name", "Player"); + + pline("TEST:{ x=%i, y=%i, name=\"%s\" }", x,y, name); + + free(name); + + return 1; +} + +static const struct luaL_Reg nhl_functions[] = { + {"test", nhl_test}, + + {"getmap", nhl_getmap}, + /*{"setmap", nhl_setmap},*/ + + {"pline", nhl_pline}, + {"verbalize", nhl_verbalize}, + {"menu", nhl_menu}, + {"getlin", nhl_getlin}, + + {"makeplural", nhl_makeplural}, + {"makesingular", nhl_makesingular}, + {"s_suffix", nhl_s_suffix}, + {"ing_suffix", nhl_ing_suffix}, + {"an", nhl_an}, + {NULL, NULL} +}; + +static const struct { + const char *name; + long value; +} nhl_consts[] = { + { "COLNO", COLNO }, + { "ROWNO", ROWNO }, + { NULL, 0 }, +}; + +/* register and init the constants table */ +void +init_nhc_data(L) +lua_State *L; +{ + int i; + + lua_newtable(L); + + for (i = 0; nhl_consts[i].name; i++) { + lua_pushstring(L, nhl_consts[i].name); + lua_pushinteger(L, nhl_consts[i].value); + lua_rawset(L, -3); + } + + lua_setglobal(L, "nhc"); +} + +int +nhl_push_anything(L, anytype, src) +lua_State *L; +int anytype; +void *src; +{ + anything any = cg.zeroany; + switch (anytype) { + case ANY_INT: any.a_int = *(int *)src; lua_pushinteger(L, any.a_int); break; + case ANY_UCHAR: any.a_uchar = *(uchar *)src; lua_pushinteger(L, any.a_uchar); break; + case ANY_SCHAR: any.a_schar = *(schar *)src; lua_pushinteger(L, any.a_schar); break; + } + return 1; +} + +static int +nhl_meta_u_index(L) +lua_State *L; +{ + const char *tkey = luaL_checkstring(L, 2); + const struct { + const char *name; + void *ptr; + int type; + } ustruct[] = { + { "ux", &(u.ux), ANY_UCHAR }, + { "uy", &(u.uy), ANY_UCHAR }, + { "dx", &(u.dx), ANY_SCHAR }, + { "dy", &(u.dy), ANY_SCHAR }, + { "dz", &(u.dz), ANY_SCHAR }, + { "tx", &(u.tx), ANY_UCHAR }, + { "ty", &(u.ty), ANY_UCHAR }, + { "ulevel", &(u.ulevel), ANY_INT }, + { "ulevelmax", &(u.ulevelmax), ANY_INT }, + { "uhunger", &(u.uhunger), ANY_INT }, + { "nv_range", &(u.nv_range), ANY_INT }, + { "xray_range", &(u.xray_range), ANY_INT }, + { "umonster", &(u.umonster), ANY_INT }, + { "umonnum", &(u.umonnum), ANY_INT }, + { "mh", &(u.mh), ANY_INT }, + { "mhmax", &(u.mhmax), ANY_INT }, + { "mtimedone", &(u.mtimedone), ANY_INT }, + }; + int i; + + /* FIXME: doesn't really work, eg. negative values for u.dx */ + for (i = 0; i < SIZE(ustruct); i++) + if (!strcmp(tkey, ustruct[i].name)) { + return nhl_push_anything(L, ustruct[i].type, ustruct[i].ptr); + } + + nhl_error(L, "Unknown u table index"); + return 0; +} + +static int +nhl_meta_u_newindex(L) +lua_State *L; +{ + nhl_error(L, "Cannot set u table values"); + return 0; +} + +void +init_u_data(L) +lua_State *L; +{ + lua_newtable(L); + lua_newtable(L); + lua_pushcfunction(L, nhl_meta_u_index); + lua_setfield(L, -2, "__index"); + lua_pushcfunction(L, nhl_meta_u_newindex); + lua_setfield(L, -2, "__newindex"); + lua_setmetatable(L, -2); + lua_setglobal(L, "u"); +} + +int +nhl_set_package_path(L, path) +lua_State *L; +const char *path; +{ + lua_getglobal(L, "package"); + lua_pushstring(L, path); + lua_setfield(L, -2, "path"); + lua_pop(L, 1); + return 0; +} + +static int +traceback_handler(L) +lua_State *L; +{ + luaL_traceback(L, L, lua_tostring(L, 1), 0); + return 1; +} + +boolean +nhl_loadlua(L, fname) +lua_State *L; +const char *fname; +{ + boolean ret = TRUE; + dlb *fh; + char *buf = (char *) 0; + long buflen; + int c, llret; + long bufidx = 0; + + fh = dlb_fopen(fname, "r"); + if (!fh) { + impossible("nhl_loadlua: Error loading %s", fname); + ret = FALSE; + goto give_up; + } + + dlb_fseek(fh, 0L, SEEK_END); + buflen = dlb_ftell(fh); + buf = (char *) alloc(sizeof(char) * (buflen + 1)); + if (!buf) { + impossible("alloc: Error allocating %i bytes for loading lua file %s", buflen, fname); + ret = FALSE; + goto give_up; + } + dlb_fseek(fh, 0L, SEEK_SET); + + do { + c = dlb_fgetc(fh); + if (c == EOF) + break; + buf[bufidx++] = (char) c; + } while (bufidx < buflen); + buf[bufidx] = '\0'; + (void) dlb_fclose(fh); + + llret = luaL_loadstring(L, buf); + if (llret != LUA_OK) { + impossible("luaL_loadstring: Error loading %s (errcode %i)", fname, llret); + ret = FALSE; + goto give_up; + } else { + lua_pushcfunction(L, traceback_handler); + lua_insert(L, 1); + if (lua_pcall(L, 0, LUA_MULTRET, -2)) { + impossible("Lua error: %s", lua_tostring(L, -1)); + ret = FALSE; + goto give_up; + } + } + +give_up: + if (buf) { + free(buf); + buf = (char *) 0; + buflen = 0; + } + return ret; +} + +boolean +load_lua(name) +const char *name; +{ + boolean ret = TRUE; + lua_State *L = luaL_newstate(); + luaL_openlibs(L); + + nhl_set_package_path(L, "./?.lua"); + + /* register nh -table, and functions for it */ + lua_newtable(L); + luaL_setfuncs(L, nhl_functions, 0); + lua_setglobal(L, "nh"); + + /* init nhc -table */ + init_nhc_data(L); + + /* init u -table */ + init_u_data(L); + + l_selection_register(L); + l_register_des(L); + + if (!nhl_loadlua(L, "nhlib.lua")) { + ret = FALSE; + goto give_up; + } + + if (!nhl_loadlua(L, name)) { + ret = FALSE; + goto give_up; + } + +give_up: + lua_close(L); + + return ret; +} diff --git a/src/save.c b/src/save.c index c62fc51c8..c60eb4d51 100644 --- a/src/save.c +++ b/src/save.c @@ -662,10 +662,14 @@ xchar lev; saveobjchn(nhfp, g.billobjs); if (release_data(nhfp)) { int x,y; - + /* TODO: maybe use clear_level_structures() */ for (y = 0; y < ROWNO; y++) - for (x = 0; x < COLNO; x++) + for (x = 0; x < COLNO; x++) { g.level.monsters[x][y] = 0; + g.level.objects[x][y] = 0; + levl[x][y].seenv = 0; + levl[x][y].glyph = cmap_to_glyph(S_stone); + } fmon = 0; g.ftrap = 0; fobj = 0; diff --git a/src/sp_lev.c b/src/sp_lev.c index cce71f3cb..331f9965d 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -9,8 +9,9 @@ * It contains also the special level loader. */ +#define IN_SP_LEV_C + #include "hack.h" -#include "dlb.h" #include "sp_lev.h" #ifdef _MSC_VER @@ -22,34 +23,12 @@ typedef void FDECL((*select_iter_func), (int, int, genericptr)); extern void FDECL(mkmap, (lev_init *)); +STATIC_DCL void NDECL(create_des_coder); STATIC_DCL void NDECL(solidify_map); -STATIC_DCL void FDECL(splev_stack_init, (struct splevstack *)); -STATIC_DCL void FDECL(splev_stack_done, (struct splevstack *)); -STATIC_DCL void FDECL(splev_stack_push, (struct splevstack *, - struct opvar *)); -STATIC_DCL struct opvar *FDECL(splev_stack_pop, (struct splevstack *)); -STATIC_DCL struct splevstack *FDECL(splev_stack_reverse, - (struct splevstack *)); -STATIC_DCL struct opvar *FDECL(opvar_new_str, (char *)); -STATIC_DCL struct opvar *FDECL(opvar_new_int, (long)); -STATIC_DCL struct opvar *FDECL(opvar_new_coord, (int, int)); -#if 0 -STATIC_DCL struct opvar * FDECL(opvar_new_region, (int,int, int,int)); -#endif /*0*/ -STATIC_DCL struct opvar *FDECL(opvar_clone, (struct opvar *)); -STATIC_DCL struct opvar *FDECL(opvar_var_conversion, (struct sp_coder *, - struct opvar *)); -STATIC_DCL struct splev_var *FDECL(opvar_var_defined, (struct sp_coder *, - char *)); -STATIC_DCL struct opvar *FDECL(splev_stack_getdat, (struct sp_coder *, - XCHAR_P)); -STATIC_DCL struct opvar *FDECL(splev_stack_getdat_any, (struct sp_coder *)); -STATIC_DCL void FDECL(variable_list_del, (struct splev_var *)); STATIC_DCL void FDECL(lvlfill_maze_grid, (int, int, int, int, SCHAR_P)); STATIC_DCL void FDECL(lvlfill_solid, (SCHAR_P, SCHAR_P)); STATIC_DCL void FDECL(set_wall_property, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, int)); -STATIC_DCL void NDECL(shuffle_alignments); STATIC_DCL void NDECL(count_features); STATIC_DCL void NDECL(remove_boundary_syms); STATIC_DCL void FDECL(set_door_orientation, (int, int)); @@ -61,8 +40,6 @@ STATIC_DCL int NDECL(rndtrap); STATIC_DCL void FDECL(get_location, (schar *, schar *, int, struct mkroom *)); STATIC_DCL boolean FDECL(is_ok_location, (SCHAR_P, SCHAR_P, int)); STATIC_DCL unpacked_coord FDECL(get_unpacked_coord, (long, int)); -STATIC_DCL void FDECL(get_location_coord, (schar *, schar *, int, - struct mkroom *, long)); STATIC_DCL void FDECL(get_room_loc, (schar *, schar *, struct mkroom *)); STATIC_DCL void FDECL(get_free_room_loc, (schar *, schar *, struct mkroom *, packed_coord)); @@ -86,69 +63,21 @@ STATIC_DCL void FDECL(light_region, (region *)); STATIC_DCL void FDECL(wallify_map, (int, int, int, int)); STATIC_DCL void FDECL(maze1xy, (coord *, int)); STATIC_DCL void NDECL(fill_empty_maze); -STATIC_DCL boolean FDECL(sp_level_loader, (dlb *, sp_lev *)); -STATIC_DCL boolean FDECL(sp_level_free, (sp_lev *)); STATIC_DCL void FDECL(splev_initlev, (lev_init *)); -STATIC_DCL struct sp_frame *FDECL(frame_new, (long)); -STATIC_DCL void FDECL(frame_del, (struct sp_frame *)); -STATIC_DCL void FDECL(spo_frame_push, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_frame_pop, (struct sp_coder *)); STATIC_DCL long FDECL(sp_code_jmpaddr, (long, long)); -STATIC_DCL void FDECL(spo_call, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_return, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_end_moninvent, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_pop_container, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_message, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_monster, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_object, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_level_flags, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_initlevel, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_engraving, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_mineralize, (struct sp_coder *)); +STATIC_DCL void NDECL(spo_end_moninvent); +STATIC_DCL void NDECL(spo_pop_container); STATIC_DCL void FDECL(spo_room, (struct sp_coder *)); STATIC_DCL void FDECL(spo_endroom, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_stair, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_ladder, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_grave, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_altar, (struct sp_coder *)); STATIC_DCL void FDECL(spo_trap, (struct sp_coder *)); STATIC_DCL void FDECL(spo_gold, (struct sp_coder *)); STATIC_DCL void FDECL(spo_corridor, (struct sp_coder *)); -STATIC_DCL void FDECL(selection_setpoint, (int, int, struct opvar *, XCHAR_P)); -STATIC_DCL struct opvar *FDECL(selection_not, (struct opvar *)); -STATIC_DCL struct opvar *FDECL(selection_logical_oper, (struct opvar *, - struct opvar *, CHAR_P)); -STATIC_DCL struct opvar *FDECL(selection_filter_mapchar, (struct opvar *, - struct opvar *)); -STATIC_DCL void FDECL(selection_filter_percent, (struct opvar *, int)); -STATIC_DCL int FDECL(selection_rndcoord, (struct opvar *, schar *, schar *, - BOOLEAN_P)); -STATIC_DCL void FDECL(selection_do_grow, (struct opvar *, int)); -STATIC_DCL int FDECL(floodfillchk_match_under, (int, int)); -STATIC_DCL int FDECL(floodfillchk_match_accessible, (int, int)); -STATIC_DCL boolean FDECL(sel_flood_havepoint, (int, int, - xchar *, xchar *, int)); -STATIC_DCL void FDECL(selection_do_ellipse, (struct opvar *, int, int, - int, int, int)); -STATIC_DCL long FDECL(line_dist_coord, (long, long, long, long, long, long)); -STATIC_DCL void FDECL(selection_do_gradient, (struct opvar *, long, long, long, - long, long, long, long, long)); -STATIC_DCL void FDECL(selection_do_line, (SCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, - struct opvar *)); -STATIC_DCL void FDECL(selection_do_randline, (SCHAR_P, SCHAR_P, SCHAR_P, - SCHAR_P, SCHAR_P, SCHAR_P, - struct opvar *)); -STATIC_DCL void FDECL(selection_iterate, (struct opvar *, select_iter_func, - genericptr_t)); STATIC_DCL void FDECL(sel_set_ter, (int, int, genericptr_t)); STATIC_DCL void FDECL(sel_set_feature, (int, int, genericptr_t)); STATIC_DCL void FDECL(sel_set_door, (int, int, genericptr_t)); -STATIC_DCL void FDECL(spo_door, (struct sp_coder *)); STATIC_DCL void FDECL(spo_feature, (struct sp_coder *)); STATIC_DCL void FDECL(spo_terrain, (struct sp_coder *)); STATIC_DCL void FDECL(spo_replace_terrain, (struct sp_coder *)); -STATIC_DCL boolean FDECL(generate_way_out_method, (int, int, struct opvar *)); -STATIC_DCL void NDECL(ensure_way_out); STATIC_DCL void FDECL(spo_levregion, (struct sp_coder *)); STATIC_DCL void FDECL(spo_region, (struct sp_coder *)); STATIC_DCL void FDECL(spo_drawbridge, (struct sp_coder *)); @@ -157,15 +86,43 @@ STATIC_DCL void FDECL(spo_wall_property, (struct sp_coder *)); STATIC_DCL void FDECL(spo_room_door, (struct sp_coder *)); STATIC_DCL void FDECL(sel_set_wallify, (int, int, genericptr_t)); STATIC_DCL void FDECL(spo_wallify, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_map, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_jmp, (struct sp_coder *, sp_lev *)); -STATIC_DCL void FDECL(spo_conditional_jump, (struct sp_coder *, sp_lev *)); -STATIC_DCL void FDECL(spo_var_init, (struct sp_coder *)); -#if 0 -STATIC_DCL long FDECL(opvar_array_length, (struct sp_coder *)); -#endif /*0*/ -STATIC_DCL void FDECL(spo_shuffle_array, (struct sp_coder *)); -STATIC_DCL boolean FDECL(sp_level_coder, (sp_lev *)); +STATIC_DCL int FDECL(get_coord, (lua_State *, int, int *, int *)); +STATIC_DCL int FDECL(get_table_region, (lua_State *, const char *, int *, int *, int *, int *, BOOLEAN_P)); + +/* lua_CFunction prototypes */ +int FDECL(lspo_altar, (lua_State *)); +int FDECL(lspo_branch, (lua_State *)); +int FDECL(lspo_corridor, (lua_State *)); +int FDECL(lspo_door, (lua_State *)); +int FDECL(lspo_drawbridge, (lua_State *)); +int FDECL(lspo_engraving, (lua_State *)); +int FDECL(lspo_feature, (lua_State *)); +int FDECL(lspo_gold, (lua_State *)); +int FDECL(lspo_grave, (lua_State *)); +int FDECL(lspo_ladder, (lua_State *)); +int FDECL(lspo_level_flags, (lua_State *)); +int FDECL(lspo_level_init, (lua_State *)); +int FDECL(lspo_levregion, (lua_State *)); +int FDECL(lspo_map, (lua_State *)); +int FDECL(lspo_mazewalk, (lua_State *)); +int FDECL(lspo_message, (lua_State *)); +int FDECL(lspo_mineralize, (lua_State *)); +int FDECL(lspo_monster, (lua_State *)); +int FDECL(lspo_non_diggable, (lua_State *)); +int FDECL(lspo_non_passwall, (lua_State *)); +int FDECL(lspo_object, (lua_State *)); +int FDECL(lspo_portal, (lua_State *)); +int FDECL(lspo_random_corridors, (lua_State *)); +int FDECL(lspo_region, (lua_State *)); +int FDECL(lspo_replace_terrain, (lua_State *)); +int FDECL(lspo_reset_level, (lua_State *)); +int FDECL(lspo_room, (lua_State *)); +int FDECL(lspo_stair, (lua_State *)); +int FDECL(lspo_teleport_region, (lua_State *)); +int FDECL(lspo_terrain, (lua_State *)); +int FDECL(lspo_trap, (lua_State *)); +int FDECL(lspo_wall_property, (lua_State *)); +int FDECL(lspo_wallify, (lua_State *)); #define LEFT 1 #define H_LEFT 2 @@ -181,17 +138,13 @@ STATIC_DCL boolean FDECL(sp_level_coder, (sp_lev *)); #define XLIM 4 #define YLIM 3 -#define Fread (void) dlb_fread -#define Fgetc (schar) dlb_fgetc #define New(type) (type *) alloc(sizeof(type)) #define NewTab(type, size) (type **) alloc(sizeof(type *) * (unsigned) size) #define Free(ptr) if (ptr) free((genericptr_t) (ptr)) extern struct engr *head_engr; -#define SPLEV_STACK_RESERVE 128 - -void +STATIC_OVL void solidify_map() { xchar x, y; @@ -202,382 +155,7 @@ solidify_map() levl[x][y].wall_info |= (W_NONDIGGABLE | W_NONPASSWALL); } -void -splev_stack_init(st) -struct splevstack *st; -{ - if (st) { - st->depth = 0; - st->depth_alloc = SPLEV_STACK_RESERVE; - st->stackdata = - (struct opvar **) alloc(st->depth_alloc * sizeof (struct opvar *)); - } -} - -void -splev_stack_done(st) -struct splevstack *st; -{ - if (st) { - int i; - - if (st->stackdata && st->depth) { - for (i = 0; i < st->depth; i++) { - switch (st->stackdata[i]->spovartyp) { - default: - case SPOVAR_NULL: - case SPOVAR_COORD: - case SPOVAR_REGION: - case SPOVAR_MAPCHAR: - case SPOVAR_MONST: - case SPOVAR_OBJ: - case SPOVAR_INT: - break; - case SPOVAR_VARIABLE: - case SPOVAR_STRING: - case SPOVAR_SEL: - Free(st->stackdata[i]->vardata.str); - st->stackdata[i]->vardata.str = NULL; - break; - } - Free(st->stackdata[i]); - st->stackdata[i] = NULL; - } - } - Free(st->stackdata); - st->stackdata = NULL; - st->depth = st->depth_alloc = 0; - Free(st); - } -} - -void -splev_stack_push(st, v) -struct splevstack *st; -struct opvar *v; -{ - if (!st || !v) - return; - if (!st->stackdata) - panic("splev_stack_push: no stackdata allocated?"); - - if (st->depth >= st->depth_alloc) { - struct opvar **tmp = (struct opvar **) alloc( - (st->depth_alloc + SPLEV_STACK_RESERVE) * sizeof (struct opvar *)); - - (void) memcpy(tmp, st->stackdata, - st->depth_alloc * sizeof(struct opvar *)); - Free(st->stackdata); - st->stackdata = tmp; - st->depth_alloc += SPLEV_STACK_RESERVE; - } - - st->stackdata[st->depth] = v; - st->depth++; -} - -struct opvar * -splev_stack_pop(st) -struct splevstack *st; -{ - struct opvar *ret = NULL; - - if (!st) - return ret; - if (!st->stackdata) - panic("splev_stack_pop: no stackdata allocated?"); - - if (st->depth) { - st->depth--; - ret = st->stackdata[st->depth]; - st->stackdata[st->depth] = NULL; - return ret; - } else - impossible("splev_stack_pop: empty stack?"); - return ret; -} - -struct splevstack * -splev_stack_reverse(st) -struct splevstack *st; -{ - long i; - struct opvar *tmp; - - if (!st) - return NULL; - if (!st->stackdata) - panic("splev_stack_reverse: no stackdata allocated?"); - for (i = 0; i < (st->depth / 2); i++) { - tmp = st->stackdata[i]; - st->stackdata[i] = st->stackdata[st->depth - i - 1]; - st->stackdata[st->depth - i - 1] = tmp; - } - return st; -} - -#define OV_typ(o) (o->spovartyp) -#define OV_i(o) (o->vardata.l) -#define OV_s(o) (o->vardata.str) - -#define OV_pop_i(x) (x = splev_stack_getdat(coder, SPOVAR_INT)) -#define OV_pop_c(x) (x = splev_stack_getdat(coder, SPOVAR_COORD)) -#define OV_pop_r(x) (x = splev_stack_getdat(coder, SPOVAR_REGION)) -#define OV_pop_s(x) (x = splev_stack_getdat(coder, SPOVAR_STRING)) -#define OV_pop(x) (x = splev_stack_getdat_any(coder)) -#define OV_pop_typ(x, typ) (x = splev_stack_getdat(coder, typ)) - -struct opvar * -opvar_new_str(s) -char *s; -{ - struct opvar *tmpov = (struct opvar *) alloc(sizeof (struct opvar)); - - tmpov->spovartyp = SPOVAR_STRING; - if (s) { - int len = strlen(s); - tmpov->vardata.str = (char *) alloc(len + 1); - (void) memcpy((genericptr_t) tmpov->vardata.str, (genericptr_t) s, - len); - tmpov->vardata.str[len] = '\0'; - } else - tmpov->vardata.str = NULL; - return tmpov; -} - -struct opvar * -opvar_new_int(i) -long i; -{ - struct opvar *tmpov = (struct opvar *) alloc(sizeof (struct opvar)); - - tmpov->spovartyp = SPOVAR_INT; - tmpov->vardata.l = i; - return tmpov; -} - -struct opvar * -opvar_new_coord(x, y) -int x, y; -{ - struct opvar *tmpov = (struct opvar *) alloc(sizeof (struct opvar)); - - tmpov->spovartyp = SPOVAR_COORD; - tmpov->vardata.l = SP_COORD_PACK(x, y); - return tmpov; -} - -#if 0 -struct opvar * -opvar_new_region(x1,y1,x2,y2) - int x1,y1,x2,y2; -{ - struct opvar *tmpov = (struct opvar *) alloc(sizeof (struct opvar)); - - tmpov->spovartyp = SPOVAR_REGION; - tmpov->vardata.l = SP_REGION_PACK(x1,y1,x2,y2); - return tmpov; -} -#endif /*0*/ - -void -opvar_free_x(ov) -struct opvar *ov; -{ - if (!ov) - return; - switch (ov->spovartyp) { - case SPOVAR_COORD: - case SPOVAR_REGION: - case SPOVAR_MAPCHAR: - case SPOVAR_MONST: - case SPOVAR_OBJ: - case SPOVAR_INT: - break; - case SPOVAR_VARIABLE: - case SPOVAR_STRING: - case SPOVAR_SEL: - Free(ov->vardata.str); - break; - default: - impossible("Unknown opvar value type (%i)!", ov->spovartyp); - } - Free(ov); -} - -/* - * Name of current function for use in messages: - * __func__ -- C99 standard; - * __FUNCTION__ -- gcc extension, starting before C99 and continuing after; - * picked up by other compilers (or vice versa?); - * __FUNC__ -- supported by Borland; - * nhFunc -- slightly intrusive but fully portable nethack construct - * for any version of any compiler. - */ -#define opvar_free(ov) \ - do { \ - if (ov) { \ - opvar_free_x(ov); \ - ov = NULL; \ - } else \ - impossible("opvar_free(), %s", nhFunc); \ - } while (0) - -struct opvar * -opvar_clone(ov) -struct opvar *ov; -{ - struct opvar *tmpov; - - if (!ov) - panic("no opvar to clone"); - tmpov = (struct opvar *) alloc(sizeof(struct opvar)); - tmpov->spovartyp = ov->spovartyp; - switch (ov->spovartyp) { - case SPOVAR_COORD: - case SPOVAR_REGION: - case SPOVAR_MAPCHAR: - case SPOVAR_MONST: - case SPOVAR_OBJ: - case SPOVAR_INT: - tmpov->vardata.l = ov->vardata.l; - break; - case SPOVAR_VARIABLE: - case SPOVAR_STRING: - case SPOVAR_SEL: - tmpov->vardata.str = dupstr(ov->vardata.str); - break; - default: - impossible("Unknown push value type (%i)!", ov->spovartyp); - } - return tmpov; -} - -struct opvar * -opvar_var_conversion(coder, ov) -struct sp_coder *coder; -struct opvar *ov; -{ - static const char nhFunc[] = "opvar_var_conversion"; - struct splev_var *tmp; - struct opvar *tmpov; - struct opvar *array_idx = NULL; - - if (!coder || !ov) - return NULL; - if (ov->spovartyp != SPOVAR_VARIABLE) - return ov; - tmp = coder->frame->variables; - while (tmp) { - if (!strcmp(tmp->name, OV_s(ov))) { - if ((tmp->svtyp & SPOVAR_ARRAY)) { - array_idx = opvar_var_conversion(coder, - splev_stack_pop(coder->stack)); - if (!array_idx || OV_typ(array_idx) != SPOVAR_INT) - panic("array idx not an int"); - if (tmp->array_len < 1) - panic("array len < 1"); - OV_i(array_idx) = (OV_i(array_idx) % tmp->array_len); - tmpov = opvar_clone(tmp->data.arrayvalues[OV_i(array_idx)]); - opvar_free(array_idx); - return tmpov; - } else { - tmpov = opvar_clone(tmp->data.value); - return tmpov; - } - } - tmp = tmp->next; - } - return NULL; -} - -struct splev_var * -opvar_var_defined(coder, name) -struct sp_coder *coder; -char *name; -{ - struct splev_var *tmp; - - if (!coder) - return NULL; - tmp = coder->frame->variables; - while (tmp) { - if (!strcmp(tmp->name, name)) - return tmp; - tmp = tmp->next; - } - return NULL; -} - -struct opvar * -splev_stack_getdat(coder, typ) -struct sp_coder *coder; -xchar typ; -{ - static const char nhFunc[] = "splev_stack_getdat"; - if (coder && coder->stack) { - struct opvar *tmp = splev_stack_pop(coder->stack); - struct opvar *ret = NULL; - - if (!tmp) - panic("no value type %i in stack.", typ); - if (tmp->spovartyp == SPOVAR_VARIABLE) { - ret = opvar_var_conversion(coder, tmp); - opvar_free(tmp); - tmp = ret; - } - if (tmp->spovartyp == typ) - return tmp; - else opvar_free(tmp); - } - return NULL; -} - -struct opvar * -splev_stack_getdat_any(coder) -struct sp_coder *coder; -{ - static const char nhFunc[] = "splev_stack_getdat_any"; - if (coder && coder->stack) { - struct opvar *tmp = splev_stack_pop(coder->stack); - if (tmp && tmp->spovartyp == SPOVAR_VARIABLE) { - struct opvar *ret = opvar_var_conversion(coder, tmp); - opvar_free(tmp); - return ret; - } - return tmp; - } - return NULL; -} - -void -variable_list_del(varlist) -struct splev_var *varlist; -{ - static const char nhFunc[] = "variable_list_del"; - struct splev_var *tmp = varlist; - - if (!tmp) - return; - while (tmp) { - Free(tmp->name); - if ((tmp->svtyp & SPOVAR_ARRAY)) { - long idx = tmp->array_len; - - while (idx-- > 0) { - opvar_free(tmp->data.arrayvalues[idx]); - }; - Free(tmp->data.arrayvalues); - } else { - opvar_free(tmp->data.value); - } - tmp = varlist->next; - Free(varlist); - varlist = tmp; - } -} - -void +STATIC_OVL void lvlfill_maze_grid(x1, y1, x2, y2, filling) int x1, y1, x2, y2; schar filling; @@ -594,7 +172,7 @@ schar filling; } } -void +STATIC_OVL void lvlfill_solid(filling, lit) schar filling; schar lit; @@ -604,9 +182,28 @@ schar lit; for (x = 2; x <= g.x_maze_max; x++) for (y = 0; y <= g.y_maze_max; y++) { SET_TYPLIT(x, y, filling, lit); + /* TODO: consolidate this w lspo_map ? */ + levl[x][y].flags = 0; + levl[x][y].horizontal = 0; + levl[x][y].roomno = 0; + levl[x][y].edge = 0; } } +void +sel_set_wall_property(x, y, arg) +int x, y; +genericptr_t arg; +{ + int prop = *(int *)arg; + + if (IS_STWALL(levl[x][y].typ) || IS_TREE(levl[x][y].typ) + /* 3.6.2: made iron bars eligible to be flagged nondiggable + (checked by chewing(hack.c) and zap_over_floor(zap.c)) */ + || levl[x][y].typ == IRONBARS) + levl[x][y].wall_info |= prop; +} + /* * Make walls of the area (x1, y1, x2, y2) non diggable/non passwall-able */ @@ -616,7 +213,7 @@ xchar x1, y1, x2, y2; int prop; { register xchar x, y; - struct rm *lev; + /* struct rm *lev; */ /* REVIEW: unreferenced */ x1 = max(x1, 1); x2 = min(x2, COLNO - 1); @@ -624,33 +221,10 @@ int prop; y2 = min(y2, ROWNO - 1); for (y = y1; y <= y2; y++) for (x = x1; x <= x2; x++) { - lev = &levl[x][y]; - if (IS_STWALL(lev->typ) || IS_TREE(lev->typ) - /* 3.6.2: made iron bars eligible to be flagged nondiggable - (checked by chewing(hack.c) and zap_over_floor(zap.c)) */ - || lev->typ == IRONBARS) - lev->wall_info |= prop; + sel_set_wall_property(x, y, (genericptr_t)&prop); } } -STATIC_OVL void -shuffle_alignments() -{ - int i; - aligntyp atmp; - - /* shuffle 3 alignments */ - i = rn2(3); - atmp = g.ralign[2]; - g.ralign[2] = g.ralign[i]; - g.ralign[i] = atmp; - if (rn2(2)) { - atmp = g.ralign[1]; - g.ralign[1] = g.ralign[0]; - g.ralign[0] = atmp; - } -} - /* * Count the different features (sinks, fountains) in the level. */ @@ -670,7 +244,7 @@ count_features() } } -void +STATIC_OVL void remove_boundary_syms() { /* @@ -775,7 +349,7 @@ link_doors_rooms() } } -void +STATIC_OVL void fill_rooms() { int tmpi, m; @@ -945,7 +519,7 @@ register int humidity; return FALSE; } -unpacked_coord +STATIC_OVL unpacked_coord get_unpacked_coord(loc, defhumidity) long loc; int defhumidity; @@ -967,7 +541,7 @@ int defhumidity; return c; } -STATIC_OVL void +void get_location_coord(x, y, humidity, croom, crd) schar *x, *y; int humidity; @@ -1375,7 +949,7 @@ struct mkroom *broom; y = broom->ly - 1; x = broom->lx + ((dpos == -1) ? rn2(1 + (broom->hx - broom->lx)) : dpos); - if (IS_ROCK(levl[x][y - 1].typ)) + if (!isok(x,y - 1)) goto redoloop; goto outdirloop; case 1: @@ -1384,7 +958,7 @@ struct mkroom *broom; y = broom->hy + 1; x = broom->lx + ((dpos == -1) ? rn2(1 + (broom->hx - broom->lx)) : dpos); - if (IS_ROCK(levl[x][y + 1].typ)) + if (!isok(x,y + 1)) goto redoloop; goto outdirloop; case 2: @@ -1393,7 +967,7 @@ struct mkroom *broom; x = broom->lx - 1; y = broom->ly + ((dpos == -1) ? rn2(1 + (broom->hy - broom->ly)) : dpos); - if (IS_ROCK(levl[x - 1][y].typ)) + if (!isok(x - 1,y)) goto redoloop; goto outdirloop; case 3: @@ -1402,7 +976,7 @@ struct mkroom *broom; x = broom->hx + 1; y = broom->ly + ((dpos == -1) ? rn2(1 + (broom->hy - broom->ly)) : dpos); - if (IS_ROCK(levl[x + 1][y].typ)) + if (!isok(x + 1,y)) goto redoloop; goto outdirloop; default: @@ -1581,9 +1155,9 @@ struct mkroom *croom; ? Align2amask(u.ualignbase[A_ORIGINAL]) : (m->align == AM_SPLEV_NONCO) ? Align2amask(noncoalignment(u.ualignbase[A_ORIGINAL])) - : (m->align <= -(MAX_REGISTERS + 1)) + : (m->align == AM_SPLEV_RANDOM) ? induced_align(80) - : (m->align < 0 ? g.ralign[-m->align - 1] : m->align); + : m->align; if (!class) pm = (struct permonst *) 0; @@ -1619,7 +1193,7 @@ struct mkroom *croom; if (MON_AT(x, y) && enexto(&cc, x, y, pm)) x = cc.x, y = cc.y; - if (m->align != -(MAX_REGISTERS + 2)) + if (m->align != AM_SPLEV_RANDOM) mtmp = mk_roamer(pm, Amask2align(amask), x, y, m->peaceful); else if (PM_ARCHEOLOGIST <= m->id && m->id <= PM_WIZARD) mtmp = mk_mplayer(pm, x, y, FALSE); @@ -1906,10 +1480,6 @@ struct mkroom *croom; otmp->otrapped = o->trapped; if (o->greased) otmp->greased = 1; -#ifdef INVISIBLE_OBJECTS - if (o->invis) - otmp->oinvis = 1; -#endif if (o->quan > 0 && objects[otmp->otyp].oc_merge) { otmp->quan = o->quan; @@ -1917,7 +1487,7 @@ struct mkroom *croom; } /* contents */ - if (o->containment & SP_OBJ_CONTENT) { + if (o->containment & SP_OBJ_CONTENT || g.invent_carrying_monster) { if (!g.container_idx) { if (!g.invent_carrying_monster) { /*impossible("create_object: no container");*/ @@ -2103,9 +1673,9 @@ struct mkroom *croom; ? Align2amask(u.ualignbase[A_ORIGINAL]) : (a->align == AM_SPLEV_NONCO) ? Align2amask(noncoalignment(u.ualignbase[A_ORIGINAL])) - : (a->align == -(MAX_REGISTERS + 1)) + : (a->align == AM_SPLEV_RANDOM) ? induced_align(80) - : (a->align < 0 ? g.ralign[-a->align - 1] : a->align); + : a->align; levl[x][y].typ = ALTAR; levl[x][y].altarmask = amask; @@ -2123,7 +1693,7 @@ struct mkroom *croom; } } -void +STATIC_OVL void replace_terrain(terr, croom) replaceterrain *terr; struct mkroom *croom; @@ -2162,13 +1732,13 @@ int cnt; int xx, yy; switch (wall) { - case W_NORTH: + case W_SOUTH: dy = 0; dx = 1; xx = croom->lx; yy = croom->hy + 1; break; - case W_SOUTH: + case W_NORTH: dy = 0; dx = 1; xx = croom->lx; @@ -2381,7 +1951,6 @@ corridor *c; if (!search_door(&g.rooms[c->src.room], &org.x, &org.y, c->src.wall, c->src.door)) return; - if (c->dest.room != -1) { if (!search_door(&g.rooms[c->dest.room], &dest.x, &dest.y, c->dest.wall, c->dest.door)) @@ -2486,7 +2055,7 @@ boolean prefilled; } } -struct mkroom * +STATIC_OVL struct mkroom * build_room(r, mkr) room *r; struct mkroom *mkr; @@ -2663,105 +2232,7 @@ fill_empty_maze() } } -/* - * special level loader - */ -STATIC_OVL boolean -sp_level_loader(fd, lvl) -dlb *fd; -sp_lev *lvl; -{ - long n_opcode = 0; - struct opvar *opdat; - int opcode; - - Fread((genericptr_t) & (lvl->n_opcodes), 1, sizeof(lvl->n_opcodes), fd); - lvl->opcodes = (_opcode *) alloc(sizeof(_opcode) * (lvl->n_opcodes)); - - while (n_opcode < lvl->n_opcodes) { - Fread((genericptr_t) &lvl->opcodes[n_opcode].opcode, 1, - sizeof(lvl->opcodes[n_opcode].opcode), fd); - opcode = lvl->opcodes[n_opcode].opcode; - - opdat = NULL; - - if (opcode < SPO_NULL || opcode >= MAX_SP_OPCODES) - panic("sp_level_loader: impossible opcode %i.", opcode); - - if (opcode == SPO_PUSH) { - int nsize; - struct opvar *ov = (struct opvar *) alloc(sizeof(struct opvar)); - - opdat = ov; - ov->spovartyp = SPO_NULL; - ov->vardata.l = 0; - Fread((genericptr_t) & (ov->spovartyp), 1, sizeof(ov->spovartyp), - fd); - - switch (ov->spovartyp) { - case SPOVAR_NULL: - break; - case SPOVAR_COORD: - case SPOVAR_REGION: - case SPOVAR_MAPCHAR: - case SPOVAR_MONST: - case SPOVAR_OBJ: - case SPOVAR_INT: - Fread((genericptr_t) & (ov->vardata.l), 1, - sizeof(ov->vardata.l), fd); - break; - case SPOVAR_VARIABLE: - case SPOVAR_STRING: - case SPOVAR_SEL: { - char *opd; - - Fread((genericptr_t) &nsize, 1, sizeof(nsize), fd); - opd = (char *) alloc(nsize + 1); - - if (nsize) - Fread(opd, 1, nsize, fd); - opd[nsize] = 0; - ov->vardata.str = opd; - break; - } - default: - panic("sp_level_loader: unknown opvar type %i", - ov->spovartyp); - } - } - - lvl->opcodes[n_opcode].opdat = opdat; - n_opcode++; - } /*while*/ - - return TRUE; -} - -/* Frees the memory allocated for special level creation structs */ -STATIC_OVL boolean -sp_level_free(lvl) -sp_lev *lvl; -{ - static const char nhFunc[] = "sp_level_free"; - long n_opcode = 0; - - while (n_opcode < lvl->n_opcodes) { - int opcode = lvl->opcodes[n_opcode].opcode; - struct opvar *opdat = lvl->opcodes[n_opcode].opdat; - - if (opcode < SPO_NULL || opcode >= MAX_SP_OPCODES) - panic("sp_level_free: unknown opcode %i", opcode); - - if (opdat) - opvar_free(opdat); - n_opcode++; - } - Free(lvl->opcodes); - lvl->opcodes = NULL; - return TRUE; -} - -void +STATIC_OVL void splev_initlev(linit) lev_init *linit; { @@ -2777,7 +2248,7 @@ lev_init *linit; lvlfill_solid(linit->filling, linit->lit); break; case LVLINIT_MAZEGRID: - lvlfill_maze_grid(2, 0, g.x_maze_max, g.y_maze_max, linit->filling); + lvlfill_maze_grid(2, 0, g.x_maze_max, g.y_maze_max, linit->bg); break; case LVLINIT_ROGUE: makeroguerooms(); @@ -2793,132 +2264,18 @@ lev_init *linit; } } -struct sp_frame * -frame_new(execptr) -long execptr; -{ - struct sp_frame *frame = - (struct sp_frame *) alloc(sizeof(struct sp_frame)); - - frame->next = NULL; - frame->variables = NULL; - frame->n_opcode = execptr; - frame->stack = (struct splevstack *) alloc(sizeof(struct splevstack)); - splev_stack_init(frame->stack); - return frame; -} - -void -frame_del(frame) -struct sp_frame *frame; -{ - if (!frame) - return; - if (frame->stack) { - splev_stack_done(frame->stack); - frame->stack = NULL; - } - if (frame->variables) { - variable_list_del(frame->variables); - frame->variables = NULL; - } - Free(frame); -} - -void -spo_frame_push(coder) -struct sp_coder *coder; -{ - struct sp_frame *tmpframe = frame_new(coder->frame->n_opcode); - - tmpframe->next = coder->frame; - coder->frame = tmpframe; -} - -void -spo_frame_pop(coder) -struct sp_coder *coder; -{ - if (coder->frame && coder->frame->next) { - struct sp_frame *tmpframe = coder->frame->next; - - frame_del(coder->frame); - coder->frame = tmpframe; - coder->stack = coder->frame->stack; - } -} - -long +STATIC_OVL long sp_code_jmpaddr(curpos, jmpaddr) long curpos, jmpaddr; { return (curpos + jmpaddr); } -void -spo_call(coder) -struct sp_coder *coder; -{ - static const char nhFunc[] = "spo_call"; - struct opvar *addr; - struct opvar *params; - struct sp_frame *tmpframe; - if (!OV_pop_i(addr) || !OV_pop_i(params)) - return; - if (OV_i(params) < 0) - return; - - tmpframe = frame_new(sp_code_jmpaddr(coder->frame->n_opcode, - OV_i(addr) - 1)); - - while (OV_i(params)-- > 0) { - splev_stack_push(tmpframe->stack, splev_stack_getdat_any(coder)); - } - splev_stack_reverse(tmpframe->stack); - - /* push a frame */ - tmpframe->next = coder->frame; - coder->frame = tmpframe; - - opvar_free(addr); - opvar_free(params); -} - -void -spo_return(coder) -struct sp_coder *coder; -{ - static const char nhFunc[] = "spo_return"; - struct opvar *params; - - if (!coder->frame || !coder->frame->next) - panic("return: no frame."); - if (!OV_pop_i(params)) - return; - if (OV_i(params) < 0) - return; - - while (OV_i(params)-- > 0) { - splev_stack_push(coder->frame->next->stack, - splev_stack_pop(coder->stack)); - } - - /* pop the frame */ - if (coder->frame->next) { - struct sp_frame *tmpframe = coder->frame->next; - frame_del(coder->frame); - coder->frame = tmpframe; - coder->stack = coder->frame->stack; - } - - opvar_free(params); -} /*ARGUSED*/ -void -spo_end_moninvent(coder) -struct sp_coder *coder UNUSED; +STATIC_OVL void +spo_end_moninvent() { if (g.invent_carrying_monster) m_dowear(g.invent_carrying_monster, TRUE); @@ -2926,9 +2283,8 @@ struct sp_coder *coder UNUSED; } /*ARGUSED*/ -void -spo_pop_container(coder) -struct sp_coder *coder UNUSED; +STATIC_OVL void +spo_pop_container() { if (g.container_idx > 0) { g.container_idx--; @@ -2936,20 +2292,24 @@ struct sp_coder *coder UNUSED; } } -void -spo_message(coder) -struct sp_coder *coder; +/* message("What a strange feeling!"); */ +int +lspo_message(L) +lua_State *L; { - static const char nhFunc[] = "spo_message"; - struct opvar *op; - char *msg, *levmsg; + char *levmsg; int old_n, n; - if (!OV_pop_s(op)) - return; - msg = OV_s(op); - if (!msg) - return; + int argc = lua_gettop(L); + + if (argc < 1) { + nhl_error(L, "Wrong parameters"); + return 0; + } + + create_des_coder(); + + const char *msg = luaL_checkstring(L, 1); old_n = g.lev_message ? (strlen(g.lev_message) + 1) : 0; n = strlen(msg); @@ -2964,25 +2324,89 @@ struct sp_coder *coder; levmsg[old_n + n] = '\0'; Free(g.lev_message); g.lev_message = levmsg; - opvar_free(op); + + return 0; /* number of results */ } -void -spo_monster(coder) -struct sp_coder *coder; +int +get_table_align(L) +lua_State *L; { - static const char nhFunc[] = "spo_monster"; - int nparams = 0; - struct opvar *varparam; - struct opvar *id, *mcoord, *has_inv; + const char *const aligns[] = { "noalign", "law", "neutral", "chaos", "coaligned", "noncoaligned", "random", NULL }; + const int aligns2i[] = { AM_NONE, AM_LAWFUL, AM_NEUTRAL, AM_CHAOTIC, AM_SPLEV_CO, AM_SPLEV_NONCO, AM_SPLEV_RANDOM, 0 }; + + int a = aligns2i[get_table_option(L, "align", "random", aligns)]; + + return a; +} + +int +get_table_monclass(L) +lua_State *L; +{ + char *s = get_table_str_opt(L, "class", NULL); + int ret = -1; + + if (s && strlen(s) == 1) + ret = (int) *s; + Free(s); + + return ret; +} + +int +find_montype(L, s) +lua_State *L; +const char *s; +{ + int i; + + for (i = LOW_PM; i < NUMMONS; i++) + if (!strcmpi(mons[i].mname, s)) + return i; + return NON_PM; +} + +int +get_table_montype(L) +lua_State *L; +{ + char *s = get_table_str_opt(L, "id", NULL); + int ret = NON_PM /*, i */ /* REVIEW: unreferenced */; + + if (s) { + ret = find_montype(L, s); + Free(s); + if (ret == NON_PM) + nhl_error(L, "Unknown monster id"); + } + return ret; +} + +/* monster(); */ +/* monster("wood nymph"); */ +/* monster("D"); */ +/* monster("giant eel",11,06); */ +/* monster("hill giant", {08,06}); */ +/* monster({ id = "giant mimic", appear_as = "obj:boulder" }); */ +/* monster({ class = "H", peaceful = 0 }); */ +int +lspo_monster(L) +lua_State *L; +{ + int argc = lua_gettop(L); monster tmpmons; + int mx = -1, my = -1; + char *mappear = NULL; + + create_des_coder(); tmpmons.peaceful = -1; tmpmons.asleep = -1; - tmpmons.name.str = (char *) 0; + tmpmons.name.str = NULL; tmpmons.appear = 0; tmpmons.appear_as.str = (char *) 0; - tmpmons.align = -MAX_REGISTERS - 2; + tmpmons.align = AM_SPLEV_RANDOM; tmpmons.female = 0; tmpmons.invis = 0; tmpmons.cancelled = 0; @@ -2996,134 +2420,240 @@ struct sp_coder *coder; tmpmons.seentraps = 0; tmpmons.has_invent = 0; - if (!OV_pop_i(has_inv)) - return; + if (argc == 1 && lua_type(L, 1) == LUA_TSTRING) { + const char *paramstr = luaL_checkstring(L, 1); - if (!OV_pop_i(varparam)) - return; - - while ((nparams++ < (SP_M_V_END + 1)) && (OV_typ(varparam) == SPOVAR_INT) - && (OV_i(varparam) >= 0) && (OV_i(varparam) < SP_M_V_END)) { - struct opvar *parm = NULL; - - OV_pop(parm); - switch (OV_i(varparam)) { - case SP_M_V_NAME: - if ((OV_typ(parm) == SPOVAR_STRING) && !tmpmons.name.str) - tmpmons.name.str = dupstr(OV_s(parm)); - break; - case SP_M_V_APPEAR: - if ((OV_typ(parm) == SPOVAR_INT) && !tmpmons.appear_as.str) { - tmpmons.appear = OV_i(parm); - opvar_free(parm); - OV_pop(parm); - tmpmons.appear_as.str = dupstr(OV_s(parm)); - } - break; - case SP_M_V_ASLEEP: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.asleep = OV_i(parm); - break; - case SP_M_V_ALIGN: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.align = OV_i(parm); - break; - case SP_M_V_PEACEFUL: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.peaceful = OV_i(parm); - break; - case SP_M_V_FEMALE: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.female = OV_i(parm); - break; - case SP_M_V_INVIS: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.invis = OV_i(parm); - break; - case SP_M_V_CANCELLED: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.cancelled = OV_i(parm); - break; - case SP_M_V_REVIVED: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.revived = OV_i(parm); - break; - case SP_M_V_AVENGE: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.avenge = OV_i(parm); - break; - case SP_M_V_FLEEING: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.fleeing = OV_i(parm); - break; - case SP_M_V_BLINDED: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.blinded = OV_i(parm); - break; - case SP_M_V_PARALYZED: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.paralyzed = OV_i(parm); - break; - case SP_M_V_STUNNED: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.stunned = OV_i(parm); - break; - case SP_M_V_CONFUSED: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.confused = OV_i(parm); - break; - case SP_M_V_SEENTRAPS: - if (OV_typ(parm) == SPOVAR_INT) - tmpmons.seentraps = OV_i(parm); - break; - case SP_M_V_END: - nparams = SP_M_V_END + 1; - break; - default: - impossible("MONSTER with unknown variable param type!"); - break; + if (strlen(paramstr) == 1) { + tmpmons.class = *paramstr; + tmpmons.id = NON_PM; + } else { + tmpmons.class = -1; + tmpmons.id = find_montype(L, paramstr); } - opvar_free(parm); - if (OV_i(varparam) != SP_M_V_END) { - opvar_free(varparam); - OV_pop(varparam); + } else if (argc == 2 && lua_type(L, 1) == LUA_TSTRING + && lua_type(L, 2) == LUA_TTABLE) { + const char *paramstr = luaL_checkstring(L, 1); + + get_coord(L, 2, &mx, &my); + + if (strlen(paramstr) == 1) { + tmpmons.class = *paramstr; + tmpmons.id = NON_PM; + } else { + tmpmons.class = -1; + tmpmons.id = find_montype(L, paramstr); + } + + } else if (argc == 3) { + const char *paramstr = luaL_checkstring(L, 1); + + mx = luaL_checkinteger(L, 2); + my = luaL_checkinteger(L, 3); + + if (strlen(paramstr) == 1) { + tmpmons.class = *paramstr; + tmpmons.id = NON_PM; + } else { + tmpmons.class = -1; + tmpmons.id = find_montype(L, paramstr); + } + } else { + lcheck_param_table(L); + + tmpmons.peaceful = get_table_int_opt(L, "peaceful", -1); /* TODO: alias hostile=!peaceful */ + tmpmons.asleep = get_table_int_opt(L, "asleep", -1); + tmpmons.name.str = get_table_str_opt(L, "name", NULL); + tmpmons.appear = 0; + tmpmons.appear_as.str = (char *) 0; + tmpmons.align = get_table_align(L); + tmpmons.female = get_table_int_opt(L, "female", 0); + tmpmons.invis = get_table_int_opt(L, "invisible", 0); + tmpmons.cancelled = get_table_int_opt(L, "cancelled", 0); + tmpmons.revived = get_table_int_opt(L, "revived", 0); + tmpmons.avenge = get_table_int_opt(L, "avenge", 0); + tmpmons.fleeing = get_table_int_opt(L, "fleeing", 0); + tmpmons.blinded = get_table_int_opt(L, "blinded", 0); + tmpmons.paralyzed = get_table_int_opt(L, "paralyzed", 0); + tmpmons.stunned = get_table_int_opt(L, "stunned", 0); + tmpmons.confused = get_table_int_opt(L, "confused", 0); + tmpmons.seentraps = 0; /* TODO: list of trap names to bitfield */ + tmpmons.has_invent = 0; + + mappear = get_table_str_opt(L, "appear_as", NULL); + if (mappear) { + if (!strncmp("obj:", mappear, 4)) { + tmpmons.appear = M_AP_OBJECT; + } else if (!strncmp("mon:", mappear, 4)) { + tmpmons.appear = M_AP_MONSTER; + } else if (!strncmp("ter:", mappear, 4)) { + tmpmons.appear = M_AP_FURNITURE; + } else { + nhl_error(L, "Unknown appear_as type"); + } + tmpmons.appear_as.str = dupstr(&mappear[4]); + Free(mappear); + } + + mx = get_table_int_opt(L, "x", -1); + my = get_table_int_opt(L, "y", -1); + + if (mx == -1 && my == -1) { + lua_getfield(L, 1, "coord"); + get_coord(L, -1, &mx, &my); + lua_pop(L, 1); + } + + tmpmons.id = get_table_montype(L); + tmpmons.class = get_table_monclass(L); + + lua_getfield(L, 1, "inventory"); + if (!lua_isnil(L, -1)) { + tmpmons.has_invent = 1; } } - if (!OV_pop_c(mcoord)) - panic("no monster coord?"); + if (mx == -1 && my == -1) + tmpmons.coord = SP_COORD_PACK_RANDOM(0); + else + tmpmons.coord = SP_COORD_PACK(mx, my); - if (!OV_pop_typ(id, SPOVAR_MONST)) - panic("no mon type"); + if (tmpmons.id != NON_PM && tmpmons.class == -1) + tmpmons.class = def_monsyms[mons[tmpmons.id].mlet].sym; - tmpmons.id = SP_MONST_PM(OV_i(id)); - tmpmons.class = SP_MONST_CLASS(OV_i(id)); - tmpmons.coord = OV_i(mcoord); - tmpmons.has_invent = OV_i(has_inv); + create_monster(&tmpmons, g.coder->croom); - create_monster(&tmpmons, coder->croom); + if (tmpmons.has_invent && lua_type(L, -1) == LUA_TFUNCTION) { + lua_remove(L, -2); + lua_call(L, 0, 0); + spo_end_moninvent(); + } else + lua_pop(L, 1); Free(tmpmons.name.str); Free(tmpmons.appear_as.str); - opvar_free(id); - opvar_free(mcoord); - opvar_free(has_inv); - opvar_free(varparam); + + return 0; } -void -spo_object(coder) -struct sp_coder *coder; +/* the hash key 'name' is an integer or "random", + or if not existent, also return rndval. + */ +int +get_table_int_or_random(L, name, rndval) +lua_State *L; +const char *name; +int rndval; +{ + int ret; + + lua_getfield(L, 1, name); + if (lua_type(L, -1) == LUA_TNIL) { + lua_pop(L, 1); + return rndval; + } + if (!lua_isnumber(L, -1)) { + const char *tmp = lua_tostring(L, -1); + + if (tmp && !strcmpi("random", tmp)) { + lua_pop(L, 1); + return rndval; + } + char buf[BUFSZ]; + Sprintf(buf, "Expected integer or \"random\" for \"%s\", got %s", name, tmp); + nhl_error(L, buf); + lua_pop(L, 1); + return 0; + } + ret = luaL_optinteger(L, -1, rndval); + lua_pop(L, 1); + return ret; +} + +int +get_table_buc(L) +lua_State *L; +{ + const char *const bucs[] = { "random", "blessed", "uncursed", "cursed", NULL }; + const int bucs2i[] = { 0, 1, 2, 3, 0 }; + + int curse_state = bucs2i[get_table_option(L, "buc", "random", bucs)]; + return curse_state; +} + +int +get_table_objclass(L) +lua_State *L; +{ + char *s = get_table_str_opt(L, "class", NULL); + int ret = -1; + + if (s && strlen(s) == 1) + ret = (int) *s; + Free(s); + return ret; +} + +int +find_objtype(L, s) +lua_State *L; +const char *s; +{ + if (s) { + int i; + const char *objname; + + /* find by object name */ + for (i = 0; i < NUM_OBJECTS; i++) { + objname = obj_descr[i].oc_name; + if (objname && !strcmpi(s, objname)) + return i; + } + + /* find by object description */ + for (i = 0; i < NUM_OBJECTS; i++) { + objname = obj_descr[i].oc_descr; + if (objname && !strcmpi(s, objname)) + return i; + } + + nhl_error(L, "Unknown object id"); + } + return STRANGE_OBJECT; +} + +int +get_table_objtype(L) +lua_State *L; +{ + char *s = get_table_str_opt(L, "id", NULL); + int ret = find_objtype(L, s); + + Free(s); + return ret; +} + +/* object(); */ +/* object("sack"); */ +/* object("scimitar", 6,7); */ +/* object("scimitar", {6,7}); */ +/* object({ class = "%" }); */ +/* object({ id = "boulder", x = 03, y = 12}); */ +/* object({ id = "boulder", coord = {03,12} }); */ +int +lspo_object(L) +lua_State *L; { - static const char nhFunc[] = "spo_object"; int nparams = 0; long quancnt; - struct opvar *varparam; - struct opvar *id, *containment; object tmpobj; + int ox = -1, oy = -1; + int argc = lua_gettop(L); + int maybe_contents = 0; + + create_des_coder(); tmpobj.spe = -127; - tmpobj.curse_state = -1; + tmpobj.curse_state = 0; tmpobj.corpsenm = NON_PM; tmpobj.name.str = (char *) 0; tmpobj.quan = -1; @@ -3133,329 +2663,426 @@ struct sp_coder *coder; tmpobj.locked = 0; tmpobj.trapped = -1; tmpobj.recharged = 0; - tmpobj.invis = 0; tmpobj.greased = 0; tmpobj.broken = 0; - tmpobj.coord = SP_COORD_PACK_RANDOM(0); - if (!OV_pop_i(containment)) - return; + if (argc == 1 && lua_type(L, 1) == LUA_TSTRING) { + const char *paramstr = luaL_checkstring(L, 1); - if (!OV_pop_i(varparam)) - return; - - while ((nparams++ < (SP_O_V_END + 1)) && (OV_typ(varparam) == SPOVAR_INT) - && (OV_i(varparam) >= 0) && (OV_i(varparam) < SP_O_V_END)) { - struct opvar *parm; - - OV_pop(parm); - switch (OV_i(varparam)) { - case SP_O_V_NAME: - if ((OV_typ(parm) == SPOVAR_STRING) && !tmpobj.name.str) - tmpobj.name.str = dupstr(OV_s(parm)); - break; - case SP_O_V_CORPSENM: - if (OV_typ(parm) == SPOVAR_MONST) { - char monclass = SP_MONST_CLASS(OV_i(parm)); - int monid = SP_MONST_PM(OV_i(parm)); - - if (monid >= LOW_PM && monid < NUMMONS) { - tmpobj.corpsenm = monid; - break; /* we're done! */ - } else { - struct permonst *pm = (struct permonst *) 0; - - if (def_char_to_monclass(monclass) != MAXMCLASSES) { - pm = mkclass(def_char_to_monclass(monclass), G_NOGEN); - } else { - pm = rndmonst(); - } - if (pm) - tmpobj.corpsenm = monsndx(pm); - } - } - break; - case SP_O_V_CURSE: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.curse_state = OV_i(parm); - break; - case SP_O_V_SPE: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.spe = OV_i(parm); - break; - case SP_O_V_QUAN: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.quan = OV_i(parm); - break; - case SP_O_V_BURIED: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.buried = OV_i(parm); - break; - case SP_O_V_LIT: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.lit = OV_i(parm); - break; - case SP_O_V_ERODED: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.eroded = OV_i(parm); - break; - case SP_O_V_LOCKED: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.locked = OV_i(parm); - break; - case SP_O_V_TRAPPED: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.trapped = OV_i(parm); - break; - case SP_O_V_RECHARGED: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.recharged = OV_i(parm); - break; - case SP_O_V_INVIS: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.invis = OV_i(parm); - break; - case SP_O_V_GREASED: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.greased = OV_i(parm); - break; - case SP_O_V_BROKEN: - if (OV_typ(parm) == SPOVAR_INT) - tmpobj.broken = OV_i(parm); - break; - case SP_O_V_COORD: - if (OV_typ(parm) != SPOVAR_COORD) - panic("no coord for obj?"); - tmpobj.coord = OV_i(parm); - break; - case SP_O_V_END: - nparams = SP_O_V_END + 1; - break; - default: - impossible("OBJECT with unknown variable param type!"); - break; + if (strlen(paramstr) == 1) { + tmpobj.class = *paramstr; + tmpobj.id = STRANGE_OBJECT; + } else { + tmpobj.class = -1; + tmpobj.id = find_objtype(L, paramstr); } - opvar_free(parm); - if (OV_i(varparam) != SP_O_V_END) { - opvar_free(varparam); - OV_pop(varparam); + } else if (argc == 2 && lua_type(L, 1) == LUA_TSTRING + && lua_type(L, 2) == LUA_TTABLE) { + const char *paramstr = luaL_checkstring(L, 1); + + get_coord(L, 2, &ox, &oy); + + if (strlen(paramstr) == 1) { + tmpobj.class = *paramstr; + tmpobj.id = STRANGE_OBJECT; + } else { + tmpobj.class = -1; + tmpobj.id = find_objtype(L, paramstr); + } + } else if (argc == 3) { + const char *paramstr = luaL_checkstring(L, 1); + + ox = luaL_checkinteger(L, 2); + oy = luaL_checkinteger(L, 3); + + if (strlen(paramstr) == 1) { + tmpobj.class = *paramstr; + tmpobj.id = STRANGE_OBJECT; + } else { + tmpobj.class = -1; + tmpobj.id = find_objtype(L, paramstr); + } + } else { + lcheck_param_table(L); + + tmpobj.spe = get_table_int_or_random(L, "spe", -127); + tmpobj.curse_state = get_table_buc(L); + tmpobj.corpsenm = NON_PM; + tmpobj.name.str = get_table_str_opt(L, "name", (char *) 0); + tmpobj.quan = get_table_int_or_random(L, "quantity", -1); + tmpobj.buried = get_table_boolean_opt(L, "buried", 0); + tmpobj.lit = get_table_boolean_opt(L, "lit", 0); + tmpobj.eroded = get_table_int_opt(L, "eroded", 0); + tmpobj.locked = get_table_boolean_opt(L, "locked", 0); + tmpobj.trapped = get_table_int_opt(L, "trapped", -1); + tmpobj.recharged = get_table_int_opt(L, "recharged", 0); + tmpobj.greased = get_table_boolean_opt(L, "greased", 0); + tmpobj.broken = get_table_boolean_opt(L, "broken", 0); + + ox = get_table_int_opt(L, "x", -1); + oy = get_table_int_opt(L, "y", -1); + + if (ox == -1 && oy == -1) { + lua_getfield(L, 1, "coord"); + get_coord(L, -1, &ox, &oy); + lua_pop(L, 1); + } + + tmpobj.id = get_table_objtype(L); + tmpobj.class = get_table_objclass(L); + maybe_contents = 1; + } + + if (ox == -1 && oy == -1) + tmpobj.coord = SP_COORD_PACK_RANDOM(0); + else + tmpobj.coord = SP_COORD_PACK(ox, oy); + + if (tmpobj.class == -1 && tmpobj.id > STRANGE_OBJECT) + tmpobj.class = objects[tmpobj.id].oc_class; + else if (tmpobj.class > -1 && tmpobj.id == STRANGE_OBJECT) + tmpobj.id = -1; + + if (tmpobj.id == STATUE || tmpobj.id == EGG || tmpobj.id == CORPSE || tmpobj.id == TIN) { + int flags = 0; + const char *montype = get_table_str_opt(L, "montype", NULL); + if (montype) { + struct permonst *pm = NULL; + if (strlen(montype) == 1 && def_char_to_monclass(*montype) != MAXMCLASSES) { + pm = mkclass(def_char_to_monclass(*montype), G_NOGEN); + } else { + int i; + for (i = LOW_PM; i < NUMMONS; i++) + if (!strcmpi(mons[i].mname, montype)) { + pm = &mons[i]; + break; + } + } + if (pm) + tmpobj.corpsenm = monsndx(pm); + else + nhl_error(L, "Unknown montype"); + } + if (tmpobj.id == STATUE) { + flags |= (get_table_boolean_opt(L, "historic", 0) ? STATUE_HISTORIC : 0x00); + flags |= (get_table_boolean_opt(L, "male", 0) ? STATUE_MALE : 0x00); + flags |= (get_table_boolean_opt(L, "female", 0) ? STATUE_FEMALE : 0x00); + tmpobj.spe = flags; + } else if (tmpobj.id == EGG) { + tmpobj.spe = get_table_boolean_opt(L, "laid_by_you", 0) ? 1 : 0; } } - if (!OV_pop_typ(id, SPOVAR_OBJ)) - panic("no obj type"); - - tmpobj.id = SP_OBJ_TYP(OV_i(id)); - tmpobj.class = SP_OBJ_CLASS(OV_i(id)); - tmpobj.containment = OV_i(containment); - quancnt = (tmpobj.id > STRANGE_OBJECT) ? tmpobj.quan : 0; + if (g.container_idx) + tmpobj.containment |= SP_OBJ_CONTENT; + + if (maybe_contents) { + lua_getfield(L, 1, "contents"); + if (!lua_isnil(L, -1)) + tmpobj.containment |= SP_OBJ_CONTAINER; + } + do { - create_object(&tmpobj, coder->croom); + create_object(&tmpobj, g.coder->croom); quancnt--; } while ((quancnt > 0) && ((tmpobj.id > STRANGE_OBJECT) && !objects[tmpobj.id].oc_merge)); + if (lua_type(L, -1) == LUA_TFUNCTION) { + lua_remove(L, -2); + lua_call(L, 0, 0); + } else + lua_pop(L, 1); + + if ((tmpobj.containment & SP_OBJ_CONTAINER) != 0) + spo_pop_container(); + Free(tmpobj.name.str); - opvar_free(varparam); - opvar_free(id); - opvar_free(containment); + + return 0; } -void -spo_level_flags(coder) -struct sp_coder *coder; +/* level_flags("noteleport", "mazelevel", ... ); */ +int +lspo_level_flags(L) +lua_State *L; { - static const char nhFunc[] = "spo_level_flags"; - struct opvar *flagdata; - long lflags; + int argc = lua_gettop(L); + int i; - if (!OV_pop_i(flagdata)) - return; - lflags = OV_i(flagdata); + create_des_coder(); - if (lflags & NOTELEPORT) - g.level.flags.noteleport = 1; - if (lflags & HARDFLOOR) - g.level.flags.hardfloor = 1; - if (lflags & NOMMAP) - g.level.flags.nommap = 1; - if (lflags & SHORTSIGHTED) - g.level.flags.shortsighted = 1; - if (lflags & ARBOREAL) - g.level.flags.arboreal = 1; - if (lflags & MAZELEVEL) - g.level.flags.is_maze_lev = 1; - if (lflags & PREMAPPED) - coder->premapped = TRUE; - if (lflags & SHROUD) - g.level.flags.hero_memory = 0; - if (lflags & GRAVEYARD) - g.level.flags.graveyard = 1; - if (lflags & ICEDPOOLS) - g.icedpools = TRUE; - if (lflags & SOLIDIFY) - coder->solidify = TRUE; - if (lflags & CORRMAZE) - g.level.flags.corrmaze = TRUE; - if (lflags & CHECK_INACCESSIBLES) - coder->check_inaccessibles = TRUE; + if (argc < 1) + nhl_error(L, "expected string params"); - opvar_free(flagdata); + for (i = 1; i <= argc; i++) { + const char *s = luaL_checkstring(L, i); + + if (!strcmpi(s, "noteleport")) + g.level.flags.noteleport = 1; + else if (!strcmpi(s, "hardfloor")) + g.level.flags.hardfloor = 1; + else if (!strcmpi(s, "nommap")) + g.level.flags.nommap = 1; + else if (!strcmpi(s, "shortsighted")) + g.level.flags.shortsighted = 1; + else if (!strcmpi(s, "arboreal")) + g.level.flags.arboreal = 1; + else if (!strcmpi(s, "mazelevel")) + g.level.flags.is_maze_lev = 1; + else if (!strcmpi(s, "shroud")) + g.level.flags.hero_memory = 1; + else if (!strcmpi(s, "graveyard")) + g.level.flags.graveyard = 1; + else if (!strcmpi(s, "icedpools")) + g.icedpools = 1; + else if (!strcmpi(s, "corrmaze")) + g.level.flags.corrmaze = 1; + else if (!strcmpi(s, "premapped")) + g.coder->premapped = 1; + else if (!strcmpi(s, "solidify")) + g.coder->solidify = 1; + else if (!strcmpi(s, "inaccessibles")) + g.coder->check_inaccessibles = 1; + else { + char buf[BUFSZ]; + Sprintf(buf, "Unknown level flag %s", s); + nhl_error(L, buf); + } + } + + return 0; } -void -spo_initlevel(coder) -struct sp_coder *coder; +/* level_init({ style = "solidfill", fg = " " }); */ +/* level_init({ style = "mines", fg = ".", bg = "}", smoothed=1, joined=1, lit=0 }) */ +int +lspo_level_init(L) +lua_State *L; { - static const char nhFunc[] = "spo_initlevel"; lev_init init_lev; - struct opvar *init_style, *fg, *bg, *smoothed, *joined, *lit, *walled, - *filling; + const char *const initstyles[] = { "solidfill", "mazegrid", "rogue", "mines", NULL }; + const int initstyles2i[] = { LVLINIT_SOLIDFILL, LVLINIT_MAZEGRID, LVLINIT_ROGUE, LVLINIT_MINES }; - if (!OV_pop_i(fg) || !OV_pop_i(bg) || !OV_pop_i(smoothed) - || !OV_pop_i(joined) || !OV_pop_i(lit) || !OV_pop_i(walled) - || !OV_pop_i(filling) || !OV_pop_i(init_style)) - return; + create_des_coder(); + + lcheck_param_table(L); g.splev_init_present = TRUE; - init_lev.init_style = OV_i(init_style); - init_lev.fg = OV_i(fg); - init_lev.bg = OV_i(bg); - init_lev.smoothed = OV_i(smoothed); - init_lev.joined = OV_i(joined); - init_lev.lit = OV_i(lit); - init_lev.walled = OV_i(walled); - init_lev.filling = OV_i(filling); + init_lev.init_style = initstyles2i[get_table_option(L, "style", "solidfill", initstyles)]; + init_lev.fg = get_table_mapchr_opt(L, "fg", ROOM); + init_lev.bg = get_table_mapchr_opt(L, "bg", STONE); + init_lev.smoothed = get_table_boolean_opt(L, "smoothed", 0); + init_lev.joined = get_table_boolean_opt(L, "joined", 0); + init_lev.lit = get_table_int_or_random(L, "lit", -1); /* TODO: allow lit=BOOL */ + init_lev.walled = get_table_boolean_opt(L, "walled", 0); + init_lev.filling = get_table_mapchr_opt(L, "filling", init_lev.fg); - coder->lvl_is_joined = OV_i(joined); + g.coder->lvl_is_joined = init_lev.joined; splev_initlev(&init_lev); - opvar_free(init_style); - opvar_free(fg); - opvar_free(bg); - opvar_free(smoothed); - opvar_free(joined); - opvar_free(lit); - opvar_free(walled); - opvar_free(filling); + return 0; } -void -spo_engraving(coder) -struct sp_coder *coder; +/* engraving({ x = 1, y = 1, type="burn", text="Foo" }); */ +/* engraving({x,y}, "engrave", "Foo"); */ +int +lspo_engraving(L) +lua_State *L; { - static const char nhFunc[] = "spo_engraving"; - struct opvar *etyp, *txt, *ecoord; + int etyp; + char *txt = (char *) 0; + long ecoord; + const char *const engrtypes[] = { "dust", "engrave", "burn", "mark", "blood", NULL }; + const int engrtypes2i[] = { DUST, ENGRAVE, BURN, MARK, ENGR_BLOOD, 0 }; xchar x, y; + int argc = lua_gettop(L); - if (!OV_pop_i(etyp) || !OV_pop_s(txt) || !OV_pop_c(ecoord)) - return; + create_des_coder(); - get_location_coord(&x, &y, DRY, coder->croom, OV_i(ecoord)); - make_engr_at(x, y, OV_s(txt), 0L, OV_i(etyp)); + if (argc == 1) { + lcheck_param_table(L); - opvar_free(etyp); - opvar_free(txt); - opvar_free(ecoord); + etyp = engrtypes2i[get_table_option(L, "type", "engrave", engrtypes)]; + x = get_table_int_opt(L, "x", -1); + y = get_table_int_opt(L, "y", -1); + txt = get_table_str(L, "text"); + } else if (argc == 3) { + int ex, ey; + get_coord(L, 1, &ex, &ey); + x = ex; + y = ey; + etyp = engrtypes2i[luaL_checkoption(L, 2, "engrave", engrtypes)]; + txt = dupstr(luaL_checkstring(L, 3)); + } else { + nhl_error(L, "Wrong parameters"); + } + + if (x == -1 && y == -1) + ecoord = SP_COORD_PACK_RANDOM(0); + else + ecoord = SP_COORD_PACK(x, y); + + get_location_coord(&x, &y, DRY, g.coder->croom, ecoord); + make_engr_at(x, y, txt, 0L, etyp); + Free(txt); + return 0; } -void -spo_mineralize(coder) -struct sp_coder *coder; +int +lspo_mineralize(L) +lua_State *L; { - static const char nhFunc[] = "spo_mineralize"; - struct opvar *kelp_pool, *kelp_moat, *gold_prob, *gem_prob; + int gem_prob, gold_prob, kelp_moat, kelp_pool; - if (!OV_pop_i(gem_prob) || !OV_pop_i(gold_prob) || !OV_pop_i(kelp_moat) - || !OV_pop_i(kelp_pool)) - return; + create_des_coder(); - mineralize(OV_i(kelp_pool), OV_i(kelp_moat), OV_i(gold_prob), - OV_i(gem_prob), TRUE); + lcheck_param_table(L); + gem_prob = get_table_int_opt(L, "gem_prob", 0); + gold_prob = get_table_int_opt(L, "gold_prob", 0); + kelp_moat = get_table_int_opt(L, "kelp_moat", 0); + kelp_pool = get_table_int_opt(L, "kelp_pool", 0); - opvar_free(gem_prob); - opvar_free(gold_prob); - opvar_free(kelp_moat); - opvar_free(kelp_pool); + mineralize(kelp_pool, kelp_moat, gold_prob, gem_prob, TRUE); + + return 0; } -void -spo_room(coder) -struct sp_coder *coder; -{ - static const char nhFunc[] = "spo_room"; +const struct { + const char *name; + int type; +} room_types[] = { + /* for historical reasons, room types are not contiguous numbers */ + /* (type 1 is skipped) */ + { "ordinary", OROOM }, + { "throne", COURT }, + { "swamp", SWAMP }, + { "vault", VAULT }, + { "beehive", BEEHIVE }, + { "morgue", MORGUE }, + { "barracks", BARRACKS }, + { "zoo", ZOO }, + { "delphi", DELPHI }, + { "temple", TEMPLE }, + { "anthole", ANTHOLE }, + { "cocknest", COCKNEST }, + { "leprehall", LEPREHALL }, + { "shop", SHOPBASE }, + { "armor shop", ARMORSHOP }, + { "scroll shop", SCROLLSHOP }, + { "potion shop", POTIONSHOP }, + { "weapon shop", WEAPONSHOP }, + { "food shop", FOODSHOP }, + { "ring shop", RINGSHOP }, + { "wand shop", WANDSHOP }, + { "tool shop", TOOLSHOP }, + { "book shop", BOOKSHOP }, + { "health food shop", FODDERSHOP }, + { "candle shop", CANDLESHOP }, + { 0, 0 } +}; - if (coder->n_subroom > MAX_NESTED_ROOMS) { +int +get_table_roomtype_opt(L, name, defval) +lua_State *L; +const char *name; +int defval; +{ + char *roomstr = get_table_str_opt(L, name, ""); + if (roomstr && *roomstr) { + int i; + for (i = 0; room_types[i].name; i++) + if (!strcmpi(roomstr, room_types[i].name)) { + Free(roomstr); + return room_types[i].type; + } + } + Free(roomstr); + return defval; +} + +/* room({ type="ordinary", lit=1, x=3,y=3, xalign="center",yalign="center", w=11,h=9 }); */ +int +lspo_room(L) +lua_State *L; +{ + create_des_coder(); + + lcheck_param_table(L); + + if (g.coder->n_subroom > MAX_NESTED_ROOMS) { panic("Too deeply nested rooms?!"); } else { - struct opvar *rflags, *h, *w, *yalign, *xalign, *y, *x, *rlit, - *chance, *rtype; + const char *const left_or_right[] = { "left", "half-left", "center", "half-right", "right", "none", "random", NULL }; + const int l_or_r2i[] = { LEFT, H_LEFT, CENTER, H_RIGHT, RIGHT, -1, -1, -1 }; + const char *const top_or_bot[] = { "top", "center", "bottom", "none", "random", NULL }; + const int t_or_b2i[] = { TOP, CENTER, BOTTOM, -1, -1, -1 }; room tmproom; struct mkroom *tmpcr; - if (!OV_pop_i(h) || !OV_pop_i(w) || !OV_pop_i(y) || !OV_pop_i(x) - || !OV_pop_i(yalign) || !OV_pop_i(xalign) || !OV_pop_i(rflags) - || !OV_pop_i(rlit) || !OV_pop_i(chance) || !OV_pop_i(rtype)) - return; + tmproom.x = get_table_int_opt(L, "x", -1); + tmproom.y = get_table_int_opt(L, "y", -1); + if ((tmproom.x == -1 || tmproom.y == -1) && tmproom.x != tmproom.y) + nhl_error(L, "Room must have both x and y"); - tmproom.x = OV_i(x); - tmproom.y = OV_i(y); - tmproom.w = OV_i(w); - tmproom.h = OV_i(h); - tmproom.xalign = OV_i(xalign); - tmproom.yalign = OV_i(yalign); - tmproom.rtype = OV_i(rtype); - tmproom.chance = OV_i(chance); - tmproom.rlit = OV_i(rlit); - tmproom.filled = (OV_i(rflags) & (1 << 0)); - /*tmproom.irregular = (OV_i(rflags) & (1 << 1));*/ - tmproom.joined = !(OV_i(rflags) & (1 << 2)); + tmproom.w = get_table_int_opt(L, "w", -1); + tmproom.h = get_table_int_opt(L, "h", -1); - opvar_free(x); - opvar_free(y); - opvar_free(w); - opvar_free(h); - opvar_free(xalign); - opvar_free(yalign); - opvar_free(rtype); - opvar_free(chance); - opvar_free(rlit); - opvar_free(rflags); + if ((tmproom.w == -1 || tmproom.h == -1) && tmproom.w != tmproom.h) + nhl_error(L, "Room must have both w and h"); - if (!coder->failed_room[coder->n_subroom - 1]) { - tmpcr = build_room(&tmproom, coder->croom); + tmproom.xalign = l_or_r2i[get_table_option(L, "xalign", "random", left_or_right)]; + tmproom.yalign = t_or_b2i[get_table_option(L, "yalign", "random", top_or_bot)]; + tmproom.rtype = get_table_roomtype_opt(L, "type", OROOM); + tmproom.chance = get_table_int_opt(L, "chance", 100); + tmproom.rlit = get_table_int_opt(L, "lit", -1); + tmproom.filled = get_table_int_opt(L, "filled", 1); + tmproom.joined = get_table_int_opt(L, "joined", 1); + + if (!g.coder->failed_room[g.coder->n_subroom - 1]) { + tmpcr = build_room(&tmproom, g.coder->croom); if (tmpcr) { - coder->tmproomlist[coder->n_subroom] = tmpcr; - coder->failed_room[coder->n_subroom] = FALSE; - coder->n_subroom++; - return; + g.coder->tmproomlist[g.coder->n_subroom] = tmpcr; + g.coder->failed_room[g.coder->n_subroom] = FALSE; + g.coder->n_subroom++; + update_croom(); + lua_getfield(L, 1, "contents"); + if (lua_type(L, -1) == LUA_TFUNCTION) { + lua_remove(L, -2); + lua_call(L, 0, 0); + } else + lua_pop(L, 1); + spo_endroom(g.coder); + return 0; } } /* failed to create parent room, so fail this too */ } - coder->tmproomlist[coder->n_subroom] = (struct mkroom *) 0; - coder->failed_room[coder->n_subroom] = TRUE; - coder->n_subroom++; + g.coder->tmproomlist[g.coder->n_subroom] = (struct mkroom *) 0; + g.coder->failed_room[g.coder->n_subroom] = TRUE; + g.coder->n_subroom++; + update_croom(); + spo_endroom(g.coder); + + return 0; } -void +STATIC_OVL void spo_endroom(coder) struct sp_coder *coder; { - if (coder->n_subroom > 1) { - coder->n_subroom--; - coder->tmproomlist[coder->n_subroom] = NULL; - coder->failed_room[coder->n_subroom] = TRUE; + if (g.coder->n_subroom > 1) { + g.coder->n_subroom--; + g.coder->tmproomlist[g.coder->n_subroom] = NULL; + g.coder->failed_room[g.coder->n_subroom] = TRUE; } else { /* no subroom, get out of top-level room */ /* Need to ensure xstart/ystart/xsize/ysize have something sensible, in case there's some stuff to be created outside the outermost - room, - and there's no MAP. - */ + room, and there's no MAP. */ if (g.xsize <= 1 && g.ysize <= 1) { g.xstart = 1; g.ystart = 0; @@ -3463,46 +3090,129 @@ struct sp_coder *coder; g.ysize = ROWNO; } } + update_croom(); } -void -spo_stair(coder) -struct sp_coder *coder; +/* stair("up"); */ +/* stair({ dir = "down" }); */ +/* stair({ dir = "down", x = 4, y = 7 }); */ +/* stair({ dir = "down", coord = {x,y} }); */ +/* stair("down", 4, 7); */ +/* TODO: stair(selection, "down"); */ +/* TODO: stair("up", {x,y}); */ +int +lspo_stair(L) +lua_State *L; { - static const char nhFunc[] = "spo_stair"; - xchar x, y; - struct opvar *up, *scoord; + int argc = lua_gettop(L); + xchar x = -1, y = -1; struct trap *badtrap; - if (!OV_pop_i(up) || !OV_pop_c(scoord)) - return; + const char *const stairdirs[] = { "down", "up", NULL }; + const int stairdirs2i[] = { 0, 1 }; - get_location_coord(&x, &y, DRY, coder->croom, OV_i(scoord)); + long scoord; + int ax = -1,ay = -1; + int up; + int ltype = lua_type(L, 1); + + create_des_coder(); + + if (argc == 1 && ltype == LUA_TSTRING) + up = stairdirs2i[luaL_checkoption(L, 1, "down", stairdirs)]; + else if (argc == 3 && ltype == LUA_TSTRING) { + up = stairdirs2i[luaL_checkoption(L, 1, "down", stairdirs)]; + ax = luaL_checkinteger(L, 2); + ay = luaL_checkinteger(L, 3); + } else { + lcheck_param_table(L); + + ax = get_table_int_opt(L, "x", -1); + ay = get_table_int_opt(L, "y", -1); + + if (ax == -1 && ay == -1) { + lua_getfield(L, 1, "coord"); + get_coord(L, -1, &ax, &ay); + lua_pop(L, 1); + } + + up = stairdirs2i[get_table_option(L, "dir", "down", stairdirs)]; + } + + x = ax; + y = ay; + + if (x == -1 && y == -1) + scoord = SP_COORD_PACK_RANDOM(0); + else + scoord = SP_COORD_PACK(x, y); + + get_location_coord(&x, &y, DRY, g.coder->croom, scoord); if ((badtrap = t_at(x, y)) != 0) deltrap(badtrap); - mkstairs(x, y, (char) OV_i(up), coder->croom); + mkstairs(x, y, (char) up, g.coder->croom); g.SpLev_Map[x][y] = 1; - opvar_free(scoord); - opvar_free(up); + return 0; } -void -spo_ladder(coder) -struct sp_coder *coder; +/* ladder("down"); */ +/* ladder("up", 6,10); */ +/* ladder({ x=11, y=05, dir="down" }); */ +int +lspo_ladder(L) +lua_State *L; { - static const char nhFunc[] = "spo_ladder"; - xchar x, y; - struct opvar *up, *lcoord; + int argc = lua_gettop(L); + xchar x = -1, y = -1; + struct trap *badtrap; - if (!OV_pop_i(up) || !OV_pop_c(lcoord)) - return; + const char *const stairdirs[] = { "down", "up", NULL }; + const int stairdirs2i[] = { 0, 1 }; - get_location_coord(&x, &y, DRY, coder->croom, OV_i(lcoord)); + long scoord; + int ax, ay; + int up; + int ltype = lua_type(L, 1); + create_des_coder(); + + if (argc == 1 && ltype == LUA_TSTRING) + up = stairdirs2i[luaL_checkoption(L, 1, "down", stairdirs)]; + else if (argc == 3 && ltype == LUA_TSTRING) { + up = stairdirs2i[luaL_checkoption(L, 1, "down", stairdirs)]; + ax = luaL_checkinteger(L, 2); + ay = luaL_checkinteger(L, 3); + } else { + lcheck_param_table(L); + + ax = get_table_int_opt(L, "x", -1); + ay = get_table_int_opt(L, "y", -1); + + if (ax == -1 && ay == -1) { + lua_getfield(L, 1, "coord"); + get_coord(L, -1, &ax, &ay); + lua_pop(L, 1); + } + + up = stairdirs2i[get_table_option(L, "dir", "down", stairdirs)]; + } + + x = ax; + y = ay; + + if (x == -1 && y == -1) + scoord = SP_COORD_PACK_RANDOM(0); + else + scoord = SP_COORD_PACK(ax, ay); + + get_location_coord(&x, &y, DRY, g.coder->croom, scoord); + + if ((badtrap = t_at(x, y)) != 0) + deltrap(badtrap); levl[x][y].typ = LADDER; g.SpLev_Map[x][y] = 1; - if (OV_i(up)) { + if (up) { xupladder = x; yupladder = y; levl[x][y].ladder = LA_UP; @@ -3511,212 +3221,388 @@ struct sp_coder *coder; ydnladder = y; levl[x][y].ladder = LA_DOWN; } - opvar_free(lcoord); - opvar_free(up); + + return 0; } -void -spo_grave(coder) -struct sp_coder *coder; +int +lspo_grave(L) +lua_State *L; { - static const char nhFunc[] = "spo_grave"; - struct opvar *gcoord, *typ, *txt; schar x, y; + long scoord; + int ax,ay; + char *txt; - if (!OV_pop_i(typ) || !OV_pop_s(txt) || !OV_pop_c(gcoord)) - return; + create_des_coder(); - get_location_coord(&x, &y, DRY, coder->croom, OV_i(gcoord)); + lcheck_param_table(L); + + x = ax = get_table_int_opt(L, "x", -1); + y = ay = get_table_int_opt(L, "y", -1); + txt = get_table_str_opt(L, "text", NULL); + + if (x == -1 && y == -1) + scoord = SP_COORD_PACK_RANDOM(0); + else + scoord = SP_COORD_PACK(ax, ay); + + get_location_coord(&x, &y, DRY, g.coder->croom, scoord); if (isok(x, y) && !t_at(x, y)) { levl[x][y].typ = GRAVE; - switch (OV_i(typ)) { - case 2: - make_grave(x, y, OV_s(txt)); - break; - case 1: + if (txt) + make_grave(x, y, txt); + else make_grave(x, y, NULL); - break; - default: - del_engr_at(x, y); - break; + } + + Free(txt); + + return 0; +} + +/* altar({ x=NN, y=NN, align=ALIGNMENT, type=SHRINE }); */ +/* des.altar({ coord = {5, 10}, align="noalign", type="altar" }); */ +int +lspo_altar(L) +lua_State *L; +{ + const char *const shrines[] = { "altar", "shrine", "sanctum", NULL }; + const int shrines2i[] = { 0, 1, 2, 0 }; + + altar tmpaltar; + + int x, y; + long acoord; + int shrine; + int align; + + create_des_coder(); + + lcheck_param_table(L); + + x = get_table_int_opt(L, "x", -1); + y = get_table_int_opt(L, "y", -1); + + if (x == -1 && y == -1) { + lua_getfield(L, 1, "coord"); + get_coord(L, -1, &x, &y); + lua_pop(L, 1); + } + + align = get_table_align(L); + shrine = shrines2i[get_table_option(L, "type", "altar", shrines)]; + + if (x == -1 && y == -1) + acoord = SP_COORD_PACK_RANDOM(0); + else + acoord = SP_COORD_PACK(x, y); + + tmpaltar.coord = acoord; + tmpaltar.align = align; + tmpaltar.shrine = shrine; + + create_altar(&tmpaltar, g.coder->croom); + + return 0; +} + +const struct { + const char *name; + int type; +} trap_types[] = { { "arrow", ARROW_TRAP }, + { "dart", DART_TRAP }, + { "falling rock", ROCKTRAP }, + { "board", SQKY_BOARD }, + { "bear", BEAR_TRAP }, + { "land mine", LANDMINE }, + { "rolling boulder", ROLLING_BOULDER_TRAP }, + { "sleep gas", SLP_GAS_TRAP }, + { "rust", RUST_TRAP }, + { "fire", FIRE_TRAP }, + { "pit", PIT }, + { "spiked pit", SPIKED_PIT }, + { "hole", HOLE }, + { "trap door", TRAPDOOR }, + { "teleport", TELEP_TRAP }, + { "level teleport", LEVEL_TELEP }, + { "magic portal", MAGIC_PORTAL }, + { "web", WEB }, + { "statue", STATUE_TRAP }, + { "magic", MAGIC_TRAP }, + { "anti magic", ANTI_MAGIC }, + { "polymorph", POLY_TRAP }, + { "vibrating square", VIBRATING_SQUARE }, + { 0, 0 } }; + +int +get_table_traptype_opt(L, name, defval) +lua_State *L; +const char *name; +int defval; +{ + char *trapstr = get_table_str_opt(L, name, ""); + if (trapstr && *trapstr) { + int i; + for (i = 0; trap_types[i].name; i++) + if (!strcmpi(trapstr, trap_types[i].name)) { + Free(trapstr); + return trap_types[i].type; + } + } + Free(trapstr); + return defval; +} + +/* trap({ type = "hole", x = 1, y = 1 }); */ +/* trap("hole", 3, 4); */ +/* trap("level teleport", {5, 8}); */ +/* trap("rust") */ +/* trap(); */ +int +lspo_trap(L) +lua_State *L; +{ + spltrap tmptrap; + int x, y; + /* long tcoord; */ /* REVIEW: unreferenced */ + int argc = lua_gettop(L); + + create_des_coder(); + + if (argc == 1 && lua_type(L, 1) == LUA_TSTRING) { + const char *trapstr = luaL_checkstring(L, 1); + int i; + + tmptrap.type = -1; + for (i = 0; trap_types[i].name; i++) + if (!strcmpi(trapstr, trap_types[i].name)) { + tmptrap.type = trap_types[i].type; + break; + } + x = y = -1; + } else if (argc == 2 && lua_type(L, 1) == LUA_TSTRING + && lua_type(L, 2) == LUA_TTABLE) { + const char *trapstr = luaL_checkstring(L, 1); + int i; + + tmptrap.type = -1; + for (i = 0; trap_types[i].name; i++) + if (!strcmpi(trapstr, trap_types[i].name)) { + tmptrap.type = trap_types[i].type; + break; + } + get_coord(L, 2, &x, &y); + } else if (argc == 3) { + const char *trapstr = luaL_checkstring(L, 1); + int i; + tmptrap.type = -1; + for (i = 0; trap_types[i].name; i++) + if (!strcmpi(trapstr, trap_types[i].name)) { + tmptrap.type = trap_types[i].type; + break; + } + x = luaL_checkinteger(L, 2); + y = luaL_checkinteger(L, 3); + + if (tmptrap.type == -1) + nhl_error(L, "Unknown trap type"); + + } else { + lcheck_param_table(L); + + x = get_table_int_opt(L, "x", -1); + y = get_table_int_opt(L, "y", -1); + tmptrap.type = get_table_traptype_opt(L, "type", -1); + + if (x == -1 && y == -1) { + lua_getfield(L, 1, "coord"); + get_coord(L, -1, &x, &y); + lua_pop(L, 1); } } - opvar_free(gcoord); - opvar_free(typ); - opvar_free(txt); + if (x == -1 && y == -1) + tmptrap.coord = SP_COORD_PACK_RANDOM(0); + else + tmptrap.coord = SP_COORD_PACK(x, y); + + create_trap(&tmptrap, g.coder->croom); + + return 0; } -void -spo_altar(coder) -struct sp_coder *coder; +/* gold({ amount = 500, x = 2, y = 5 });*/ +int +lspo_gold(L) +lua_State *L; { - static const char nhFunc[] = "spo_altar"; - struct opvar *al, *shrine, *acoord; - altar tmpaltar; - - if (!OV_pop_i(al) || !OV_pop_i(shrine) || !OV_pop_c(acoord)) - return; - - tmpaltar.coord = OV_i(acoord); - tmpaltar.align = OV_i(al); - tmpaltar.shrine = OV_i(shrine); - - create_altar(&tmpaltar, coder->croom); - - opvar_free(acoord); - opvar_free(shrine); - opvar_free(al); -} - -void -spo_trap(coder) -struct sp_coder *coder; -{ - static const char nhFunc[] = "spo_trap"; - struct opvar *type; - struct opvar *tcoord; - spltrap tmptrap; - - if (!OV_pop_i(type) || !OV_pop_c(tcoord)) - return; - - tmptrap.coord = OV_i(tcoord); - tmptrap.type = OV_i(type); - - create_trap(&tmptrap, coder->croom); - opvar_free(tcoord); - opvar_free(type); -} - -void -spo_gold(coder) -struct sp_coder *coder; -{ - static const char nhFunc[] = "spo_gold"; - struct opvar *gcoord, *amt; schar x, y; long amount; + long gcoord; + int gx, gy; - if (!OV_pop_c(gcoord) || !OV_pop_i(amt)) - return; - amount = OV_i(amt); - get_location_coord(&x, &y, DRY, coder->croom, OV_i(gcoord)); - if (amount == -1) + create_des_coder(); + + lcheck_param_table(L); + + x = gx = get_table_int_opt(L, "x", -1); + y = gy = get_table_int_opt(L, "y", -1); + + if (x == -1 && y == -1) + gcoord = SP_COORD_PACK_RANDOM(0); + else + gcoord = SP_COORD_PACK(gx, gy); + amount = get_table_int_opt(L, "amount", -1); + get_location_coord(&x, &y, DRY, g.coder->croom, gcoord); + if (amount < 0) amount = rnd(200); mkgold(amount, x, y); - opvar_free(gcoord); - opvar_free(amt); + + return 0; } -void -spo_corridor(coder) -struct sp_coder *coder; +/* corridor({ srcroom=1, srcdoor=2, srcwall="north", destroom=2, destdoor=1, destwall="west" });*/ +int +lspo_corridor(L) +lua_State *L; { - static const char nhFunc[] = "spo_corridor"; - struct opvar *deswall, *desdoor, *desroom, *srcwall, *srcdoor, *srcroom; + const char *const walldirs[] = { "all", "random", "north", "west", "east", "south", NULL }; + const int walldirs2i[] = { W_ANY, -1, W_NORTH, W_WEST, W_EAST, W_SOUTH, 0 }; corridor tc; - if (!OV_pop_i(deswall) || !OV_pop_i(desdoor) || !OV_pop_i(desroom) - || !OV_pop_i(srcwall) || !OV_pop_i(srcdoor) || !OV_pop_i(srcroom)) - return; + create_des_coder(); - tc.src.room = OV_i(srcroom); - tc.src.door = OV_i(srcdoor); - tc.src.wall = OV_i(srcwall); - tc.dest.room = OV_i(desroom); - tc.dest.door = OV_i(desdoor); - tc.dest.wall = OV_i(deswall); + lcheck_param_table(L); + + tc.src.room = get_table_int(L, "srcroom"); + tc.src.door = get_table_int(L, "srcdoor"); + tc.src.wall = walldirs2i[get_table_option(L, "srcwall", "all", walldirs)]; + tc.dest.room = get_table_int(L, "destroom"); + tc.dest.door = get_table_int(L, "destdoor"); + tc.dest.wall = walldirs2i[get_table_option(L, "destwall", "all", walldirs)]; create_corridor(&tc); - opvar_free(deswall); - opvar_free(desdoor); - opvar_free(desroom); - opvar_free(srcwall); - opvar_free(srcdoor); - opvar_free(srcroom); + return 0; } -struct opvar * -selection_opvar(nbuf) -char *nbuf; +/* random_corridors(); */ +int +lspo_random_corridors(L) +lua_State *L; { - struct opvar *ov; - char buf[(COLNO * ROWNO) + 1]; + corridor tc; - if (!nbuf) { - (void) memset(buf, 1, sizeof(buf)); - buf[(COLNO * ROWNO)] = '\0'; - ov = opvar_new_str(buf); - } else { - ov = opvar_new_str(nbuf); - } - ov->spovartyp = SPOVAR_SEL; - return ov; + create_des_coder(); + + tc.src.room = -1; + tc.src.door = -1; + tc.src.wall = -1; + tc.dest.room = -1; + tc.dest.door = -1; + tc.dest.wall = -1; + + create_corridor(&tc); + + return 0; } -xchar -selection_getpoint(x, y, ov) -int x, y; -struct opvar *ov; +/* selection */ +struct selectionvar * +selection_new() { - if (!ov || ov->spovartyp != SPOVAR_SEL) - return 0; - if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO) - return 0; + struct selectionvar *tmps = (struct selectionvar *) alloc(sizeof (struct selectionvar)); - return (ov->vardata.str[COLNO * y + x] - 1); + tmps->wid = COLNO; + tmps->hei = ROWNO; + tmps->map = (char *)alloc((COLNO * ROWNO) + 1); + (void) memset(tmps->map, 1, (COLNO * ROWNO)); + tmps->map[(COLNO * ROWNO)] = '\0'; + + return tmps; } void -selection_setpoint(x, y, ov, c) +selection_free(sel) +struct selectionvar *sel; +{ + if (!sel) + return; + Free(sel->map); + sel->map = NULL; + sel->wid = sel->hei = 0; +} + +struct selectionvar * +selection_clone(sel) +struct selectionvar *sel; +{ + struct selectionvar *tmps = (struct selectionvar *) alloc(sizeof (struct selectionvar)); + + tmps->wid = sel->wid; + tmps->hei = sel->hei; + tmps->map = dupstr(sel->map); + + return tmps; +} + +xchar +selection_getpoint(x, y, sel) int x, y; -struct opvar *ov; +struct selectionvar *sel; +{ + if (!sel || !sel->map) + return 0; + if (x < 0 || y < 0 || x >= sel->wid || y >= sel->hei) + return 0; + + return (sel->map[sel->wid * y + x] - 1); +} + +void +selection_setpoint(x, y, sel, c) +int x, y; +struct selectionvar *sel; xchar c; { - if (!ov || ov->spovartyp != SPOVAR_SEL) + if (!sel || !sel->map) return; - if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO) + if (x < 0 || y < 0 || x >= sel->wid || y >= sel->hei) return; - ov->vardata.str[COLNO * y + x] = (char) (c + 1); + sel->map[sel->wid * y + x] = (char) (c + 1); } -struct opvar * +struct selectionvar * selection_not(s) -struct opvar *s; +struct selectionvar *s; { - struct opvar *ov; int x, y; - ov = selection_opvar((char *) 0); - if (!ov) - return NULL; - for (x = 0; x < COLNO; x++) - for (y = 0; y < ROWNO; y++) - if (!selection_getpoint(x, y, s)) - selection_setpoint(x, y, ov, 1); + for (x = 0; x < s->wid; x++) + for (y = 0; y < s->hei; y++) + selection_setpoint(x, y, s, selection_getpoint(x, y, s) ? 0 : 1); - return ov; + return s; } -struct opvar * +struct selectionvar * selection_logical_oper(s1, s2, oper) -struct opvar *s1, *s2; +struct selectionvar *s1, *s2; char oper; { - struct opvar *ov; + struct selectionvar *ov; int x, y; - ov = selection_opvar((char *) 0); + ov = selection_new(); if (!ov) return NULL; - for (x = 0; x < COLNO; x++) - for (y = 0; y < ROWNO; y++) { + for (x = 0; x < ov->wid; x++) + for (y = 0; y < ov->hei; y++) { switch (oper) { default: case '|': @@ -3735,23 +3621,21 @@ char oper; return ov; } -struct opvar * -selection_filter_mapchar(ov, mc) -struct opvar *ov; -struct opvar *mc; +struct selectionvar * +selection_filter_mapchar(ov, typ, lit) +struct selectionvar *ov; +xchar typ; +int lit; { int x, y; - schar mapc; - xchar lit; - struct opvar *ret = selection_opvar((char *) 0); + struct selectionvar *ret = selection_new(); - if (!ov || !mc || !ret) + if (!ov || !ret) return NULL; - mapc = SP_MAPCHAR_TYP(OV_i(mc)); - lit = SP_MAPCHAR_LIT(OV_i(mc)); - for (x = 0; x < COLNO; x++) - for (y = 0; y < ROWNO; y++) - if (selection_getpoint(x, y, ov) && (levl[x][y].typ == mapc)) { + + for (x = 0; x < ret->wid; x++) + for (y = 0; y < ret->hei; y++) + if (selection_getpoint(x, y, ov) && (levl[x][y].typ == typ)) { switch (lit) { default: case -2: @@ -3772,22 +3656,22 @@ struct opvar *mc; void selection_filter_percent(ov, percent) -struct opvar *ov; +struct selectionvar *ov; int percent; { int x, y; if (!ov) return; - for (x = 0; x < COLNO; x++) - for (y = 0; y < ROWNO; y++) + for (x = 0; x < ov->wid; x++) + for (y = 0; y < ov->hei; y++) if (selection_getpoint(x, y, ov) && (rn2(100) >= percent)) selection_setpoint(x, y, ov, 0); } -STATIC_OVL int +int selection_rndcoord(ov, x, y, removeit) -struct opvar *ov; +struct selectionvar *ov; schar *x, *y; boolean removeit; { @@ -3795,20 +3679,21 @@ boolean removeit; int c; int dx, dy; - for (dx = 0; dx < COLNO; dx++) - for (dy = 0; dy < ROWNO; dy++) - if (isok(dx, dy) && selection_getpoint(dx, dy, ov)) + for (dx = 0; dx < ov->wid; dx++) + for (dy = 0; dy < ov->hei; dy++) + if (selection_getpoint(dx, dy, ov)) idx++; if (idx) { c = rn2(idx); - for (dx = 0; dx < COLNO; dx++) - for (dy = 0; dy < ROWNO; dy++) - if (isok(dx, dy) && selection_getpoint(dx, dy, ov)) { + for (dx = 0; dx < ov->wid; dx++) + for (dy = 0; dy < ov->hei; dy++) + if (selection_getpoint(dx, dy, ov)) { if (!c) { *x = dx; *y = dy; - if (removeit) selection_setpoint(dx, dy, ov, 0); + if (removeit) + selection_setpoint(dx, dy, ov, 0); return 1; } c--; @@ -3820,21 +3705,17 @@ boolean removeit; void selection_do_grow(ov, dir) -struct opvar *ov; +struct selectionvar *ov; int dir; { int x, y; - char tmp[COLNO][ROWNO]; + struct selectionvar *tmp = selection_new(); - if (ov->spovartyp != SPOVAR_SEL) - return; - if (!ov) + if (!ov || !tmp) return; - (void) memset(tmp, 0, sizeof tmp); - - for (x = 1; x < COLNO; x++) - for (y = 0; y < ROWNO; y++) { + for (x = 1; x < ov->wid; x++) + for (y = 0; y < ov->hei; y++) { /* note: dir is a mask of multiple directions, but the only way to specify diagonals is by including the two adjacent orthogonal directions, which effectively specifies three- @@ -3851,14 +3732,16 @@ int dir; || ((dir & W_SOUTH) && selection_getpoint(x, y - 1, ov)) || (((dir & (W_SOUTH | W_WEST)) == (W_SOUTH | W_WEST)) && selection_getpoint(x + 1, y - 1, ov))) { - tmp[x][y] = 1; + selection_setpoint(x, y, tmp, 1); } } - for (x = 1; x < COLNO; x++) - for (y = 0; y < ROWNO; y++) - if (tmp[x][y]) + for (x = 1; x < ov->wid; x++) + for (y = 0; y < ov->hei; y++) + if (selection_getpoint(x, y, tmp)) selection_setpoint(x, y, ov, 1); + + selection_free(tmp); } STATIC_VAR int FDECL((*selection_flood_check_func), (int, int)); @@ -3878,6 +3761,14 @@ int x,y; return (floodfillchk_match_under_typ == levl[x][y].typ); } +void +set_floodfillchk_match_under(typ) +xchar typ; +{ + floodfillchk_match_under_typ = typ; + set_selection_floodfillchk(floodfillchk_match_under); +} + STATIC_OVL int floodfillchk_match_accessible(x, y) int x, y; @@ -3906,12 +3797,11 @@ int n; void selection_floodfill(ov, x, y, diagonals) -struct opvar *ov; +struct selectionvar *ov; int x, y; boolean diagonals; { - static const char nhFunc[] = "selection_floodfill"; - struct opvar *tmp = selection_opvar((char *) 0); + struct selectionvar *tmp = selection_new(); #define SEL_FLOOD_STACK (COLNO * ROWNO) #define SEL_FLOOD(nx, ny) \ do { \ @@ -3936,7 +3826,7 @@ boolean diagonals; xchar dy[SEL_FLOOD_STACK]; if (selection_flood_check_func == (int FDECL((*), (int, int))) 0) { - opvar_free(tmp); + selection_free(tmp); return; } SEL_FLOOD(x, y); @@ -3962,13 +3852,13 @@ boolean diagonals; #undef SEL_FLOOD #undef SEL_FLOOD_STACK #undef SEL_FLOOD_CHKDIR - opvar_free(tmp); + selection_free(tmp); } /* McIlroy's Ellipse Algorithm */ void selection_do_ellipse(ov, xc, yc, a, b, filled) -struct opvar *ov; +struct selectionvar *ov; int xc, yc, a, b, filled; { /* e(x,y) = b^2*x^2 + a^2*y^2 - a^2*b^2 */ int x = 0, y = b; @@ -4080,7 +3970,7 @@ long x1, y1, x2, y2, x3, y3; void selection_do_gradient(ov, x, y, x2, y2, gtyp, mind, maxd, limit) -struct opvar *ov; +struct selectionvar *ov; long x, y, x2, y2, gtyp, mind, maxd, limit; { long dx, dy, dofs; @@ -4132,7 +4022,7 @@ long x, y, x2, y2, gtyp, mind, maxd, limit; void selection_do_line(x1, y1, x2, y2, ov) schar x1, y1, x2, y2; -struct opvar *ov; +struct selectionvar *ov; { int d0, dx, dy, ai, bi, xi, yi; @@ -4186,7 +4076,7 @@ struct opvar *ov; void selection_do_randline(x1, y1, x2, y2, rough, rec, ov) schar x1, y1, x2, y2, rough, rec; -struct opvar *ov; +struct selectionvar *ov; { int mx, my; int dx, dy; @@ -4227,20 +4117,49 @@ struct opvar *ov; void selection_iterate(ov, func, arg) -struct opvar *ov; +struct selectionvar *ov; select_iter_func func; genericptr_t arg; { int x, y; + if (!ov) + return; + /* yes, this is very naive, but it's not _that_ expensive. */ - for (x = 0; x < COLNO; x++) - for (y = 0; y < ROWNO; y++) + for (x = 0; x < ov->wid; x++) + for (y = 0; y < ov->hei; y++) if (selection_getpoint(x, y, ov)) (*func)(x, y, arg); } + void +stackDump(L) +lua_State *L; +{ + int i; + int top = lua_gettop(L); + for (i = 1; i <= top; i++) { /* repeat for each level */ + int t = lua_type(L, i); + switch (t) { + case LUA_TSTRING: /* strings */ + pline("%i:\"%s\"", i, lua_tostring(L, i)); + break; + case LUA_TBOOLEAN: /* booleans */ + pline("%i:%s", i, lua_toboolean(L, i) ? "true" : "false"); + break; + case LUA_TNUMBER: /* numbers */ + pline("%i:%g", i, lua_tonumber(L, i)); + break; + default: /* other values */ + pline("%i:%s", i, lua_typename(L, t)); + break; + } + } +} + +STATIC_OVL void sel_set_ter(x, y, arg) int x, y; genericptr_t arg; @@ -4258,7 +4177,7 @@ genericptr_t arg; } } -void +STATIC_OVL void sel_set_feature(x, y, arg) int x, y; genericptr_t arg; @@ -4268,7 +4187,7 @@ genericptr_t arg; levl[x][y].typ = (*(int *) arg); } -void +STATIC_OVL void sel_set_door(dx, dy, arg) int dx, dy; genericptr_t arg; @@ -4288,121 +4207,239 @@ genericptr_t arg; g.SpLev_Map[x][y] = 1; } -void -spo_door(coder) -struct sp_coder *coder; +/* door({ x = 1, y = 1, state = "nodoor" }); */ +/* door({ wall = "north", pos = 3, state="secret" }); */ +/* door("nodoor", 1, 2); */ +int +lspo_door(L) +lua_State *L; { - static const char nhFunc[] = "spo_door"; - struct opvar *msk, *sel; + int msk; + schar x,y; xchar typ; + const char *const doorstates[] = { "random", "open", "closed", "locked", "nodoor", "broken", "secret", NULL }; + const int doorstates2i[] = { -1, D_ISOPEN, D_CLOSED, D_LOCKED, D_NODOOR, D_BROKEN, D_SECRET }; + int argc = lua_gettop(L); - if (!OV_pop_i(msk) || !OV_pop_typ(sel, SPOVAR_SEL)) - return; + create_des_coder(); - typ = OV_i(msk) == -1 ? rnddoor() : (xchar) OV_i(msk); + if (argc == 3) { + msk = doorstates2i[luaL_checkoption(L, 1, "random", doorstates)]; + x = luaL_checkinteger(L, 2); + y = luaL_checkinteger(L, 3); - selection_iterate(sel, sel_set_door, (genericptr_t) &typ); + } else { + lcheck_param_table(L); - opvar_free(sel); - opvar_free(msk); + x = get_table_int_opt(L, "x", -1); + y = get_table_int_opt(L, "y", -1); + msk = doorstates2i[get_table_option(L, "state", "random", doorstates)]; + } + + typ = (msk == -1) ? rnddoor() : (xchar) msk; + + if (x == -1 && y == -1) { + const char *const walldirs[] = { "all", "random", "north", "west", "east", "south", NULL }; + const int walldirs2i[] = { W_ANY, W_ANY, W_NORTH, W_WEST, W_EAST, W_SOUTH, 0 }; + room_door tmpd; + + tmpd.secret = (typ == D_SECRET) ? 1 : 0; + tmpd.mask = msk; + tmpd.pos = get_table_int_opt(L, "pos", -1); + tmpd.wall = walldirs2i[get_table_option(L, "wall", "all", walldirs)]; + + create_door(&tmpd, g.coder->croom); + link_doors_rooms(); + } else { + /*selection_iterate(sel, sel_set_door, (genericptr_t) &typ);*/ + get_location_coord(&x, &y, ANY_LOC, g.coder->croom, SP_COORD_PACK(x,y)); + if (!isok(x,y)) + nhl_error(L, "door coord not ok"); + sel_set_door(x, y, (genericptr_t) &typ); + } + + return 0; } -void -spo_feature(coder) -struct sp_coder *coder; +/* feature("fountain", x, y); */ +/* feature("fountain", {x,y}); */ +/* feature({ type="fountain", x=NN, y=NN }); */ +int +lspo_feature(L) +lua_State *L; { - static const char nhFunc[] = "spo_feature"; - struct opvar *sel; + const char *const features[] = { "fountain", "sink", "pool", NULL }; + const int features2i[] = { FOUNTAIN, SINK, POOL, STONE }; + schar x,y; int typ; + int argc = lua_gettop(L); - if (!OV_pop_typ(sel, SPOVAR_SEL)) - return; + create_des_coder(); - switch (coder->opcode) { + if (argc == 2 && lua_type(L, 1) == LUA_TSTRING + && lua_type(L, 2) == LUA_TTABLE) { + int fx, fy; + typ = features2i[luaL_checkoption(L, 1, NULL, features)]; + get_coord(L, 2, &fx, &fy); + x = fx; + y = fy; + } else if (argc == 3) { + typ = features2i[luaL_checkoption(L, 1, NULL, features)]; + x = luaL_checkinteger(L, 2); + y = luaL_checkinteger(L, 3); + } else { + lcheck_param_table(L); + + x = get_table_int(L, "x"); + y = get_table_int(L, "y"); + typ = features2i[get_table_option(L, "type", NULL, features)]; + } + + get_location_coord(&x, &y, ANY_LOC, g.coder->croom, SP_COORD_PACK(x,y)); + + switch (typ) { default: - impossible("spo_feature called with wrong opcode %i.", coder->opcode); break; - case SPO_FOUNTAIN: + case FOUNTAIN: typ = FOUNTAIN; break; - case SPO_SINK: + case SINK: typ = SINK; break; - case SPO_POOL: + case POOL: typ = POOL; break; } - selection_iterate(sel, sel_set_feature, (genericptr_t) &typ); - opvar_free(sel); + if (typ == STONE) + impossible("feature has unknown type param."); + else + sel_set_feature(x, y, (genericptr_t) &typ); + + return 0; } -void -spo_terrain(coder) -struct sp_coder *coder; +/* terrain({ x=NN, y=NN, typ=MAPCHAR, lit=BOOL }); */ +/* terrain({ selection=SELECTION, typ=MAPCHAR, lit=BOOL }); */ +/* terrain( SELECTION, MAPCHAR [, BOOL ] ); */ +/* terrain({x,y}, MAPCHAR); */ +/* terrain(x,y, MAPCHAR); */ +int +lspo_terrain(L) +lua_State *L; { - static const char nhFunc[] = "spo_terrain"; terrain tmpterrain; - struct opvar *ter, *sel; + xchar x, y; + /* char *ter; */ /* REVIEW: unreferenced */ + struct selectionvar *sel = NULL; + int argc = lua_gettop(L); - if (!OV_pop_typ(ter, SPOVAR_MAPCHAR) || !OV_pop_typ(sel, SPOVAR_SEL)) - return; + create_des_coder(); - tmpterrain.ter = SP_MAPCHAR_TYP(OV_i(ter)); - tmpterrain.tlit = SP_MAPCHAR_LIT(OV_i(ter)); - selection_iterate(sel, sel_set_ter, (genericptr_t) &tmpterrain); + if (argc == 1) { + lcheck_param_table(L); - opvar_free(ter); - opvar_free(sel); + x = get_table_int_opt(L, "x", -1); + y = get_table_int_opt(L, "y", -1); + if (x == -1 && y == -1) { + lua_getfield(L, 1, "selection"); + sel = l_selection_check(L, -1); + lua_pop(L, 1); + } + tmpterrain.ter = get_table_mapchr(L, "typ"); + tmpterrain.tlit = get_table_int_opt(L, "lit", 0); + } else if (argc == 2 && lua_type(L, 1) == LUA_TTABLE + && lua_type(L, 2) == LUA_TSTRING) { + int tx, ty; + tmpterrain.ter = check_mapchr(luaL_checkstring(L, 2)); + lua_pop(L, 1); + get_coord(L, 1, &tx, &ty); + x = tx; + y = ty; + } else if (argc == 2) { + sel = l_selection_check(L, 1); + tmpterrain.ter = check_mapchr(luaL_checkstring(L, 2)); + tmpterrain.tlit = luaL_optinteger(L, 3, 0); /* FIXME: this can never be here, argc==2 */ + } else if (argc == 3) { + x = luaL_checkinteger(L, 1); + y = luaL_checkinteger(L, 2); + tmpterrain.ter = check_mapchr(luaL_checkstring(L, 3)); + tmpterrain.tlit = 0; + } else { + nhl_error(L, "wrong parameters"); + } + + if (tmpterrain.ter == INVALID_TYPE) + nhl_error(L, "Erroneous map char"); + + if (sel) { + selection_iterate(sel, sel_set_ter, (genericptr_t) &tmpterrain); + } else { + get_location_coord(&x, &y, ANY_LOC, g.coder->croom, SP_COORD_PACK(x,y)); + sel_set_ter(x,y, (genericptr_t) &tmpterrain); + } + + return 0; } -void -spo_replace_terrain(coder) -struct sp_coder *coder; +/* TODO: better parameters, allow selection instead of x1,y1,x2,y2 nonsense. + TODO: or remove, if terrain + selection can do this better? +*/ +/* replace_terrain({ x1=NN,y1=NN, x2=NN,y2=NN, fromterrain=MAPCHAR, toterrain=MAPCHAR, lit=N, chance=NN }); */ +/* replace_terrain({ region={x1,y1, x2,y2}, fromterrain=MAPCHAR, toterrain=MAPCHAR, lit=N, chance=NN }); */ +int +lspo_replace_terrain(L) +lua_State *L; { - static const char nhFunc[] = "spo_replace_terrain"; replaceterrain rt; - struct opvar *reg, *from_ter, *to_ter, *chance; + /* char *toter, *fromter; */ /* REVIEW: unreferenced */ + xchar totyp, fromtyp; - if (!OV_pop_i(chance) || !OV_pop_typ(to_ter, SPOVAR_MAPCHAR) - || !OV_pop_typ(from_ter, SPOVAR_MAPCHAR) || !OV_pop_r(reg)) - return; + create_des_coder(); - rt.chance = OV_i(chance); - rt.tolit = SP_MAPCHAR_LIT(OV_i(to_ter)); - rt.toter = SP_MAPCHAR_TYP(OV_i(to_ter)); - rt.fromter = SP_MAPCHAR_TYP(OV_i(from_ter)); - /* TODO: use SP_MAPCHAR_LIT(OV_i(from_ter)) too */ - rt.x1 = SP_REGION_X1(OV_i(reg)); - rt.y1 = SP_REGION_Y1(OV_i(reg)); - rt.x2 = SP_REGION_X2(OV_i(reg)); - rt.y2 = SP_REGION_Y2(OV_i(reg)); + lcheck_param_table(L); - replace_terrain(&rt, coder->croom); + totyp = get_table_mapchr(L, "toterrain"); - opvar_free(reg); - opvar_free(from_ter); - opvar_free(to_ter); - opvar_free(chance); + fromtyp = get_table_mapchr(L, "fromterrain"); + + rt.chance = get_table_int_opt(L, "chance", 100); + rt.tolit = get_table_int_opt(L, "lit", 1); + rt.toter = totyp; + rt.fromter = fromtyp; + rt.x1 = get_table_int_opt(L, "x1", -1); + rt.y1 = get_table_int_opt(L, "y1", -1); + rt.x2 = get_table_int_opt(L, "x2", -1); + rt.y2 = get_table_int_opt(L, "y2", -1); + + if (rt.x1 == -1 && rt.y1 == -1 && rt.x2 == -1 && rt.y2 == -1) { + int rx1, ry1, rx2, ry2; + get_table_region(L, "region", &rx1, &ry1, &rx2, &ry2, FALSE); + rt.x1 = rx1; rt.y1 = ry1; + rt.x2 = rx2; rt.y2 = ry2; + } + + replace_terrain(&rt, g.coder->croom); + + return 0; } STATIC_OVL boolean generate_way_out_method(nx,ny, ov) int nx,ny; -struct opvar *ov; +struct selectionvar *ov; { - static const char nhFunc[] = "generate_way_out_method"; const int escapeitems[] = { PICK_AXE, DWARVISH_MATTOCK, WAN_DIGGING, WAN_TELEPORTATION, SCR_TELEPORTATION, RIN_TELEPORTATION }; - struct opvar *ov2 = selection_opvar((char *) 0), *ov3; + struct selectionvar *ov2 = selection_new(), *ov3; schar x, y; boolean res = TRUE; selection_floodfill(ov2, nx, ny, TRUE); - ov3 = opvar_clone(ov2); + ov3 = selection_clone(ov2); /* try to make a secret door */ while (selection_rndcoord(ov3, &x, &y, TRUE)) { @@ -4438,8 +4475,8 @@ struct opvar *ov; /* try to make a hole or a trapdoor */ if (Can_fall_thru(&u.uz)) { - opvar_free(ov3); - ov3 = opvar_clone(ov2); + selection_free(ov3); + ov3 = selection_clone(ov2); while (selection_rndcoord(ov3, &x, &y, TRUE)) { if (maketrap(x,y, rn2(2) ? HOLE : TRAPDOOR)) goto gotitdone; @@ -4454,16 +4491,15 @@ struct opvar *ov; res = FALSE; gotitdone: - opvar_free(ov2); - opvar_free(ov3); + selection_free(ov2); + selection_free(ov3); return res; } STATIC_OVL void ensure_way_out() { - static const char nhFunc[] = "ensure_way_out"; - struct opvar *ov = selection_opvar((char *) 0); + struct selectionvar *ov = selection_new(); struct trap *ttmp = g.ftrap; int x,y; boolean ret = TRUE; @@ -4500,55 +4536,108 @@ ensure_way_out() } outhere: ; } while (!ret); - opvar_free(ov); + selection_free(ov); +} + +int +get_table_intarray_entry(L, tableidx, entrynum) +lua_State *L; +int tableidx, entrynum; +{ + int ret = 0; + if (tableidx < 0) + tableidx--; + + lua_pushinteger(L, entrynum); + lua_gettable(L, tableidx); + if (lua_isnumber(L, -1)) { + ret = lua_tonumber(L, -1); + } else { + char buf[BUFSZ]; + Sprintf(buf, "Array entry #%i is %s, expected number", + 1, luaL_typename(L, -1)); + nhl_error(L, buf); + } + lua_pop(L, 1); + return ret; +} + +STATIC_OVL int +get_table_region(L, name, x1,y1, x2,y2, optional) +lua_State *L; +const char *name; +int *x1, *y1, *x2, *y2; +boolean optional; +{ + int arrlen /*, i*/ /* REVIEW: unreferenced */; + /* int retvals[4]; */ /* REVIEW: unreferenced */ + + lua_getfield(L, 1, name); + if (optional && lua_type(L, -1) == LUA_TNIL) { + lua_pop(L, 1); + return 1; + } + + luaL_checktype(L, -1, LUA_TTABLE); + + lua_len(L, -1); + arrlen = lua_tonumber(L, -1); + lua_pop(L, 1); + if (arrlen != 4) { + nhl_error(L, "Not a region"); + lua_pop(L, 1); + return 0; + } + + *x1 = get_table_intarray_entry(L, -1, 1); + *y1 = get_table_intarray_entry(L, -1, 2); + *x2 = get_table_intarray_entry(L, -1, 3); + *y2 = get_table_intarray_entry(L, -1, 4); + + lua_pop(L, 1); + return 1; +} + +STATIC_OVL int +get_coord(L, index, x, y) +lua_State *L; +int index; +int *x, *y; +{ + if (lua_type(L, index) == LUA_TTABLE) { + int arrlen; + + lua_len(L, index); + arrlen = lua_tonumber(L, -1); + lua_pop(L, 1); + if (arrlen != 2) { + nhl_error(L, "Not a coordinate"); + return 0; + } + + *x = get_table_intarray_entry(L, index, 1); + *y = get_table_intarray_entry(L, index, 2); + + return 1; + } + return 0; } void -spo_levregion(coder) -struct sp_coder *coder; +levregion_add(lregion) +lev_region *lregion; { - static const char nhFunc[] = "spo_levregion"; - struct opvar *rname, *padding, *rtype, *del_islev, *dy2, *dx2, *dy1, *dx1, - *in_islev, *iy2, *ix2, *iy1, *ix1; - - lev_region *tmplregion; - - if (!OV_pop_s(rname) || !OV_pop_i(padding) || !OV_pop_i(rtype) - || !OV_pop_i(del_islev) || !OV_pop_i(dy2) || !OV_pop_i(dx2) - || !OV_pop_i(dy1) || !OV_pop_i(dx1) || !OV_pop_i(in_islev) - || !OV_pop_i(iy2) || !OV_pop_i(ix2) || !OV_pop_i(iy1) - || !OV_pop_i(ix1)) - return; - - tmplregion = (lev_region *) alloc(sizeof(lev_region)); - - tmplregion->inarea.x1 = OV_i(ix1); - tmplregion->inarea.y1 = OV_i(iy1); - tmplregion->inarea.x2 = OV_i(ix2); - tmplregion->inarea.y2 = OV_i(iy2); - - tmplregion->delarea.x1 = OV_i(dx1); - tmplregion->delarea.y1 = OV_i(dy1); - tmplregion->delarea.x2 = OV_i(dx2); - tmplregion->delarea.y2 = OV_i(dy2); - - tmplregion->in_islev = OV_i(in_islev); - tmplregion->del_islev = OV_i(del_islev); - tmplregion->rtype = OV_i(rtype); - tmplregion->padding = OV_i(padding); - tmplregion->rname.str = dupstr(OV_s(rname)); - - if (!tmplregion->in_islev) { - get_location(&tmplregion->inarea.x1, &tmplregion->inarea.y1, ANY_LOC, + if (!lregion->in_islev) { + get_location(&lregion->inarea.x1, &lregion->inarea.y1, ANY_LOC, (struct mkroom *) 0); - get_location(&tmplregion->inarea.x2, &tmplregion->inarea.y2, ANY_LOC, + get_location(&lregion->inarea.x2, &lregion->inarea.y2, ANY_LOC, (struct mkroom *) 0); } - if (!tmplregion->del_islev) { - get_location(&tmplregion->delarea.x1, &tmplregion->delarea.y1, + if (!lregion->del_islev) { + get_location(&lregion->delarea.x1, &lregion->delarea.y1, ANY_LOC, (struct mkroom *) 0); - get_location(&tmplregion->delarea.x2, &tmplregion->delarea.y2, + get_location(&lregion->delarea.x2, &lregion->delarea.y2, ANY_LOC, (struct mkroom *) 0); } if (g.num_lregions) { @@ -4565,59 +4654,176 @@ struct sp_coder *coder; g.num_lregions = 1; g.lregions = (lev_region *) alloc(sizeof(lev_region)); } - (void) memcpy(&g.lregions[g.num_lregions - 1], tmplregion, + (void) memcpy(&g.lregions[g.num_lregions - 1], lregion, sizeof(lev_region)); - free(tmplregion); - - opvar_free(dx1); - opvar_free(dy1); - opvar_free(dx2); - opvar_free(dy2); - - opvar_free(ix1); - opvar_free(iy1); - opvar_free(ix2); - opvar_free(iy2); - - opvar_free(del_islev); - opvar_free(in_islev); - opvar_free(rname); - opvar_free(rtype); - opvar_free(padding); } -void -spo_region(coder) -struct sp_coder *coder; +/* teleport_region({ region = { x1,y1, x2,y2} }); */ +/* teleport_region({ region = { x1,y1, x2,y2}, [ region_islev = 1, ] exclude = { x1,y1, x2,y2}, [ exclude_islen = 1, ] [ dir = "up" ] }); */ +/* TODO: maybe allow using selection, with a new selection method "getextents()"? */ +int +lspo_teleport_region(L) +lua_State *L; +{ + const char *const teledirs[] = { "both", "down", "up", NULL }; + const int teledirs2i[] = { LR_TELE, LR_DOWNTELE, LR_UPTELE, -1 }; + lev_region tmplregion; + int x1,y1,x2,y2; + + create_des_coder(); + + lcheck_param_table(L); + + get_table_region(L, "region", &x1, &y1, &x2, &y2, FALSE); + tmplregion.inarea.x1 = x1; + tmplregion.inarea.y1 = y1; + tmplregion.inarea.x2 = x2; + tmplregion.inarea.y2 = y2; + + x1 = y1 = x2 = y2 = 0; + get_table_region(L, "exclude", &x1, &y1, &x2, &y2, TRUE); + tmplregion.delarea.x1 = x1; + tmplregion.delarea.y1 = y1; + tmplregion.delarea.x2 = x2; + tmplregion.delarea.y2 = y2; + + tmplregion.in_islev = get_table_boolean_opt(L, "region_islev", 0); + tmplregion.del_islev = get_table_boolean_opt(L, "exclude_islev", 0); + + tmplregion.rtype = teledirs2i[get_table_option(L, "dir", "both", teledirs)]; + tmplregion.padding = 0; + tmplregion.rname.str = NULL; + + levregion_add(&tmplregion); + + return 0; +} + +/* TODO: FIXME + from lev_comp SPO_LEVREGION was called as: + - STAIR:(x1,y1,x2,y2),(x1,y1,x2,y2),dir + - PORTAL:(x1,y1,x2,y2),(x1,y1,x2,y2),string + - BRANCH:(x1,y1,x2,y2),(x1,y1,x2,y2),dir + +*/ +/* levregion({ region = { x1,y1, x2,y2 }, exclude = { x1,y1, x2,y2 }, type = "portal", name="air" }); */ +/* TODO: allow region to be optional, defaulting to whole level */ +int +lspo_levregion(L) +lua_State *L; +{ + const char *const regiontypes[] = { "stair-down", "stair-up", "portal", "branch", "teleport", "teleport-up", "teleport-down", NULL }; + const int regiontypes2i[] = { LR_DOWNSTAIR, LR_UPSTAIR, LR_PORTAL, LR_BRANCH, LR_TELE, LR_UPTELE, LR_DOWNTELE, 0 }; + lev_region tmplregion; + int x1,y1,x2,y2; + + create_des_coder(); + + lcheck_param_table(L); + + get_table_region(L, "region", &x1, &y1, &x2, &y2, FALSE); + + tmplregion.inarea.x1 = x1; + tmplregion.inarea.y1 = y1; + tmplregion.inarea.x2 = x2; + tmplregion.inarea.y2 = y2; + + x1 = y1 = x2 = y2 = 0; + get_table_region(L, "exclude", &x1, &y1, &x2, &y2, TRUE); + + tmplregion.delarea.x1 = x1; + tmplregion.delarea.y1 = y1; + tmplregion.delarea.x2 = x2; + tmplregion.delarea.y2 = y2; + + tmplregion.in_islev = get_table_boolean_opt(L, "region_islev", 0); + tmplregion.del_islev = get_table_boolean_opt(L, "exclude_islev", 0); + tmplregion.rtype = regiontypes2i[get_table_option(L, "type", "stair-down", regiontypes)]; + tmplregion.padding = get_table_int_opt(L, "padding", 0); + tmplregion.rname.str = get_table_str_opt(L, "name", NULL); + + levregion_add(&tmplregion); + + return 0; +} + + +void +sel_set_lit(x, y, arg) +int x, y; +genericptr_t arg; +{ + int lit = *(int *)arg; + + levl[x][y].lit = (levl[x][y].typ == LAVAPOOL) ? 1 : lit; +} + +/* region(selection, lit); */ +/* region({ x1=NN, y1=NN, x2=NN, y2=NN, lit=BOOL, type=ROOMTYPE, joined=BOOL, irregular=BOOL, prefilled=BOOL [ , contents = FUNCTION ] }); */ +/* region({ region={x1,y1, x2,y2}, type="ordinary" }); */ +int +lspo_region(L) +lua_State *L; { - static const char nhFunc[] = "spo_region"; - struct opvar *rtype, *rlit, *rflags, *area; xchar dx1, dy1, dx2, dy2; register struct mkroom *troom; - boolean prefilled, room_not_needed, irregular, joined; + boolean prefilled = FALSE, room_not_needed, irregular = FALSE, joined = TRUE; + int rtype = OROOM, rlit = 1; + int argc = lua_gettop(L); - if (!OV_pop_i(rflags) || !OV_pop_i(rtype) || !OV_pop_i(rlit) - || !OV_pop_r(area)) - return; + create_des_coder(); - prefilled = !(OV_i(rflags) & (1 << 0)); - irregular = (OV_i(rflags) & (1 << 1)); - joined = !(OV_i(rflags) & (1 << 2)); + if (argc <= 1) { + lcheck_param_table(L); - if (OV_i(rtype) > MAXRTYPE) { - OV_i(rtype) -= MAXRTYPE + 1; - prefilled = TRUE; - } else - prefilled = FALSE; + /* TODO: check the prefilled, what was the default in lev_comp? */ + /* "unfilled" == 0, "filled" == 1, missing = "filled" */ - if (OV_i(rlit) < 0) - OV_i(rlit) = - (rnd(1 + abs(depth(&u.uz))) < 11 && rn2(77)) ? TRUE : FALSE; + /* TODO: "unfilled" ==> prefilled=1 */ + prefilled = get_table_boolean_opt(L, "prefilled", 0); + irregular = get_table_boolean_opt(L, "irregular", 0); + joined = get_table_boolean_opt(L, "joined", 1); + rtype = get_table_roomtype_opt(L, "type", OROOM); + rlit = get_table_int_opt(L, "lit", -1); + dx1 = get_table_int_opt(L, "x1", -1); /* TODO: area */ + dy1 = get_table_int_opt(L, "y1", -1); + dx2 = get_table_int_opt(L, "x2", -1); + dy2 = get_table_int_opt(L, "y2", -1); - dx1 = SP_REGION_X1(OV_i(area)); - dy1 = SP_REGION_Y1(OV_i(area)); - dx2 = SP_REGION_X2(OV_i(area)); - dy2 = SP_REGION_Y2(OV_i(area)); + if (dx1 == -1 && dy1 == -1 && dx2 == -1 && dy2 == -1) { + int rx1, ry1, rx2, ry2; + get_table_region(L, "region", &rx1, &ry1, &rx2, &ry2, FALSE); + dx1 = rx1; dy1 = ry1; + dx2 = rx2; dy2 = ry2; + } + if (dx1 == -1 && dy1 == -1 && dx2 == -1 && dy2 == -1) { + nhl_error(L, "region needs region"); + } + + } else if (argc == 2) { + /* region(selection, "lit"); */ + const char *const lits[] = { "unlit", "lit", NULL }; + struct selectionvar *sel = l_selection_check(L, 1); + + rlit = luaL_checkoption(L, 2, "lit", lits); + + /* + TODO: adjust region size for wall, but only if lit + TODO: lit=random + */ + if (rlit) + selection_do_grow(sel, W_ANY); + selection_iterate(sel, sel_set_lit, (genericptr_t) &rlit); + + /* TODO: skip the rest of this function? */ + return 0; + } else { + nhl_error(L, "Wrong parameters"); + return 0; + } + + if (rlit < 0) + rlit = (rnd(1 + abs(depth(&u.uz))) < 11 && rn2(77)) ? TRUE : FALSE; get_location(&dx1, &dy1, ANY_LOC, (struct mkroom *) 0); get_location(&dx2, &dy2, ANY_LOC, (struct mkroom *) 0); @@ -4625,30 +4831,25 @@ struct sp_coder *coder; /* for an ordinary room, `prefilled' is a flag to force an actual room to be created (such rooms are used to control placement of migrating monster arrivals) */ - room_not_needed = (OV_i(rtype) == OROOM && !irregular && !prefilled); + room_not_needed = (rtype == OROOM && !irregular && !prefilled); if (room_not_needed || g.nroom >= MAXNROFROOMS) { region tmpregion; if (!room_not_needed) impossible("Too many rooms on new level!"); - tmpregion.rlit = OV_i(rlit); + tmpregion.rlit = rlit; tmpregion.x1 = dx1; tmpregion.y1 = dy1; tmpregion.x2 = dx2; tmpregion.y2 = dy2; light_region(&tmpregion); - opvar_free(area); - opvar_free(rflags); - opvar_free(rlit); - opvar_free(rtype); - - return; + return 0; } troom = &g.rooms[g.nroom]; /* mark rooms that must be filled, but do it later */ - if (OV_i(rtype) != OROOM) + if (rtype != OROOM) troom->needfill = (prefilled ? 2 : 1); troom->needjoining = joined; @@ -4657,13 +4858,12 @@ struct sp_coder *coder; g.min_rx = g.max_rx = dx1; g.min_ry = g.max_ry = dy1; g.smeq[g.nroom] = g.nroom; - flood_fill_rm(dx1, dy1, g.nroom + ROOMOFFSET, OV_i(rlit), TRUE); - add_room(g.min_rx, g.min_ry, g.max_rx, g.max_ry, FALSE, OV_i(rtype), - TRUE); - troom->rlit = OV_i(rlit); + flood_fill_rm(dx1, dy1, g.nroom + ROOMOFFSET, rlit, TRUE); + add_room(g.min_rx, g.min_ry, g.max_rx, g.max_ry, FALSE, rtype, TRUE); + troom->rlit = rlit; troom->irregular = TRUE; } else { - add_room(dx1, dy1, dx2, dy2, OV_i(rlit), OV_i(rtype), TRUE); + add_room(dx1, dy1, dx2, dy2, rlit, rtype, TRUE); #ifdef SPECIALIZATION topologize(troom, FALSE); /* set roomno */ #else @@ -4672,68 +4872,111 @@ struct sp_coder *coder; } if (!room_not_needed) { - if (coder->n_subroom > 1) + if (g.coder->n_subroom > 1) impossible("region as subroom"); else { - coder->tmproomlist[coder->n_subroom] = troom; - coder->failed_room[coder->n_subroom] = FALSE; - coder->n_subroom++; + g.coder->tmproomlist[g.coder->n_subroom] = troom; + g.coder->failed_room[g.coder->n_subroom] = FALSE; + g.coder->n_subroom++; + update_croom(); + lua_getfield(L, 1, "contents"); + if (lua_type(L, -1) == LUA_TFUNCTION) { + lua_remove(L, -2); + lua_call(L, 0, 0); + } else + lua_pop(L, 1); + spo_endroom(g.coder); } } - opvar_free(area); - opvar_free(rflags); - opvar_free(rlit); - opvar_free(rtype); + return 0; } -void -spo_drawbridge(coder) -struct sp_coder *coder; +/* drawbridge({ dir="east", state="closed", x=05,y=08}); */ +int +lspo_drawbridge(L) +lua_State *L; { - static const char nhFunc[] = "spo_drawbridge"; + const char *const mwdirs[] = { "north", "south", "west", "east", "random", NULL }; + const int mwdirs2i[] = { DB_NORTH, DB_SOUTH, DB_WEST, DB_EAST, -1, -2 }; + const char *const dbopens[] = { "open", "closed", "random", NULL }; + const int dbopens2i[] = { 1, 0, -1, -2 }; xchar x, y; - int dopen; - struct opvar *dir, *db_open, *dcoord; +/* int dbopen; */ + int mx, my, dir; + int db_open; + long dcoord; - if (!OV_pop_i(dir) || !OV_pop_i(db_open) || !OV_pop_c(dcoord)) - return; + create_des_coder(); - get_location_coord(&x, &y, DRY | WET | HOT, coder->croom, OV_i(dcoord)); - if ((dopen = OV_i(db_open)) == -1) - dopen = !rn2(2); - if (!create_drawbridge(x, y, OV_i(dir), dopen ? TRUE : FALSE)) + lcheck_param_table(L); + + mx = get_table_int(L, "x"); + my = get_table_int(L, "y"); + dir = mwdirs2i[get_table_option(L, "dir", "random", mwdirs)]; + dcoord = SP_COORD_PACK(mx, my); + db_open = dbopens2i[get_table_option(L, "state", "random", dbopens)]; + x = mx; + y = my; + + get_location_coord(&x, &y, DRY | WET | HOT, g.coder->croom, dcoord); + /* REVIEW: from here down was using dbopen previously */ + if (db_open == -1) + db_open = !rn2(2); + if (!create_drawbridge(x, y, dir, db_open ? TRUE : FALSE)) impossible("Cannot create drawbridge."); g.SpLev_Map[x][y] = 1; - opvar_free(dcoord); - opvar_free(db_open); - opvar_free(dir); + return 0; } -void -spo_mazewalk(coder) -struct sp_coder *coder; +/* mazewalk({ x = NN, y = NN, typ = ".", dir = "north", stocked = 0 }); */ +/* mazewalk(x,y,dir); */ +int +lspo_mazewalk(L) +lua_State *L; { - static const char nhFunc[] = "spo_mazewalk"; + const char *const mwdirs[] = { "north", "south", "east", "west", "random", NULL }; + const int mwdirs2i[] = { W_NORTH, W_SOUTH, W_EAST, W_WEST, -1, -2 }; xchar x, y; - struct opvar *ftyp, *fstocked, *fdir, *mcoord; - int dir; + int mx, my; + xchar ftyp = ROOM; + int fstocked = 1, dir = -1; + long mcoord; + int argc = lua_gettop(L); - if (!OV_pop_i(ftyp) || !OV_pop_i(fstocked) || !OV_pop_i(fdir) - || !OV_pop_c(mcoord)) - return; + create_des_coder(); - dir = OV_i(fdir); + if (argc == 3) { + mx = luaL_checkinteger(L, 1); + my = luaL_checkinteger(L, 2); + dir = mwdirs2i[luaL_checkoption(L, 3, "random", mwdirs)]; + } else { + lcheck_param_table(L); - get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(mcoord)); - if (!isok(x, y)) - return; - - if (OV_i(ftyp) < 1) { - OV_i(ftyp) = g.level.flags.corrmaze ? CORR : ROOM; + mx = get_table_int(L, "x"); + my = get_table_int(L, "y"); + ftyp = get_table_mapchr_opt(L, "typ", ROOM); + fstocked = get_table_boolean_opt(L, "stocked", 1); + dir = mwdirs2i[get_table_option(L, "dir", "random", mwdirs)]; } + mcoord = SP_COORD_PACK(mx, my); + x = mx; + y = my; + + get_location_coord(&x, &y, ANY_LOC, g.coder->croom, mcoord); + + if (!isok(x, y)) + return 0; + + if (ftyp < 1) { + ftyp = g.level.flags.corrmaze ? CORR : ROOM; + } + + if (dir == -1) + dir = mwdirs2i[rn2(4)]; + /* don't use move() - it doesn't use W_NORTH, etc. */ switch (dir) { case W_NORTH: @@ -4749,11 +4992,11 @@ struct sp_coder *coder; --x; break; default: - impossible("spo_mazewalk: Bad MAZEWALK direction"); + impossible("mazewalk: Bad direction"); } if (!IS_DOOR(levl[x][y].typ)) { - levl[x][y].typ = OV_i(ftyp); + levl[x][y].typ = ftyp; levl[x][y].flags = 0; } @@ -4769,7 +5012,7 @@ struct sp_coder *coder; x--; /* no need for IS_DOOR check; out of map bounds */ - levl[x][y].typ = OV_i(ftyp); + levl[x][y].typ = ftyp; levl[x][y].flags = 0; } @@ -4780,70 +5023,121 @@ struct sp_coder *coder; y--; } - walkfrom(x, y, OV_i(ftyp)); - if (OV_i(fstocked)) + walkfrom(x, y, ftyp); + if (fstocked) fill_empty_maze(); - opvar_free(mcoord); - opvar_free(fdir); - opvar_free(fstocked); - opvar_free(ftyp); + return 0; } -void -spo_wall_property(coder) -struct sp_coder *coder; +/* wall_property({ x1=0, y1=0, x2=78, y2=20, property="nondiggable" }); */ +/* wall_property({ region = {1,0, 78,20}, property="nonpasswall" }); */ +int +lspo_wall_property(L) +lua_State *L; { - static const char nhFunc[] = "spo_wall_property"; - struct opvar *r; - xchar dx1, dy1, dx2, dy2; - int wprop = (coder->opcode == SPO_NON_DIGGABLE) - ? W_NONDIGGABLE - : W_NONPASSWALL; + const char *const wprops[] = { "nondiggable", "nonpasswall", NULL }; + const int wprop2i[] = { W_NONDIGGABLE, W_NONPASSWALL, -1 }; + schar dx1 = -1, dy1 = -1, dx2 = -1, dy2 = -1; + int wprop; - if (!OV_pop_r(r)) - return; + create_des_coder(); - dx1 = SP_REGION_X1(OV_i(r)); - dy1 = SP_REGION_Y1(OV_i(r)); - dx2 = SP_REGION_X2(OV_i(r)); - dy2 = SP_REGION_Y2(OV_i(r)); + lcheck_param_table(L); + + dx1 = get_table_int_opt(L, "x1", -1); + dy1 = get_table_int_opt(L, "y1", -1); + dx2 = get_table_int_opt(L, "x2", -1); + dy2 = get_table_int_opt(L, "y2", -1); + + if (dx1 == -1 && dy1 == -1 && dx2 == -1 && dy2 == -1) { + int rx1, ry1, rx2, ry2; + get_table_region(L, "region", &rx1, &ry1, &rx2, &ry2, FALSE); + dx1 = rx1; dy1 = ry1; + dx2 = rx2; dy2 = ry2; + } + + wprop = wprop2i[get_table_option(L, "property", "nondiggable", wprops)]; + + if (dx1 == -1) + dx1 = g.xstart - 1; + if (dy1 == -1) + dy1 = g.ystart - 1; + if (dx2 == -1) + dx2 = g.xstart + g.xsize + 1; + if (dy2 == -1) + dy2 = g.ystart + g.ysize + 1; get_location(&dx1, &dy1, ANY_LOC, (struct mkroom *) 0); get_location(&dx2, &dy2, ANY_LOC, (struct mkroom *) 0); set_wall_property(dx1, dy1, dx2, dy2, wprop); - opvar_free(r); + return 0; } -void -spo_room_door(coder) -struct sp_coder *coder; +/* non_diggable(selection); */ +/* non_diggable(); */ +int +lspo_non_diggable(L) +lua_State *L; { - static const char nhFunc[] = "spo_room_door"; - struct opvar *wall, *secret, *mask, *pos; - room_door tmpd; + int prop = W_NONDIGGABLE; + int argc = lua_gettop(L); + struct selectionvar *sel = (struct selectionvar *) 0; + /* REVIEW: compiler warning, + all assignments conditional + so initializer was added */ - if (!OV_pop_i(wall) || !OV_pop_i(secret) || !OV_pop_i(mask) - || !OV_pop_i(pos) || !coder->croom) - return; + create_des_coder(); - tmpd.secret = OV_i(secret); - tmpd.mask = OV_i(mask); - tmpd.pos = OV_i(pos); - tmpd.wall = OV_i(wall); + if (argc == 1) + sel = l_selection_check(L, -1); + else if (argc == 0) { + sel = selection_new(); + selection_not(sel); + } - create_door(&tmpd, coder->croom); + if (sel) + selection_iterate(sel, sel_set_wall_property, (genericptr_t) &prop); - opvar_free(wall); - opvar_free(secret); - opvar_free(mask); - opvar_free(pos); + /* TODO: Free(sel)? */ + + return 0; +} + +/* non_passwall(selection); */ +/* non_passwall(); */ +int +lspo_non_passwall(L) +lua_State *L; +{ + int prop = W_NONPASSWALL; + int argc = lua_gettop(L); + struct selectionvar *sel = (struct selectionvar *) 0; + /* REVIEW: compiler warning, + all assignments conditional + so initializer was added */ + + create_des_coder(); + + if (argc == 1) + sel = l_selection_check(L, -1); + else if (argc == 0) { + sel = selection_new(); + selection_not(sel); + } + + if (sel) + selection_iterate(sel, sel_set_wall_property, (genericptr_t) &prop); + + /* TODO: Free(sel)? */ + + return 0; } /*ARGSUSED*/ -void +STATIC_OVL void sel_set_wallify(x, y, arg) int x, y; genericptr_t arg UNUSED; @@ -4851,78 +5145,141 @@ genericptr_t arg UNUSED; wallify_map(x, y, x, y); } -void -spo_wallify(coder) -struct sp_coder *coder; +/* TODO: wallify(selection) */ +/* wallify({ x1=NN,y1=NN, x2=NN,y2=NN }); */ +/* wallify(); */ +int +lspo_wallify(L) +lua_State *L; { - static const char nhFunc[] = "spo_wallify"; - struct opvar *typ, *r; - int dx1, dy1, dx2, dy2; + int dx1 = -1, dy1 = -1, dx2 = -1, dy2 = -1; - if (!OV_pop_i(typ)) - return; - switch (OV_i(typ)) { - default: - case 0: - if (!OV_pop_r(r)) - return; - dx1 = (xchar) SP_REGION_X1(OV_i(r)); - dy1 = (xchar) SP_REGION_Y1(OV_i(r)); - dx2 = (xchar) SP_REGION_X2(OV_i(r)); - dy2 = (xchar) SP_REGION_Y2(OV_i(r)); - wallify_map(dx1 < 0 ? (g.xstart - 1) : dx1, - dy1 < 0 ? (g.ystart - 1) : dy1, - dx2 < 0 ? (g.xstart + g.xsize + 1) : dx2, - dy2 < 0 ? (g.ystart + g.ysize + 1) : dy2); - break; - case 1: - if (!OV_pop_typ(r, SPOVAR_SEL)) - return; - selection_iterate(r, sel_set_wallify, NULL); - break; + /* TODO: clamp coord values */ + /* TODO: maybe allow wallify({x1,y1}, {x2,y2}) */ + /* TODO: is_table_coord(), is_table_area(), get_table_coord(), get_table_area() */ + + create_des_coder(); + + if (lua_gettop(L) == 1) { + dx1 = get_table_int(L, "x1"); + dy1 = get_table_int(L, "y1"); + dx2 = get_table_int(L, "x2"); + dy2 = get_table_int(L, "y2"); } - opvar_free(r); - opvar_free(typ); + + wallify_map(dx1 < 0 ? (g.xstart - 1) : dx1, + dy1 < 0 ? (g.ystart - 1) : dy1, + dx2 < 0 ? (g.xstart + g.xsize + 1) : dx2, + dy2 < 0 ? (g.ystart + g.ysize + 1) : dy2); + + return 0; } -void -spo_map(coder) -struct sp_coder *coder; +/* reset_level is only needed for testing purposes */ +int +lspo_reset_level(L) +lua_State *L; +{ + boolean wtower = In_W_tower(u.ux, u.uy, &u.uz); + + create_des_coder(); + makemap_prepost(TRUE, wtower); + clear_level_structures(); + return 0; /* REVIEW: warning, int fn must return value + so added "return 0; " */ +} + +/* map({ x = 10, y = 10, map = [[...]] }); */ +/* map({ halign = "center", valign = "center", map = [[...]] }); */ +/* map([[...]]) */ +int +lspo_map(L) +lua_State *L; { - static const char nhFunc[] = "spo_map"; mazepart tmpmazepart; - struct opvar *mpxs, *mpys, *mpmap, *mpa, *mpkeepr, *mpzalign; - xchar halign, valign; + /* xchar halign, valign; */ /* REVIEW: unreferenced */ xchar tmpxstart, tmpystart, tmpxsize, tmpysize; - unpacked_coord upc; + /* unpacked_coord upc; */ /* REVIEW: unreferenced */ - if (!OV_pop_i(mpxs) || !OV_pop_i(mpys) || !OV_pop_s(mpmap) - || !OV_pop_i(mpkeepr) || !OV_pop_i(mpzalign) || !OV_pop_c(mpa)) - return; + /* +TODO: allow passing an array of strings as map data +TODO: handle if map lines aren't same length +TODO: g.coder->croom needs to be updated + */ - tmpmazepart.xsize = OV_i(mpxs); - tmpmazepart.ysize = OV_i(mpys); - tmpmazepart.zaligntyp = OV_i(mpzalign); + const char *const left_or_right[] = { "left", "half-left", "center", "half-right", "right", "none", NULL }; + const int l_or_r2i[] = { LEFT, H_LEFT, CENTER, H_RIGHT, RIGHT, -1, -1 }; + const char *const top_or_bot[] = { "top", "center", "bottom", "none", NULL }; + const int t_or_b2i[] = { TOP, CENTER, BOTTOM, -1, -1 }; + int lr, tb, keepregion = 1, x, y; + char *tmps, *mapdata; + int mapwid, maphei = 0; + int argc = lua_gettop(L); - upc = get_unpacked_coord(OV_i(mpa), ANY_LOC); - tmpmazepart.halign = upc.x; - tmpmazepart.valign = upc.y; + create_des_coder(); + if (argc == 1 && lua_type(L, 1) == LUA_TSTRING) { + lr = tb = CENTER; + mapdata = dupstr(luaL_checkstring(L, 1)); + } else { + lcheck_param_table(L); + lr = l_or_r2i[get_table_option(L, "halign", "none", left_or_right)]; + tb = t_or_b2i[get_table_option(L, "valign", "none", top_or_bot)]; + keepregion = get_table_boolean_opt(L, "keepregion", 1); /* TODO: maybe rename? */ + x = get_table_int_opt(L, "x", -1); + y = get_table_int_opt(L, "y", -1); + mapdata = get_table_str(L, "map"); + } + + (void) stripdigits(mapdata); + mapwid = str_lines_maxlen(mapdata); + tmps = mapdata; + while (tmps && *tmps) { + char *s1 = index(tmps, '\n'); + if (maphei > MAP_Y_LIM) + break; + if (s1) + s1++; + tmps = s1; + maphei++; + } + + /* keepregion restricts the coordinates of the commands coming after the map + into the map region */ + /* for keepregion */ tmpxsize = g.xsize; tmpysize = g.ysize; tmpxstart = g.xstart; tmpystart = g.ystart; - halign = tmpmazepart.halign; - valign = tmpmazepart.valign; - g.xsize = tmpmazepart.xsize; - g.ysize = tmpmazepart.ysize; - switch (tmpmazepart.zaligntyp) { - default: - case 0: - break; - case 1: - switch ((int) halign) { + + g.xsize = tmpmazepart.xsize = mapwid; + g.ysize = tmpmazepart.ysize = maphei; + tmpmazepart.halign = lr; + tmpmazepart.valign = tb; + + if (lr == -1 && tb == -1) { + if (isok(x,y)) { + /* x,y is given, place map starting at x,y */ + if (g.coder->croom) { + /* in a room? adjust to room relative coords */ + g.xstart = x + g.coder->croom->lx; + g.ystart = y + g.coder->croom->ly; + g.xsize = min(tmpmazepart.xsize, (g.coder->croom->hx - g.coder->croom->lx)); + g.ysize = min(tmpmazepart.ysize, (g.coder->croom->hy - g.coder->croom->ly)); + } else { + g.xsize = tmpmazepart.xsize; + g.ysize = tmpmazepart.ysize; + g.xstart = x; + g.ystart = y; + } + } else { + nhl_error(L, "Map requires either x,y or halign,valign params"); + return 0; + } + } else { + /* place map starting at halign,valign */ + switch (lr) { case LEFT: g.xstart = g.splev_init_present ? 1 : 3; break; @@ -4939,7 +5296,7 @@ struct sp_coder *coder; g.xstart = g.x_maze_max - g.xsize - 1; break; } - switch ((int) valign) { + switch (tb) { case TOP: g.ystart = 3; break; @@ -4954,29 +5311,15 @@ struct sp_coder *coder; g.xstart++; if (!(g.ystart % 2)) g.ystart++; - break; - case 2: - if (!coder->croom) { - g.xstart = 1; - g.ystart = 0; - g.xsize = COLNO - 1 - tmpmazepart.xsize; - g.ysize = ROWNO - tmpmazepart.ysize; - } - get_location_coord(&halign, &valign, ANY_LOC, coder->croom, - OV_i(mpa)); - g.xsize = tmpmazepart.xsize; - g.ysize = tmpmazepart.ysize; - g.xstart = halign; - g.ystart = valign; - break; } + if (g.ystart < 0 || g.ystart + g.ysize > ROWNO) { /* try to move the start a bit */ g.ystart += (g.ystart > 0) ? -2 : 2; if (g.ysize == ROWNO) g.ystart = 0; if (g.ystart < 0 || g.ystart + g.ysize > ROWNO) - panic("reading special level with g.ysize too large"); + g.ystart = 0; } if (g.xsize <= 1 && g.ysize <= 1) { g.xstart = 1; @@ -4984,13 +5327,18 @@ struct sp_coder *coder; g.xsize = COLNO - 1; g.ysize = ROWNO; } else { - xchar x, y, mptyp; + char mpchr; + xchar mptyp; /* Load the map */ - for (y = g.ystart; y < g.ystart + g.ysize; y++) - for (x = g.xstart; x < g.xstart + g.xsize; x++) { - mptyp = (mpmap->vardata.str[(y - g.ystart) * g.xsize - + (x - g.xstart)] - 1); + for (y = g.ystart; y < min(ROWNO, g.ystart + g.ysize); y++) + for (x = g.xstart; x < min(COLNO, g.xstart + g.xsize); x++) { + mpchr = (mapdata[(y - g.ystart) * (mapwid+1) + (x - g.xstart)]); + mptyp = splev_chr2typ(mpchr); + if (mptyp == INVALID_TYPE) { + /* TODO: warn about illegal map char */ + continue; + } if (mptyp >= MAX_TYPE) continue; levl[x][y].typ = mptyp; @@ -5024,291 +5372,47 @@ struct sp_coder *coder; else if (g.splev_init_present && levl[x][y].typ == ICE) levl[x][y].icedpool = g.icedpools ? ICED_POOL : ICED_MOAT; } - if (coder->lvl_is_joined) + if (g.coder->lvl_is_joined) remove_rooms(g.xstart, g.ystart, g.xstart + g.xsize, g.ystart + g.ysize); } - if (!OV_i(mpkeepr)) { + if (!keepregion) { g.xstart = tmpxstart; g.ystart = tmpystart; g.xsize = tmpxsize; g.ysize = tmpysize; } - opvar_free(mpxs); - opvar_free(mpys); - opvar_free(mpmap); - opvar_free(mpa); - opvar_free(mpkeepr); - opvar_free(mpzalign); + Free(mapdata); + + return 0; } void -spo_jmp(coder, lvl) -struct sp_coder *coder; -sp_lev *lvl; +update_croom() { - static const char nhFunc[] = "spo_jmp"; - struct opvar *tmpa; - long a; - - if (!OV_pop_i(tmpa)) - return; - a = sp_code_jmpaddr(coder->frame->n_opcode, (OV_i(tmpa) - 1)); - if ((a >= 0) && (a < lvl->n_opcodes) && (a != coder->frame->n_opcode)) - coder->frame->n_opcode = a; - opvar_free(tmpa); -} - -void -spo_conditional_jump(coder, lvl) -struct sp_coder *coder; -sp_lev *lvl; -{ - static const char nhFunc[] = "spo_conditional_jump"; - struct opvar *oa, *oc; - long a, c; - int test = 0; - - if (!OV_pop_i(oa) || !OV_pop_i(oc)) + if (!g.coder) return; - a = sp_code_jmpaddr(coder->frame->n_opcode, (OV_i(oa) - 1)); - c = OV_i(oc); - - switch (coder->opcode) { - default: - impossible("spo_conditional_jump: illegal opcode"); - break; - case SPO_JL: - test = (c & SP_CPUFLAG_LT); - break; - case SPO_JLE: - test = (c & (SP_CPUFLAG_LT | SP_CPUFLAG_EQ)); - break; - case SPO_JG: - test = (c & SP_CPUFLAG_GT); - break; - case SPO_JGE: - test = (c & (SP_CPUFLAG_GT | SP_CPUFLAG_EQ)); - break; - case SPO_JE: - test = (c & SP_CPUFLAG_EQ); - break; - case SPO_JNE: - test = (c & ~SP_CPUFLAG_EQ); - break; - } - - if ((test) && (a >= 0) && (a < lvl->n_opcodes) - && (a != coder->frame->n_opcode)) - coder->frame->n_opcode = a; - - opvar_free(oa); - opvar_free(oc); + if (g.coder->n_subroom) + g.coder->croom = g.coder->tmproomlist[g.coder->n_subroom - 1]; + else + g.coder->croom = NULL; } -void -spo_var_init(coder) -struct sp_coder *coder; +struct sp_coder * +sp_level_coder_init() { - static const char nhFunc[] = "spo_var_init"; - struct opvar *vname; - struct opvar *arraylen; - struct opvar *vvalue; - struct splev_var *tmpvar; - struct splev_var *tmp2; - long idx; - - OV_pop_s(vname); - OV_pop_i(arraylen); - - if (!vname || !arraylen) - panic("no values for SPO_VAR_INIT"); - - tmpvar = opvar_var_defined(coder, OV_s(vname)); - - if (tmpvar) { - /* variable redefinition */ - if (OV_i(arraylen) < 0) { - /* copy variable */ - if (tmpvar->array_len) { - idx = tmpvar->array_len; - while (idx-- > 0) { - opvar_free(tmpvar->data.arrayvalues[idx]); - } - Free(tmpvar->data.arrayvalues); - } else { - opvar_free(tmpvar->data.value); - } - tmpvar->data.arrayvalues = NULL; - goto copy_variable; - } else if (OV_i(arraylen)) { - /* redefined array */ - idx = tmpvar->array_len; - while (idx-- > 0) { - opvar_free(tmpvar->data.arrayvalues[idx]); - } - Free(tmpvar->data.arrayvalues); - tmpvar->data.arrayvalues = NULL; - goto create_new_array; - } else { - /* redefined single value */ - OV_pop(vvalue); - if (tmpvar->svtyp != vvalue->spovartyp) - panic("redefining variable as different type"); - opvar_free(tmpvar->data.value); - tmpvar->data.value = vvalue; - tmpvar->array_len = 0; - } - } else { - /* new variable definition */ - tmpvar = (struct splev_var *) alloc(sizeof(struct splev_var)); - tmpvar->next = coder->frame->variables; - tmpvar->name = dupstr(OV_s(vname)); - coder->frame->variables = tmpvar; - - if (OV_i(arraylen) < 0) { - /* copy variable */ - copy_variable: - OV_pop(vvalue); - tmp2 = opvar_var_defined(coder, OV_s(vvalue)); - if (!tmp2) - panic("no copyable var"); - tmpvar->svtyp = tmp2->svtyp; - tmpvar->array_len = tmp2->array_len; - if (tmpvar->array_len) { - idx = tmpvar->array_len; - tmpvar->data.arrayvalues = - (struct opvar **) alloc(sizeof(struct opvar *) * idx); - while (idx-- > 0) { - tmpvar->data.arrayvalues[idx] = - opvar_clone(tmp2->data.arrayvalues[idx]); - } - } else { - tmpvar->data.value = opvar_clone(tmp2->data.value); - } - opvar_free(vvalue); - } else if (OV_i(arraylen)) { - /* new array */ - create_new_array: - idx = OV_i(arraylen); - tmpvar->array_len = idx; - tmpvar->data.arrayvalues = - (struct opvar **) alloc(sizeof(struct opvar *) * idx); - while (idx-- > 0) { - OV_pop(vvalue); - if (!vvalue) - panic("no value for arrayvariable"); - tmpvar->data.arrayvalues[idx] = vvalue; - } - tmpvar->svtyp = SPOVAR_ARRAY; - } else { - /* new single value */ - OV_pop(vvalue); - if (!vvalue) - panic("no value for variable"); - tmpvar->svtyp = OV_typ(vvalue); - tmpvar->data.value = vvalue; - tmpvar->array_len = 0; - } - } - - opvar_free(vname); - opvar_free(arraylen); - -} - -#if 0 -STATIC_OVL long -opvar_array_length(coder) -struct sp_coder *coder; -{ - static const char nhFunc[] = "opvar_array_length"; - struct opvar *vname; - struct splev_var *tmp; - long len = 0; - - if (!coder) - return 0; - - vname = splev_stack_pop(coder->stack); - if (!vname) - return 0; - if (vname->spovartyp != SPOVAR_VARIABLE) - goto pass; - - tmp = coder->frame->variables; - while (tmp) { - if (!strcmp(tmp->name, OV_s(vname))) { - if ((tmp->svtyp & SPOVAR_ARRAY)) { - len = tmp->array_len; - if (len < 1) - len = 0; - } - goto pass; - } - tmp = tmp->next; - } - -pass: - opvar_free(vname); - return len; -} -#endif /*0*/ - -void -spo_shuffle_array(coder) -struct sp_coder *coder; -{ - static const char nhFunc[] = "spo_shuffle_array"; - struct opvar *vname; - struct splev_var *tmp; - struct opvar *tmp2; - long i, j; - - if (!OV_pop_s(vname)) - return; - - tmp = opvar_var_defined(coder, OV_s(vname)); - if (!tmp || (tmp->array_len < 1)) { - opvar_free(vname); - return; - } - for (i = tmp->array_len - 1; i > 0; i--) { - if ((j = rn2(i + 1)) == i) - continue; - tmp2 = tmp->data.arrayvalues[j]; - tmp->data.arrayvalues[j] = tmp->data.arrayvalues[i]; - tmp->data.arrayvalues[i] = tmp2; - } - - opvar_free(vname); -} - -/* Special level coder, creates the special level from the sp_lev codes. - * Does not free the allocated memory. - */ -STATIC_OVL boolean -sp_level_coder(lvl) -sp_lev *lvl; -{ - static const char nhFunc[] = "sp_level_coder"; - unsigned long exec_opcodes = 0; int tmpi; - long room_stack = 0; - unsigned long max_execution = SPCODER_MAX_RUNTIME; struct sp_coder *coder = (struct sp_coder *) alloc(sizeof (struct sp_coder)); - coder->frame = frame_new(0); - coder->stack = NULL; coder->premapped = FALSE; coder->solidify = FALSE; coder->check_inaccessibles = FALSE; coder->croom = NULL; coder->n_subroom = 1; - coder->exit_script = FALSE; coder->lvl_is_joined = 0; + coder->room_stack = 0; g.splev_init_present = FALSE; g.icedpools = FALSE; @@ -5317,19 +5421,12 @@ sp_lev *lvl; once either level is created, these values can be forgotten */ g.mines_prize_count = g.soko_prize_count = 0; - if (wizard) { - char *met = nh_getenv("SPCODER_MAX_RUNTIME"); - - if (met && met[0] == '1') - max_execution = (1 << 30) - 1; - } - for (tmpi = 0; tmpi <= MAX_NESTED_ROOMS; tmpi++) { coder->tmproomlist[tmpi] = (struct mkroom *) 0; coder->failed_room[tmpi] = FALSE; } - shuffle_alignments(); + update_croom(); for (tmpi = 0; tmpi < MAX_CONTAINMENT; tmpi++) g.container_obj[tmpi] = NULL; @@ -5346,642 +5443,99 @@ sp_lev *lvl; g.xsize = COLNO - 1; g.ysize = ROWNO; - while (coder->frame->n_opcode < lvl->n_opcodes && !coder->exit_script) { - coder->opcode = lvl->opcodes[coder->frame->n_opcode].opcode; - coder->opdat = lvl->opcodes[coder->frame->n_opcode].opdat; + return coder; +} - coder->stack = coder->frame->stack; - if (exec_opcodes++ > max_execution) { - impossible("Level script is taking too much time, stopping."); - coder->exit_script = TRUE; - } +static const struct luaL_Reg nhl_functions[] = { + { "message", lspo_message }, + { "monster", lspo_monster }, + { "object", lspo_object }, + { "level_flags", lspo_level_flags }, + { "level_init", lspo_level_init }, + { "engraving", lspo_engraving }, + { "mineralize", lspo_mineralize }, + { "door", lspo_door }, + { "stair", lspo_stair }, + { "ladder", lspo_ladder }, + { "grave", lspo_grave }, + { "altar", lspo_altar }, + { "map", lspo_map }, + { "feature", lspo_feature }, + { "terrain", lspo_terrain }, + { "replace_terrain", lspo_replace_terrain }, + { "room", lspo_room }, + { "corridor", lspo_corridor }, + { "random_corridors", lspo_random_corridors }, + { "gold", lspo_gold }, + { "trap", lspo_trap }, + { "mazewalk", lspo_mazewalk }, + { "drawbridge", lspo_drawbridge }, + { "region", lspo_region }, + { "levregion", lspo_levregion }, + { "wallify", lspo_wallify }, + { "wall_property", lspo_wall_property }, + { "non_diggable", lspo_non_diggable }, + { "non_passwall", lspo_non_passwall }, + { "teleport_region", lspo_teleport_region }, + { "reset_level", lspo_reset_level }, + /* TODO: { "branch", lspo_branch }, */ + /* TODO: { "portal", lspo_portal }, */ + { NULL, NULL } +}; - if (coder->failed_room[coder->n_subroom - 1] - && coder->opcode != SPO_ENDROOM && coder->opcode != SPO_ROOM - && coder->opcode != SPO_SUBROOM) - goto next_opcode; +/* TODO: - coder->croom = coder->tmproomlist[coder->n_subroom - 1]; + - if des-file used MAZE_ID to start a level, the level needs des.level_flags("mazelevel") + - expose g.coder->croom or g.[xy]start and g.xy[size] to lua. + - detect a "subroom" automatically. + - new function get_mapchar(x,y) to return the mapchar on map + - many params should accept their normal type (eg, int or bool), AND "random" + - automatically add shuffle(array) + - automatically add align = { "law", "neutral", "chaos" } and shuffle it. (remove from lua files) + - grab the header comments from des-files and add add them to the lua files - switch (coder->opcode) { - case SPO_NULL: - break; - case SPO_EXIT: - coder->exit_script = TRUE; - break; - case SPO_FRAME_PUSH: - spo_frame_push(coder); - break; - case SPO_FRAME_POP: - spo_frame_pop(coder); - break; - case SPO_CALL: - spo_call(coder); - break; - case SPO_RETURN: - spo_return(coder); - break; - case SPO_END_MONINVENT: - spo_end_moninvent(coder); - break; - case SPO_POP_CONTAINER: - spo_pop_container(coder); - break; - case SPO_POP: { - struct opvar *ov = splev_stack_pop(coder->stack); +*/ - opvar_free(ov); - break; - } - case SPO_PUSH: - splev_stack_push(coder->stack, opvar_clone(coder->opdat)); - break; - case SPO_MESSAGE: - spo_message(coder); - break; - case SPO_MONSTER: - spo_monster(coder); - break; - case SPO_OBJECT: - spo_object(coder); - break; - case SPO_LEVEL_FLAGS: - spo_level_flags(coder); - break; - case SPO_INITLEVEL: - spo_initlevel(coder); - break; - case SPO_ENGRAVING: - spo_engraving(coder); - break; - case SPO_MINERALIZE: - spo_mineralize(coder); - break; - case SPO_SUBROOM: - case SPO_ROOM: - if (!coder->failed_room[coder->n_subroom - 1]) { - spo_room(coder); - } else - room_stack++; - break; - case SPO_ENDROOM: - if (coder->failed_room[coder->n_subroom - 1]) { - if (!room_stack) - spo_endroom(coder); - else - room_stack--; - } else { - spo_endroom(coder); - } - break; - case SPO_DOOR: - spo_door(coder); - break; - case SPO_STAIR: - spo_stair(coder); - break; - case SPO_LADDER: - spo_ladder(coder); - break; - case SPO_GRAVE: - spo_grave(coder); - break; - case SPO_ALTAR: - spo_altar(coder); - break; - case SPO_SINK: - case SPO_POOL: - case SPO_FOUNTAIN: - spo_feature(coder); - break; - case SPO_TRAP: - spo_trap(coder); - break; - case SPO_GOLD: - spo_gold(coder); - break; - case SPO_CORRIDOR: - spo_corridor(coder); - break; - case SPO_TERRAIN: - spo_terrain(coder); - break; - case SPO_REPLACETERRAIN: - spo_replace_terrain(coder); - break; - case SPO_LEVREGION: - spo_levregion(coder); - break; - case SPO_REGION: - spo_region(coder); - break; - case SPO_DRAWBRIDGE: - spo_drawbridge(coder); - break; - case SPO_MAZEWALK: - spo_mazewalk(coder); - break; - case SPO_NON_PASSWALL: - case SPO_NON_DIGGABLE: - spo_wall_property(coder); - break; - case SPO_ROOM_DOOR: - spo_room_door(coder); - break; - case SPO_WALLIFY: - spo_wallify(coder); - break; - case SPO_COPY: { - struct opvar *a = splev_stack_pop(coder->stack); +void +l_register_des(L) +lua_State *L; +{ + /* register des -table, and functions for it */ + lua_newtable(L); + luaL_setfuncs(L, nhl_functions, 0); + lua_setglobal(L, "des"); +} - splev_stack_push(coder->stack, opvar_clone(a)); - splev_stack_push(coder->stack, opvar_clone(a)); - opvar_free(a); - break; - } - case SPO_DEC: { - struct opvar *a; +STATIC_OVL void +create_des_coder() +{ + if (!g.coder) + g.coder = sp_level_coder_init(); +} - if (!OV_pop_i(a)) - break; - OV_i(a)--; - splev_stack_push(coder->stack, a); - break; - } - case SPO_INC: { - struct opvar *a; +/* + * General loader + */ +boolean +load_special(name) +const char *name; +{ + boolean result = FALSE; - if (!OV_pop_i(a)) - break; - OV_i(a)++; - splev_stack_push(coder->stack, a); - break; - } - case SPO_MATH_SIGN: { - struct opvar *a; + create_des_coder(); - if (!OV_pop_i(a)) - break; - OV_i(a) = ((OV_i(a) < 0) ? -1 : ((OV_i(a) > 0) ? 1 : 0)); - splev_stack_push(coder->stack, a); - break; - } - case SPO_MATH_ADD: { - struct opvar *a, *b; - - if (!OV_pop(b) || !OV_pop(a)) - break; - if (OV_typ(b) == OV_typ(a)) { - if (OV_typ(a) == SPOVAR_INT) { - OV_i(a) = OV_i(a) + OV_i(b); - splev_stack_push(coder->stack, a); - opvar_free(b); - } else if (OV_typ(a) == SPOVAR_STRING) { - struct opvar *c; - char *tmpbuf = (char *) alloc(strlen(OV_s(a)) - + strlen(OV_s(b)) + 1); - - (void) sprintf(tmpbuf, "%s%s", OV_s(a), OV_s(b)); - c = opvar_new_str(tmpbuf); - splev_stack_push(coder->stack, c); - opvar_free(a); - opvar_free(b); - Free(tmpbuf); - } else { - splev_stack_push(coder->stack, a); - opvar_free(b); - impossible("adding weird types"); - } - } else { - splev_stack_push(coder->stack, a); - opvar_free(b); - impossible("adding different types"); - } - break; - } - case SPO_MATH_SUB: { - struct opvar *a, *b; - - if (!OV_pop_i(b) || !OV_pop_i(a)) - break; - OV_i(a) = OV_i(a) - OV_i(b); - splev_stack_push(coder->stack, a); - opvar_free(b); - break; - } - case SPO_MATH_MUL: { - struct opvar *a, *b; - - if (!OV_pop_i(b) || !OV_pop_i(a)) - break; - OV_i(a) = OV_i(a) * OV_i(b); - splev_stack_push(coder->stack, a); - opvar_free(b); - break; - } - case SPO_MATH_DIV: { - struct opvar *a, *b; - - if (!OV_pop_i(b) || !OV_pop_i(a)) - break; - if (OV_i(b) >= 1) { - OV_i(a) = OV_i(a) / OV_i(b); - } else { - OV_i(a) = 0; - } - splev_stack_push(coder->stack, a); - opvar_free(b); - break; - } - case SPO_MATH_MOD: { - struct opvar *a, *b; - - if (!OV_pop_i(b) || !OV_pop_i(a)) - break; - if (OV_i(b) > 0) { - OV_i(a) = OV_i(a) % OV_i(b); - } else { - OV_i(a) = 0; - } - splev_stack_push(coder->stack, a); - opvar_free(b); - break; - } - case SPO_CMP: { - struct opvar *a; - struct opvar *b; - struct opvar *c; - long val = 0; - - OV_pop(b); - OV_pop(a); - if (!a || !b) { - impossible("spo_cmp: no values in stack"); - break; - } - if (OV_typ(a) != OV_typ(b)) { - impossible("spo_cmp: trying to compare differing datatypes"); - break; - } - switch (OV_typ(a)) { - case SPOVAR_COORD: - case SPOVAR_REGION: - case SPOVAR_MAPCHAR: - case SPOVAR_MONST: - case SPOVAR_OBJ: - case SPOVAR_INT: - if (OV_i(b) > OV_i(a)) - val |= SP_CPUFLAG_LT; - if (OV_i(b) < OV_i(a)) - val |= SP_CPUFLAG_GT; - if (OV_i(b) == OV_i(a)) - val |= SP_CPUFLAG_EQ; - c = opvar_new_int(val); - break; - case SPOVAR_STRING: - c = opvar_new_int(!strcmp(OV_s(b), OV_s(a)) - ? SP_CPUFLAG_EQ - : 0); - break; - default: - c = opvar_new_int(0); - break; - } - splev_stack_push(coder->stack, c); - opvar_free(a); - opvar_free(b); - break; - } - case SPO_JMP: - spo_jmp(coder, lvl); - break; - case SPO_JL: - case SPO_JLE: - case SPO_JG: - case SPO_JGE: - case SPO_JE: - case SPO_JNE: - spo_conditional_jump(coder, lvl); - break; - case SPO_RN2: { - struct opvar *tmpv; - struct opvar *t; - - if (!OV_pop_i(tmpv)) - break; - t = opvar_new_int((OV_i(tmpv) > 1) ? rn2(OV_i(tmpv)) : 0); - splev_stack_push(coder->stack, t); - opvar_free(tmpv); - break; - } - case SPO_DICE: { - struct opvar *a, *b, *t; - - if (!OV_pop_i(b) || !OV_pop_i(a)) - break; - if (OV_i(b) < 1) - OV_i(b) = 1; - if (OV_i(a) < 1) - OV_i(a) = 1; - t = opvar_new_int(d(OV_i(a), OV_i(b))); - splev_stack_push(coder->stack, t); - opvar_free(a); - opvar_free(b); - break; - } - case SPO_MAP: - spo_map(coder); - break; - case SPO_VAR_INIT: - spo_var_init(coder); - break; - case SPO_SHUFFLE_ARRAY: - spo_shuffle_array(coder); - break; - case SPO_SEL_ADD: /* actually, logical or */ - { - struct opvar *sel1, *sel2, *pt; - - if (!OV_pop_typ(sel1, SPOVAR_SEL)) - panic("no sel1 for add"); - if (!OV_pop_typ(sel2, SPOVAR_SEL)) - panic("no sel2 for add"); - pt = selection_logical_oper(sel1, sel2, '|'); - opvar_free(sel1); - opvar_free(sel2); - splev_stack_push(coder->stack, pt); - break; - } - case SPO_SEL_COMPLEMENT: { - struct opvar *sel, *pt; - - if (!OV_pop_typ(sel, SPOVAR_SEL)) - panic("no sel for not"); - pt = selection_not(sel); - opvar_free(sel); - splev_stack_push(coder->stack, pt); - break; - } - case SPO_SEL_FILTER: /* sorta like logical and */ - { - struct opvar *filtertype; - - if (!OV_pop_i(filtertype)) - panic("no sel filter type"); - switch (OV_i(filtertype)) { - case SPOFILTER_PERCENT: { - struct opvar *tmp1, *sel; - - if (!OV_pop_i(tmp1)) - panic("no sel filter percent"); - if (!OV_pop_typ(sel, SPOVAR_SEL)) - panic("no sel filter"); - selection_filter_percent(sel, OV_i(tmp1)); - splev_stack_push(coder->stack, sel); - opvar_free(tmp1); - break; - } - case SPOFILTER_SELECTION: /* logical and */ - { - struct opvar *pt, *sel1, *sel2; - - if (!OV_pop_typ(sel1, SPOVAR_SEL)) - panic("no sel filter sel1"); - if (!OV_pop_typ(sel2, SPOVAR_SEL)) - panic("no sel filter sel2"); - pt = selection_logical_oper(sel1, sel2, '&'); - splev_stack_push(coder->stack, pt); - opvar_free(sel1); - opvar_free(sel2); - break; - } - case SPOFILTER_MAPCHAR: { - struct opvar *pt, *tmp1, *sel; - - if (!OV_pop_typ(sel, SPOVAR_SEL)) - panic("no sel filter"); - if (!OV_pop_typ(tmp1, SPOVAR_MAPCHAR)) - panic("no sel filter mapchar"); - pt = selection_filter_mapchar(sel, tmp1); - splev_stack_push(coder->stack, pt); - opvar_free(tmp1); - opvar_free(sel); - break; - } - default: - panic("unknown sel filter type"); - } - opvar_free(filtertype); - break; - } - case SPO_SEL_POINT: { - struct opvar *tmp; - struct opvar *pt = selection_opvar((char *) 0); - schar x, y; - - if (!OV_pop_c(tmp)) - panic("no ter sel coord"); - get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(tmp)); - selection_setpoint(x, y, pt, 1); - splev_stack_push(coder->stack, pt); - opvar_free(tmp); - break; - } - case SPO_SEL_RECT: - case SPO_SEL_FILLRECT: { - struct opvar *tmp, *pt = selection_opvar((char *) 0); - schar x, y, x1, y1, x2, y2; - - if (!OV_pop_r(tmp)) - panic("no ter sel region"); - x1 = min(SP_REGION_X1(OV_i(tmp)), SP_REGION_X2(OV_i(tmp))); - y1 = min(SP_REGION_Y1(OV_i(tmp)), SP_REGION_Y2(OV_i(tmp))); - x2 = max(SP_REGION_X1(OV_i(tmp)), SP_REGION_X2(OV_i(tmp))); - y2 = max(SP_REGION_Y1(OV_i(tmp)), SP_REGION_Y2(OV_i(tmp))); - get_location(&x1, &y1, ANY_LOC, coder->croom); - get_location(&x2, &y2, ANY_LOC, coder->croom); - x1 = (x1 < 0) ? 0 : x1; - y1 = (y1 < 0) ? 0 : y1; - x2 = (x2 >= COLNO) ? COLNO - 1 : x2; - y2 = (y2 >= ROWNO) ? ROWNO - 1 : y2; - if (coder->opcode == SPO_SEL_RECT) { - for (x = x1; x <= x2; x++) { - selection_setpoint(x, y1, pt, 1); - selection_setpoint(x, y2, pt, 1); - } - for (y = y1; y <= y2; y++) { - selection_setpoint(x1, y, pt, 1); - selection_setpoint(x2, y, pt, 1); - } - } else { - for (x = x1; x <= x2; x++) - for (y = y1; y <= y2; y++) - selection_setpoint(x, y, pt, 1); - } - splev_stack_push(coder->stack, pt); - opvar_free(tmp); - break; - } - case SPO_SEL_LINE: { - struct opvar *tmp = NULL, *tmp2 = NULL, - *pt = selection_opvar((char *) 0); - schar x1, y1, x2, y2; - - if (!OV_pop_c(tmp)) - panic("no ter sel linecoord1"); - if (!OV_pop_c(tmp2)) - panic("no ter sel linecoord2"); - get_location_coord(&x1, &y1, ANY_LOC, coder->croom, OV_i(tmp)); - get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(tmp2)); - x1 = (x1 < 0) ? 0 : x1; - y1 = (y1 < 0) ? 0 : y1; - x2 = (x2 >= COLNO) ? COLNO - 1 : x2; - y2 = (y2 >= ROWNO) ? ROWNO - 1 : y2; - selection_do_line(x1, y1, x2, y2, pt); - splev_stack_push(coder->stack, pt); - opvar_free(tmp); - opvar_free(tmp2); - break; - } - case SPO_SEL_RNDLINE: { - struct opvar *tmp = NULL, *tmp2 = NULL, *tmp3, - *pt = selection_opvar((char *) 0); - schar x1, y1, x2, y2; - - if (!OV_pop_i(tmp3)) - panic("no ter sel randline1"); - if (!OV_pop_c(tmp)) - panic("no ter sel randline2"); - if (!OV_pop_c(tmp2)) - panic("no ter sel randline3"); - get_location_coord(&x1, &y1, ANY_LOC, coder->croom, OV_i(tmp)); - get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(tmp2)); - x1 = (x1 < 0) ? 0 : x1; - y1 = (y1 < 0) ? 0 : y1; - x2 = (x2 >= COLNO) ? COLNO - 1 : x2; - y2 = (y2 >= ROWNO) ? ROWNO - 1 : y2; - selection_do_randline(x1, y1, x2, y2, OV_i(tmp3), 12, pt); - splev_stack_push(coder->stack, pt); - opvar_free(tmp); - opvar_free(tmp2); - opvar_free(tmp3); - break; - } - case SPO_SEL_GROW: { - struct opvar *dirs, *pt; - - if (!OV_pop_i(dirs)) - panic("no dirs for grow"); - if (!OV_pop_typ(pt, SPOVAR_SEL)) - panic("no selection for grow"); - selection_do_grow(pt, OV_i(dirs)); - splev_stack_push(coder->stack, pt); - opvar_free(dirs); - break; - } - case SPO_SEL_FLOOD: { - struct opvar *tmp; - schar x, y; - - if (!OV_pop_c(tmp)) - panic("no ter sel flood coord"); - get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(tmp)); - if (isok(x, y)) { - struct opvar *pt = selection_opvar((char *) 0); - - set_selection_floodfillchk(floodfillchk_match_under); - floodfillchk_match_under_typ = levl[x][y].typ; - selection_floodfill(pt, x, y, FALSE); - splev_stack_push(coder->stack, pt); - } - opvar_free(tmp); - break; - } - case SPO_SEL_RNDCOORD: { - struct opvar *pt; - schar x, y; - - if (!OV_pop_typ(pt, SPOVAR_SEL)) - panic("no selection for rndcoord"); - if (selection_rndcoord(pt, &x, &y, FALSE)) { - x -= g.xstart; - y -= g.ystart; - } - splev_stack_push(coder->stack, opvar_new_coord(x, y)); - opvar_free(pt); - break; - } - case SPO_SEL_ELLIPSE: { - struct opvar *filled, *xaxis, *yaxis, *pt; - struct opvar *sel = selection_opvar((char *) 0); - schar x, y; - - if (!OV_pop_i(filled)) - panic("no filled for ellipse"); - if (!OV_pop_i(yaxis)) - panic("no yaxis for ellipse"); - if (!OV_pop_i(xaxis)) - panic("no xaxis for ellipse"); - if (!OV_pop_c(pt)) - panic("no pt for ellipse"); - get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(pt)); - selection_do_ellipse(sel, x, y, OV_i(xaxis), OV_i(yaxis), - OV_i(filled)); - splev_stack_push(coder->stack, sel); - opvar_free(filled); - opvar_free(yaxis); - opvar_free(xaxis); - opvar_free(pt); - break; - } - case SPO_SEL_GRADIENT: { - struct opvar *gtyp, *glim, *mind, *maxd, *gcoord, *coord2; - struct opvar *sel; - schar x, y, x2, y2; - - if (!OV_pop_i(gtyp)) - panic("no gtyp for grad"); - if (!OV_pop_i(glim)) - panic("no glim for grad"); - if (!OV_pop_c(coord2)) - panic("no coord2 for grad"); - if (!OV_pop_c(gcoord)) - panic("no coord for grad"); - if (!OV_pop_i(maxd)) - panic("no maxd for grad"); - if (!OV_pop_i(mind)) - panic("no mind for grad"); - get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(gcoord)); - get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(coord2)); - - sel = selection_opvar((char *) 0); - selection_do_gradient(sel, x, y, x2, y2, OV_i(gtyp), OV_i(mind), - OV_i(maxd), OV_i(glim)); - splev_stack_push(coder->stack, sel); - - opvar_free(gtyp); - opvar_free(glim); - opvar_free(gcoord); - opvar_free(coord2); - opvar_free(maxd); - opvar_free(mind); - break; - } - default: - panic("sp_level_coder: Unknown opcode %i", coder->opcode); - } - - next_opcode: - coder->frame->n_opcode++; - } /*while*/ + if (!load_lua(name)) + goto give_up; link_doors_rooms(); fill_rooms(); remove_boundary_syms(); - if (coder->check_inaccessibles) + /* TODO: ensure_way_out() needs rewrite */ + if (g.coder->check_inaccessibles) ensure_way_out(); + /* FIXME: Ideally, we want this call to only cover areas of the map * which were not inserted directly by the special level file (see * the insect legs on Baalzebub's level, for instance). Since that @@ -5993,59 +5547,21 @@ sp_lev *lvl; count_features(); - if (coder->solidify) + if (g.coder->solidify) solidify_map(); /* This must be done before sokoban_detect(), * otherwise branch stairs won't be premapped. */ fixup_special(); - if (coder->premapped) + if (g.coder->premapped) sokoban_detect(); - if (coder->frame) { - struct sp_frame *tmpframe; - do { - tmpframe = coder->frame->next; - frame_del(coder->frame); - coder->frame = tmpframe; - } while (coder->frame); - } - Free(coder); - - return TRUE; -} - -/* - * General loader - */ -boolean -load_special(name) -const char *name; -{ - dlb *fd; - sp_lev *lvl = NULL; - boolean result = FALSE; - struct version_info vers_info; - - fd = dlb_fopen(name, RDBMODE); - if (!fd) - return FALSE; - Fread((genericptr_t) &vers_info, sizeof vers_info, 1, fd); - if (!check_version(&vers_info, name, TRUE, UTD_CHECKSIZES)) { - (void) dlb_fclose(fd); - goto give_up; - } - - lvl = (sp_lev *) alloc(sizeof (sp_lev)); - result = sp_level_loader(fd, lvl); - (void) dlb_fclose(fd); - if (result) - result = sp_level_coder(lvl); - sp_level_free(lvl); - Free(lvl); - + result = TRUE; give_up: + Free(g.coder); + g.coder = NULL; + return result; } diff --git a/sys/msdos/Makefile.GCC b/sys/msdos/Makefile.GCC index 82237eb6e..0a2b0eea5 100644 --- a/sys/msdos/Makefile.GCC +++ b/sys/msdos/Makefile.GCC @@ -1,5 +1,5 @@ # NetHack 3.6 Makefile.GCC $NHDT-Date: 1519600525 2018/02/25 23:15:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.34 $ -# Copyright (c) NetHack PC Development Team 1996-2006. +# Copyright (c) NetHack PC Development Team 1996-2019. # PC NetHack 3.6 Makefile for djgpp V2 # # Gnu gcc compiler for msdos (djgpp) @@ -25,6 +25,28 @@ GAME = nethack # The GNU Make has a problem if you include a drive spec below (unfortunately). GAMEDIR =../binary +# Optional PDCurses support +# Uncomment these and set them appropriately if you want to +# include curses port support alongside TTY support in your +# NetHack.exe binary. +# +# You'll have to set PDCURSES_H to the correct location of the +# PDCurses header (.h) files and PDCURSES_C to the location +# of your PDCurses C files which must already be resident on +# your machine. +# +ADD_CURSES=Y +PDCURSES_TOP=../../pdcurses + +#--------------------------------------------------------------- +# Location of LUA +ADD_LUA=Y +LUATOP=../../lua-535 + +# +#============================================================================== +# This marks the end of the BUILD DECISIONS section. +#============================================================================== # # Directories, gcc likes unix style directory specs # @@ -38,6 +60,7 @@ SRC = ../src SSHR = ../sys/share UTIL = ../util WIN = ../win/tty +WCURSES = ../win/curses WSHR = ../win/share # @@ -67,7 +90,8 @@ LIBRARIES = $(LIBS) $(TERMLIB) # If you have yacc/lex or a work-alike set YACC_LEX to Y # YACC_LEX = N -ifeq ($(YACC_LEX),Y) + +ifeq "$(YACC_LEX)" "Y" DO_YACC = YACC_ACT DO_LEX = LEX_ACT endif @@ -138,97 +162,39 @@ SUPPRESS_GRAPHICS = GAMEFILE = $(GAMEDIR)/$(GAME).exe # Changing this conditional block is not recommended -ifeq ($(USE_DLB),Y) +ifeq "$(USE_DLB)" "Y" DLBFLG = -DDLB else DLBFLG = endif -# -# Flags. -# -ifeq ($(SUPPRESS_GRAPHICS),Y) TERMLIB = # Build NetHack suitable for blind players -# Debugging -#cflags = -pg -c -I../include $(DLBFLG) -DSUPPRESS_GRAPHICS -#LFLAGS = -pg - -cflags = -c -O -I../include $(DLBFLG) -DSUPPRESS_GRAPHICS -LFLAGS = - -else - -# Debugging -#cflags = -g -c -I../include $(DLBFLG) -DUSE_TILES -#LFLAGS = -g - -# Normal -cflags = -c -O -I../include $(DLBFLG) -DUSE_TILES -LFLAGS = -endif - -#========================================== -#================ RULES ================== -#========================================== - -.SUFFIXES: .exe .o .til .uu .c .y .l - -#========================================== -# Rules for files in src -#========================================== - -$(OBJ)/%.o : /%.c - $(CC) $(cflags) -o$@ $< - -$(OBJ)/%.o : $(SRC)/%.c - $(CC) $(cflags) -o$@ $< - -#========================================== -# Rules for files in sys/share -#========================================== - -$(OBJ)/%.o : $(SSHR)/%.c - $(CC) $(cflags) -o$@ $< - -#========================================== -# Rules for files in sys/msdos -#========================================== - -$(OBJ)/%.o : $(MSYS)/%.c - $(CC) $(cflags) -I../sys/msdos -o$@ $< - -#========================================== -# Rules for files in util -#========================================== - -$(OBJ)/%.o : $(UTIL)/%.c - $(CC) $(cflags) -o$@ $< - -#========================================== -# Rules for files in win/share -#========================================== - -$(OBJ)/%.o : $(WSHR)/%.c - $(CC) $(cflags) -I../win/share -o$@ $< - -#{$(WSHR)}.txt{$(DAT)}.txt: -# copy $< $@ - -#========================================== -# Rules for files in win/tty -#========================================== - -$(OBJ)/%.o : $(TTY)/%.c - $(CC) $(cflags) -o$@ $< - #========================================== #================ MACROS ================== #========================================== # This section creates shorthand macros for many objects # referenced later on in the Makefile. # +# Have windows path styles available for use in commands +# +W_OBJ =$(subst /,\, $(OBJ)) +W_INCL =$(subst /,\, $(INCL)) +W_DAT =$(subst /,\, $(DAT)) +W_DOC =$(subst /,\, $(DOC)) +W_UTIL =$(subst /,\, $(UTIL)) +W_SRC =$(subst /,\, $(SRC)) +W_SSYS =$(subst /,\, $(SSYS)) +W_MSWSYS =$(subst /,\, $(MSWSYS)) +W_TTY =$(subst /,\, $(TTY)) +W_MSWIN =$(subst /,\, $(MSWIN)) +ifeq "$(ADD_CURSES)" "Y" +W_WCURSES =$(subst /,\, $(WCURSES)) +endif +W_WSHR =$(subst /,\, $(WSHR)) +W_GAMEDIR =$(subst /,\, $(GAMEDIR)) + # # Shorten up the location for some files # @@ -245,15 +211,19 @@ VGAOBJ = $(O)vidvga.o $(O)vidvesa.o MAKESRC = makedefs.c +ifneq "$(ADD_LUA)" "Y" SPLEVSRC = lev_yacc.c lev_$(LEX).c lev_main.c panic.c +endif DGNCOMPSRC = dgn_yacc.c dgn_$(LEX).c dgn_main.c -MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o +MAKEDEFSOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o +ifneq "$(ADD_LUA)" "Y" SPLEVOBJS = $(O)lev_yacc.o $(O)lev_$(LEX).o $(O)lev_main.o $(O)alloc.o \ $(O)monst.o $(O)objects.o $(O)panic.o \ $(O)drawing.o $(O)decl.o $(O)stubvid.o +endif DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_$(LEX).o $(O)dgn_main.o $(O)alloc.o \ $(O)panic.o @@ -339,21 +309,97 @@ VOBJ19 = $(O)trap.o $(O)u_init.o $(O)uhitm.o $(O)vault.o $(O)vision.o VOBJ20 = $(O)vis_tab.o $(O)weapon.o $(O)were.o $(O)wield.o $(O)windows.o VOBJ21 = $(O)wintty.o $(O)wizard.o $(O)worm.o $(O)worn.o $(O)write.o VOBJ22 = $(O)zap.o $(O)light.o $(O)dlb.o $(O)dig.o $(O)teleport.o -VOBJ23 = $(O)region.o $(O)sys.o $(REGEX) +VOBJ23 = $(O)region.o $(O)sys.o $(REGEX) $(O)isaac64.o +VOBJ24 = $(O)sfbase.o $(O)sfdata.o +VOBJ25 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o SOBJ = $(O)msdos.o $(O)pcsys.o $(O)tty.o $(O)unix.o \ $(O)video.o $(O)vidtxt.o $(O)pckeys.o VVOBJ = $(O)version.o +ifeq "$(ADD_LUA)" "Y" +LUAOBJ = $(O)nhlua.o $(O)nhlsel.o +endif + +ifeq "$(ADD_CURSES)" "Y" +CURSESOBJ= $(O)cursdial.o $(O)cursinit.o $(O)cursinvt.o $(O)cursmain.o \ + $(O)cursmesg.o $(O)cursmisc.o $(O)cursstat.o $(O)curswins.o +else +CURSESOBJ= +endif + VOBJ = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \ $(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) \ $(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \ $(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \ - $(VOBJ21) $(VOBJ22) $(VOBJ23) + $(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \ + $(CURSESOBJ) $(LUAOBJ) ALLOBJ = $(VOBJ) $(SOBJ) $(TILOBJ) $(TILOBJ2) $(VVOBJ) +ifeq "$(ADD_LUA)" "Y" +#===============-================================================= +# LUA library +# Source from http://www.lua.org/ftp/lua-5.3.5.tar.gz +#================================================================= + +LUASRC = $(LUATOP)/src +LUALIB = $(O)lua535s.a +LUADLL = $(O)lua535.a +LUAINCL = -I$(LUASRC) +#LUAFLAGS = unix added -lm here? +LUATARGETS = lua.exe luac.exe $(LUADLL) $(LUALIB) + +LUASRCFILES = lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c \ + lcorolib.c lctype.c ldblib.c ldebug.c ldo.c \ + ldump.c lfunc.c lgc.c linit.c liolib.c llex.c \ + lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c \ + loslib.c lparser.c lstate.c lstring.c lstrlib.c \ + ltable.c ltablib.c ltm.c lundump.c lutf8lib.c \ + lvm.c lzio.c + +LUAOBJFILES = $(O)lapi.o $(O)lauxlib.o $(O)lbaselib.o $(O)lbitlib.o \ + $(O)lcode.o $(O)lcorolib.o $(O)lctype.o $(O)ldblib.o \ + $(O)ldebug.o $(O)ldo.o $(O)ldump.o $(O)lfunc.o \ + $(O)lgc.o $(O)linit.o $(O)liolib.o $(O)llex.o \ + $(O)lmathlib.o $(O)lmem.o $(O)loadlib.o $(O)lobject.o \ + $(O)lopcodes.o $(O)loslib.o $(O)lparser.o $(O)lstate.o \ + $(O)lstring.o $(O)lstrlib.o $(O)ltable.o $(O)ltablib.o \ + $(O)ltm.o $(O)lundump.o $(O)lutf8lib.o $(O)lvm.o $(O)lzio.o +endif + +ifeq "$(ADD_CURSES)" "Y" +#========================================== +# PDCurses build macros +#========================================== +PDCURSES_CURSES_H = $(PDCURSES_TOP)/curses.h +PDCURSES_CURSPRIV_H = $(PDCURSES_TOP)/curspriv.h +PDCURSES_HEADERS = $(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PDCSRC = $(PDCURSES_TOP)/pdcurses +PDCDOS = $(PDCURSES_TOP)/dos +PDCLIBOBJS = $(O)addch.o $(O)addchstr.o $(O)addstr.o $(O)attr.o $(O)beep.o \ + $(O)bkgd.o $(O)border.o $(O)clear.o $(O)color.o $(O)delch.o $(O)deleteln.o \ + $(O)getch.o $(O)getstr.o $(O)getyx.o $(O)inch.o $(O)inchstr.o \ + $(O)initscr.o $(O)inopts.o $(O)insch.o $(O)insstr.o $(O)instr.o $(O)kernel.o \ + $(O)keyname.o $(O)mouse.o $(O)move.o $(O)outopts.o $(O)overlay.o $(O)pad.o \ + $(O)panel.o $(O)printw.o $(O)refresh.o $(O)scanw.o $(O)scr_dump.o $(O)scroll.o \ + $(O)slk.o $(O)termattr.o $(O)touch.o $(O)util.o $(O)window.o \ + $(O)debug.o + +PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o \ + $(O)pdcscrn.o $(O)pdcsetsc.o $(O)pdcutil.o + +#PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o $(O)pdcscrn.o \ +# $(O)pdcsetsc.o $(O)pdcutil.o + +PDCLIB = $(O)pdcurses.a + +PDCINCL = -I$(PDCURSES_TOP) -I$(PDCSRC) -I$(PDCDOS) +else +PDCLIB = +endif + #========================================== # Header file macros #========================================== @@ -410,6 +456,117 @@ DJ1 = $(dir $(DJGPP)) CWSDPMI = $(subst /,\,$(DJ1))bin\CWSDPMI.* endif +#========================================== +# More compiler setup macros +#========================================== +# +ifeq "$(ADD_CURSES)" "Y" +CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" +else +CURSESDEF= +CURSESLIB= +endif + +INCLDIR=-I../include -I../sys/msdos $(LUAINCL) + +# Debugging +#cflags = -pg -c $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DSUPPRESS_GRAPHICS +#LFLAGS = -pg + +cflags = -c -O $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DSUPPRESS_GRAPHICS +LFLAGS = + +# Debugging +#cflags = -g -c $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DUSE_TILES +#LFLAGS = -g + +# Normal +cflags = -c -O $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DUSE_TILES +LFLAGS = + +#========================================== +#================ RULES ================== +#========================================== + +.SUFFIXES: .exe .o .til .uu .c .y .l + +#========================================== +# Rules for files in src +#========================================== + +$(OBJ)/%.o : /%.c + $(CC) $(cflags) -o$@ $< + +$(OBJ)/%.o : $(SRC)/%.c + $(CC) $(cflags) -o$@ $< + +#========================================== +# Rules for files in sys/share +#========================================== + +$(OBJ)/%.o : $(SSHR)/%.c + $(CC) $(cflags) -o$@ $< + +#========================================== +# Rules for files in sys/msdos +#========================================== + +$(OBJ)/%.o : $(MSYS)/%.c + $(CC) $(cflags) -I../sys/msdos -o$@ $< + +#========================================== +# Rules for files in util +#========================================== + +$(OBJ)/%.o : $(UTIL)/%.c + $(CC) $(cflags) -o$@ $< + +#========================================== +# Rules for files in win/share +#========================================== + +$(OBJ)/%.o : $(WSHR)/%.c + $(CC) $(cflags) -I../win/share -o$@ $< + +#{$(WSHR)}.txt{$(DAT)}.txt: +# copy $< $@ + +#========================================== +# Rules for files in win/tty +#========================================== + +$(OBJ)/%.o : $(TTY)/%.c + $(CC) $(cflags) -o$@ $< + +#========================================== +# Rules for files in win/curses +#========================================== + +$(OBJ)/%.o : $(WCURSES)/%.c + $(CC) -DPDC_NCMOUSE $(PDCINCL) $(cflags) -o$@ $< + +#========================================== +# Rules for files in PDCurses +#========================================== + +$(OBJ)/%.o : $(PDCURSES_TOP)/%.c + $(CC) $(PDCINCL) $(cflags) -o$@ $< + +$(OBJ)/%.o : $(PDCSRC)/%.c + $(CC) $(PDCINCL) $(cflags) -o$@ $< + +$(OBJ)/%.o : $(PDCDOS)/%.c + $(CC) $(PDCINCL) $(cflags) -o$@ $< + +ifeq "$(ADD_LUA)" "Y" +#========================================== +# Rules for LUA files +#========================================== + +$(OBJ)/%.o : $(LUASRC)/%.c + $(CC) $(cflags) -o$@ $< +endif + #========================================== # Primary Targets. #========================================== @@ -425,9 +582,14 @@ default: $(GAMEFILE) util: $(O)utility.tag -$(O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/onames.h \ - $(INCL)/pm.h monstr.c vis_tab.c \ - $(U)lev_comp.exe $(U)dgn_comp.exe $(TILEUTIL) +ifneq "$(ADD_LUA)" "Y" +LEVCOMPEXE = $(U)lev_comp.exe +else +LEVCOMPEXE = +endif +$(O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/onames.h \ + $(INCL)/pm.h monstr.c vis_tab.c $(LEVCOMPEXE) \ + $(U)dgn_comp.exe $(TILEUTIL) $(subst /,\,echo utilities made > $@) tileutil: $(U)gif2txt.exe $(U)txt2ppm.exe @@ -444,7 +606,11 @@ ifeq ($(USE_DLB),Y) else @$(subst /,\,copy $(DAT)/*. $(GAMEDIR)) @$(subst /,\,copy $(DAT)/*.dat $(GAMEDIR)) +ifeq "$(ADD_LUA)" "Y" + @$(subst /,\,copy $(DAT)/*.lua $(GAMEDIR)) +else @$(subst /,\,copy $(DAT)/*.lev $(GAMEDIR)) +endif @$(subst /,\,copy $(MSYS)/msdoshlp.txt $(GAMEDIR)) @$(subst /,\,if exist $(GAMEDIR)/makefile. del $(GAMEDIR)/makefile.) endif @@ -455,7 +621,7 @@ endif @$(subst /,\,if exist $(DAT)/symbols copy $(DAT)/symbols $(GAMEDIR)) @$(subst /,\,copy $(SSHR)/NetHack.cnf $(GAMEDIR)/defaults.nh) -@$(subst /,\,touch $(GAMEDIR)/record) - @$(subst /,\,copy $(DOC)/guidebo*.txt $(GAMEDIR)) + @$(subst /,\,copy $(DOC)/guideb*.txt $(GAMEDIR)) @$(subst /,\,copy ../sys/winnt/sysconf $(GAMEDIR)) @$(subst /,\,if exist $(DOC)/nethack.txt copy $(DOC)/nethack.txt $(GAMEDIR)) ifdef CWSDPMI @@ -469,7 +635,8 @@ endif # The main target. #========================================== -$(GAMEFILE): $(O)obj.tag $(PATCHLEV_H) $(O)utility.tag $(ALLOBJ) $(O)$(GAME).lnk +$(GAMEFILE): $(O)obj.tag $(PATCHLEV_H) $(PDCLIB) $(LUATARGETS) \ + $(O)utility.tag $(ALLOBJ) $(O)$(GAME).lnk @if exist temp.a del temp.a @ar ru temp.a $(VOBJ01) @ar ru temp.a $(VOBJ02) @@ -494,11 +661,20 @@ $(GAMEFILE): $(O)obj.tag $(PATCHLEV_H) $(O)utility.tag $(ALLOBJ) $(O)$(GAME).lnk @ar ru temp.a $(VOBJ21) @ar ru temp.a $(VOBJ22) @ar ru temp.a $(VOBJ23) + @ar ru temp.a $(VOBJ24) + @ar ru temp.a $(VOBJ25) @ar ru temp.a $(SOBJ) @ar ru temp.a $(TILOBJ) @ar ru temp.a $(TILOBJ2) @ar ru temp.a $(VVOBJ) - $(LINK) $(LFLAGS) -o$(GAME).exe temp.a $(LIBRARIES) $(ZLIB) +ifeq "$(ADD_LUA)" "Y" + @ar ru temp.a $(LUAOBJ) +endif +ifeq "$(ADD_CURSES)" "Y" + @ar ru temp.a $(CURSESOBJ) +endif + $(LINK) $(LFLAGS) -o$(GAME).exe temp.a \ + $(PDCLIB) $(LUALIB) $(LIBRARIES) $(ZLIB) @$(subst /,\,stubedit $(GAME).exe minstack=2048K) @$(subst /,\,copy $(GAME).exe $(GAMEFILE)) @$(subst /,\,del $(GAME).exe) @@ -527,86 +703,18 @@ $(O)$(GAME).lnk: $(ALLOBJ) echo $(VOBJ21) >> $(subst /,\,$@) echo $(VOBJ22) >> $(subst /,\,$@) echo $(VOBJ23) >> $(subst /,\,$@) + echo $(VOBJ24) >> $(subst /,\,$@) + echo $(VOBJ25) >> $(subst /,\,$@) echo $(SOBJ) >> $(subst /,\,$@) echo $(TILOBJ) >> $(subst /,\,$@) echo $(TILOBJ2) >> $(subst /,\,$@) echo $(VVOBJ) >> $(subst /,\,$@) - - -#========================================== -# Housekeeping. -#========================================== - -clean: - $(subst /,\,if exist $(O)*.o del $(O)*.o) - $(subst /,\,if exist $(O)dat.tag del $(O)dat.tag) - $(subst /,\,if exist $(O)install.tag del $(O)install.tag) - $(subst /,\,if exist $(O)$(GAME).lnk del $(O)$(GAME).lnk) - $(subst /,\,if exist $(O)obj.tag del $(O)obj.tag) - $(subst /,\,if exist $(O)sp_lev.tag del $(O)sp_lev.tag) - $(subst /,\,if exist $(O)thintile.tag del $(O)thintile.tag) - $(subst /,\,if exist $(O)utility.tag del $(O)utility.tag) - $(subst /,\,if exist temp.a del temp.a) - -spotless: clean - - $(subst /,\,if exist $(U)lev_flex.c del $(U)lev_flex.c) - $(subst /,\,if exist $(U)lev_lex.c del $(U)lev_lex.c) - $(subst /,\,if exist $(U)lev_yacc.c del $(U)lev_yacc.c) - $(subst /,\,if exist $(U)dgn_flex.c del $(U)dgn_flex.c) - $(subst /,\,if exist $(U)dgn_lex.c del $(U)dgn_lex.c) - $(subst /,\,if exist $(U)dgn_yacc.c del $(U)lev_yacc.c) - $(subst /,\,if exist $(U)makedefs.exe del $(U)makedefs.exe) - $(subst /,\,if exist $(U)lev_comp.exe del $(U)lev_comp.exe) - $(subst /,\,if exist $(U)dgn_comp.exe del $(U)dgn_comp.exe) - $(subst /,\,if exist $(U)recover.exe del $(U)recover.exe) - $(subst /,\,if exist $(U)tilemap.exe del $(U)tilemap.exe) - $(subst /,\,if exist $(U)tile2bmp.exe del $(U)tile2bmp.exe) - $(subst /,\,if exist $(U)tile2bin.exe del $(U)tile2bin.exe) - $(subst /,\,if exist $(U)til2bin2.exe del $(U)til2bin2.exe) - $(subst /,\,if exist $(U)thintile.exe del $(U)thintile.exe) - $(subst /,\,if exist $(U)dlb_main.exe del $(U)dlb_main.exe) - $(subst /,\,if exist $(INCL)/vis_tab.h del $(INCL)/vis_tab.h) - $(subst /,\,if exist $(INCL)/onames.h del $(INCL)/onames.h) - $(subst /,\,if exist $(INCL)/pm.h del $(INCL)/pm.h) - $(subst /,\,if exist $(INCL)/date.h del $(INCL)/date.h) - $(subst /,\,if exist $(INCL)/dgn_comp.h del $(INCL)/dgn_comp.h) - $(subst /,\,if exist $(INCL)/lev_comp.h del $(INCL)/lev_comp.h) - $(subst /,\,if exist $(SRC)/monstr.c del $(SRC)/monstr.c) - $(subst /,\,if exist $(SRC)/vis_tab.c del $(SRC)/vis_tab.c) - $(subst /,\,if exist $(SRC)/tile.c del $(SRC)/tile.c) - $(subst /,\,if exist $(DAT)/options del $(DAT)/options) - $(subst /,\,if exist $(DAT)/data del $(DAT)/data) - $(subst /,\,if exist $(DAT)/rumors del $(DAT)/rumors) - $(subst /,\,if exist $(DAT)/dungeon.pdf del $(DAT)/dungeon.pdf) - $(subst /,\,if exist $(DAT)/dungeon del $(DAT)/dungeon) - $(subst /,\,if exist $(DAT)/oracles del $(DAT)/oracles) - $(subst /,\,if exist $(DAT)/quest.dat del $(DAT)/quest.dat) - $(subst /,\,if exist $(DAT)/bogusmon del $(DAT)/bogusmon) - $(subst /,\,if exist $(DAT)/engrave del $(DAT)/engrave) - $(subst /,\,if exist $(DAT)/epitaph del $(DAT)/epitaph) - $(subst /,\,if exist $(DAT)/dlb.lst del $(DAT)/dlb.lst) - $(subst /,\,if exist $(DAT)/nhdat del $(DAT)/nhdat) - $(subst /,\,if exist $(DAT)/*.lev del $(DAT)/*.lev) - $(subst /,\,if exist $(TILE_BMP) del $(TILE_BMP)) - $(subst /,\,if exist $(WSHR)/monthin.txt del $(WSHR)/monthin.txt) - $(subst /,\,if exist $(WSHR)/objthin.txt del $(WSHR)/objthin.txt) - $(subst /,\,if exist $(WSHR)/oththin.txt del $(WSHR)/oththin.txt) - -#========================================== -# Create directory for holding object files -#========================================== - -$(O)obj.tag: - -$(subst /,\,@if not exist $(OBJ)/*.* mkdir $(OBJ)) - @$(subst /,\,@echo directory created > $@) - -#=========================================== -# Work around some djgpp long file name woes -#=========================================== - -$(PATCHLEV_H): - @$(subst /,\,if not exist $@ copy $(INCL)/patchlevel.h $(INCL)/patchlev.h) +ifeq "$(ADD_LUA)" "Y" + echo $(LUAOBJ) >> $(subst /,\,$@) +endif +ifeq "$(ADD_CURSES)" "Y" + echo $(CURSESOBJ) >> $(subst /,\,$@) +endif #========================================== #=========== SECONDARY TARGETS ============ @@ -640,12 +748,13 @@ vis_tab.c: $(U)makedefs.exe # Makedefs Stuff #========================================== -$(U)makedefs.exe: $(MAKEOBJS) - $(LINK) $(LFLAGS) -o$@ $(MAKEOBJS) +$(U)makedefs.exe: $(MAKEDEFSOBJS) + $(LINK) $(LFLAGS) -o$@ $(MAKEDEFSOBJS) $(O)makedefs.o: $(CONFIG_H) $(PERMONST_H) $(INCL)/objclass.h \ $(INCL)/monsym.h $(INCL)/qtext.h $(U)makedefs.c +ifneq "$(ADD_LUA)" "Y" #========================================== # Level Compiler Dependencies #========================================== @@ -718,6 +827,7 @@ else @$(subst /,\,copy $(SSHR)/lev_lex.c $@) @$(subst /,\,echo.>>$@) endif +endif #========================================== # Dungeon Dependencies @@ -900,6 +1010,13 @@ $(O)viewtib.o: $(MSYS)/viewtib.c endif +#========================================== +# PDCurses Library +#========================================== + +$(O)pdcurses.a : $(PDCLIBOBJS) $(PDCOBJS) + ar rcs $@ $(PDCLIBOBJS) $(PDCOBJS) + #========================================== # Other Util Dependencies. #========================================== @@ -954,7 +1071,9 @@ $(DAT)/engrave: $(O)utility.tag $(DAT)/engrave.txt $(DAT)/epitaph: $(O)utility.tag $(DAT)/epitaph.txt @$(subst /,\,$(U)makedefs.exe -s) -$(O)sp_lev.tag: $(O)utility.tag $(DAT)/bigroom.des $(DAT)/castle.des \ +ifneq "$(ADD_LUA)" "Y" +$(O)sp_lev.tag: $(O)utility.tag \ + $(DAT)/bigroom.des $(DAT)/castle.des \ $(DAT)/endgame.des $(DAT)/gehennom.des $(DAT)/knox.des \ $(DAT)/medusa.des $(DAT)/oracle.des $(DAT)/tower.des \ $(DAT)/yendor.des $(DAT)/arch.des $(DAT)/barb.des \ @@ -988,6 +1107,9 @@ $(O)sp_lev.tag: $(O)utility.tag $(DAT)/bigroom.des $(DAT)/castle.des \ @$(subst /,\,$(U)lev_comp valkyrie.des) @$(subst /,\,$(U)lev_comp wizard.des) @$(subst /,\,cd $(SRC)) +else +$(O)sp_lev.tag: $(O)utility.tag +endif @$(subst /,\,echo sp_levs done > $@) $(DAT)/dungeon: $(O)utility.tag $(DAT)/dungeon.def @@ -1011,7 +1133,11 @@ $(DAT)/nhdat: $(U)dlb_main.exe $(DAT)/data $(DAT)/rumors $(DAT)/dungeon \ @$(LS) data dungeon oracles options quest.dat rumors help hh >dlb.lst @$(LS) cmdhelp history opthelp wizhelp license msdoshlp.txt >>dlb.lst @$(LS) bogusmon engrave epitaph tribute >>dlb.lst +ifeq "$(ADD_LUA)" "Y" + $(LS) $(subst /,\,*.lua) >>dlb.lst +else $(LS) $(subst /,\,*.lev) >>dlb.lst +endif @$(subst /,\,$(U)dlb_main cvIf dlb.lst nhdat) @$(subst /,\,cd $(SRC)) @@ -1021,6 +1147,100 @@ $(U)dlb_main.exe: $(DLBOBJS) $(O)dlb_main.o: $(U)dlb_main.c $(INCL)/config.h $(DLB_H) $(CC) $(cflags) -o$@ $(U)dlb_main.c +#============================================================= +# LUA +#============================================================= + +lua.exe: $(O)lua.o $(LUALIB) + $(link) $(LFLAGS) -o$@ $(O)lua.o $(LUALIB) + +luac.exe: $(O)luac.o $(O)lua535s.a + $(link) $(LFLAGSU) -o$@ $(O)luac.o $(LUALIB) + +$(O)lua535.a: $(LUAOBJFILES) + $(cc) -shared -Wl,--export-all-symbols \ + -Wl,--add-stdcall-alias -o $@ $< + +$(O)lua535s.a: $(LUAOBJFILES) + ar rcs $@ $(LUAOBJFILES) + +$(O)lua.o: $(LUASRC)/lua.c +$(O)luac.o: $(LUASRC)/luac.c + +#========================================== +# Housekeeping. +#========================================== + +clean: + $(subst /,\,if exist $(O)*.o del $(O)*.o) + $(subst /,\,if exist $(O)dat.tag del $(O)dat.tag) + $(subst /,\,if exist $(O)install.tag del $(O)install.tag) + $(subst /,\,if exist $(O)$(GAME).lnk del $(O)$(GAME).lnk) + $(subst /,\,if exist $(O)obj.tag del $(O)obj.tag) + $(subst /,\,if exist $(O)sp_lev.tag del $(O)sp_lev.tag) + $(subst /,\,if exist $(O)thintile.tag del $(O)thintile.tag) + $(subst /,\,if exist $(O)utility.tag del $(O)utility.tag) + $(subst /,\,if exist temp.a del temp.a) + +spotless: clean + + $(subst /,\,if exist $(U)dgn_flex.c del $(U)dgn_flex.c) + $(subst /,\,if exist $(U)dgn_lex.c del $(U)dgn_lex.c) + $(subst /,\,if exist $(U)makedefs.exe del $(U)makedefs.exe) + $(subst /,\,if exist $(U)dgn_comp.exe del $(U)dgn_comp.exe) + $(subst /,\,if exist $(U)recover.exe del $(U)recover.exe) + $(subst /,\,if exist $(U)tilemap.exe del $(U)tilemap.exe) + $(subst /,\,if exist $(U)tile2bmp.exe del $(U)tile2bmp.exe) + $(subst /,\,if exist $(U)tile2bin.exe del $(U)tile2bin.exe) + $(subst /,\,if exist $(U)til2bin2.exe del $(U)til2bin2.exe) + $(subst /,\,if exist $(U)thintile.exe del $(U)thintile.exe) + $(subst /,\,if exist $(U)dlb_main.exe del $(U)dlb_main.exe) + $(subst /,\,if exist $(INCL)/vis_tab.h del $(INCL)/vis_tab.h) + $(subst /,\,if exist $(INCL)/onames.h del $(INCL)/onames.h) + $(subst /,\,if exist $(INCL)/pm.h del $(INCL)/pm.h) + $(subst /,\,if exist $(INCL)/date.h del $(INCL)/date.h) + $(subst /,\,if exist $(INCL)/dgn_comp.h del $(INCL)/dgn_comp.h) +ifneq "$(ADD_LUA)" "Y" + $(subst /,\,if exist $(INCL)/lev_comp.h del $(INCL)/lev_comp.h) +endif + $(subst /,\,if exist $(SRC)/monstr.c del $(SRC)/monstr.c) + $(subst /,\,if exist $(SRC)/vis_tab.c del $(SRC)/vis_tab.c) + $(subst /,\,if exist $(SRC)/tile.c del $(SRC)/tile.c) + $(subst /,\,if exist $(DAT)/options del $(DAT)/options) + $(subst /,\,if exist $(DAT)/data del $(DAT)/data) + $(subst /,\,if exist $(DAT)/rumors del $(DAT)/rumors) + $(subst /,\,if exist $(DAT)/dungeon.pdf del $(DAT)/dungeon.pdf) + $(subst /,\,if exist $(DAT)/dungeon del $(DAT)/dungeon) + $(subst /,\,if exist $(DAT)/oracles del $(DAT)/oracles) + $(subst /,\,if exist $(DAT)/quest.dat del $(DAT)/quest.dat) + $(subst /,\,if exist $(DAT)/bogusmon del $(DAT)/bogusmon) + $(subst /,\,if exist $(DAT)/engrave del $(DAT)/engrave) + $(subst /,\,if exist $(DAT)/epitaph del $(DAT)/epitaph) + $(subst /,\,if exist $(DAT)/dlb.lst del $(DAT)/dlb.lst) + $(subst /,\,if exist $(DAT)/nhdat del $(DAT)/nhdat) +ifneq "$(ADD_LUA)" "Y" + $(subst /,\,if exist $(DAT)/*.lev del $(DAT)/*.lev) +endif + $(subst /,\,if exist $(TILE_BMP) del $(TILE_BMP)) + $(subst /,\,if exist $(WSHR)/monthin.txt del $(WSHR)/monthin.txt) + $(subst /,\,if exist $(WSHR)/objthin.txt del $(WSHR)/objthin.txt) + $(subst /,\,if exist $(WSHR)/oththin.txt del $(WSHR)/oththin.txt) + +#========================================== +# Create directory for holding object files +#========================================== + +$(O)obj.tag: + -$(subst /,\,@if not exist $(OBJ)/*.* mkdir $(OBJ)) + @$(subst /,\,@echo directory created > $@) + +#=========================================== +# Work around some djgpp long file name woes +#=========================================== + +$(PATCHLEV_H): + @$(subst /,\,if not exist $@ copy $(INCL)/patchlevel.h $(INCL)/patchlev.h) + #========================================== # Game Dependencies #========================================== @@ -1269,6 +1489,8 @@ $(O)mplayer.o: mplayer.c $(HACK_H) $(O)mthrowu.o: mthrowu.c $(HACK_H) $(O)muse.o: muse.c $(HACK_H) $(O)music.o: music.c $(HACK_H) #interp.c +$(O)nhlua.o: nhlua.c $(HACK_H) +$(O)nhlsel.o: nhlsel.c $(HACK_H) $(O)o_init.o: o_init.c $(HACK_H) $(INCL)/lev.h $(O)objects.o: objects.c $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \ $(INCL)/prop.h $(INCL)/skills.h $(INCL)/color.h diff --git a/sys/msdos/setup.bat b/sys/msdos/setup.bat index 403b3a69c..0613be865 100755 --- a/sys/msdos/setup.bat +++ b/sys/msdos/setup.bat @@ -16,10 +16,9 @@ goto err_set echo Checking to see if directories are set up properly ... if not exist ..\..\include\hack.h goto err_dir if not exist ..\..\src\hack.c goto err_dir -if not exist ..\..\dat\wizard.des goto err_dir +if not exist ..\..\dat\wizard1.lua goto err_dir if not exist ..\..\util\makedefs.c goto err_dir if not exist ..\..\win\tty\wintty.c goto err_dir -if not exist ..\share\lev_yacc.c goto err_dir echo Directories OK. if not exist ..\..\binary\* mkdir ..\..\binary diff --git a/sys/msdos/vidvesa.c b/sys/msdos/vidvesa.c index e9b7bb183..65ae2e845 100644 --- a/sys/msdos/vidvesa.c +++ b/sys/msdos/vidvesa.c @@ -62,7 +62,7 @@ extern int attrib_text_normal; /* text mode normal attribute */ extern int attrib_gr_normal; /* graphics mode normal attribute */ extern int attrib_gr_intense; /* graphics mode intense attribute */ extern boolean inmap; /* in the map window */ -extern boolean restoring; +/* extern boolean g.restoring; */ /* * Global Variables @@ -609,7 +609,7 @@ int x, y; clipx = clipxmax - (viewport_size - 1); } if (clipx != oldx) { - if (on_level(&u.uz0, &u.uz) && !restoring) + if (on_level(&u.uz0, &u.uz) && !g.restoring) /* (void) doredraw(); */ vesa_redrawmap(); } diff --git a/sys/msdos/vidvga.c b/sys/msdos/vidvga.c index 4e8a18206..13c873737 100644 --- a/sys/msdos/vidvga.c +++ b/sys/msdos/vidvga.c @@ -435,7 +435,7 @@ static void vga_cliparound(x, y) int x, y; { - extern boolean restoring; +/* extern boolean g.restoring; */ int oldx = clipx; if (!iflags.tile_view || iflags.over_view || iflags.traditional_view) @@ -449,7 +449,7 @@ int x, y; clipx = clipxmax - (viewport_size - 1); } if (clipx != oldx) { - if (on_level(&u.uz0, &u.uz) && !restoring) + if (on_level(&u.uz0, &u.uz) && !g.restoring) /* (void) doredraw(); */ vga_redrawmap(1); } diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c deleted file mode 100644 index acf03dbaf..000000000 --- a/sys/share/lev_lex.c +++ /dev/null @@ -1,3310 +0,0 @@ - -#line 3 "lev_lex.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex via 'flex -S flexhack.skl' - * where flexhack.skl is a nethack-specific alternate skeleton derived - * from flex 2.6.0's skel.c (which in turn was generated from flex.skl). - * - * Support for C++, re-entrancy, and table serialization stripped out. - * NetHack's usage doesn't need them and we want to reduce the size and - * complexity of this skeleton as well as of the generated scanner code. - */ -#define FLEXHACK_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 0 - -#include "config.h" - -#include - -/* we don't care if actual types happen to have more bits than their names; - the tables will just take up more space, possibly slowing the parse; - still, allow config.h to override these via typedef+#define if desired */ -#ifndef FLEX_INT32_T -typedef int flex_int32_t; -#endif -#ifndef FLEX_INT16_T -typedef short int flex_int16_t; -#endif -#ifndef FLEX_UINT16_T -typedef unsigned short int flex_uint16_t; -#endif - -#define yyconst const - -#define FDECL_dummy /*empty*/ - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (uchar) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character - * in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern yy_size_t yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -#define YY_LESS_LINENO(n) -#define YY_LINENO_REWIND_TO(ptr) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg); \ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - -}; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart FDECL(FDECL_dummy, (FILE *input_file )); -void yy_switch_to_buffer FDECL(FDECL_dummy, (YY_BUFFER_STATE new_buffer )); -YY_BUFFER_STATE yy_create_buffer FDECL(FDECL_dummy, (FILE *file,int size )); -void yy_delete_buffer FDECL(FDECL_dummy, (YY_BUFFER_STATE b )); -void yy_flush_buffer FDECL(FDECL_dummy, (YY_BUFFER_STATE b )); -void yypush_buffer_state FDECL(FDECL_dummy, (YY_BUFFER_STATE new_buffer )); -void yypop_buffer_state FDECL(FDECL_dummy, (void )); - -static void yyensure_buffer_stack FDECL(FDECL_dummy, (void )); -static void yy_load_buffer_state FDECL(FDECL_dummy, (void )); -static void yy_init_buffer FDECL(FDECL_dummy, (YY_BUFFER_STATE b,FILE *file )); - -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer FDECL(FDECL_dummy, (char *base,yy_size_t size )); -YY_BUFFER_STATE yy_scan_string FDECL(FDECL_dummy, (yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes FDECL(FDECL_dummy, (yyconst char *bytes,yy_size_t len )); - -void *yyalloc FDECL(FDECL_dummy, (yy_size_t )); -void *yyrealloc FDECL(FDECL_dummy, (void *,yy_size_t )); -void yyfree FDECL(FDECL_dummy, (void * )); - -#define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ) { \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ) { \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; - -typedef int yy_state_type; - -extern int yylineno; - -int yylineno = 1; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state FDECL(FDECL_dummy, (void )); -static yy_state_type yy_try_NUL_trans FDECL(FDECL_dummy, (yy_state_type current_state )); -static int yy_get_next_buffer FDECL(FDECL_dummy, (void )); -static void yy_fatal_error FDECL(FDECL_dummy, (yyconst char msg[] )) NORETURN; - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 200 -#define YY_END_OF_BUFFER 201 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[1057] = - { 0, - 0, 0, 0, 0, 201, 199, 195, 194, 199, 199, - 199, 199, 199, 199, 198, 184, 192, 199, 193, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 199, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 195, 199, 198, 2, 199, 195, 199, 199, 198, 184, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 195, 199, 195, 194, 188, 0, 185, 186, - 0, 0, 182, 198, 181, 183, 184, 198, 190, 189, - - 187, 191, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 39, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 55, 198, 198, 0, 0, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 154, 198, 198, 195, 0, 0, 3, 198, - 2, 2, 0, 195, 0, 182, 198, 181, 184, 198, - 198, 198, 198, 39, 198, 198, 198, 198, 198, 198, - 195, 0, 2, 0, 0, 197, 0, 197, 179, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 54, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 0, 198, 104, 198, 83, - - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 79, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 81, - 198, 198, 198, 198, 198, 139, 198, 198, 198, 198, - 128, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 16, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 126, 198, 198, 198, 198, 198, 198, 198, - - 198, 80, 198, 198, 198, 198, 198, 198, 198, 198, - 196, 198, 198, 198, 58, 198, 198, 198, 22, 198, - 40, 198, 41, 198, 198, 198, 198, 49, 198, 198, - 198, 198, 56, 6, 198, 198, 198, 53, 198, 198, - 198, 36, 198, 198, 198, 198, 42, 198, 35, 198, - 198, 198, 198, 198, 21, 198, 0, 180, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 160, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 155, 158, 114, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 69, 198, 198, 198, - - 198, 198, 198, 198, 198, 198, 121, 198, 198, 67, - 198, 198, 198, 198, 161, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 119, 198, 198, 198, 198, 107, - 198, 198, 198, 198, 198, 198, 198, 65, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 157, 198, 198, 198, - 198, 198, 116, 15, 0, 198, 198, 198, 198, 198, - 28, 198, 59, 198, 198, 198, 198, 198, 13, 198, - 198, 198, 50, 198, 198, 7, 198, 198, 198, 198, - 5, 198, 198, 198, 198, 198, 198, 198, 198, 198, - - 30, 198, 198, 198, 198, 198, 120, 153, 198, 198, - 198, 147, 198, 198, 162, 198, 198, 198, 198, 198, - 141, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 156, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 11, 198, - 198, 198, 198, 198, 198, 198, 113, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 125, 198, 12, 198, 198, 198, 198, 198, 198, 198, - 82, 115, 198, 198, 198, 198, 198, 198, 198, 198, - - 129, 198, 198, 198, 198, 33, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 29, 198, 198, 198, 198, - 198, 198, 17, 31, 198, 27, 198, 198, 198, 198, - 57, 198, 198, 198, 198, 146, 97, 198, 198, 127, - 111, 86, 198, 123, 72, 108, 198, 198, 198, 198, - 165, 198, 198, 87, 198, 94, 130, 198, 74, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 135, 198, 198, 109, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 110, 168, 198, 198, - 198, 16, 198, 198, 198, 198, 77, 198, 117, 198, - - 198, 198, 198, 198, 112, 198, 198, 198, 152, 173, - 198, 198, 78, 198, 198, 198, 198, 198, 198, 198, - 198, 1, 57, 198, 198, 198, 60, 198, 198, 198, - 198, 198, 198, 198, 4, 198, 19, 198, 198, 198, - 198, 198, 62, 43, 198, 46, 26, 198, 163, 99, - 198, 198, 198, 198, 198, 73, 159, 198, 198, 98, - 198, 198, 198, 93, 198, 198, 198, 198, 145, 198, - 198, 198, 198, 198, 136, 198, 198, 198, 198, 198, - 20, 63, 140, 138, 198, 198, 198, 198, 198, 198, - 198, 198, 118, 198, 132, 96, 198, 151, 198, 198, - - 198, 198, 198, 101, 47, 89, 198, 198, 198, 198, - 198, 198, 45, 198, 198, 34, 61, 14, 8, 25, - 198, 198, 198, 198, 198, 23, 198, 169, 198, 198, - 198, 102, 177, 198, 66, 198, 75, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 150, - 9, 198, 198, 198, 198, 198, 144, 198, 85, 68, - 198, 71, 198, 198, 198, 198, 176, 164, 131, 134, - 198, 106, 18, 198, 51, 198, 198, 198, 198, 198, - 198, 95, 142, 198, 198, 70, 174, 122, 198, 167, - 198, 175, 198, 92, 133, 84, 148, 149, 171, 198, - - 198, 198, 100, 172, 91, 198, 64, 198, 10, 137, - 24, 52, 198, 198, 198, 198, 198, 76, 88, 124, - 105, 198, 198, 198, 166, 103, 198, 198, 198, 198, - 198, 198, 198, 198, 90, 198, 37, 38, 198, 198, - 198, 198, 143, 170, 198, 198, 198, 178, 198, 198, - 198, 198, 48, 32, 44, 0 - } ; - -static yyconst YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 6, 7, 8, 9, 10, 1, 11, 1, - 1, 1, 12, 1, 13, 14, 1, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 1, 1, 16, - 17, 18, 1, 1, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 1, 48, 1, 49, 50, 51, 52, - - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 14, 14, 14, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst YY_CHAR yy_meta[75] = - { 0, - 1, 2, 3, 2, 2, 1, 1, 2, 1, 1, - 1, 2, 4, 2, 4, 1, 1, 1, 5, 5, - 5, 6, 6, 5, 6, 5, 5, 6, 5, 5, - 6, 6, 6, 5, 6, 6, 5, 5, 6, 6, - 5, 6, 6, 6, 1, 2, 1, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 5, 6, 6 - } ; - -static yyconst flex_uint16_t yy_base[1064] = - { 0, - 0, 73, 102, 77, 1254, 1255, 75, 1255, 1250, 1235, - 1244, 0, 1204, 1234, 1233, 78, 66, 1230, 1229, 1215, - 1208, 57, 63, 59, 64, 101, 0, 63, 79, 119, - 94, 1223, 1209, 122, 123, 121, 1222, 104, 105, 100, - 124, 90, 129, 137, 1174, 84, 117, 1176, 139, 150, - 151, 151, 156, 1169, 163, 168, 166, 56, 1184, 1183, - 232, 1232, 216, 1255, 1231, 242, 248, 251, 264, 196, - 155, 167, 208, 228, 241, 1218, 249, 242, 195, 277, - 284, 223, 319, 334, 257, 1255, 1255, 1225, 1255, 0, - 1220, 1219, 1214, 0, 1213, 1255, 298, 1212, 1255, 1255, - - 1255, 1255, 1188, 263, 1188, 264, 1200, 1190, 1203, 1184, - 1195, 1192, 1199, 270, 1185, 1183, 1185, 1195, 0, 1186, - 1190, 1171, 1177, 1165, 1171, 1175, 1174, 1174, 280, 1176, - 292, 1171, 301, 1169, 1162, 1168, 1180, 1178, 1170, 259, - 0, 1177, 1165, 203, 304, 272, 1121, 1143, 1132, 1138, - 1141, 288, 1121, 1125, 1121, 1124, 1123, 1135, 1117, 1119, - 308, 1115, 1109, 1106, 1111, 1110, 1116, 1120, 1111, 1113, - 1111, 1111, 234, 281, 296, 299, 1117, 282, 1103, 1111, - 1096, 81, 315, 1115, 324, 26, 1103, 1102, 1102, 1093, - 330, 1103, 1107, 1093, 1109, 1104, 1107, 281, 333, 1100, - - 1102, 1098, 1090, 342, 323, 321, 1082, 1081, 1083, 1084, - 345, 350, 0, 1081, 332, 407, 1143, 1142, 1255, 363, - 1255, 1255, 1141, 411, 415, 416, 1128, 0, 412, 390, - 396, 404, 415, 1127, 410, 420, 421, 422, 423, 424, - 0, 0, 1255, 1138, 0, 1255, 1129, 1128, 1123, 1118, - 1104, 1116, 1111, 1095, 1096, 1112, 1094, 1088, 1105, 1091, - 1088, 1100, 0, 1092, 1102, 1091, 1099, 1080, 1081, 1096, - 1094, 1082, 1092, 1077, 1090, 1075, 1088, 1091, 1061, 1085, - 1077, 1068, 1083, 1077, 1073, 1071, 1077, 1071, 1072, 1062, - 1059, 1073, 1059, 1060, 1063, 435, 1037, 0, 1042, 0, - - 1027, 1036, 1026, 1028, 1019, 1023, 1021, 1015, 1023, 385, - 1030, 1012, 1016, 1027, 1010, 1016, 1011, 1020, 1007, 1005, - 1009, 0, 1002, 1001, 1011, 1001, 1014, 998, 1015, 383, - 1010, 999, 392, 1012, 989, 1005, 1006, 1000, 988, 0, - 1003, 1003, 996, 999, 989, 0, 982, 983, 991, 994, - 0, 987, 992, 981, 993, 983, 988, 987, 378, 986, - 970, 977, 973, 974, 404, 966, 408, 980, 970, 982, - 979, 968, 966, 970, 974, 392, 956, 967, 967, 971, - 952, 969, 953, 956, 964, 950, 395, 958, 946, 964, - 950, 945, 0, 946, 956, 939, 950, 943, 948, 936, - - 935, 0, 462, 448, 453, 971, 454, 456, 434, 455, - 1255, 965, 979, 970, 0, 979, 970, 957, 0, 975, - 0, 975, 0, 956, 954, 953, 967, 0, 966, 940, - 964, 956, 0, 944, 965, 947, 944, 0, 947, 452, - 959, 0, 960, 945, 944, 957, 953, 950, 0, 937, - 939, 950, 936, 950, 0, 941, 468, 1255, 905, 900, - 899, 911, 908, 909, 894, 908, 907, 895, 904, 903, - 0, 902, 901, 886, 892, 898, 893, 889, 879, 886, - 893, 0, 0, 0, 881, 895, 890, 889, 881, 422, - 887, 882, 886, 880, 883, 868, 0, 921, 879, 858, - - 874, 866, 878, 861, 872, 873, 0, 872, 856, 0, - 870, 873, 859, 862, 0, 429, 852, 850, 844, 850, - 858, 851, 864, 849, 0, 855, 842, 849, 857, 0, - 847, 853, 856, 836, 854, 417, 853, 0, 841, 830, - 831, 835, 844, 828, 842, 846, 842, 824, 829, 821, - 837, 832, 821, 824, 836, 820, 0, 817, 822, 824, - 426, 823, 0, 1255, 876, 463, 859, 466, 475, 476, - 0, 851, 0, 849, 853, 844, 837, 832, 0, 852, - 843, 831, 0, 837, 831, 0, 847, 840, 845, 840, - 0, 835, 842, 822, 829, 827, 825, 835, 822, 824, - - 0, 820, 826, 818, 823, 825, 0, 0, 795, 783, - 793, 0, 792, 791, 0, 782, 780, 789, 780, 773, - 0, 785, 785, 781, 782, 767, 784, 780, 764, 760, - 440, 0, 776, 776, 774, 760, 763, 770, 770, 749, - 768, 435, 760, 756, 758, 754, 763, 758, 745, 761, - 757, 758, 758, 741, 741, 754, 740, 752, 0, 751, - 739, 753, 746, 734, 735, 749, 0, 731, 743, 727, - 721, 739, 728, 734, 730, 732, 727, 721, 737, 732, - 0, 721, 0, 714, 714, 713, 712, 712, 725, 725, - 443, 0, 723, 722, 717, 720, 705, 711, 708, 712, - - 0, 717, 733, 483, 490, 0, 734, 732, 726, 736, - 735, 734, 727, 723, 739, 0, 724, 712, 81, 122, - 205, 226, 0, 0, 311, 0, 350, 460, 483, 476, - 0, 472, 478, 468, 463, 0, 0, 461, 464, 0, - 0, 0, 457, 0, 0, 0, 456, 458, 467, 447, - 0, 469, 470, 0, 458, 0, 0, 474, 0, 471, - 470, 466, 480, 478, 478, 475, 470, 472, 482, 473, - 470, 488, 479, 0, 483, 489, 0, 473, 475, 493, - 488, 476, 481, 495, 489, 488, 0, 0, 491, 503, - 489, 0, 480, 486, 492, 489, 0, 496, 514, 505, - - 495, 510, 497, 503, 0, 499, 509, 510, 0, 0, - 511, 515, 0, 518, 509, 520, 520, 521, 522, 508, - 528, 0, 563, 564, 557, 545, 0, 560, 551, 552, - 553, 543, 553, 559, 0, 562, 0, 565, 554, 571, - 545, 558, 0, 0, 557, 0, 0, 536, 0, 0, - 544, 545, 546, 548, 548, 0, 0, 539, 535, 0, - 544, 537, 540, 0, 554, 554, 547, 543, 0, 552, - 546, 554, 566, 553, 0, 551, 565, 551, 568, 568, - 0, 0, 0, 0, 565, 559, 561, 572, 566, 574, - 555, 576, 1255, 577, 0, 0, 579, 0, 583, 570, - - 579, 575, 563, 0, 0, 0, 585, 586, 587, 587, - 581, 606, 0, 618, 619, 0, 0, 0, 0, 0, - 601, 627, 606, 615, 611, 0, 602, 0, 599, 600, - 591, 0, 0, 591, 0, 595, 0, 604, 589, 602, - 593, 611, 594, 605, 610, 598, 603, 613, 601, 0, - 0, 608, 614, 606, 605, 620, 0, 621, 0, 0, - 622, 0, 611, 614, 621, 618, 0, 0, 0, 0, - 627, 0, 0, 657, 0, 658, 662, 664, 648, 662, - 650, 0, 0, 619, 634, 0, 0, 0, 621, 0, - 630, 0, 641, 0, 0, 0, 0, 0, 0, 630, - - 640, 626, 0, 0, 0, 628, 0, 628, 0, 0, - 0, 0, 667, 668, 663, 664, 678, 0, 0, 0, - 0, 642, 650, 652, 0, 0, 652, 683, 677, 681, - 673, 685, 658, 660, 0, 661, 0, 0, 692, 696, - 689, 650, 0, 0, 685, 692, 687, 0, 685, 690, - 691, 687, 0, 0, 0, 1255, 724, 726, 732, 735, - 741, 746, 751 - } ; - -static yyconst flex_int16_t yy_def[1064] = - { 0, - 1056, 1, 1, 3, 1056, 1056, 1056, 1056, 1056, 1056, - 1057, 1058, 1059, 1056, 1060, 1060, 1056, 1056, 1056, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1056, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1056, 1061, 1060, 1056, 1056, 1062, 1062, 1062, 1060, 69, - 69, 69, 69, 1060, 69, 69, 69, 69, 69, 69, - 69, 69, 1062, 1061, 1056, 1056, 1056, 1057, 1056, 1058, - 1056, 1063, 1056, 1060, 1060, 1056, 1060, 1060, 1056, 1056, - - 1056, 1056, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1056, 1056, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1056, 1061, 1061, 1056, 1060, - 1056, 1056, 1056, 83, 83, 83, 69, 69, 69, 69, - 69, 1060, 69, 69, 69, 69, 69, 69, 69, 69, - 83, 84, 1056, 1061, 84, 1056, 1056, 1056, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1056, 1060, 1060, 1060, 1060, - - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - - 1060, 1060, 1060, 69, 69, 1060, 69, 69, 69, 69, - 1056, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1056, 1056, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1056, 1056, 69, 1060, 69, 69, 69, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - - 1060, 1060, 1060, 69, 69, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 69, 69, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1056, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1060, 1060, 1060, 1060, 1060, 0, 1056, 1056, 1056, 1056, - 1056, 1056, 1056 - } ; - -static yyconst flex_uint16_t yy_nxt[1330] = - { 0, - 6, 7, 8, 9, 7, 10, 11, 6, 12, 6, - 13, 14, 15, 6, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 27, 27, 29, - 30, 31, 32, 33, 27, 34, 35, 36, 27, 27, - 37, 27, 27, 27, 38, 6, 6, 27, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 27, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 27, 27, 27, 61, 105, 85, 61, 61, 85, - 62, 83, 99, 100, 84, 107, 119, 96, 110, 106, - 111, 356, 97, 113, 120, 108, 114, 121, 109, 357, - - 112, 122, 115, 63, 64, 65, 66, 63, 144, 67, - 836, 123, 128, 68, 69, 67, 70, 212, 145, 213, - 71, 72, 73, 116, 74, 75, 129, 76, 77, 98, - 76, 78, 175, 117, 347, 79, 118, 124, 80, 81, - 132, 125, 82, 140, 133, 126, 176, 67, 135, 136, - 348, 127, 163, 141, 134, 164, 142, 837, 165, 152, - 137, 138, 153, 139, 146, 154, 147, 177, 155, 227, - 148, 149, 156, 76, 150, 151, 157, 166, 178, 158, - 159, 227, 179, 160, 230, 170, 161, 181, 167, 171, - 168, 182, 162, 172, 169, 183, 173, 185, 186, 189, - - 192, 184, 104, 190, 194, 96, 187, 144, 195, 227, - 229, 198, 188, 191, 193, 199, 203, 145, 209, 200, - 204, 196, 227, 205, 201, 202, 231, 131, 210, 838, - 206, 211, 207, 216, 220, 208, 216, 227, 125, 217, - 106, 240, 126, 85, 222, 223, 224, 98, 127, 1056, - 222, 223, 1056, 222, 223, 227, 227, 110, 85, 232, - 235, 85, 839, 227, 122, 226, 222, 223, 225, 112, - 233, 225, 234, 114, 123, 225, 227, 225, 228, 115, - 120, 251, 227, 227, 227, 252, 331, 227, 292, 227, - 227, 227, 227, 227, 293, 254, 332, 227, 227, 255, - - 227, 227, 236, 237, 227, 263, 140, 96, 264, 225, - 278, 279, 97, 296, 238, 138, 141, 239, 145, 142, - 216, 222, 223, 241, 281, 284, 242, 282, 297, 333, - 342, 298, 374, 334, 285, 227, 243, 244, 245, 299, - 305, 245, 375, 335, 306, 245, 245, 245, 245, 98, - 307, 343, 245, 245, 245, 336, 316, 245, 840, 245, - 245, 337, 245, 245, 338, 339, 340, 245, 317, 318, - 245, 245, 841, 319, 245, 349, 350, 353, 362, 245, - 388, 363, 351, 376, 354, 386, 355, 377, 387, 389, - 364, 365, 383, 394, 384, 366, 403, 367, 401, 402, - - 396, 385, 378, 397, 227, 245, 273, 398, 216, 399, - 227, 216, 85, 395, 217, 224, 1056, 1056, 225, 225, - 225, 96, 225, 225, 227, 406, 229, 404, 260, 227, - 226, 270, 405, 407, 227, 227, 227, 227, 227, 457, - 408, 470, 490, 494, 518, 519, 471, 537, 227, 409, - 491, 549, 288, 410, 524, 527, 525, 550, 287, 538, - 528, 495, 227, 98, 564, 565, 566, 227, 227, 227, - 227, 569, 457, 592, 634, 415, 676, 227, 424, 677, - 227, 458, 568, 657, 570, 593, 700, 635, 658, 227, - 227, 754, 842, 701, 765, 704, 811, 227, 571, 812, - - 766, 601, 705, 755, 227, 843, 844, 845, 823, 846, - 847, 848, 849, 824, 458, 850, 851, 852, 853, 854, - 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, - 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, - 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, - 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, - 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, - 905, 906, 907, 908, 909, 910, 911, 227, 227, 912, - 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, - 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, - - 933, 934, 935, 936, 937, 938, 847, 939, 940, 941, - 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, - 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, - 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, - 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, - 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, - 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, - 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, - 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, - 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, - - 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, - 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, - 1052, 1053, 1054, 1055, 88, 88, 88, 88, 88, 88, - 90, 90, 91, 91, 835, 91, 91, 91, 94, 94, - 94, 218, 218, 218, 218, 218, 218, 225, 225, 225, - 225, 247, 247, 834, 247, 247, 247, 833, 832, 831, - 830, 829, 828, 827, 826, 825, 822, 821, 820, 819, - 818, 817, 816, 815, 814, 813, 810, 809, 808, 807, - 806, 805, 804, 803, 802, 801, 800, 799, 798, 797, - 796, 795, 794, 793, 792, 791, 790, 789, 788, 787, - - 786, 785, 784, 783, 782, 781, 780, 779, 778, 777, - 776, 775, 774, 773, 772, 771, 770, 769, 768, 767, - 764, 763, 762, 761, 760, 759, 758, 757, 756, 753, - 752, 751, 750, 749, 748, 747, 746, 745, 744, 743, - 742, 741, 740, 739, 738, 737, 736, 735, 734, 733, - 732, 731, 730, 729, 728, 727, 726, 725, 724, 723, - 722, 721, 720, 719, 718, 717, 716, 715, 714, 713, - 712, 711, 710, 709, 708, 707, 706, 703, 564, 702, - 699, 698, 697, 696, 695, 694, 693, 692, 691, 690, - 689, 688, 687, 686, 685, 684, 683, 682, 681, 680, - - 679, 678, 675, 674, 673, 672, 671, 670, 669, 668, - 667, 666, 665, 664, 663, 662, 661, 660, 659, 656, - 655, 654, 653, 652, 651, 650, 649, 648, 647, 646, - 645, 644, 643, 642, 641, 640, 639, 638, 637, 636, - 633, 632, 631, 630, 629, 628, 627, 626, 625, 624, - 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, - 613, 612, 611, 610, 609, 608, 607, 606, 605, 604, - 603, 602, 601, 600, 599, 598, 597, 596, 595, 594, - 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, - 581, 580, 579, 578, 577, 576, 575, 574, 573, 572, - - 571, 567, 563, 562, 561, 560, 559, 558, 557, 556, - 555, 554, 553, 552, 551, 548, 547, 546, 545, 544, - 543, 542, 541, 540, 539, 536, 535, 534, 533, 532, - 531, 530, 529, 526, 523, 522, 521, 520, 438, 517, - 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, - 506, 505, 504, 503, 502, 501, 500, 499, 498, 497, - 496, 493, 492, 489, 488, 487, 486, 485, 484, 483, - 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, - 472, 469, 468, 467, 466, 465, 464, 463, 462, 461, - 460, 459, 456, 455, 454, 453, 452, 451, 450, 449, - - 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - 418, 417, 416, 415, 414, 413, 412, 249, 411, 411, - 243, 227, 227, 222, 219, 219, 400, 393, 392, 391, - 390, 382, 381, 380, 379, 373, 372, 371, 370, 369, - 368, 361, 360, 359, 358, 352, 346, 345, 344, 341, - 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, - 320, 315, 314, 313, 312, 311, 310, 309, 308, 304, - 303, 302, 301, 300, 295, 294, 291, 290, 289, 288, - - 287, 286, 283, 280, 277, 276, 275, 274, 273, 272, - 271, 270, 269, 268, 267, 266, 265, 262, 261, 260, - 259, 258, 257, 256, 253, 250, 249, 95, 93, 248, - 246, 89, 227, 221, 219, 215, 214, 197, 180, 174, - 143, 131, 130, 104, 103, 102, 101, 95, 93, 92, - 89, 87, 86, 1056, 5, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056 - } ; - -static yyconst flex_int16_t yy_chk[1330] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 22, 7, 2, 4, 7, - 2, 4, 17, 17, 4, 23, 28, 16, 24, 22, - 24, 186, 16, 25, 28, 23, 25, 29, 23, 186, - - 24, 29, 25, 2, 3, 3, 3, 4, 38, 3, - 719, 29, 31, 3, 3, 3, 3, 58, 38, 58, - 3, 3, 3, 26, 3, 3, 31, 3, 3, 16, - 3, 3, 46, 26, 182, 3, 26, 30, 3, 3, - 34, 30, 3, 36, 34, 30, 46, 3, 35, 35, - 182, 30, 42, 36, 34, 42, 36, 720, 42, 40, - 35, 35, 40, 35, 39, 40, 39, 47, 40, 71, - 39, 39, 41, 3, 39, 39, 41, 43, 47, 41, - 41, 72, 47, 41, 71, 44, 41, 49, 43, 44, - 43, 49, 41, 44, 43, 49, 44, 50, 50, 51, - - 52, 49, 72, 51, 53, 70, 50, 144, 53, 79, - 70, 55, 50, 51, 52, 55, 56, 144, 57, 55, - 56, 53, 73, 56, 55, 55, 73, 79, 57, 721, - 56, 57, 56, 61, 63, 56, 61, 82, 63, 61, - 73, 82, 63, 66, 66, 66, 66, 70, 63, 67, - 67, 67, 68, 68, 68, 75, 78, 74, 85, 74, - 78, 85, 722, 77, 78, 68, 69, 69, 69, 74, - 75, 69, 77, 75, 78, 69, 69, 69, 69, 75, - 77, 104, 69, 69, 69, 104, 173, 69, 140, 69, - 69, 80, 69, 69, 140, 106, 173, 69, 81, 106, - - 69, 69, 80, 80, 69, 114, 81, 97, 114, 69, - 129, 129, 97, 145, 80, 80, 81, 80, 145, 81, - 83, 83, 83, 83, 131, 133, 83, 131, 146, 174, - 178, 146, 198, 174, 133, 69, 84, 84, 84, 146, - 152, 84, 198, 174, 152, 84, 84, 84, 84, 97, - 152, 178, 84, 84, 84, 175, 161, 84, 725, 84, - 84, 175, 84, 84, 176, 176, 176, 84, 161, 161, - 84, 84, 727, 161, 84, 183, 183, 185, 191, 84, - 206, 191, 183, 199, 185, 205, 185, 199, 205, 206, - 191, 191, 204, 211, 204, 191, 220, 191, 215, 215, - - 212, 204, 199, 212, 230, 84, 220, 212, 216, 212, - 231, 216, 224, 211, 216, 224, 225, 226, 224, 225, - 226, 229, 225, 226, 235, 232, 229, 230, 232, 233, - 226, 235, 231, 233, 236, 237, 238, 239, 240, 296, - 238, 310, 330, 333, 359, 359, 310, 376, 409, 239, - 330, 387, 237, 240, 365, 367, 365, 387, 236, 376, - 367, 333, 404, 229, 403, 403, 404, 405, 407, 410, - 408, 409, 457, 440, 490, 405, 536, 566, 407, 536, - 568, 296, 408, 516, 410, 440, 561, 490, 516, 569, - 570, 631, 728, 561, 642, 569, 691, 704, 566, 691, - - 642, 568, 570, 631, 705, 729, 730, 732, 704, 733, - 734, 735, 738, 705, 457, 739, 743, 747, 748, 749, - 750, 752, 753, 755, 758, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 775, - 776, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 789, 790, 791, 793, 794, 795, 796, 798, 799, 800, - 801, 802, 803, 804, 806, 807, 808, 811, 812, 814, - 815, 816, 817, 818, 819, 820, 821, 823, 824, 825, - 826, 828, 829, 830, 831, 832, 833, 834, 836, 838, - 839, 840, 841, 842, 845, 848, 851, 852, 853, 854, - - 855, 858, 859, 861, 862, 863, 824, 865, 866, 867, - 868, 870, 871, 872, 873, 874, 876, 877, 878, 879, - 880, 885, 886, 887, 888, 889, 890, 891, 892, 894, - 897, 899, 900, 901, 902, 903, 907, 908, 909, 910, - 911, 912, 914, 915, 921, 922, 923, 924, 925, 927, - 929, 930, 931, 934, 936, 938, 939, 940, 941, 942, - 943, 944, 945, 946, 947, 948, 949, 952, 953, 954, - 955, 956, 958, 961, 963, 964, 965, 966, 971, 974, - 976, 977, 978, 979, 980, 981, 984, 985, 989, 991, - 993, 1000, 1001, 1002, 1006, 1008, 1013, 1014, 1015, 1016, - - 1017, 1022, 1023, 1024, 1027, 1028, 1029, 1030, 1031, 1032, - 1033, 1034, 1036, 1039, 1040, 1041, 1042, 1045, 1046, 1047, - 1049, 1050, 1051, 1052, 1057, 1057, 1057, 1057, 1057, 1057, - 1058, 1058, 1059, 1059, 718, 1059, 1059, 1059, 1060, 1060, - 1060, 1061, 1061, 1061, 1061, 1061, 1061, 1062, 1062, 1062, - 1062, 1063, 1063, 717, 1063, 1063, 1063, 715, 714, 713, - 712, 711, 710, 709, 708, 707, 703, 702, 700, 699, - 698, 697, 696, 695, 694, 693, 690, 689, 688, 687, - 686, 685, 684, 682, 680, 679, 678, 677, 676, 675, - 674, 673, 672, 671, 670, 669, 668, 666, 665, 664, - - 663, 662, 661, 660, 658, 657, 656, 655, 654, 653, - 652, 651, 650, 649, 648, 647, 646, 645, 644, 643, - 641, 640, 639, 638, 637, 636, 635, 634, 633, 630, - 629, 628, 627, 626, 625, 624, 623, 622, 620, 619, - 618, 617, 616, 614, 613, 611, 610, 609, 606, 605, - 604, 603, 602, 600, 599, 598, 597, 596, 595, 594, - 593, 592, 590, 589, 588, 587, 585, 584, 582, 581, - 580, 578, 577, 576, 575, 574, 572, 567, 565, 562, - 560, 559, 558, 556, 555, 554, 553, 552, 551, 550, - 549, 548, 547, 546, 545, 544, 543, 542, 541, 540, - - 539, 537, 535, 534, 533, 532, 531, 529, 528, 527, - 526, 524, 523, 522, 521, 520, 519, 518, 517, 514, - 513, 512, 511, 509, 508, 506, 505, 504, 503, 502, - 501, 500, 499, 498, 496, 495, 494, 493, 492, 491, - 489, 488, 487, 486, 485, 481, 480, 479, 478, 477, - 476, 475, 474, 473, 472, 470, 469, 468, 467, 466, - 465, 464, 463, 462, 461, 460, 459, 456, 454, 453, - 452, 451, 450, 448, 447, 446, 445, 444, 443, 441, - 439, 437, 436, 435, 434, 432, 431, 430, 429, 427, - 426, 425, 424, 422, 420, 418, 417, 416, 414, 413, - - 412, 406, 401, 400, 399, 398, 397, 396, 395, 394, - 392, 391, 390, 389, 388, 386, 385, 384, 383, 382, - 381, 380, 379, 378, 377, 375, 374, 373, 372, 371, - 370, 369, 368, 366, 364, 363, 362, 361, 360, 358, - 357, 356, 355, 354, 353, 352, 350, 349, 348, 347, - 345, 344, 343, 342, 341, 339, 338, 337, 336, 335, - 334, 332, 331, 329, 328, 327, 326, 325, 324, 323, - 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, - 311, 309, 308, 307, 306, 305, 304, 303, 302, 301, - 299, 297, 295, 294, 293, 292, 291, 290, 289, 288, - - 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, - 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, - 267, 266, 265, 264, 262, 261, 260, 259, 258, 257, - 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, - 244, 234, 227, 223, 218, 217, 214, 210, 209, 208, - 207, 203, 202, 201, 200, 197, 196, 195, 194, 193, - 192, 190, 189, 188, 187, 184, 181, 180, 179, 177, - 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, - 162, 160, 159, 158, 157, 156, 155, 154, 153, 151, - 150, 149, 148, 147, 143, 142, 139, 138, 137, 136, - - 135, 134, 132, 130, 128, 127, 126, 125, 124, 123, - 122, 121, 120, 118, 117, 116, 115, 113, 112, 111, - 110, 109, 108, 107, 105, 103, 98, 95, 93, 92, - 91, 88, 76, 65, 62, 60, 59, 54, 48, 45, - 37, 33, 32, 21, 20, 19, 18, 15, 14, 13, - 11, 10, 9, 5, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -/* NetHack 3.6 lev_comp.l $NHDT-Date: 1543372935 2018/11/28 02:42:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.29 $ */ -/* Copyright (c) 1989 by Jean-Christophe Collet */ -/* NetHack may be freely redistributed. See license for details. */ - -#define LEV_LEX_C - -#include "hack.h" -#include "lev_comp.h" -#include "sp_lev.h" - -/* Most of these don't exist in flex, yywrap is macro and - * yyunput is properly declared in flex.skel. - */ -#if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) -int FDECL(yyback, (int *,int)); -int NDECL(yylook); -int NDECL(yyinput); -int NDECL(yywrap); -int NDECL(yylex); - /* Traditional lexes let yyunput() and yyoutput() default to int; - * newer ones may declare them as void since they don't return - * values. For even more fun, the lex supplied as part of the - * newer unbundled compiler for SunOS 4.x adds the void declarations - * (under __STDC__ or _cplusplus ifdefs -- otherwise they remain - * int) while the bundled lex and the one with the older unbundled - * compiler do not. To detect this, we need help from outside -- - * sys/unix/Makefile.utl. - * - * Digital UNIX is difficult and still has int in spite of all - * other signs. - */ -# if defined(NeXT) || defined(SVR4) || defined(_AIX32) -# define VOIDYYPUT -# endif -# if !defined(VOIDYYPUT) && defined(POSIX_TYPES) -# if !defined(BOS) && !defined(HISX) && !defined(_M_UNIX) && !defined(VMS) -# define VOIDYYPUT -# endif -# endif -# if !defined(VOIDYYPUT) && defined(WEIRD_LEX) -# if defined(SUNOS4) && defined(__STDC__) && (WEIRD_LEX > 1) -# define VOIDYYPUT -# endif -# endif -# if defined(VOIDYYPUT) && defined(__osf__) -# undef VOIDYYPUT -# endif -# ifdef VOIDYYPUT -void FDECL(yyunput, (int)); -void FDECL(yyoutput, (int)); -# else -int FDECL(yyunput, (int)); -int FDECL(yyoutput, (int)); -# endif - -#else /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ -/* most recent flex allows suppressing yyunput() altogether when not needed */ -#define YY_NO_UNPUT -#define YY_NO_INPUT -#endif - -#if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) -/* older flex wants this */ -#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t, size_t)); -/* newer flex assumes so needs this in case it's been suppressed */ -YY_MALLOC_DECL -#endif - -void FDECL(init_yyin, (FILE *)); -void FDECL(init_yyout, (FILE *)); - -long NDECL(handle_varstring_check); -long FDECL(corefunc_str_check, (char *, long)); - -extern void VDECL(lc_error, (const char *, ...)); -extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); - -extern struct lc_vardefs *vardefs; - -extern long FDECL(method_defined, (char *, long, long *)); - -void FDECL(savetoken, (char *)); -void NDECL(newline); -void FDECL(advancepos, (char *)); - -/* - * This doesn't always get put in lev_comp.h - * (esp. when using older versions of bison). - */ -extern YYSTYPE yylval; - -int nh_line_number = 1; -int token_start_pos = 0; -char curr_token[512]; -static char map[4096]; -static int map_cnt = 0; - -FILE *orig_yyin = NULL; - -#define ST_RET(x) do { savetoken(yytext); return x; } while (0); -#define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0); - -#define INITIAL 0 -#define MAPC 1 - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy FDECL(FDECL_dummy, (void )); -int yyget_debug FDECL(FDECL_dummy, (void )); -void yyset_debug FDECL(FDECL_dummy, (int debug_flag )); -YY_EXTRA_TYPE yyget_extra FDECL(FDECL_dummy, (void )); -void yyset_extra FDECL(FDECL_dummy, (YY_EXTRA_TYPE user_defined )); -FILE *yyget_in FDECL(FDECL_dummy, (void )); -void yyset_in FDECL(FDECL_dummy, (FILE * _in_str )); -FILE *yyget_out FDECL(FDECL_dummy, (void )); -void yyset_out FDECL(FDECL_dummy, (FILE * _out_str )); -yy_size_t yyget_leng FDECL(FDECL_dummy, (void )); -char *yyget_text FDECL(FDECL_dummy, (void )); -int yyget_lineno FDECL(FDECL_dummy, (void )); -void yyset_lineno FDECL(FDECL_dummy, (int _line_number )); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -extern int yywrap FDECL(FDECL_dummy, (void )); -#endif - -#ifndef YY_NO_UNPUT - -void yyunput FDECL(FDECL_dummy, (int c,char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy FDECL(FDECL_dummy, (char *,yyconst char *,int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen FDECL(FDECL_dummy, (yyconst char * )); -#endif - -#ifndef YY_NO_INPUT - -static int input FDECL(FDECL_dummy, (void )); - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex FDECL(FDECL_dummy, (void)); - -#define YY_DECL int yylex () -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - { - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1057 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1255 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -{ - savetoken(yytext); - BEGIN(INITIAL); - yylval.map = (char *) alloc(map_cnt + 1); - (void) strncpy(yylval.map, map, map_cnt); - yylval.map[map_cnt] = 0; - map_cnt = 0; - return MAP_ID; - } - YY_BREAK -case 2: -/* rule 2 can match eol */ -YY_RULE_SETUP -{ - int len = yyleng; - savetoken(yytext); - /* convert \r\n to \n */ - if (len >= 2 && yytext[len - 2] == '\r') - len -= 1; - (void) strncpy(map + map_cnt, yytext, len); - map_cnt += len; - map[map_cnt - 1] = '\n'; - map[map_cnt] = '\0'; - newline(); - } - YY_BREAK -case 3: -/* rule 3 can match eol */ -YY_RULE_SETUP -{ savetoken(yytext); newline(); } - YY_BREAK -case 4: -YY_RULE_SETUP -ST_RET(MESSAGE_ID); - YY_BREAK -case 5: -YY_RULE_SETUP -ST_RET(NOMAP_ID); - YY_BREAK -case 6: -YY_RULE_SETUP -ST_RET(MAZE_ID); - YY_BREAK -case 7: -YY_RULE_SETUP -ST_RET(LEVEL_ID); - YY_BREAK -case 8: -YY_RULE_SETUP -ST_RET(LEV_INIT_ID); - YY_BREAK -case 9: -YY_RULE_SETUP -ST_RET(MAZE_GRID_ID); - YY_BREAK -case 10: -YY_RULE_SETUP -ST_RET(SOLID_FILL_ID); - YY_BREAK -case 11: -YY_RULE_SETUP -ST_RET(MINES_ID); - YY_BREAK -case 12: -YY_RULE_SETUP -ST_RET(ROGUELEV_ID); - YY_BREAK -case 13: -YY_RULE_SETUP -ST_RET(FLAGS_ID); - YY_BREAK -case 14: -YY_RULE_SETUP -ST_RET(GEOMETRY_ID); - YY_BREAK -case 15: -/* rule 15 can match eol */ -YY_RULE_SETUP -{ savetoken(yytext); BEGIN(MAPC); newline(); } - YY_BREAK -case 16: -YY_RULE_SETUP -ST_RET(object_ID); - YY_BREAK -case 17: -YY_RULE_SETUP -ST_RET(OBJECT_ID); - YY_BREAK -case 18: -YY_RULE_SETUP -ST_RET(COBJECT_ID); - YY_BREAK -case 19: -YY_RULE_SETUP -ST_RET(MONSTER_ID); - YY_BREAK -case 20: -YY_RULE_SETUP -ST_RET(monster_ID); - YY_BREAK -case 21: -YY_RULE_SETUP -ST_RET(TRAP_ID); - YY_BREAK -case 22: -YY_RULE_SETUP -ST_RET(DOOR_ID); - YY_BREAK -case 23: -YY_RULE_SETUP -ST_RET(ROOMDOOR_ID); - YY_BREAK -case 24: -YY_RULE_SETUP -ST_RET(DRAWBRIDGE_ID); - YY_BREAK -case 25: -YY_RULE_SETUP -ST_RET(MAZEWALK_ID); - YY_BREAK -case 26: -YY_RULE_SETUP -ST_RET(WALLIFY_ID); - YY_BREAK -case 27: -YY_RULE_SETUP -ST_RET(REGION_ID); - YY_BREAK -case 28: -YY_RULE_SETUP -ST_RET(ALTAR_ID); - YY_BREAK -case 29: -YY_RULE_SETUP -ST_RET(LADDER_ID); - YY_BREAK -case 30: -YY_RULE_SETUP -ST_RET(STAIR_ID); - YY_BREAK -case 31: -YY_RULE_SETUP -ST_RET(PORTAL_ID); - YY_BREAK -case 32: -YY_RULE_SETUP -ST_RET(TELEPRT_ID); - YY_BREAK -case 33: -YY_RULE_SETUP -ST_RET(BRANCH_ID); - YY_BREAK -case 34: -YY_RULE_SETUP -ST_RET(FOUNTAIN_ID); - YY_BREAK -case 35: -YY_RULE_SETUP -ST_RET(SINK_ID); - YY_BREAK -case 36: -YY_RULE_SETUP -ST_RET(POOL_ID); - YY_BREAK -case 37: -YY_RULE_SETUP -ST_RET(NON_DIGGABLE_ID); - YY_BREAK -case 38: -YY_RULE_SETUP -ST_RET(NON_PASSWALL_ID); - YY_BREAK -case 39: -YY_RULE_SETUP -ST_RET(IF_ID); - YY_BREAK -case 40: -YY_RULE_SETUP -ST_RET(ELSE_ID); - YY_BREAK -case 41: -YY_RULE_SETUP -ST_RET(EXIT_ID); - YY_BREAK -case 42: -YY_RULE_SETUP -ST_RET(ROOM_ID); - YY_BREAK -case 43: -YY_RULE_SETUP -ST_RET(SUBROOM_ID); - YY_BREAK -case 44: -YY_RULE_SETUP -ST_RET(RAND_CORRIDOR_ID); - YY_BREAK -case 45: -YY_RULE_SETUP -ST_RET(CORRIDOR_ID); - YY_BREAK -case 46: -YY_RULE_SETUP -ST_RET(TERRAIN_ID); - YY_BREAK -case 47: -YY_RULE_SETUP -ST_RET(terrain_ID); - YY_BREAK -case 48: -YY_RULE_SETUP -ST_RET(REPLACE_TERRAIN_ID); - YY_BREAK -case 49: -YY_RULE_SETUP -ST_RET(GOLD_ID); - YY_BREAK -case 50: -YY_RULE_SETUP -ST_RET(GRAVE_ID); - YY_BREAK -case 51: -YY_RULE_SETUP -ST_RET(ENGRAVING_ID); - YY_BREAK -case 52: -YY_RULE_SETUP -ST_RET(MINERALIZE_ID); - YY_BREAK -case 53: -YY_RULE_SETUP -ST_RET(NAME_ID); - YY_BREAK -case 54: -YY_RULE_SETUP -ST_RET(FOR_ID); - YY_BREAK -case 55: -YY_RULE_SETUP -ST_RET(TO_ID); - YY_BREAK -case 56: -YY_RULE_SETUP -ST_RET(LOOP_ID); - YY_BREAK -case 57: -YY_RULE_SETUP -ST_RET(SWITCH_ID); - YY_BREAK -case 58: -YY_RULE_SETUP -ST_RET(CASE_ID); - YY_BREAK -case 59: -YY_RULE_SETUP -ST_RET(BREAK_ID); - YY_BREAK -case 60: -YY_RULE_SETUP -ST_RET(DEFAULT_ID); - YY_BREAK -case 61: -YY_RULE_SETUP -ST_RET(FUNCTION_ID); - YY_BREAK -case 62: -YY_RULE_SETUP -ST_RET(SHUFFLE_ID); - YY_BREAK -case 63: -YY_RULE_SETUP -ST_RET(MONTYPE_ID); - YY_BREAK -case 64: -YY_RULE_SETUP -ST_RET(selection_ID); - YY_BREAK -case 65: -YY_RULE_SETUP -ST_RET(rect_ID); - YY_BREAK -case 66: -YY_RULE_SETUP -ST_RET(fillrect_ID); - YY_BREAK -case 67: -YY_RULE_SETUP -ST_RET(line_ID); - YY_BREAK -case 68: -YY_RULE_SETUP -ST_RET(randline_ID); - YY_BREAK -case 69: -YY_RULE_SETUP -ST_RET(grow_ID); - YY_BREAK -case 70: -YY_RULE_SETUP -ST_RET(flood_ID); - YY_BREAK -case 71: -YY_RULE_SETUP -ST_RET(rndcoord_ID); - YY_BREAK -case 72: -YY_RULE_SETUP -ST_RET(circle_ID); - YY_BREAK -case 73: -YY_RULE_SETUP -ST_RET(ellipse_ID); - YY_BREAK -case 74: -YY_RULE_SETUP -ST_RET(filter_ID); - YY_BREAK -case 75: -YY_RULE_SETUP -ST_RET(gradient_ID); - YY_BREAK -case 76: -YY_RULE_SETUP -ST_RET(complement_ID); - YY_BREAK -case 77: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=SEL_GRADIENT_RADIAL; return GRADIENT_TYPE; } - YY_BREAK -case 78: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=SEL_GRADIENT_SQUARE; return GRADIENT_TYPE; } - YY_BREAK -case 79: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=DRY; return HUMIDITY_TYPE; } - YY_BREAK -case 80: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=WET; return HUMIDITY_TYPE; } - YY_BREAK -case 81: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=HOT; return HUMIDITY_TYPE; } - YY_BREAK -case 82: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=SOLID; return HUMIDITY_TYPE; } - YY_BREAK -case 83: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=ANY_LOC; return HUMIDITY_TYPE; } - YY_BREAK -case 84: -YY_RULE_SETUP -ST_RET(LEV); - YY_BREAK -case 85: -YY_RULE_SETUP -ST_RET(QUANTITY_ID); - YY_BREAK -case 86: -YY_RULE_SETUP -ST_RET(BURIED_ID); - YY_BREAK -case 87: -YY_RULE_SETUP -ST_RET(ERODED_ID); - YY_BREAK -case 88: -YY_RULE_SETUP -ST_RET(ERODEPROOF_ID); - YY_BREAK -case 89: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return TRAPPED_STATE; } - YY_BREAK -case 90: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return TRAPPED_STATE; } - YY_BREAK -case 91: -YY_RULE_SETUP -ST_RET(RECHARGED_ID); - YY_BREAK -case 92: -YY_RULE_SETUP -ST_RET(INVIS_ID); - YY_BREAK -case 93: -YY_RULE_SETUP -ST_RET(GREASED_ID); - YY_BREAK -case 94: -YY_RULE_SETUP -ST_RET(FEMALE_ID); - YY_BREAK -case 95: -YY_RULE_SETUP -ST_RET(CANCELLED_ID); - YY_BREAK -case 96: -YY_RULE_SETUP -ST_RET(REVIVED_ID); - YY_BREAK -case 97: -YY_RULE_SETUP -ST_RET(AVENGE_ID); - YY_BREAK -case 98: -YY_RULE_SETUP -ST_RET(FLEEING_ID); - YY_BREAK -case 99: -YY_RULE_SETUP -ST_RET(BLINDED_ID); - YY_BREAK -case 100: -YY_RULE_SETUP -ST_RET(PARALYZED_ID); - YY_BREAK -case 101: -YY_RULE_SETUP -ST_RET(STUNNED_ID); - YY_BREAK -case 102: -YY_RULE_SETUP -ST_RET(CONFUSED_ID); - YY_BREAK -case 103: -YY_RULE_SETUP -ST_RET(SEENTRAPS_ID); - YY_BREAK -case 104: -YY_RULE_SETUP -ST_RET(ALL_ID); - YY_BREAK -case 105: -YY_RULE_SETUP -ST_RETF((yylval.i=1), HORIZ_OR_VERT); - YY_BREAK -case 106: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=2; return HORIZ_OR_VERT; } - YY_BREAK -case 107: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=D_ISOPEN; return DOOR_STATE; } - YY_BREAK -case 108: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=D_CLOSED; return DOOR_STATE; } - YY_BREAK -case 109: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=D_LOCKED; return DOOR_STATE; } - YY_BREAK -case 110: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=D_NODOOR; return DOOR_STATE; } - YY_BREAK -case 111: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=D_BROKEN; return DOOR_STATE; } - YY_BREAK -case 112: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=D_SECRET; return DOOR_STATE; } - YY_BREAK -case 113: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=W_NORTH; return DIRECTION; } - YY_BREAK -case 114: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=W_EAST; return DIRECTION; } - YY_BREAK -case 115: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=W_SOUTH; return DIRECTION; } - YY_BREAK -case 116: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=W_WEST; return DIRECTION; } - YY_BREAK -case 117: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = -1; return RANDOM_TYPE; } - YY_BREAK -case 118: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = -1; return RANDOM_TYPE_BRACKET; } - YY_BREAK -case 119: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = -2; return NONE; } - YY_BREAK -case 120: -YY_RULE_SETUP -ST_RET(A_REGISTER); - YY_BREAK -case 121: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return LEFT_OR_RIGHT; } - YY_BREAK -case 122: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=2; return LEFT_OR_RIGHT; } - YY_BREAK -case 123: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=3; return CENTER; } - YY_BREAK -case 124: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=4; return LEFT_OR_RIGHT; } - YY_BREAK -case 125: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=5; return LEFT_OR_RIGHT; } - YY_BREAK -case 126: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return TOP_OR_BOT; } - YY_BREAK -case 127: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=5; return TOP_OR_BOT; } - YY_BREAK -case 128: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return LIGHT_STATE; } - YY_BREAK -case 129: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return LIGHT_STATE; } - YY_BREAK -case 130: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return FILLING; } - YY_BREAK -case 131: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return FILLING; } - YY_BREAK -case 132: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return IRREGULAR; } - YY_BREAK -case 133: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return IRREGULAR; } - YY_BREAK -case 134: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return JOINED; } - YY_BREAK -case 135: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return JOINED; } - YY_BREAK -case 136: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return LIMITED; } - YY_BREAK -case 137: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return LIMITED; } - YY_BREAK -case 138: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i= AM_NONE; return ALIGNMENT; } - YY_BREAK -case 139: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i= AM_LAWFUL; return ALIGNMENT; } - YY_BREAK -case 140: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i= AM_NEUTRAL; return ALIGNMENT; } - YY_BREAK -case 141: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i= AM_CHAOTIC; return ALIGNMENT; } - YY_BREAK -case 142: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i= AM_SPLEV_CO; return ALIGNMENT; } - YY_BREAK -case 143: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } - YY_BREAK -case 144: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return MON_ATTITUDE; } - YY_BREAK -case 145: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return MON_ATTITUDE; } - YY_BREAK -case 146: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return MON_ALERTNESS; } - YY_BREAK -case 147: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return MON_ALERTNESS; } - YY_BREAK -case 148: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } - YY_BREAK -case 149: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } - YY_BREAK -case 150: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } - YY_BREAK -case 151: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=2; return ALTAR_TYPE; } - YY_BREAK -case 152: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return ALTAR_TYPE; } - YY_BREAK -case 153: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return ALTAR_TYPE; } - YY_BREAK -case 154: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return UP_OR_DOWN; } - YY_BREAK -case 155: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return UP_OR_DOWN; } - YY_BREAK -case 156: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=0; return BOOLEAN; } - YY_BREAK -case 157: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return BOOLEAN; } - YY_BREAK -case 158: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=DUST; return ENGRAVING_TYPE; } - YY_BREAK -case 159: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=ENGRAVE; return ENGRAVING_TYPE; } - YY_BREAK -case 160: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=BURN; return ENGRAVING_TYPE; } - YY_BREAK -case 161: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=MARK; return ENGRAVING_TYPE; } - YY_BREAK -case 162: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } - YY_BREAK -case 163: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=1; return CURSE_TYPE; } - YY_BREAK -case 164: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=2; return CURSE_TYPE; } - YY_BREAK -case 165: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=3; return CURSE_TYPE; } - YY_BREAK -case 166: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=NOTELEPORT; return FLAG_TYPE; } - YY_BREAK -case 167: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=HARDFLOOR; return FLAG_TYPE; } - YY_BREAK -case 168: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=NOMMAP; return FLAG_TYPE; } - YY_BREAK -case 169: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ - YY_BREAK -case 170: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=SHORTSIGHTED; return FLAG_TYPE; } - YY_BREAK -case 171: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=MAZELEVEL; return FLAG_TYPE; } - YY_BREAK -case 172: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=PREMAPPED; return FLAG_TYPE; } - YY_BREAK -case 173: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; } - YY_BREAK -case 174: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } - YY_BREAK -case 175: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=ICEDPOOLS; return FLAG_TYPE; } - YY_BREAK -case 176: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=SOLIDIFY; return FLAG_TYPE; } - YY_BREAK -case 177: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=CORRMAZE; return FLAG_TYPE; } - YY_BREAK -case 178: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=CHECK_INACCESSIBLES; return FLAG_TYPE; } - YY_BREAK -case 179: -YY_RULE_SETUP -{ char *p = index(yytext, 'd'); - savetoken(yytext); - if (p) { - *p++ = '\0'; - yylval.dice.num = atoi(yytext); - yylval.dice.die = atoi(p); - } else { - yylval.dice.num = yylval.dice.die = 1; - } - return DICE; - } - YY_BREAK -case 180: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = atoi(yytext + 1); - if (yylval.i < 0 || yylval.i > 100) - lc_error("Unexpected percentile '%li%%'", yylval.i); - return PERCENT; } - YY_BREAK -case 181: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } - YY_BREAK -case 182: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } - YY_BREAK -case 183: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = atoi(yytext); - if (yylval.i < 0 || yylval.i > 100) - lc_error("Unexpected percentile '%li%%'", yylval.i); - return SPERCENT; } - YY_BREAK -case 184: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i=atoi(yytext); return INTEGER; } - YY_BREAK -case 185: -/* rule 185 can match eol */ -YY_RULE_SETUP -{ savetoken(yytext); - yytext[yyleng - 1] = '\0'; /* discard the trailing \" */ - yylval.map = dupstr(yytext + 1); /* skip the first \" */ - return STRING; } - YY_BREAK -case 186: -YY_RULE_SETUP -{ savetoken(yytext); return handle_varstring_check(); } - YY_BREAK -case 187: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } - YY_BREAK -case 188: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } - YY_BREAK -case 189: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } - YY_BREAK -case 190: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } - YY_BREAK -case 191: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } - YY_BREAK -case 192: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } - YY_BREAK -case 193: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } - YY_BREAK -case 194: -/* rule 194 can match eol */ -YY_RULE_SETUP -{ newline(); } - YY_BREAK -case 195: -YY_RULE_SETUP -{ advancepos(yytext); } - YY_BREAK -case 196: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = yytext[2]; return CHAR; } - YY_BREAK -case 197: -YY_RULE_SETUP -{ savetoken(yytext); yylval.i = yytext[1]; return CHAR; } - YY_BREAK -case 198: -YY_RULE_SETUP -ST_RET(UNKNOWN_TYPE); - YY_BREAK -case 199: -YY_RULE_SETUP -{ savetoken(yytext); return yytext[0]; } - YY_BREAK -case 200: -YY_RULE_SETUP -ECHO; - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(MAPC): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer () -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - yy_size_t number_to_move, i; - int ret_val; - - if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) - YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - - if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { - /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } else { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for (i = 0; i < number_to_move; ++i) - *(dest++) = *(source++); - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) { - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - } else { - yy_size_t num_to_read; - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - /* [pr] This could probably be (b->yy_buf_size < number_to_move) - * since the allocated size is actually b->yy_buf_size + 2. - * The old code calculated num_to_read above (with same formula - * as is used below), then used (num_to_read <= 0) here, which - * got broken when num_to_read was changed to an unsigned type. */ - while (b->yy_buf_size <= number_to_move + 1) { - /* Not enough room in the buffer - grow it. */ - - int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) { - b->yy_buf_size += b->yy_buf_size / 4; - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if (! b->yy_ch_buf) - YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - } - - num_to_read = b->yy_buf_size - number_to_move - 1; - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ((yy_n_chars) == 0) { - if (number_to_move == YY_MORE_ADJ) { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); - } else { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } - } else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) - > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) - yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if (! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before EOB char was reached */ - -static yy_state_type yy_get_previous_state () -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) { - - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1057 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -static yy_state_type yy_try_NUL_trans (yy_current_state ) - yy_state_type yy_current_state; -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1057 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 1056); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -void yyunput (c,yy_bp ) - int c; - char * yy_bp; -{ - char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - yy_size_t number_to_move = (yy_n_chars) + 2; - char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - -#endif - -#ifndef YY_NO_INPUT -static int input () -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - return input(); - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(uchar *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - -void yyrestart (input_file ) - FILE * input_file; -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ -void yy_switch_to_buffer (new_buffer ) - YY_BUFFER_STATE new_buffer; -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state () -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ -YY_BUFFER_STATE yy_create_buffer (file,size ) - FILE * file; - int size; -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - if (!size) - size = YY_BUF_SIZE; - - b->yy_buf_size = (yy_size_t)size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ -void yy_delete_buffer (b ) - YY_BUFFER_STATE b; -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); - - yyfree((void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ -static void yy_init_buffer (b,file ) - YY_BUFFER_STATE b; - FILE * file; -{ - int oerrno = errno; - - yy_flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ -void yy_flush_buffer (b ) - YY_BUFFER_STATE b; -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (new_buffer ) - YY_BUFFER_STATE new_buffer; -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state () -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack () -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ -#if 1 /* [PR] avoid C++-style comment; older C compilers choke on it */ - num_to_alloc = 2; /* also changed to match the comment... */ -#else - num_to_alloc = 1; // After all that talk, this was set to 1 anyways... -#endif - (yy_buffer_stack) = (struct yy_buffer_state**) - yyalloc(num_to_alloc * sizeof(struct yy_buffer_state*) ); - if (!(yy_buffer_stack)) - YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - - (void) memset((yy_buffer_stack), 0, - num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**) - yyrealloc((yy_buffer_stack),num_to_alloc * sizeof(struct yy_buffer_state*) ); - if (!(yy_buffer_stack)) - YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - - /* zero only the new slots.*/ - (void) memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, - grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified - * character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (base,size ) - char * base; - yy_size_t size; -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() - * will scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (yystr ) - yyconst char * yystr; -{ - - return yy_scan_bytes(yystr,strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to - * yylex() will scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a - * bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (yybytes,_yybytes_len ) - yyconst char * yybytes; - yy_size_t _yybytes_len; -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - yy_size_t i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (msg ) - yyconst char* msg; -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg); \ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno () -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in () -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out () -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -yy_size_t yyget_leng () -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text () -{ - return yytext; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void yyset_lineno (_line_number ) - int _line_number; -{ - - yylineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (_in_str ) - FILE * _in_str; -{ - yyin = _in_str ; -} - -void yyset_out (_out_str ) - FILE * _out_str; -{ - yyout = _out_str ; -} - -int yyget_debug () -{ - return yy_flex_debug; -} - -void yyset_debug (_bdebug ) - int _bdebug; -{ - yy_flex_debug = _bdebug ; -} - -static int yy_init_globals () -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy () -{ - - /* Pop the buffer stack, destroying each element. */ - while (YY_CURRENT_BUFFER) { - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner - * so the next time yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (s1,s2,n ) - char* s1; - yyconst char * s2; - int n; -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (s ) - yyconst char * s; -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (size ) - yy_size_t size; -{ - - return (void *) malloc( size ); -} - -void *yyrealloc (ptr,size ) - void * ptr; - yy_size_t size; -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void yyfree (ptr ) - void * ptr; -{ - - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#ifdef AMIGA -long * -alloc(n) - unsigned n; -{ - return (long *) malloc(n); -} -#endif - -/* routine to switch to another input file; needed for flex */ -void -init_yyin( input_f ) -FILE *input_f; -{ -#if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) - if (yyin) - yyrestart(input_f); - else -#endif - yyin = input_f; - - if (!orig_yyin) - orig_yyin = yyin; -} -/* analogous routine (for completeness) */ -void -init_yyout( output_f ) -FILE *output_f; -{ - yyout = output_f; -} - -long -handle_varstring_check() -{ - struct lc_vardefs *vd; - - yylval.map = dupstr(yytext); - if ((vd = vardef_defined(vardefs, yytext, 1)) != 0) { - long l = vd->var_type; - int a = ((l & SPOVAR_ARRAY) == SPOVAR_ARRAY); - - l &= ~SPOVAR_ARRAY; - if (l == SPOVAR_INT) - return (a ? VARSTRING_INT_ARRAY : VARSTRING_INT); - if (l == SPOVAR_STRING) - return (a ? VARSTRING_STRING_ARRAY : VARSTRING_STRING); - if (l == SPOVAR_VARIABLE) - return (a ? VARSTRING_VAR_ARRAY : VARSTRING_VAR); - if (l == SPOVAR_COORD) - return (a ? VARSTRING_COORD_ARRAY : VARSTRING_COORD); - if (l == SPOVAR_REGION) - return (a ? VARSTRING_REGION_ARRAY : VARSTRING_REGION); - if (l == SPOVAR_MAPCHAR) - return (a ? VARSTRING_MAPCHAR_ARRAY : VARSTRING_MAPCHAR); - if (l == SPOVAR_MONST) - return (a ? VARSTRING_MONST_ARRAY : VARSTRING_MONST); - if (l == SPOVAR_OBJ) - return (a ? VARSTRING_OBJ_ARRAY : VARSTRING_OBJ); - if (l == SPOVAR_SEL) - return (a ? VARSTRING_SEL_ARRAY : VARSTRING_SEL); - } - return VARSTRING; -} - -void -newline() -{ - nh_line_number++; - token_start_pos = 0; - (void) memset((genericptr_t) curr_token, 0, 512); -} - -void -savetoken(s) -char *s; -{ - Sprintf(curr_token, "%s", s); - advancepos(s); -} - -void -advancepos(s) -char *s; -{ - token_start_pos += strlen(s); -} - -/*lev_comp.l*/ - diff --git a/sys/share/lev_yacc.c b/sys/share/lev_yacc.c deleted file mode 100644 index b6ac4d935..000000000 --- a/sys/share/lev_yacc.c +++ /dev/null @@ -1,4985 +0,0 @@ -#ifndef lint -/* static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; */ -/* static char nhsccsid[] = "@(#)yaccpar 1.9.0-nh (NetHack) 12/03/2015"; */ -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYSUBMINOR "0-nh" - -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define YYPREFIX "yy" -/* NetHack 3.6 lev_comp.y $NHDT-Date: 1551901401 2019/03/06 19:43:21 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.26 $ */ -/* Copyright (c) 1989 by Jean-Christophe Collet */ -/* NetHack may be freely redistributed. See license for details. */ - -/* - * This file contains the Level Compiler code - * It may handle special mazes & special room-levels - */ - -/* In case we're using bison in AIX. This definition must be - * placed before any other C-language construct in the file - * excluding comments and preprocessor directives (thanks IBM - * for this wonderful feature...). - * - * Note: some cpps barf on this 'undefined control' (#pragma). - * Addition of the leading space seems to prevent barfage for now, - * and AIX will still see the directive. - */ -#ifdef _AIX - #pragma alloca /* keep leading space! */ -#endif - -#define SPEC_LEV /* for USE_OLDARGS (sp_lev.h) */ -#include "hack.h" -#include "sp_lev.h" - -#define ERR (-1) -/* many types of things are put in chars for transference to NetHack. - * since some systems will use signed chars, limit everybody to the - * same number for portability. - */ -#define MAX_OF_TYPE 128 - -#define MAX_NESTED_IFS 20 -#define MAX_SWITCH_CASES 20 - -#define New(type) \ - (type *) memset((genericptr_t) alloc(sizeof (type)), 0, sizeof (type)) -#define NewTab(type, size) (type **) alloc(sizeof (type *) * size) -#define Free(ptr) free((genericptr_t) ptr) - -extern void VDECL(lc_error, (const char *, ...)); -extern void VDECL(lc_warning, (const char *, ...)); -extern void FDECL(yyerror, (const char *)); -extern void FDECL(yywarning, (const char *)); -extern int NDECL(yylex); -int NDECL(yyparse); - -extern int FDECL(get_floor_type, (CHAR_P)); -extern int FDECL(get_room_type, (char *)); -extern int FDECL(get_trap_type, (char *)); -extern int FDECL(get_monster_id, (char *,CHAR_P)); -extern int FDECL(get_object_id, (char *,CHAR_P)); -extern boolean FDECL(check_monster_char, (CHAR_P)); -extern boolean FDECL(check_object_char, (CHAR_P)); -extern char FDECL(what_map_char, (CHAR_P)); -extern void FDECL(scan_map, (char *, sp_lev *)); -extern void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); -extern genericptr_t FDECL(get_last_opcode_data1, (sp_lev *, int)); -extern genericptr_t FDECL(get_last_opcode_data2, (sp_lev *, int, int)); -extern boolean FDECL(check_subrooms, (sp_lev *)); -extern boolean FDECL(write_level_file, (char *,sp_lev *)); -extern struct opvar *FDECL(set_opvar_int, (struct opvar *, long)); -extern void VDECL(add_opvars, (sp_lev *, const char *, ...)); -extern void FDECL(start_level_def, (sp_lev * *, char *)); - -extern struct lc_funcdefs *FDECL(funcdef_new, (long,char *)); -extern void FDECL(funcdef_free_all, (struct lc_funcdefs *)); -extern struct lc_funcdefs *FDECL(funcdef_defined, (struct lc_funcdefs *, - char *, int)); -extern char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *)); -extern char *FDECL(decode_parm_str, (char *)); - -extern struct lc_vardefs *FDECL(vardef_new, (long,char *)); -extern void FDECL(vardef_free_all, (struct lc_vardefs *)); -extern struct lc_vardefs *FDECL(vardef_defined, (struct lc_vardefs *, - char *, int)); - -extern void NDECL(break_stmt_start); -extern void FDECL(break_stmt_end, (sp_lev *)); -extern void FDECL(break_stmt_new, (sp_lev *, long)); - -extern void FDECL(splev_add_from, (sp_lev *, sp_lev *)); - -extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long)); -extern void FDECL(vardef_used, (struct lc_vardefs *, char *)); -extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *, - char *, long)); - -extern int FDECL(reverse_jmp_opcode, (int)); - -struct coord { - long x; - long y; -}; - -struct forloopdef { - char *varname; - long jmp_point; -}; -static struct forloopdef forloop_list[MAX_NESTED_IFS]; -static short n_forloops = 0; - - -sp_lev *splev = NULL; - -static struct opvar *if_list[MAX_NESTED_IFS]; - -static short n_if_list = 0; - -unsigned int max_x_map, max_y_map; -int obj_containment = 0; - -int in_container_obj = 0; - -/* integer value is possibly an inconstant value (eg. dice notation - or a variable) */ -int is_inconstant_number = 0; - -int in_switch_statement = 0; -static struct opvar *switch_check_jump = NULL; -static struct opvar *switch_default_case = NULL; -static struct opvar *switch_case_list[MAX_SWITCH_CASES]; -static long switch_case_value[MAX_SWITCH_CASES]; -int n_switch_case_list = 0; - -int allow_break_statements = 0; -struct lc_breakdef *break_list = NULL; - -extern struct lc_vardefs *vardefs; /* variable definitions */ - - -struct lc_vardefs *function_tmp_var_defs = NULL; -extern struct lc_funcdefs *function_definitions; -struct lc_funcdefs *curr_function = NULL; -struct lc_funcdefs_parm * curr_function_param = NULL; -int in_function_definition = 0; -sp_lev *function_splev_backup = NULL; - -extern int fatal_error; -extern int got_errors; -extern int line_number; -extern const char *fname; - -extern char curr_token[512]; - -typedef union -{ - long i; - char *map; - struct { - long room; - long wall; - long door; - } corpos; - struct { - long area; - long x1; - long y1; - long x2; - long y2; - } lregn; - struct { - long x; - long y; - } crd; - struct { - long ter; - long lit; - } terr; - struct { - long height; - long width; - } sze; - struct { - long die; - long num; - } dice; - struct { - long cfunc; - char *varstr; - } meth; -} YYSTYPE; -#define CHAR 257 -#define INTEGER 258 -#define BOOLEAN 259 -#define PERCENT 260 -#define SPERCENT 261 -#define MINUS_INTEGER 262 -#define PLUS_INTEGER 263 -#define MAZE_GRID_ID 264 -#define SOLID_FILL_ID 265 -#define MINES_ID 266 -#define ROGUELEV_ID 267 -#define MESSAGE_ID 268 -#define MAZE_ID 269 -#define LEVEL_ID 270 -#define LEV_INIT_ID 271 -#define GEOMETRY_ID 272 -#define NOMAP_ID 273 -#define OBJECT_ID 274 -#define COBJECT_ID 275 -#define MONSTER_ID 276 -#define TRAP_ID 277 -#define DOOR_ID 278 -#define DRAWBRIDGE_ID 279 -#define object_ID 280 -#define monster_ID 281 -#define terrain_ID 282 -#define MAZEWALK_ID 283 -#define WALLIFY_ID 284 -#define REGION_ID 285 -#define FILLING 286 -#define IRREGULAR 287 -#define JOINED 288 -#define ALTAR_ID 289 -#define LADDER_ID 290 -#define STAIR_ID 291 -#define NON_DIGGABLE_ID 292 -#define NON_PASSWALL_ID 293 -#define ROOM_ID 294 -#define PORTAL_ID 295 -#define TELEPRT_ID 296 -#define BRANCH_ID 297 -#define LEV 298 -#define MINERALIZE_ID 299 -#define CORRIDOR_ID 300 -#define GOLD_ID 301 -#define ENGRAVING_ID 302 -#define FOUNTAIN_ID 303 -#define POOL_ID 304 -#define SINK_ID 305 -#define NONE 306 -#define RAND_CORRIDOR_ID 307 -#define DOOR_STATE 308 -#define LIGHT_STATE 309 -#define CURSE_TYPE 310 -#define ENGRAVING_TYPE 311 -#define DIRECTION 312 -#define RANDOM_TYPE 313 -#define RANDOM_TYPE_BRACKET 314 -#define A_REGISTER 315 -#define ALIGNMENT 316 -#define LEFT_OR_RIGHT 317 -#define CENTER 318 -#define TOP_OR_BOT 319 -#define ALTAR_TYPE 320 -#define UP_OR_DOWN 321 -#define SUBROOM_ID 322 -#define NAME_ID 323 -#define FLAGS_ID 324 -#define FLAG_TYPE 325 -#define MON_ATTITUDE 326 -#define MON_ALERTNESS 327 -#define MON_APPEARANCE 328 -#define ROOMDOOR_ID 329 -#define IF_ID 330 -#define ELSE_ID 331 -#define TERRAIN_ID 332 -#define HORIZ_OR_VERT 333 -#define REPLACE_TERRAIN_ID 334 -#define EXIT_ID 335 -#define SHUFFLE_ID 336 -#define QUANTITY_ID 337 -#define BURIED_ID 338 -#define LOOP_ID 339 -#define FOR_ID 340 -#define TO_ID 341 -#define SWITCH_ID 342 -#define CASE_ID 343 -#define BREAK_ID 344 -#define DEFAULT_ID 345 -#define ERODED_ID 346 -#define TRAPPED_STATE 347 -#define RECHARGED_ID 348 -#define INVIS_ID 349 -#define GREASED_ID 350 -#define FEMALE_ID 351 -#define CANCELLED_ID 352 -#define REVIVED_ID 353 -#define AVENGE_ID 354 -#define FLEEING_ID 355 -#define BLINDED_ID 356 -#define PARALYZED_ID 357 -#define STUNNED_ID 358 -#define CONFUSED_ID 359 -#define SEENTRAPS_ID 360 -#define ALL_ID 361 -#define MONTYPE_ID 362 -#define GRAVE_ID 363 -#define ERODEPROOF_ID 364 -#define FUNCTION_ID 365 -#define MSG_OUTPUT_TYPE 366 -#define COMPARE_TYPE 367 -#define UNKNOWN_TYPE 368 -#define rect_ID 369 -#define fillrect_ID 370 -#define line_ID 371 -#define randline_ID 372 -#define grow_ID 373 -#define selection_ID 374 -#define flood_ID 375 -#define rndcoord_ID 376 -#define circle_ID 377 -#define ellipse_ID 378 -#define filter_ID 379 -#define complement_ID 380 -#define gradient_ID 381 -#define GRADIENT_TYPE 382 -#define LIMITED 383 -#define HUMIDITY_TYPE 384 -#define STRING 385 -#define MAP_ID 386 -#define NQSTRING 387 -#define VARSTRING 388 -#define CFUNC 389 -#define CFUNC_INT 390 -#define CFUNC_STR 391 -#define CFUNC_COORD 392 -#define CFUNC_REGION 393 -#define VARSTRING_INT 394 -#define VARSTRING_INT_ARRAY 395 -#define VARSTRING_STRING 396 -#define VARSTRING_STRING_ARRAY 397 -#define VARSTRING_VAR 398 -#define VARSTRING_VAR_ARRAY 399 -#define VARSTRING_COORD 400 -#define VARSTRING_COORD_ARRAY 401 -#define VARSTRING_REGION 402 -#define VARSTRING_REGION_ARRAY 403 -#define VARSTRING_MAPCHAR 404 -#define VARSTRING_MAPCHAR_ARRAY 405 -#define VARSTRING_MONST 406 -#define VARSTRING_MONST_ARRAY 407 -#define VARSTRING_OBJ 408 -#define VARSTRING_OBJ_ARRAY 409 -#define VARSTRING_SEL 410 -#define VARSTRING_SEL_ARRAY 411 -#define METHOD_INT 412 -#define METHOD_INT_ARRAY 413 -#define METHOD_STRING 414 -#define METHOD_STRING_ARRAY 415 -#define METHOD_VAR 416 -#define METHOD_VAR_ARRAY 417 -#define METHOD_COORD 418 -#define METHOD_COORD_ARRAY 419 -#define METHOD_REGION 420 -#define METHOD_REGION_ARRAY 421 -#define METHOD_MAPCHAR 422 -#define METHOD_MAPCHAR_ARRAY 423 -#define METHOD_MONST 424 -#define METHOD_MONST_ARRAY 425 -#define METHOD_OBJ 426 -#define METHOD_OBJ_ARRAY 427 -#define METHOD_SEL 428 -#define METHOD_SEL_ARRAY 429 -#define DICE 430 -#define YYERRCODE 256 -short yylhs[] = { -1, - 0, 0, 73, 73, 74, 57, 57, 56, 56, 76, - 76, 76, 76, 55, 55, 54, 54, 46, 46, 14, - 14, 75, 75, 26, 26, 22, 22, 23, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 60, 60, 60, 61, 61, 85, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 38, 38, 44, 44, 43, 43, 42, 42, 41, - 41, 39, 39, 40, 40, 129, 130, 100, 101, 98, - 45, 45, 31, 31, 31, 131, 133, 93, 134, 134, - 136, 135, 137, 135, 99, 138, 138, 139, 140, 94, - 141, 95, 142, 97, 144, 96, 143, 145, 143, 79, - 110, 110, 110, 83, 83, 65, 146, 147, 113, 148, - 112, 10, 10, 68, 68, 69, 69, 70, 70, 71, - 71, 87, 87, 15, 15, 13, 13, 16, 16, 11, - 11, 103, 103, 103, 1, 1, 2, 2, 105, 150, - 105, 149, 20, 20, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 35, 35, 35, 106, 152, 106, 151, 18, 18, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 120, 88, 104, 104, 121, 121, - 102, 117, 118, 109, 119, 82, 17, 17, 91, 114, - 108, 72, 72, 116, 115, 86, 107, 154, 111, 24, - 24, 80, 81, 81, 81, 92, 89, 90, 90, 3, - 3, 4, 4, 29, 29, 28, 28, 27, 27, 27, - 5, 5, 6, 6, 7, 7, 7, 12, 12, 12, - 8, 8, 9, 155, 155, 155, 132, 77, 77, 77, - 77, 32, 32, 32, 30, 30, 127, 127, 127, 33, - 124, 124, 124, 34, 34, 125, 125, 125, 36, 36, - 36, 36, 126, 126, 126, 37, 37, 37, 37, 123, - 123, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 50, 50, 157, 158, 158, 128, 128, 64, - 64, 63, 63, 62, 62, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 48, 48, 156, 47, 47, 47, - 153, 153, 153, 153, 51, 51, 52, 52, 53, 53, - 25, 25, 67, 67, 66, -}; -short yylen[] = { 2, - 0, 1, 1, 2, 3, 3, 5, 1, 1, 5, - 5, 3, 16, 0, 2, 0, 2, 0, 2, 1, - 1, 0, 3, 3, 1, 0, 2, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 3, 5, 3, 5, - 5, 5, 3, 3, 5, 5, 5, 7, 7, 7, - 5, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 0, 0, 8, 4, 1, - 0, 1, 1, 5, 3, 0, 0, 9, 0, 2, - 0, 5, 0, 4, 1, 2, 1, 6, 0, 3, - 0, 6, 0, 4, 0, 4, 1, 0, 4, 3, - 1, 3, 3, 5, 5, 7, 4, 0, 10, 0, - 12, 0, 2, 5, 1, 5, 1, 5, 1, 5, - 1, 9, 5, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 7, 5, 1, 1, 1, 1, 3, 0, - 5, 4, 0, 3, 1, 1, 1, 1, 2, 1, - 1, 1, 1, 1, 3, 3, 3, 1, 1, 3, - 1, 1, 3, 3, 0, 5, 2, 0, 3, 1, - 3, 1, 3, 3, 1, 1, 3, 1, 1, 1, - 3, 1, 1, 1, 5, 7, 5, 8, 1, 3, - 5, 5, 7, 7, 6, 5, 0, 2, 3, 3, - 3, 1, 5, 9, 5, 3, 3, 0, 10, 0, - 1, 7, 5, 5, 3, 5, 7, 9, 1, 1, - 1, 1, 1, 0, 2, 1, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, - 4, 5, 1, 3, 1, 3, 1, 1, 4, 9, - 1, 1, 4, 1, 5, 1, 1, 4, 1, 1, - 5, 1, 1, 1, 4, 1, 1, 5, 1, 1, - 3, 1, 1, 3, 1, 4, 3, 3, 3, 3, - 3, 3, 1, 1, 3, 1, 3, 0, 1, 1, - 1, 1, 3, 0, 1, 1, 2, 2, 4, 6, - 4, 6, 6, 6, 6, 2, 6, 8, 8, 10, - 14, 2, 1, 3, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 10, 9, -}; -short yydefred[] = { 0, - 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, - 4, 0, 6, 0, 133, 0, 0, 0, 192, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 130, 0, 0, 0, 136, 145, 0, 0, 0, 0, - 93, 82, 73, 83, 74, 84, 75, 85, 76, 86, - 77, 87, 78, 88, 79, 89, 80, 90, 81, 5, - 0, 92, 91, 0, 30, 0, 29, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 149, - 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 155, 0, 0, 0, 0, 94, - 95, 0, 0, 0, 0, 342, 0, 345, 0, 387, - 0, 343, 0, 153, 0, 27, 0, 9, 8, 7, - 0, 304, 305, 0, 0, 340, 0, 0, 0, 12, - 313, 0, 195, 196, 0, 0, 310, 0, 0, 308, - 0, 337, 339, 0, 336, 334, 0, 333, 228, 224, - 225, 330, 332, 0, 329, 327, 0, 326, 0, 0, - 281, 280, 0, 291, 292, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 383, 250, 0, 366, 0, 318, 0, 317, 0, 0, - 0, 0, 0, 403, 0, 0, 266, 267, 283, 282, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 259, 261, 260, 390, 388, 389, 163, 162, - 0, 184, 185, 0, 0, 0, 0, 96, 0, 0, - 0, 0, 126, 0, 0, 0, 0, 135, 0, 0, - 0, 0, 0, 0, 0, 362, 0, 0, 0, 396, - 398, 395, 397, 399, 400, 0, 0, 0, 0, 0, - 0, 103, 0, 0, 104, 0, 150, 24, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 367, 368, 0, 0, 0, 376, 0, - 0, 0, 382, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 132, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 156, 0, 0, 151, 0, 0, 0, 0, 344, 352, - 0, 0, 0, 0, 349, 350, 351, 129, 0, 154, - 0, 0, 120, 118, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 341, 11, 262, 0, 10, - 0, 0, 314, 0, 0, 0, 198, 197, 0, 173, - 194, 0, 0, 0, 226, 0, 0, 203, 201, 245, - 183, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 324, 0, 0, 322, 0, 321, 0, 0, 0, 384, - 386, 0, 0, 293, 294, 0, 297, 0, 295, 0, - 296, 251, 0, 0, 0, 252, 0, 175, 0, 0, - 0, 0, 0, 256, 0, 0, 165, 164, 276, 401, - 402, 0, 177, 0, 0, 0, 0, 0, 265, 0, - 0, 147, 0, 0, 137, 274, 0, 0, 0, 356, - 0, 346, 134, 363, 98, 0, 0, 105, 0, 111, - 0, 106, 0, 107, 0, 102, 0, 101, 0, 100, - 28, 306, 0, 0, 316, 309, 0, 311, 0, 0, - 335, 393, 391, 392, 239, 236, 230, 0, 0, 235, - 0, 240, 0, 242, 243, 0, 238, 229, 244, 232, - 394, 0, 328, 0, 0, 0, 369, 0, 0, 0, - 371, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 319, 0, 0, 0, 0, 0, 0, 167, 0, 0, - 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, - 0, 0, 152, 146, 0, 0, 0, 127, 0, 0, - 0, 0, 121, 119, 112, 0, 114, 0, 116, 0, - 0, 0, 312, 193, 338, 0, 0, 0, 0, 0, - 331, 0, 246, 0, 0, 189, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 302, 301, - 272, 0, 0, 253, 0, 179, 0, 0, 254, 258, - 0, 0, 0, 0, 181, 0, 0, 187, 0, 186, - 159, 0, 0, 353, 354, 355, 0, 357, 0, 110, - 0, 109, 0, 108, 0, 0, 0, 234, 237, 241, - 231, 0, 298, 206, 207, 0, 211, 210, 212, 213, - 214, 0, 0, 0, 218, 219, 0, 299, 208, 204, - 0, 0, 248, 0, 372, 0, 377, 0, 373, 0, - 323, 374, 375, 0, 0, 0, 268, 303, 0, 0, - 0, 0, 0, 0, 190, 191, 0, 0, 0, 168, - 0, 0, 0, 0, 0, 0, 128, 113, 115, 117, - 263, 0, 0, 0, 0, 0, 0, 0, 19, 0, - 0, 325, 0, 0, 288, 289, 290, 0, 285, 0, - 0, 0, 174, 0, 0, 278, 166, 176, 0, 0, - 182, 264, 0, 143, 138, 140, 0, 300, 215, 216, - 217, 222, 0, 220, 378, 0, 379, 0, 0, 0, - 271, 269, 0, 0, 0, 170, 0, 169, 141, 0, - 0, 0, 0, 0, 0, 320, 287, 0, 405, 178, - 0, 180, 0, 144, 0, 223, 380, 15, 0, 404, - 171, 142, 0, 0, 0, 0, 20, 21, 0, 0, - 0, 13, 17, 381, -}; -short yydgoto[] = { 3, - 209, 449, 233, 271, 236, 486, 490, 671, 491, 351, - 757, 729, 689, 859, 294, 467, 614, 354, 578, 584, - 730, 80, 337, 822, 512, 133, 788, 789, 747, 345, - 81, 210, 258, 476, 814, 228, 218, 636, 425, 426, - 427, 428, 640, 638, 387, 733, 290, 375, 253, 696, - 329, 330, 331, 861, 835, 190, 4, 82, 83, 84, - 172, 314, 315, 316, 280, 264, 265, 500, 515, 678, - 687, 440, 5, 6, 10, 85, 254, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 277, 318, 478, 229, 219, 259, 529, 408, 697, - 173, 278, 626, 765, 766, 843, 830, 524, 130, 187, - 521, 319, 401, 295, 517, 272, 800, 841, 230, 359, - 220, 355, 580, 790, 196, 182, 530, 531, -}; -short yysindex[] = { 68, - 17, 31, 0, -217, 0, 68, -257, -226, 112, 5680, - 0, 136, 0, -136, 0, 170, 185, 201, 0, 225, - 229, 238, 244, 248, 251, 255, 266, 272, 275, 283, - 304, 309, 346, 366, 378, 380, 382, 383, 396, 397, - 398, 400, 401, 404, 405, 413, 415, -46, 417, 420, - 0, 426, 108, 489, 0, 0, 428, 101, -35, 449, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 432, 0, 0, 430, 0, 5680, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -190, 450, 0, -234, 62, -13, 41, 41, 40, -252, - -121, 109, 109, 1644, -34, 109, 109, 92, -34, -34, - -249, -20, -20, -20, -35, 458, -35, 109, 1644, 1644, - 1644, -160, -249, -174, 0, 1644, -34, 288, -35, 0, - 0, 439, 414, 109, 467, 0, -22, 0, 421, 0, - -9, 0, -14, 0, 163, 0, 385, 0, 0, 0, - -136, 0, 0, 423, 465, 0, 471, 473, 475, 0, - 0, 137, 0, 0, 490, 271, 0, 441, 496, 0, - 503, 0, 0, 276, 0, 0, 452, 0, 0, 0, - 0, 0, 0, 292, 0, 0, 470, 0, 512, 0, - 0, 0, 518, 0, 0, 523, 524, 526, -34, -34, - 109, 109, 540, 109, 542, 544, 545, 1644, 548, 5537, - 0, 0, 533, 0, 331, 0, 500, 0, 555, 558, - 559, 564, 347, 0, 571, 582, 0, 0, 0, 0, - 367, 584, 379, 592, 594, 595, 141, 596, 402, 597, - 588, 611, 0, 0, 0, 0, 0, 0, 0, 0, - 617, 0, 0, 628, 385, 638, 640, 0, 593, -35, - -35, 644, 0, 649, 159, -35, -35, 0, -35, -35, - -35, -35, -35, 651, 650, 0, 141, 465, 5680, 0, - 0, 0, 0, 0, 0, 642, -1, 4, 643, 647, - 653, 0, 141, 465, 0, 5680, 0, 0, -35, -234, - 445, 14, 455, 654, 614, 1644, 678, -35, 38, 476, - 338, 682, -35, 688, 385, 690, -35, 109, 385, 109, - 1644, 424, 431, 0, 0, 694, 696, 1298, 0, 109, - 109, 5435, 0, 360, 704, 1644, 702, -35, -165, -83, - 429, 491, 703, -20, 433, 0, 707, -24, 708, -20, - -20, -20, -35, 709, 10, 109, -91, -19, -121, 0, - 0, 9, 9, 0, 45, 655, -254, 560, 0, 0, - 75, 148, 79, 79, 0, 0, 0, 0, -14, 0, - 1644, 711, 0, 0, 16, 25, 27, 29, 141, 465, - 22, -10, -28, 631, 427, 0, 0, 0, 501, 0, - 715, 137, 0, 719, 505, 459, 0, 0, 503, 0, - 0, 381, 499, 2, 0, 403, 508, 0, 0, 0, - 0, 721, 723, 109, 109, 662, 743, 748, 746, 749, - 0, 750, 5448, 0, 701, 0, 751, 752, 753, 0, - 0, 554, 536, 0, 0, 754, 0, 726, 0, 774, - 0, 0, 775, 579, 785, 0, -165, 0, 581, 796, - 583, 798, 800, 0, 802, 535, 0, 0, 0, 0, - 0, 804, 0, 591, 806, 807, 521, 598, 0, 810, - 385, 0, 811, -35, 0, 0, 465, 801, 815, 0, - 814, 0, 0, 0, 0, 604, -35, 0, -234, 0, - -21, 0, 824, 0, 57, 0, 98, 0, 23, 0, - 0, 0, 825, 621, 0, 0, 827, 0, 493, 839, - 0, 0, 0, 0, 0, 0, 0, 823, 826, 0, - 828, 0, 830, 0, 0, 832, 0, 0, 0, 0, - 0, 841, 0, 848, -121, 641, 0, 857, 590, 1644, - 0, -35, -35, 1644, 859, -35, 1644, 1644, 864, 861, - 0, -249, 648, -148, 652, 135, 586, 0, 867, -5, - 868, 528, 587, 0, -35, 870, -234, 871, 6, 72, - 385, 9, 0, 0, 141, 793, 1, 0, 560, 166, - 141, 465, 0, 0, 0, 32, 0, 33, 0, 35, - -165, 873, 0, 0, 0, -234, -35, -35, -35, 40, - 0, 5526, 0, 876, -35, 0, 880, 174, 686, 881, - -165, 569, 882, 883, -35, 685, 900, 852, 0, 0, - 0, 902, 691, 0, 693, 0, 110, 908, 0, 0, - 928, -184, 465, 716, 0, 717, 900, 0, 929, 0, - 0, 932, 90, 0, 0, 0, 385, 0, 57, 0, - 98, 0, 23, 0, 936, 722, 465, 0, 0, 0, - 0, 56, 0, 0, 0, -234, 0, 0, 0, 0, - 0, 920, 921, 924, 0, 0, 925, 0, 0, 0, - 465, 727, 0, 141, 0, 699, 0, -35, 0, 945, - 0, 0, 0, 481, 943, 59, 0, 0, 744, 957, - 965, 963, 6, -35, 0, 0, 967, 977, 982, 0, - -184, 767, -50, 971, 905, 90, 0, 0, 0, 0, - 0, 987, 724, 465, -35, -35, -35, -261, 0, 991, - 576, 0, -35, 777, 0, 0, 0, 989, 0, 385, - 992, 780, 0, 38, 900, 0, 0, 0, 781, 385, - 0, 0, 983, 0, 0, 0, 784, 0, 0, 0, - 0, 0, 916, 0, 0, 758, 0, 93, 1004, 59, - 0, 0, 788, 1006, 1007, 0, 1010, 0, 0, 5680, - 1009, -261, 1016, 675, 1020, 0, 0, 1025, 0, 0, - 385, 0, 5680, 0, -165, 0, 0, 0, 1023, 0, - 0, 0, 1024, 109, -149, 1026, 0, 0, 876, 109, - 1028, 0, 0, 0, -}; -short yyrindex[] = { 1071, - 0, 0, 0, 5225, 0, 1072, 0, 0, 0, 53, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2985, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3174, 0, 0, - 0, 0, 0, 0, 3331, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 182, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5382, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1032, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3520, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1947, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 136, 0, 0, 0, 0, 0, 720, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3677, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1033, 0, 241, 247, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3866, 4023, 0, 951, 0, 0, 0, 0, - 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2136, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2293, - 0, 0, 0, 0, 0, 0, 0, 1037, 0, 0, - 0, 0, 374, 531, 0, 0, 0, 0, 0, 0, - 0, 553, 0, 0, 0, 0, 0, 0, 42, 49, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 689, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 4212, 0, 0, 1035, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 4369, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4558, 0, 0, 0, - 1039, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2482, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 958, 0, 0, 0, 0, 0, - 50, 52, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 4715, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2639, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 4904, 0, 0, 0, 959, 0, 0, 0, - 0, 0, 961, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1255, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1444, 0, 0, 909, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 961, 0, 0, 0, 0, - 0, 0, 0, 1601, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2828, 0, 5061, - 0, 0, 0, 0, 959, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1790, 0, 0, 0, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -69, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -69, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1043, 0, 0, 4715, 0, - 0, 0, 0, 0, -}; -short yygindex[] = { 0, - 410, 294, 0, 487, -329, -480, 0, 0, 438, 645, - 330, 0, 0, 0, 0, -474, 0, 0, 0, 0, - 0, -86, -287, 0, 0, 901, 0, 273, -629, 657, - 1047, -296, -297, -509, 264, -504, -494, 0, 0, 0, - 0, 0, 0, 0, 0, 242, -384, -137, 849, 0, - 0, 0, 0, 0, 0, 0, 0, 1046, 934, -371, - 0, 0, 0, 684, 710, 0, -48, 0, 0, 0, - 351, 0, 1100, 0, 0, 0, -133, 790, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -58, -130, -355, -375, 679, -84, 0, 0, 0, - 0, -167, 0, 345, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 949, 0, 0, 0, 0, - 975, 0, 0, 0, 792, 680, 504, 0, -}; -#define YYTABLESIZE 6091 -short yytable[] = { 186, - 181, 299, 211, 195, 177, 255, 252, 400, 237, 238, - 507, 518, 260, 261, 266, 499, 608, 177, 206, 273, - 514, 283, 284, 285, 282, 177, 206, 313, 296, 224, - 424, 423, 311, 309, 677, 310, 528, 312, 177, 639, - 302, 206, 637, 327, 59, 686, 519, 520, 518, 279, - 635, 332, 26, 439, 334, 26, 548, 760, 526, 537, - 231, 214, 518, 269, 267, 268, 188, 455, 539, 516, - 541, 459, 543, 755, 7, 699, 701, 550, 703, 224, - 214, 313, 297, 308, 292, 122, 311, 309, 8, 310, - 523, 312, 124, 123, 549, 125, 214, 286, 281, 812, - 335, 287, 288, 274, 275, 276, 9, 366, 367, 857, - 369, 313, 547, 773, 656, 313, 311, 309, 305, 310, - 311, 312, 189, 813, 317, 312, 333, 12, 756, 313, - 192, 263, 232, 406, 311, 270, 834, 224, 293, 312, - 538, 193, 194, 484, 545, 690, 603, 485, 206, 540, - 192, 542, 289, 544, 364, 365, 700, 702, 13, 704, - 705, 193, 194, 858, 669, 826, 122, 532, 14, 14, - 348, 670, 348, 124, 123, 643, 125, 313, 673, 131, - 740, 26, 311, 309, 313, 310, 234, 312, 132, 311, - 309, 235, 310, 770, 312, 313, 769, 430, 169, 410, - 311, 309, 327, 310, 768, 312, 643, 286, 444, 666, - 313, 287, 288, 15, 737, 311, 309, 736, 310, 510, - 312, 511, 176, 461, 458, 505, 460, 134, 471, 487, - 468, 488, 489, 623, 477, 176, 469, 470, 481, 304, - 533, 405, 135, 176, 633, 634, 222, 411, 412, 434, - 413, 414, 415, 416, 417, 653, 422, 528, 136, 562, - 304, 176, 509, 563, 564, 471, 692, 286, 305, 429, - 438, 287, 288, 26, 711, 26, 527, 262, 212, 471, - 435, 360, 137, 535, 360, 328, 138, 361, 498, 446, - 361, 201, 202, 513, 453, 139, 222, 212, 457, 201, - 202, 140, 223, 203, 204, 141, 26, 676, 142, 565, - 566, 567, 143, 212, 201, 202, 201, 202, 685, 483, - 579, 26, 26, 144, 568, 197, 198, 199, 200, 145, - 587, 588, 146, 691, 213, 495, 1, 2, 569, 570, - 147, 502, 503, 504, 785, 786, 787, 571, 572, 573, - 574, 575, 223, 213, 222, 447, 448, 307, 178, 179, - 317, 148, 205, 576, 853, 577, 149, 256, 257, 213, - 192, 178, 179, 347, 225, 474, 475, 205, 803, 178, - 179, 193, 194, 466, 688, 522, 207, 208, 192, 262, - 694, 695, 178, 179, 180, 226, 227, 178, 179, 193, - 194, 207, 208, 150, 201, 202, 215, 180, 632, 767, - 223, 347, 474, 475, 347, 180, 347, 347, 347, 347, - 176, 201, 202, 151, 225, 215, 203, 204, 180, 216, - 217, 180, 763, 180, 764, 152, 320, 153, 321, 154, - 155, 215, 322, 323, 324, 226, 227, 681, 216, 217, - 26, 26, 657, 156, 157, 158, 660, 159, 160, 663, - 664, 161, 162, 313, 347, 625, 347, 205, 311, 309, - 163, 310, 164, 312, 166, 201, 202, 167, 631, 708, - 709, 710, 225, 168, 205, 174, 683, 175, 183, 184, - 185, 207, 208, 191, 325, 313, 347, 279, 347, 300, - 311, 309, 821, 310, 301, 312, 303, 336, 207, 208, - 340, 306, 828, 339, 341, 707, 342, 313, 343, 552, - 344, 731, 311, 309, 26, 783, 26, 312, 347, 346, - 348, 348, 352, 658, 659, 313, 326, 662, 205, 349, - 311, 309, 353, 310, 313, 312, 350, 192, 356, 311, - 309, 558, 310, 851, 312, 358, 178, 179, 193, 194, - 357, 360, 207, 208, 256, 257, 361, 362, 348, 363, - 376, 348, 313, 348, 348, 348, 348, 311, 309, 368, - 310, 370, 312, 371, 372, 774, 796, 374, 377, 342, - 378, 561, 180, 342, 342, 342, 734, 342, 379, 342, - 583, 380, 381, 382, 383, 313, 744, 809, 810, 811, - 311, 309, 313, 310, 384, 312, 817, 311, 309, 816, - 310, 348, 312, 348, 313, 385, 386, 388, 601, 311, - 309, 396, 310, 347, 312, 390, 389, 391, 392, 393, - 395, 347, 347, 347, 347, 347, 347, 347, 347, 347, - 347, 347, 347, 348, 397, 348, 347, 347, 347, 394, - 398, 741, 347, 347, 347, 347, 347, 347, 347, 347, - 347, 399, 347, 347, 347, 347, 347, 347, 347, 781, - 347, 402, 63, 403, 65, 404, 67, 407, 69, 409, - 71, 418, 73, 419, 75, 347, 77, 442, 79, 421, - 431, 437, 347, 347, 432, 347, 443, 347, 347, 347, - 433, 441, 347, 347, 347, 347, 347, 347, 347, 307, - 856, 445, 313, 451, 818, 452, 863, 311, 309, 738, - 310, 454, 312, 456, 450, 462, 347, 464, 347, 465, - 347, 479, 463, 844, 480, 482, 494, 525, 493, 492, - 497, 501, 506, 496, 536, 551, 852, 553, 554, 556, - 347, 347, 557, 307, 585, 560, 586, 347, 347, 347, - 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, - 347, 347, 347, 347, 347, 589, 590, 582, 591, 592, - 348, 596, 593, 594, 597, 598, 599, 602, 348, 348, - 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, - 307, 600, 307, 348, 348, 348, 603, 604, 605, 348, - 348, 348, 348, 348, 348, 348, 348, 348, 607, 348, - 348, 348, 348, 348, 348, 348, 606, 348, 609, 610, - 611, 612, 307, 613, 307, 615, 616, 617, 618, 619, - 620, 621, 348, 622, 595, 628, 624, 629, 627, 348, - 348, 630, 348, 255, 348, 348, 348, 643, 641, 348, - 348, 348, 348, 348, 348, 348, 170, 642, 644, 645, - 646, 651, 62, 647, 64, 648, 66, 649, 68, 650, - 70, 652, 72, 348, 74, 348, 76, 348, 78, 654, - 655, 466, 661, 665, 666, 668, 674, 680, 370, 672, - 675, 673, 679, 682, 684, 693, 706, 348, 348, 732, - 735, 739, 742, 743, 348, 348, 348, 348, 348, 348, - 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, - 348, 348, 745, 746, 748, 749, 370, 61, 750, 370, - 751, 753, 370, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 754, 761, 758, 759, 762, 771, 775, 776, 307, - 772, 777, 778, 779, 780, 782, 784, 307, 307, 307, - 307, 307, 307, 307, 307, 307, 307, 307, 307, 370, - 792, 791, 307, 307, 307, 793, 794, 797, 307, 307, - 307, 307, 307, 307, 307, 307, 307, 798, 307, 307, - 307, 307, 307, 307, 307, 799, 307, 802, 804, 805, - 807, 815, 820, 370, 819, 823, 808, 824, 827, 832, - 829, 307, 831, 833, 836, 838, 839, 840, 307, 307, - 842, 307, 845, 307, 307, 307, 847, 848, 307, 307, - 849, 307, 307, 307, 307, 850, 854, 855, 864, 860, - 1, 3, 364, 365, 172, 26, 315, 358, 188, 359, - 148, 284, 307, 16, 307, 139, 752, 825, 667, 728, - 801, 338, 837, 559, 165, 846, 373, 385, 555, 171, - 862, 298, 534, 795, 508, 11, 307, 307, 420, 546, - 806, 291, 221, 307, 307, 307, 307, 307, 307, 307, - 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, - 307, 436, 698, 581, 0, 0, 0, 0, 385, 0, - 0, 385, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 370, 0, - 0, 0, 0, 0, 0, 0, 370, 370, 370, 370, - 370, 370, 370, 370, 370, 370, 370, 370, 385, 0, - 0, 370, 370, 370, 0, 0, 0, 370, 370, 370, - 370, 370, 370, 370, 370, 370, 0, 370, 370, 370, - 370, 370, 370, 370, 0, 370, 0, 0, 0, 0, - 0, 0, 385, 0, 0, 0, 0, 0, 0, 0, - 370, 0, 0, 0, 0, 0, 0, 370, 370, 0, - 370, 0, 370, 370, 370, 0, 0, 370, 370, 0, - 370, 370, 370, 370, 233, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 370, 0, 370, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 370, 370, 0, 233, 0, - 0, 0, 370, 370, 370, 370, 370, 370, 370, 370, - 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 250, 0, 0, - 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 385, 0, 0, - 0, 0, 0, 0, 0, 385, 385, 385, 385, 385, - 385, 385, 385, 385, 385, 385, 385, 233, 0, 233, - 385, 385, 385, 0, 0, 0, 385, 385, 385, 385, - 385, 385, 385, 385, 385, 0, 385, 385, 385, 385, - 385, 385, 385, 0, 385, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 385, - 0, 0, 0, 0, 0, 0, 385, 385, 0, 385, - 0, 385, 385, 385, 0, 0, 385, 385, 0, 385, - 385, 385, 385, 205, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 385, 0, 385, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 385, 385, 0, 205, 0, 0, - 0, 385, 385, 385, 385, 385, 385, 385, 385, 385, - 385, 385, 385, 385, 385, 385, 385, 385, 385, 0, - 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, - 0, 0, 233, 233, 233, 233, 233, 233, 233, 233, - 233, 233, 233, 233, 205, 0, 0, 233, 233, 233, - 0, 0, 0, 233, 233, 233, 233, 233, 233, 233, - 233, 233, 0, 233, 233, 233, 233, 233, 233, 233, - 0, 233, 0, 0, 0, 0, 205, 0, 205, 0, - 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, - 0, 0, 0, 233, 233, 0, 233, 0, 233, 233, - 233, 0, 0, 233, 233, 0, 233, 233, 233, 233, - 209, 0, 0, 0, 0, 0, 0, 0, 0, 466, - 201, 202, 0, 0, 0, 0, 0, 233, 0, 233, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 233, 233, 0, 209, 0, 0, 0, 233, 233, - 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, - 233, 233, 233, 233, 233, 233, 239, 240, 241, 242, - 243, 0, 244, 205, 245, 246, 247, 248, 249, 0, - 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, - 0, 209, 0, 0, 0, 0, 0, 207, 208, 0, - 0, 0, 0, 205, 0, 0, 0, 251, 0, 0, - 0, 205, 205, 205, 205, 205, 205, 205, 205, 205, - 205, 205, 205, 209, 0, 209, 205, 205, 205, 0, - 0, 0, 205, 205, 205, 205, 205, 205, 205, 205, - 205, 0, 205, 205, 205, 205, 205, 205, 205, 0, - 205, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, - 0, 0, 205, 205, 0, 205, 0, 205, 205, 205, - 0, 0, 205, 205, 0, 205, 205, 205, 205, 221, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 205, 0, 205, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 205, 205, 0, 221, 0, 0, 0, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, - 205, 205, 205, 205, 205, 0, 0, 0, 0, 0, - 209, 0, 0, 0, 0, 0, 0, 0, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 221, 0, 0, 209, 209, 209, 0, 0, 0, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 0, 209, - 209, 209, 209, 209, 209, 209, 0, 209, 0, 0, - 0, 0, 221, 0, 221, 0, 0, 0, 0, 0, - 0, 0, 209, 0, 0, 0, 0, 0, 0, 209, - 209, 0, 209, 0, 209, 209, 209, 0, 0, 209, - 209, 0, 209, 209, 209, 209, 199, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 201, 202, 0, 0, - 0, 0, 0, 209, 0, 209, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 209, 209, 0, - 0, 0, 0, 0, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 239, 240, 241, 242, 243, 0, 244, 205, - 245, 246, 247, 248, 249, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 199, 0, 0, - 0, 0, 0, 207, 208, 0, 0, 0, 0, 221, - 0, 0, 0, 251, 0, 0, 0, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 200, - 0, 199, 221, 221, 221, 0, 0, 0, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 0, 221, 221, - 221, 221, 221, 221, 221, 0, 221, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 221, 0, 0, 0, 0, 0, 0, 221, 221, - 0, 221, 0, 221, 221, 221, 0, 0, 221, 221, - 0, 221, 221, 221, 221, 227, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 221, 0, 221, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 221, 221, 0, 0, - 0, 0, 0, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 0, 0, 0, 0, 0, 199, 0, 0, 0, - 0, 0, 0, 0, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 227, 0, 0, 199, - 199, 199, 0, 0, 0, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 0, 199, 199, 199, 199, 199, - 199, 199, 0, 199, 0, 0, 0, 0, 227, 0, - 227, 0, 0, 0, 0, 0, 0, 0, 199, 0, - 0, 0, 0, 0, 0, 199, 199, 0, 199, 0, - 199, 199, 199, 0, 0, 199, 199, 0, 199, 199, - 199, 199, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, - 0, 199, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 199, 199, 0, 0, 0, 0, 0, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 157, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 227, 0, 0, 0, 0, - 0, 0, 0, 227, 227, 227, 227, 227, 227, 227, - 227, 227, 227, 227, 227, 0, 0, 157, 227, 227, - 227, 0, 0, 0, 227, 227, 227, 227, 227, 227, - 227, 227, 227, 0, 227, 227, 227, 227, 227, 227, - 227, 0, 227, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 227, 0, 0, - 0, 0, 0, 0, 227, 227, 0, 227, 0, 227, - 227, 227, 0, 0, 227, 227, 0, 227, 227, 227, - 227, 202, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 227, 0, - 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 227, 227, 0, 0, 0, 0, 0, 227, - 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, - 227, 227, 227, 227, 227, 227, 227, 0, 0, 0, - 0, 0, 157, 0, 0, 0, 0, 0, 0, 0, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 202, 0, 0, 157, 157, 157, 0, 0, - 0, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 0, 157, 157, 157, 157, 157, 157, 157, 0, 157, - 0, 0, 0, 0, 202, 0, 202, 0, 0, 0, - 0, 0, 0, 0, 157, 0, 0, 0, 0, 0, - 0, 157, 157, 158, 157, 0, 157, 157, 157, 0, - 0, 157, 157, 0, 157, 157, 157, 157, 284, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 157, 0, 157, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, - 157, 0, 0, 0, 0, 0, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 284, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 202, 0, 0, 0, 0, 0, 0, 0, 202, - 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, - 202, 284, 0, 284, 202, 202, 202, 0, 0, 0, - 202, 202, 202, 202, 202, 202, 202, 202, 202, 0, - 202, 202, 202, 202, 202, 202, 202, 0, 202, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 202, 0, 0, 0, 0, 0, 0, - 202, 202, 0, 202, 0, 202, 202, 202, 0, 0, - 202, 202, 0, 202, 202, 202, 202, 286, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 202, 0, 202, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 202, 202, - 0, 0, 0, 0, 0, 202, 202, 202, 202, 202, - 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, - 202, 202, 202, 0, 0, 0, 0, 0, 284, 0, - 0, 0, 0, 0, 0, 0, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, 286, 0, - 0, 284, 284, 284, 0, 0, 0, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 0, 284, 284, 284, - 284, 284, 284, 284, 0, 284, 0, 0, 0, 0, - 286, 0, 286, 0, 0, 0, 0, 0, 0, 0, - 284, 0, 0, 0, 0, 0, 0, 284, 284, 0, - 284, 0, 284, 284, 284, 0, 0, 284, 284, 0, - 284, 284, 284, 284, 249, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 284, 0, 284, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 284, 284, 0, 0, 0, - 0, 0, 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 249, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 286, 0, 0, - 0, 0, 0, 0, 0, 286, 286, 286, 286, 286, - 286, 286, 286, 286, 286, 286, 286, 0, 0, 249, - 286, 286, 286, 0, 0, 0, 286, 286, 286, 286, - 286, 286, 286, 286, 286, 0, 286, 286, 286, 286, - 286, 286, 286, 0, 286, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 286, - 0, 0, 0, 0, 0, 0, 286, 286, 0, 286, - 0, 286, 286, 286, 0, 0, 286, 286, 0, 286, - 286, 286, 286, 279, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 286, 0, 286, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 286, 286, 0, 0, 0, 0, - 0, 286, 286, 286, 286, 286, 286, 286, 286, 286, - 286, 286, 286, 286, 286, 286, 286, 286, 286, 0, - 0, 0, 0, 0, 249, 0, 0, 0, 0, 0, - 0, 0, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 249, 249, 249, 279, 0, 0, 249, 249, 249, - 0, 0, 0, 249, 249, 249, 249, 249, 249, 249, - 249, 249, 0, 249, 249, 249, 249, 249, 249, 249, - 0, 249, 0, 0, 0, 0, 0, 0, 279, 0, - 0, 0, 0, 0, 0, 0, 249, 0, 0, 0, - 0, 0, 0, 249, 249, 0, 249, 0, 249, 249, - 249, 0, 0, 249, 249, 0, 249, 249, 249, 249, - 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 249, 0, 249, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 249, 249, 0, 0, 0, 0, 0, 249, 249, - 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 249, 249, 249, 249, 249, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 161, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 279, 0, 0, 0, 0, 0, 0, - 0, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 0, 0, 161, 279, 279, 279, 0, - 0, 0, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 0, 279, 279, 279, 279, 279, 279, 279, 0, - 279, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 279, 0, 0, 0, 0, - 0, 0, 279, 279, 0, 279, 0, 279, 279, 279, - 0, 0, 279, 279, 0, 279, 279, 279, 279, 160, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 279, 0, 279, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 279, 279, 0, 0, 0, 0, 0, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 0, 0, 0, 0, 0, - 161, 0, 0, 0, 0, 0, 0, 0, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 160, 0, 0, 161, 161, 161, 0, 0, 0, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 0, 161, - 161, 161, 161, 161, 161, 161, 0, 161, 0, 0, - 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, - 0, 0, 161, 0, 0, 0, 0, 0, 0, 161, - 161, 0, 161, 0, 161, 161, 161, 0, 0, 161, - 161, 0, 161, 161, 161, 161, 275, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 161, 0, 161, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 161, 161, 0, - 0, 0, 0, 0, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 275, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, - 0, 0, 0, 0, 0, 0, 0, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 0, - 0, 275, 160, 160, 160, 0, 0, 0, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 0, 160, 160, - 160, 160, 160, 160, 160, 0, 160, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 160, 0, 0, 0, 0, 0, 0, 160, 160, - 0, 160, 0, 160, 160, 160, 0, 0, 160, 160, - 0, 160, 160, 160, 160, 97, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 160, 0, 160, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 160, 160, 0, 0, - 0, 0, 0, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 0, 0, 0, 0, 0, 275, 0, 0, 0, - 0, 0, 0, 0, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 97, 0, 0, 275, - 275, 275, 0, 0, 0, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 0, 275, 275, 275, 275, 275, - 275, 275, 0, 275, 0, 0, 0, 0, 0, 0, - 97, 0, 0, 0, 0, 0, 0, 0, 275, 0, - 0, 0, 0, 0, 0, 275, 275, 0, 275, 0, - 275, 275, 275, 0, 0, 275, 275, 0, 275, 275, - 275, 275, 99, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 275, - 0, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 275, 275, 0, 0, 0, 0, 0, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 97, 0, 0, 0, 0, - 0, 0, 0, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 0, 0, 99, 97, 97, - 97, 0, 0, 0, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 0, 97, 97, 97, 97, 97, 97, - 97, 0, 97, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, - 0, 0, 0, 0, 97, 97, 0, 97, 0, 97, - 97, 97, 0, 0, 97, 97, 0, 97, 97, 97, - 97, 247, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 97, 0, - 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 97, 97, 0, 0, 0, 0, 0, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 0, 0, 0, - 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, - 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 247, 0, 0, 99, 99, 99, 0, 0, - 0, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 0, 99, 99, 99, 99, 99, 99, 99, 0, 99, - 0, 0, 0, 0, 0, 0, 247, 0, 0, 0, - 0, 0, 0, 0, 99, 0, 0, 0, 0, 0, - 0, 99, 99, 0, 99, 0, 99, 99, 99, 0, - 0, 99, 99, 0, 99, 99, 99, 99, 257, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 99, 0, 99, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, - 99, 0, 0, 0, 0, 0, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 257, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 247, 0, 0, 0, 0, 0, 0, 0, 247, - 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, - 247, 0, 0, 257, 247, 247, 247, 0, 0, 0, - 247, 247, 247, 247, 247, 247, 247, 247, 247, 0, - 247, 247, 247, 247, 247, 247, 247, 0, 247, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 247, 0, 0, 0, 0, 0, 0, - 247, 247, 0, 247, 0, 247, 247, 247, 0, 0, - 247, 247, 0, 247, 247, 247, 247, 273, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 247, 0, 247, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, - 0, 0, 0, 0, 0, 247, 247, 247, 247, 247, - 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, - 247, 247, 247, 0, 0, 0, 0, 0, 257, 0, - 0, 0, 0, 0, 0, 0, 257, 257, 257, 257, - 257, 257, 257, 257, 257, 257, 257, 257, 273, 0, - 0, 257, 257, 257, 0, 0, 0, 257, 257, 257, - 257, 257, 257, 257, 257, 257, 0, 257, 257, 257, - 257, 257, 257, 257, 0, 257, 0, 0, 0, 0, - 0, 0, 273, 0, 0, 0, 0, 0, 0, 0, - 257, 0, 0, 0, 0, 0, 0, 257, 257, 0, - 257, 0, 257, 257, 257, 0, 0, 257, 257, 0, - 257, 257, 257, 257, 18, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 257, 0, 257, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 257, 257, 0, 0, 0, - 0, 0, 257, 257, 257, 257, 257, 257, 257, 257, - 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 273, 0, 0, - 0, 0, 0, 0, 0, 273, 273, 273, 273, 273, - 273, 273, 273, 273, 273, 273, 273, 0, 0, 18, - 273, 273, 273, 0, 0, 0, 273, 273, 273, 273, - 273, 273, 273, 273, 273, 0, 273, 273, 273, 273, - 273, 273, 273, 0, 273, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 273, - 0, 0, 0, 0, 0, 0, 273, 273, 0, 273, - 0, 273, 273, 273, 0, 0, 273, 273, 0, 273, - 273, 273, 273, 277, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 273, 0, 273, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 273, 273, 0, 0, 0, 0, - 0, 273, 273, 273, 273, 273, 273, 273, 273, 273, - 273, 273, 273, 273, 273, 273, 273, 273, 273, 0, - 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, - 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 277, 0, 0, 18, 18, 18, - 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 0, 18, 18, 18, 18, 18, 18, 18, - 0, 18, 0, 0, 0, 0, 0, 0, 277, 0, - 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, - 0, 0, 0, 18, 18, 0, 18, 0, 18, 18, - 18, 0, 0, 18, 18, 0, 18, 18, 18, 18, - 270, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 18, 0, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 18, 18, 0, 0, 0, 0, 0, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 270, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 277, 0, 0, 0, 0, 0, 0, - 0, 277, 277, 277, 277, 277, 277, 277, 277, 277, - 277, 277, 277, 0, 0, 270, 277, 277, 277, 0, - 0, 0, 277, 277, 277, 277, 277, 277, 277, 277, - 277, 0, 277, 277, 277, 277, 277, 277, 277, 0, - 277, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 22, 277, 0, 0, 0, 0, - 0, 0, 277, 277, 0, 277, 0, 277, 277, 277, - 0, 0, 277, 277, 0, 277, 277, 277, 277, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 277, 0, 277, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 277, 277, 0, 0, 0, 0, 0, 277, 277, 277, - 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - 277, 277, 277, 277, 277, 22, 0, 0, 0, 0, - 270, 0, 0, 0, 0, 0, 0, 0, 270, 270, - 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, - 0, 0, 0, 270, 270, 270, 0, 0, 0, 270, - 270, 270, 270, 270, 270, 270, 270, 270, 0, 270, - 270, 270, 270, 270, 270, 270, 0, 270, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 25, 270, 0, 0, 0, 0, 0, 0, 270, - 270, 0, 270, 0, 270, 270, 270, 0, 0, 270, - 270, 0, 270, 270, 270, 270, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 270, 0, 270, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 270, 270, 0, - 0, 0, 0, 0, 270, 270, 270, 270, 270, 270, - 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, - 270, 270, 25, 0, 473, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 22, 0, 0, 250, 0, 0, - 0, 0, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 0, 0, 0, 22, 22, 22, - 0, 0, 0, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 0, 22, 22, 22, 22, 22, 22, 22, - 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, - 0, 0, 0, 22, 22, 0, 22, 0, 22, 22, - 22, 0, 0, 22, 22, 0, 22, 0, 22, 0, - 0, 0, 0, 0, 0, 0, 250, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 22, 0, 22, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 22, 22, 0, 0, 0, 0, 0, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 0, 0, 0, 0, - 0, 25, 0, 0, 0, 0, 0, 0, 0, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 0, 0, 0, 25, 25, 25, 0, 0, 0, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, - 25, 25, 25, 25, 25, 25, 25, 0, 25, 0, - 0, 471, 0, 0, 0, 472, 0, 0, 0, 0, - 0, 0, 0, 25, 595, 347, 0, 0, 0, 0, - 25, 25, 0, 25, 0, 25, 25, 25, 0, 0, - 25, 25, 0, 25, 0, 25, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 0, 25, 201, 202, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 201, 202, 0, 0, 0, 0, 0, 0, 25, 25, - 59, 0, 0, 0, 0, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 0, 347, 0, 0, 0, 0, 0, - 0, 0, 0, 239, 240, 241, 242, 243, 0, 244, - 205, 245, 246, 247, 248, 249, 239, 240, 241, 242, - 243, 0, 244, 205, 245, 246, 247, 248, 249, 0, - 0, 0, 0, 0, 207, 208, 0, 0, 474, 475, - 712, 713, 0, 0, 251, 0, 0, 207, 208, 201, - 202, 714, 715, 716, 0, 0, 0, 251, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 717, 0, 718, 719, 720, 721, - 722, 723, 724, 725, 726, 727, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 239, 240, 241, 242, 243, - 192, 244, 205, 245, 246, 247, 248, 249, 0, 0, - 0, 193, 194, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 207, 208, 0, 15, - 0, 0, 0, 0, 0, 0, 251, 16, 0, 0, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, - 0, 0, 26, 27, 28, 0, 0, 0, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 0, 38, 39, - 40, 41, 42, 43, 44, 0, 45, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 46, 0, 0, 0, 0, 0, 0, 47, 48, - 0, 49, 0, 50, 51, 52, 0, 0, 53, 54, - 0, 55, 0, 56, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 57, 0, 58, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 60, 61, 0, 0, - 0, 0, 0, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, -}; -short yycheck[] = { 86, - 59, 169, 136, 134, 40, 40, 144, 295, 142, 143, - 395, 40, 146, 147, 148, 40, 497, 40, 40, 40, - 40, 159, 160, 161, 158, 40, 40, 37, 166, 40, - 328, 328, 42, 43, 40, 45, 408, 47, 40, 549, - 174, 40, 547, 40, 91, 40, 402, 403, 40, 40, - 545, 185, 0, 40, 185, 125, 432, 687, 313, 44, - 313, 40, 40, 313, 149, 150, 257, 355, 44, 399, - 44, 359, 44, 258, 58, 44, 44, 433, 44, 40, - 40, 37, 167, 93, 259, 44, 42, 43, 58, 45, - 46, 47, 44, 44, 123, 44, 40, 258, 157, 361, - 185, 262, 263, 152, 153, 154, 324, 241, 242, 259, - 244, 37, 123, 58, 589, 37, 42, 43, 177, 45, - 42, 47, 313, 385, 183, 47, 185, 385, 313, 37, - 385, 40, 385, 301, 42, 385, 44, 40, 313, 47, - 125, 396, 397, 309, 123, 620, 91, 313, 40, 125, - 385, 125, 313, 125, 239, 240, 125, 125, 385, 125, - 641, 396, 397, 313, 313, 795, 125, 93, 41, 58, - 43, 320, 45, 125, 125, 41, 125, 37, 44, 44, - 661, 0, 42, 43, 37, 45, 308, 47, 325, 42, - 43, 313, 45, 703, 47, 37, 701, 328, 91, 41, - 42, 43, 40, 45, 699, 47, 41, 258, 346, 44, - 37, 262, 263, 260, 41, 42, 43, 44, 45, 311, - 47, 313, 258, 361, 358, 393, 360, 58, 257, 313, - 368, 315, 316, 521, 372, 258, 370, 371, 376, 262, - 93, 300, 58, 258, 541, 543, 257, 306, 307, 336, - 309, 310, 311, 312, 313, 585, 258, 629, 58, 258, - 262, 258, 396, 262, 263, 257, 622, 258, 327, 328, - 257, 262, 263, 343, 650, 345, 407, 298, 257, 257, - 339, 41, 58, 421, 44, 123, 58, 41, 313, 348, - 44, 313, 314, 313, 353, 58, 257, 257, 357, 313, - 314, 58, 313, 317, 318, 58, 125, 313, 58, 308, - 309, 310, 58, 257, 313, 314, 313, 314, 313, 378, - 454, 269, 270, 58, 323, 264, 265, 266, 267, 58, - 464, 465, 58, 621, 313, 384, 269, 270, 337, 338, - 58, 390, 391, 392, 286, 287, 288, 346, 347, 348, - 349, 350, 313, 313, 257, 318, 319, 367, 394, 395, - 419, 58, 376, 362, 845, 364, 58, 402, 403, 313, - 385, 394, 395, 0, 385, 404, 405, 376, 763, 394, - 395, 396, 397, 312, 313, 341, 400, 401, 385, 298, - 390, 391, 394, 395, 430, 406, 407, 394, 395, 396, - 397, 400, 401, 58, 313, 314, 385, 430, 539, 697, - 313, 38, 404, 405, 41, 430, 43, 44, 45, 46, - 258, 313, 314, 58, 385, 385, 317, 318, 430, 408, - 409, 430, 343, 430, 345, 58, 274, 58, 276, 58, - 58, 385, 280, 281, 282, 406, 407, 615, 408, 409, - 269, 270, 590, 58, 58, 58, 594, 58, 58, 597, - 598, 58, 58, 37, 91, 524, 93, 376, 42, 43, - 58, 45, 58, 47, 58, 313, 314, 58, 537, 647, - 648, 649, 385, 58, 376, 58, 617, 387, 40, 58, - 61, 400, 401, 44, 332, 37, 123, 40, 125, 61, - 42, 43, 790, 45, 91, 47, 40, 123, 400, 401, - 46, 91, 800, 91, 44, 646, 44, 37, 44, 93, - 384, 652, 42, 43, 343, 45, 345, 47, 258, 40, - 0, 91, 257, 592, 593, 37, 374, 596, 376, 44, - 42, 43, 91, 45, 37, 47, 44, 385, 257, 42, - 43, 93, 45, 841, 47, 44, 394, 395, 396, 397, - 91, 44, 400, 401, 402, 403, 44, 44, 38, 44, - 38, 41, 37, 43, 44, 45, 46, 42, 43, 40, - 45, 40, 47, 40, 40, 716, 754, 40, 258, 37, - 91, 93, 430, 41, 42, 43, 655, 45, 44, 47, - 93, 44, 44, 40, 258, 37, 665, 775, 776, 777, - 42, 43, 37, 45, 44, 47, 41, 42, 43, 44, - 45, 91, 47, 93, 37, 44, 260, 44, 93, 42, - 43, 44, 45, 260, 47, 44, 258, 44, 44, 44, - 44, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 123, 44, 125, 283, 284, 285, 258, - 44, 93, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 44, 299, 300, 301, 302, 303, 304, 305, 738, - 307, 44, 395, 44, 397, 93, 399, 44, 401, 41, - 403, 41, 405, 44, 407, 322, 409, 44, 411, 58, - 58, 257, 329, 330, 58, 332, 93, 334, 335, 336, - 58, 257, 339, 340, 341, 342, 343, 344, 345, 0, - 854, 44, 37, 386, 783, 44, 860, 42, 43, 44, - 45, 44, 47, 44, 259, 312, 363, 44, 365, 44, - 367, 382, 312, 830, 41, 44, 44, 93, 258, 321, - 44, 44, 44, 321, 44, 125, 843, 257, 44, 41, - 387, 388, 258, 44, 44, 385, 44, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 124, 44, 385, 41, 44, - 260, 91, 44, 44, 44, 44, 44, 44, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 91, 258, 93, 283, 284, 285, 91, 44, 44, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 44, 299, - 300, 301, 302, 303, 304, 305, 258, 307, 258, 44, - 258, 44, 123, 44, 125, 44, 312, 44, 258, 44, - 44, 331, 322, 44, 257, 41, 46, 44, 58, 329, - 330, 258, 332, 40, 334, 335, 336, 41, 44, 339, - 340, 341, 342, 343, 344, 345, 388, 257, 386, 41, - 58, 41, 394, 58, 396, 58, 398, 58, 400, 58, - 402, 44, 404, 363, 406, 365, 408, 367, 410, 259, - 44, 312, 44, 40, 44, 258, 321, 321, 0, 258, - 44, 44, 385, 44, 44, 123, 44, 387, 388, 44, - 41, 41, 41, 41, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 258, 44, 93, 44, 38, 388, 258, 41, - 258, 44, 44, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 44, 44, 258, 258, 44, 41, 58, 58, 260, - 259, 58, 58, 257, 286, 41, 44, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 91, - 44, 258, 283, 284, 285, 41, 44, 41, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 41, 299, 300, - 301, 302, 303, 304, 305, 44, 307, 261, 58, 125, - 44, 41, 44, 125, 258, 44, 313, 258, 258, 124, - 58, 322, 259, 286, 41, 258, 41, 41, 329, 330, - 41, 332, 44, 334, 335, 336, 41, 383, 339, 340, - 41, 342, 343, 344, 345, 41, 44, 44, 41, 44, - 0, 0, 41, 41, 386, 125, 93, 41, 44, 41, - 123, 123, 363, 41, 365, 125, 677, 794, 602, 652, - 761, 191, 820, 449, 48, 832, 248, 0, 442, 54, - 859, 168, 419, 753, 395, 6, 387, 388, 319, 431, - 766, 163, 138, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 340, 629, 454, -1, -1, -1, -1, 41, -1, - -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 260, -1, - -1, -1, -1, -1, -1, -1, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 91, -1, - -1, 283, 284, 285, -1, -1, -1, 289, 290, 291, - 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, - 302, 303, 304, 305, -1, 307, -1, -1, -1, -1, - -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, - 322, -1, -1, -1, -1, -1, -1, 329, 330, -1, - 332, -1, 334, 335, 336, -1, -1, 339, 340, -1, - 342, 343, 344, 345, 0, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 363, -1, 365, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 387, 388, -1, 44, -1, - -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, - -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 260, -1, -1, - -1, -1, -1, -1, -1, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 123, -1, 125, - 283, 284, 285, -1, -1, -1, 289, 290, 291, 292, - 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, - 303, 304, 305, -1, 307, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 322, - -1, -1, -1, -1, -1, -1, 329, 330, -1, 332, - -1, 334, 335, 336, -1, -1, 339, 340, -1, 342, - 343, 344, 345, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 363, -1, 365, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 387, 388, -1, 44, -1, -1, - -1, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, - -1, -1, -1, -1, 260, -1, -1, -1, -1, -1, - -1, -1, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 91, -1, -1, 283, 284, 285, - -1, -1, -1, 289, 290, 291, 292, 293, 294, 295, - 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, - -1, 307, -1, -1, -1, -1, 123, -1, 125, -1, - -1, -1, -1, -1, -1, -1, 322, -1, -1, -1, - -1, -1, -1, 329, 330, -1, 332, -1, 334, 335, - 336, -1, -1, 339, 340, -1, 342, 343, 344, 345, - 0, -1, -1, -1, -1, -1, -1, -1, -1, 312, - 313, 314, -1, -1, -1, -1, -1, 363, -1, 365, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 387, 388, -1, 44, -1, -1, -1, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 369, 370, 371, 372, - 373, -1, 375, 376, 377, 378, 379, 380, 381, -1, - -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, - -1, 91, -1, -1, -1, -1, -1, 400, 401, -1, - -1, -1, -1, 260, -1, -1, -1, 410, -1, -1, - -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 123, -1, 125, 283, 284, 285, -1, - -1, -1, 289, 290, 291, 292, 293, 294, 295, 296, - 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, - 307, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 322, -1, -1, -1, -1, - -1, -1, 329, 330, -1, 332, -1, 334, 335, 336, - -1, -1, 339, 340, -1, 342, 343, 344, 345, 0, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 363, -1, 365, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 387, 388, -1, 44, -1, -1, -1, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, -1, -1, -1, -1, -1, - 260, -1, -1, -1, -1, -1, -1, -1, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 91, -1, -1, 283, 284, 285, -1, -1, -1, 289, - 290, 291, 292, 293, 294, 295, 296, 297, -1, 299, - 300, 301, 302, 303, 304, 305, -1, 307, -1, -1, - -1, -1, 123, -1, 125, -1, -1, -1, -1, -1, - -1, -1, 322, -1, -1, -1, -1, -1, -1, 329, - 330, -1, 332, -1, 334, 335, 336, -1, -1, 339, - 340, -1, 342, 343, 344, 345, 0, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 313, 314, -1, -1, - -1, -1, -1, 363, -1, 365, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 387, 388, -1, - -1, -1, -1, -1, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 369, 370, 371, 372, 373, -1, 375, 376, - 377, 378, 379, 380, 381, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, - -1, -1, -1, 400, 401, -1, -1, -1, -1, 260, - -1, -1, -1, 410, -1, -1, -1, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 123, - -1, 125, 283, 284, 285, -1, -1, -1, 289, 290, - 291, 292, 293, 294, 295, 296, 297, -1, 299, 300, - 301, 302, 303, 304, 305, -1, 307, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 322, -1, -1, -1, -1, -1, -1, 329, 330, - -1, 332, -1, 334, 335, 336, -1, -1, 339, 340, - -1, 342, 343, 344, 345, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 363, -1, 365, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 387, 388, -1, -1, - -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, -1, -1, -1, -1, -1, 260, -1, -1, -1, - -1, -1, -1, -1, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 91, -1, -1, 283, - 284, 285, -1, -1, -1, 289, 290, 291, 292, 293, - 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, - 304, 305, -1, 307, -1, -1, -1, -1, 123, -1, - 125, -1, -1, -1, -1, -1, -1, -1, 322, -1, - -1, -1, -1, -1, -1, 329, 330, -1, 332, -1, - 334, 335, 336, -1, -1, 339, 340, -1, 342, 343, - 344, 345, 0, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 363, - -1, 365, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 387, 388, -1, -1, -1, -1, -1, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 260, -1, -1, -1, -1, - -1, -1, -1, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, -1, -1, 125, 283, 284, - 285, -1, -1, -1, 289, 290, 291, 292, 293, 294, - 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, - 305, -1, 307, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 322, -1, -1, - -1, -1, -1, -1, 329, 330, -1, 332, -1, 334, - 335, 336, -1, -1, 339, 340, -1, 342, 343, 344, - 345, 0, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 363, -1, - 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 387, 388, -1, -1, -1, -1, -1, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, -1, -1, -1, - -1, -1, 260, -1, -1, -1, -1, -1, -1, -1, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 91, -1, -1, 283, 284, 285, -1, -1, - -1, 289, 290, 291, 292, 293, 294, 295, 296, 297, - -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, - -1, -1, -1, -1, 123, -1, 125, -1, -1, -1, - -1, -1, -1, -1, 322, -1, -1, -1, -1, -1, - -1, 329, 330, 331, 332, -1, 334, 335, 336, -1, - -1, 339, 340, -1, 342, 343, 344, 345, 0, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 363, -1, 365, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 387, - 388, -1, -1, -1, -1, -1, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 260, -1, -1, -1, -1, -1, -1, -1, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 123, -1, 125, 283, 284, 285, -1, -1, -1, - 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, - 299, 300, 301, 302, 303, 304, 305, -1, 307, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 322, -1, -1, -1, -1, -1, -1, - 329, 330, -1, 332, -1, 334, 335, 336, -1, -1, - 339, 340, -1, 342, 343, 344, 345, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 363, -1, 365, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 387, 388, - -1, -1, -1, -1, -1, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, -1, -1, -1, 260, -1, - -1, -1, -1, -1, -1, -1, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 91, -1, - -1, 283, 284, 285, -1, -1, -1, 289, 290, 291, - 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, - 302, 303, 304, 305, -1, 307, -1, -1, -1, -1, - 123, -1, 125, -1, -1, -1, -1, -1, -1, -1, - 322, -1, -1, -1, -1, -1, -1, 329, 330, -1, - 332, -1, 334, 335, 336, -1, -1, 339, 340, -1, - 342, 343, 344, 345, 0, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 363, -1, 365, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 387, 388, -1, -1, -1, - -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 260, -1, -1, - -1, -1, -1, -1, -1, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, -1, -1, 125, - 283, 284, 285, -1, -1, -1, 289, 290, 291, 292, - 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, - 303, 304, 305, -1, 307, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 322, - -1, -1, -1, -1, -1, -1, 329, 330, -1, 332, - -1, 334, 335, 336, -1, -1, 339, 340, -1, 342, - 343, 344, 345, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 363, -1, 365, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 387, 388, -1, -1, -1, -1, - -1, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, - -1, -1, -1, -1, 260, -1, -1, -1, -1, -1, - -1, -1, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 91, -1, -1, 283, 284, 285, - -1, -1, -1, 289, 290, 291, 292, 293, 294, 295, - 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, - -1, 307, -1, -1, -1, -1, -1, -1, 125, -1, - -1, -1, -1, -1, -1, -1, 322, -1, -1, -1, - -1, -1, -1, 329, 330, -1, 332, -1, 334, 335, - 336, -1, -1, 339, 340, -1, 342, 343, 344, 345, - 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 363, -1, 365, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 387, 388, -1, -1, -1, -1, -1, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 260, -1, -1, -1, -1, -1, -1, - -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, -1, -1, 125, 283, 284, 285, -1, - -1, -1, 289, 290, 291, 292, 293, 294, 295, 296, - 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, - 307, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 322, -1, -1, -1, -1, - -1, -1, 329, 330, -1, 332, -1, 334, 335, 336, - -1, -1, 339, 340, -1, 342, 343, 344, 345, 0, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 363, -1, 365, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 387, 388, -1, -1, -1, -1, -1, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, -1, -1, -1, -1, -1, - 260, -1, -1, -1, -1, -1, -1, -1, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 91, -1, -1, 283, 284, 285, -1, -1, -1, 289, - 290, 291, 292, 293, 294, 295, 296, 297, -1, 299, - 300, 301, 302, 303, 304, 305, -1, 307, -1, -1, - -1, -1, -1, -1, 125, -1, -1, -1, -1, -1, - -1, -1, 322, -1, -1, -1, -1, -1, -1, 329, - 330, -1, 332, -1, 334, 335, 336, -1, -1, 339, - 340, -1, 342, 343, 344, 345, 0, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 363, -1, 365, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 387, 388, -1, - -1, -1, -1, -1, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 260, - -1, -1, -1, -1, -1, -1, -1, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, - -1, 125, 283, 284, 285, -1, -1, -1, 289, 290, - 291, 292, 293, 294, 295, 296, 297, -1, 299, 300, - 301, 302, 303, 304, 305, -1, 307, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 322, -1, -1, -1, -1, -1, -1, 329, 330, - -1, 332, -1, 334, 335, 336, -1, -1, 339, 340, - -1, 342, 343, 344, 345, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 363, -1, 365, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 387, 388, -1, -1, - -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, -1, -1, -1, -1, -1, 260, -1, -1, -1, - -1, -1, -1, -1, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 91, -1, -1, 283, - 284, 285, -1, -1, -1, 289, 290, 291, 292, 293, - 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, - 304, 305, -1, 307, -1, -1, -1, -1, -1, -1, - 125, -1, -1, -1, -1, -1, -1, -1, 322, -1, - -1, -1, -1, -1, -1, 329, 330, -1, 332, -1, - 334, 335, 336, -1, -1, 339, 340, -1, 342, 343, - 344, 345, 0, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 363, - -1, 365, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 387, 388, -1, -1, -1, -1, -1, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 260, -1, -1, -1, -1, - -1, -1, -1, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, -1, -1, 125, 283, 284, - 285, -1, -1, -1, 289, 290, 291, 292, 293, 294, - 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, - 305, -1, 307, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 322, -1, -1, - -1, -1, -1, -1, 329, 330, -1, 332, -1, 334, - 335, 336, -1, -1, 339, 340, -1, 342, 343, 344, - 345, 0, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 363, -1, - 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 387, 388, -1, -1, -1, -1, -1, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, -1, -1, -1, - -1, -1, 260, -1, -1, -1, -1, -1, -1, -1, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 91, -1, -1, 283, 284, 285, -1, -1, - -1, 289, 290, 291, 292, 293, 294, 295, 296, 297, - -1, 299, 300, 301, 302, 303, 304, 305, -1, 307, - -1, -1, -1, -1, -1, -1, 125, -1, -1, -1, - -1, -1, -1, -1, 322, -1, -1, -1, -1, -1, - -1, 329, 330, -1, 332, -1, 334, 335, 336, -1, - -1, 339, 340, -1, 342, 343, 344, 345, 0, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 363, -1, 365, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 387, - 388, -1, -1, -1, -1, -1, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 260, -1, -1, -1, -1, -1, -1, -1, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, -1, -1, 125, 283, 284, 285, -1, -1, -1, - 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, - 299, 300, 301, 302, 303, 304, 305, -1, 307, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 322, -1, -1, -1, -1, -1, -1, - 329, 330, -1, 332, -1, 334, 335, 336, -1, -1, - 339, 340, -1, 342, 343, 344, 345, 0, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 363, -1, 365, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 387, 388, - -1, -1, -1, -1, -1, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, -1, -1, -1, 260, -1, - -1, -1, -1, -1, -1, -1, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 91, -1, - -1, 283, 284, 285, -1, -1, -1, 289, 290, 291, - 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, - 302, 303, 304, 305, -1, 307, -1, -1, -1, -1, - -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, - 322, -1, -1, -1, -1, -1, -1, 329, 330, -1, - 332, -1, 334, 335, 336, -1, -1, 339, 340, -1, - 342, 343, 344, 345, 0, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 363, -1, 365, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 387, 388, -1, -1, -1, - -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 260, -1, -1, - -1, -1, -1, -1, -1, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, -1, -1, 125, - 283, 284, 285, -1, -1, -1, 289, 290, 291, 292, - 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, - 303, 304, 305, -1, 307, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 322, - -1, -1, -1, -1, -1, -1, 329, 330, -1, 332, - -1, 334, 335, 336, -1, -1, 339, 340, -1, 342, - 343, 344, 345, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 363, -1, 365, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 387, 388, -1, -1, -1, -1, - -1, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, - -1, -1, -1, -1, 260, -1, -1, -1, -1, -1, - -1, -1, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 91, -1, -1, 283, 284, 285, - -1, -1, -1, 289, 290, 291, 292, 293, 294, 295, - 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, - -1, 307, -1, -1, -1, -1, -1, -1, 125, -1, - -1, -1, -1, -1, -1, -1, 322, -1, -1, -1, - -1, -1, -1, 329, 330, -1, 332, -1, 334, 335, - 336, -1, -1, 339, 340, -1, 342, 343, 344, 345, - 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 363, -1, 365, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 387, 388, -1, -1, -1, -1, -1, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 260, -1, -1, -1, -1, -1, -1, - -1, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, -1, -1, 125, 283, 284, 285, -1, - -1, -1, 289, 290, 291, 292, 293, 294, 295, 296, - 297, -1, 299, 300, 301, 302, 303, 304, 305, -1, - 307, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 0, 322, -1, -1, -1, -1, - -1, -1, 329, 330, -1, 332, -1, 334, 335, 336, - -1, -1, 339, 340, -1, 342, 343, 344, 345, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 363, -1, 365, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 387, 388, -1, -1, -1, -1, -1, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 91, -1, -1, -1, -1, - 260, -1, -1, -1, -1, -1, -1, -1, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - -1, -1, -1, 283, 284, 285, -1, -1, -1, 289, - 290, 291, 292, 293, 294, 295, 296, 297, -1, 299, - 300, 301, 302, 303, 304, 305, -1, 307, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 0, 322, -1, -1, -1, -1, -1, -1, 329, - 330, -1, 332, -1, 334, 335, 336, -1, -1, 339, - 340, -1, 342, 343, 344, 345, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 363, -1, 365, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 387, 388, -1, - -1, -1, -1, -1, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 91, -1, 40, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 260, -1, -1, 40, -1, -1, - -1, -1, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, -1, -1, -1, 283, 284, 285, - -1, -1, -1, 289, 290, 291, 292, 293, 294, 295, - 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, - -1, 307, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 322, -1, -1, -1, - -1, -1, -1, 329, 330, -1, 332, -1, 334, 335, - 336, -1, -1, 339, 340, -1, 342, -1, 344, -1, - -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 363, -1, 365, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 387, 388, -1, -1, -1, -1, -1, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, -1, -1, -1, -1, - -1, 260, -1, -1, -1, -1, -1, -1, -1, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, -1, -1, -1, 283, 284, 285, -1, -1, -1, - 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, - 299, 300, 301, 302, 303, 304, 305, -1, 307, -1, - -1, 257, -1, -1, -1, 261, -1, -1, -1, -1, - -1, -1, -1, 322, 257, 258, -1, -1, -1, -1, - 329, 330, -1, 332, -1, 334, 335, 336, -1, -1, - 339, 340, -1, 342, -1, 344, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 363, -1, 365, 313, 314, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 313, 314, -1, -1, -1, -1, -1, -1, 387, 388, - 91, -1, -1, -1, -1, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, 258, -1, -1, -1, -1, -1, - -1, -1, -1, 369, 370, 371, 372, 373, -1, 375, - 376, 377, 378, 379, 380, 381, 369, 370, 371, 372, - 373, -1, 375, 376, 377, 378, 379, 380, 381, -1, - -1, -1, -1, -1, 400, 401, -1, -1, 404, 405, - 315, 316, -1, -1, 410, -1, -1, 400, 401, 313, - 314, 326, 327, 328, -1, -1, -1, 410, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 349, -1, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 369, 370, 371, 372, 373, - 385, 375, 376, 377, 378, 379, 380, 381, -1, -1, - -1, 396, 397, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 400, 401, -1, 260, - -1, -1, -1, -1, -1, -1, 410, 268, -1, -1, - 271, 272, 273, 274, 275, 276, 277, 278, 279, -1, - -1, -1, 283, 284, 285, -1, -1, -1, 289, 290, - 291, 292, 293, 294, 295, 296, 297, -1, 299, 300, - 301, 302, 303, 304, 305, -1, 307, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 322, -1, -1, -1, -1, -1, -1, 329, 330, - -1, 332, -1, 334, 335, 336, -1, -1, 339, 340, - -1, 342, -1, 344, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 363, -1, 365, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 387, 388, -1, -1, - -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, -}; -#define YYFINAL 3 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 430 -#if YYDEBUG -char *yyname[] = { -"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'","'.'","'/'",0,0,0,0,0,0, -0,0,0,0,"':'",0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,"'['",0,"']'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'{'", -"'|'","'}'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"CHAR","INTEGER","BOOLEAN","PERCENT", -"SPERCENT","MINUS_INTEGER","PLUS_INTEGER","MAZE_GRID_ID","SOLID_FILL_ID", -"MINES_ID","ROGUELEV_ID","MESSAGE_ID","MAZE_ID","LEVEL_ID","LEV_INIT_ID", -"GEOMETRY_ID","NOMAP_ID","OBJECT_ID","COBJECT_ID","MONSTER_ID","TRAP_ID", -"DOOR_ID","DRAWBRIDGE_ID","object_ID","monster_ID","terrain_ID","MAZEWALK_ID", -"WALLIFY_ID","REGION_ID","FILLING","IRREGULAR","JOINED","ALTAR_ID","LADDER_ID", -"STAIR_ID","NON_DIGGABLE_ID","NON_PASSWALL_ID","ROOM_ID","PORTAL_ID", -"TELEPRT_ID","BRANCH_ID","LEV","MINERALIZE_ID","CORRIDOR_ID","GOLD_ID", -"ENGRAVING_ID","FOUNTAIN_ID","POOL_ID","SINK_ID","NONE","RAND_CORRIDOR_ID", -"DOOR_STATE","LIGHT_STATE","CURSE_TYPE","ENGRAVING_TYPE","DIRECTION", -"RANDOM_TYPE","RANDOM_TYPE_BRACKET","A_REGISTER","ALIGNMENT","LEFT_OR_RIGHT", -"CENTER","TOP_OR_BOT","ALTAR_TYPE","UP_OR_DOWN","SUBROOM_ID","NAME_ID", -"FLAGS_ID","FLAG_TYPE","MON_ATTITUDE","MON_ALERTNESS","MON_APPEARANCE", -"ROOMDOOR_ID","IF_ID","ELSE_ID","TERRAIN_ID","HORIZ_OR_VERT", -"REPLACE_TERRAIN_ID","EXIT_ID","SHUFFLE_ID","QUANTITY_ID","BURIED_ID","LOOP_ID", -"FOR_ID","TO_ID","SWITCH_ID","CASE_ID","BREAK_ID","DEFAULT_ID","ERODED_ID", -"TRAPPED_STATE","RECHARGED_ID","INVIS_ID","GREASED_ID","FEMALE_ID", -"CANCELLED_ID","REVIVED_ID","AVENGE_ID","FLEEING_ID","BLINDED_ID", -"PARALYZED_ID","STUNNED_ID","CONFUSED_ID","SEENTRAPS_ID","ALL_ID","MONTYPE_ID", -"GRAVE_ID","ERODEPROOF_ID","FUNCTION_ID","MSG_OUTPUT_TYPE","COMPARE_TYPE", -"UNKNOWN_TYPE","rect_ID","fillrect_ID","line_ID","randline_ID","grow_ID", -"selection_ID","flood_ID","rndcoord_ID","circle_ID","ellipse_ID","filter_ID", -"complement_ID","gradient_ID","GRADIENT_TYPE","LIMITED","HUMIDITY_TYPE", -"STRING","MAP_ID","NQSTRING","VARSTRING","CFUNC","CFUNC_INT","CFUNC_STR", -"CFUNC_COORD","CFUNC_REGION","VARSTRING_INT","VARSTRING_INT_ARRAY", -"VARSTRING_STRING","VARSTRING_STRING_ARRAY","VARSTRING_VAR", -"VARSTRING_VAR_ARRAY","VARSTRING_COORD","VARSTRING_COORD_ARRAY", -"VARSTRING_REGION","VARSTRING_REGION_ARRAY","VARSTRING_MAPCHAR", -"VARSTRING_MAPCHAR_ARRAY","VARSTRING_MONST","VARSTRING_MONST_ARRAY", -"VARSTRING_OBJ","VARSTRING_OBJ_ARRAY","VARSTRING_SEL","VARSTRING_SEL_ARRAY", -"METHOD_INT","METHOD_INT_ARRAY","METHOD_STRING","METHOD_STRING_ARRAY", -"METHOD_VAR","METHOD_VAR_ARRAY","METHOD_COORD","METHOD_COORD_ARRAY", -"METHOD_REGION","METHOD_REGION_ARRAY","METHOD_MAPCHAR","METHOD_MAPCHAR_ARRAY", -"METHOD_MONST","METHOD_MONST_ARRAY","METHOD_OBJ","METHOD_OBJ_ARRAY", -"METHOD_SEL","METHOD_SEL_ARRAY","DICE", -}; -char *yyrule[] = { -"$accept : file", -"file :", -"file : levels", -"levels : level", -"levels : level levels", -"level : level_def flags levstatements", -"level_def : LEVEL_ID ':' STRING", -"level_def : MAZE_ID ':' STRING ',' mazefiller", -"mazefiller : RANDOM_TYPE", -"mazefiller : CHAR", -"lev_init : LEV_INIT_ID ':' SOLID_FILL_ID ',' terrain_type", -"lev_init : LEV_INIT_ID ':' MAZE_GRID_ID ',' CHAR", -"lev_init : LEV_INIT_ID ':' ROGUELEV_ID", -"lev_init : LEV_INIT_ID ':' MINES_ID ',' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled opt_fillchar", -"opt_limited :", -"opt_limited : ',' LIMITED", -"opt_coord_or_var :", -"opt_coord_or_var : ',' coord_or_var", -"opt_fillchar :", -"opt_fillchar : ',' CHAR", -"walled : BOOLEAN", -"walled : RANDOM_TYPE", -"flags :", -"flags : FLAGS_ID ':' flag_list", -"flag_list : FLAG_TYPE ',' flag_list", -"flag_list : FLAG_TYPE", -"levstatements :", -"levstatements : levstatement levstatements", -"stmt_block : '{' levstatements '}'", -"levstatement : message", -"levstatement : lev_init", -"levstatement : altar_detail", -"levstatement : grave_detail", -"levstatement : branch_region", -"levstatement : corridor", -"levstatement : variable_define", -"levstatement : shuffle_detail", -"levstatement : diggable_detail", -"levstatement : door_detail", -"levstatement : drawbridge_detail", -"levstatement : engraving_detail", -"levstatement : mineralize", -"levstatement : fountain_detail", -"levstatement : gold_detail", -"levstatement : switchstatement", -"levstatement : forstatement", -"levstatement : loopstatement", -"levstatement : ifstatement", -"levstatement : chancestatement", -"levstatement : exitstatement", -"levstatement : breakstatement", -"levstatement : function_define", -"levstatement : function_call", -"levstatement : ladder_detail", -"levstatement : map_definition", -"levstatement : mazewalk_detail", -"levstatement : monster_detail", -"levstatement : object_detail", -"levstatement : passwall_detail", -"levstatement : pool_detail", -"levstatement : portal_region", -"levstatement : random_corridors", -"levstatement : region_detail", -"levstatement : room_def", -"levstatement : subroom_def", -"levstatement : sink_detail", -"levstatement : terrain_detail", -"levstatement : replace_terrain_detail", -"levstatement : stair_detail", -"levstatement : stair_region", -"levstatement : teleprt_region", -"levstatement : trap_detail", -"levstatement : wallify_detail", -"any_var_array : VARSTRING_INT_ARRAY", -"any_var_array : VARSTRING_STRING_ARRAY", -"any_var_array : VARSTRING_VAR_ARRAY", -"any_var_array : VARSTRING_COORD_ARRAY", -"any_var_array : VARSTRING_REGION_ARRAY", -"any_var_array : VARSTRING_MAPCHAR_ARRAY", -"any_var_array : VARSTRING_MONST_ARRAY", -"any_var_array : VARSTRING_OBJ_ARRAY", -"any_var_array : VARSTRING_SEL_ARRAY", -"any_var : VARSTRING_INT", -"any_var : VARSTRING_STRING", -"any_var : VARSTRING_VAR", -"any_var : VARSTRING_COORD", -"any_var : VARSTRING_REGION", -"any_var : VARSTRING_MAPCHAR", -"any_var : VARSTRING_MONST", -"any_var : VARSTRING_OBJ", -"any_var : VARSTRING_SEL", -"any_var_or_arr : any_var_array", -"any_var_or_arr : any_var", -"any_var_or_arr : VARSTRING", -"any_var_or_unk : VARSTRING", -"any_var_or_unk : any_var", -"shuffle_detail : SHUFFLE_ID ':' any_var_array", -"variable_define : any_var_or_arr '=' math_expr_var", -"variable_define : any_var_or_arr '=' selection_ID ':' ter_selection", -"variable_define : any_var_or_arr '=' string_expr", -"variable_define : any_var_or_arr '=' terrainid ':' mapchar_or_var", -"variable_define : any_var_or_arr '=' monsterid ':' monster_or_var", -"variable_define : any_var_or_arr '=' objectid ':' object_or_var", -"variable_define : any_var_or_arr '=' coord_or_var", -"variable_define : any_var_or_arr '=' region_or_var", -"variable_define : any_var_or_arr '=' '{' integer_list '}'", -"variable_define : any_var_or_arr '=' '{' encodecoord_list '}'", -"variable_define : any_var_or_arr '=' '{' encoderegion_list '}'", -"variable_define : any_var_or_arr '=' terrainid ':' '{' mapchar_list '}'", -"variable_define : any_var_or_arr '=' monsterid ':' '{' encodemonster_list '}'", -"variable_define : any_var_or_arr '=' objectid ':' '{' encodeobj_list '}'", -"variable_define : any_var_or_arr '=' '{' string_list '}'", -"encodeobj_list : encodeobj", -"encodeobj_list : encodeobj_list ',' encodeobj", -"encodemonster_list : encodemonster", -"encodemonster_list : encodemonster_list ',' encodemonster", -"mapchar_list : mapchar", -"mapchar_list : mapchar_list ',' mapchar", -"encoderegion_list : encoderegion", -"encoderegion_list : encoderegion_list ',' encoderegion", -"encodecoord_list : encodecoord", -"encodecoord_list : encodecoord_list ',' encodecoord", -"integer_list : math_expr_var", -"integer_list : integer_list ',' math_expr_var", -"string_list : string_expr", -"string_list : string_list ',' string_expr", -"$$1 :", -"$$2 :", -"function_define : FUNCTION_ID NQSTRING '(' $$1 func_params_list ')' $$2 stmt_block", -"function_call : NQSTRING '(' func_call_params_list ')'", -"exitstatement : EXIT_ID", -"opt_percent :", -"opt_percent : PERCENT", -"comparestmt : PERCENT", -"comparestmt : '[' math_expr_var COMPARE_TYPE math_expr_var ']'", -"comparestmt : '[' math_expr_var ']'", -"$$3 :", -"$$4 :", -"switchstatement : SWITCH_ID $$3 '[' integer_or_var ']' $$4 '{' switchcases '}'", -"switchcases :", -"switchcases : switchcase switchcases", -"$$5 :", -"switchcase : CASE_ID all_integers ':' $$5 levstatements", -"$$6 :", -"switchcase : DEFAULT_ID ':' $$6 levstatements", -"breakstatement : BREAK_ID", -"for_to_span : '.' '.'", -"for_to_span : TO_ID", -"forstmt_start : FOR_ID any_var_or_unk '=' math_expr_var for_to_span math_expr_var", -"$$7 :", -"forstatement : forstmt_start $$7 stmt_block", -"$$8 :", -"loopstatement : LOOP_ID '[' integer_or_var ']' $$8 stmt_block", -"$$9 :", -"chancestatement : comparestmt ':' $$9 levstatement", -"$$10 :", -"ifstatement : IF_ID comparestmt $$10 if_ending", -"if_ending : stmt_block", -"$$11 :", -"if_ending : stmt_block $$11 ELSE_ID stmt_block", -"message : MESSAGE_ID ':' string_expr", -"random_corridors : RAND_CORRIDOR_ID", -"random_corridors : RAND_CORRIDOR_ID ':' all_integers", -"random_corridors : RAND_CORRIDOR_ID ':' RANDOM_TYPE", -"corridor : CORRIDOR_ID ':' corr_spec ',' corr_spec", -"corridor : CORRIDOR_ID ':' corr_spec ',' all_integers", -"corr_spec : '(' INTEGER ',' DIRECTION ',' door_pos ')'", -"room_begin : room_type opt_percent ',' light_state", -"$$12 :", -"subroom_def : SUBROOM_ID ':' room_begin ',' subroom_pos ',' room_size optroomregionflags $$12 stmt_block", -"$$13 :", -"room_def : ROOM_ID ':' room_begin ',' room_pos ',' room_align ',' room_size optroomregionflags $$13 stmt_block", -"roomfill :", -"roomfill : ',' BOOLEAN", -"room_pos : '(' INTEGER ',' INTEGER ')'", -"room_pos : RANDOM_TYPE", -"subroom_pos : '(' INTEGER ',' INTEGER ')'", -"subroom_pos : RANDOM_TYPE", -"room_align : '(' h_justif ',' v_justif ')'", -"room_align : RANDOM_TYPE", -"room_size : '(' INTEGER ',' INTEGER ')'", -"room_size : RANDOM_TYPE", -"door_detail : ROOMDOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos", -"door_detail : DOOR_ID ':' door_state ',' ter_selection", -"secret : BOOLEAN", -"secret : RANDOM_TYPE", -"door_wall : dir_list", -"door_wall : RANDOM_TYPE", -"dir_list : DIRECTION", -"dir_list : DIRECTION '|' dir_list", -"door_pos : INTEGER", -"door_pos : RANDOM_TYPE", -"map_definition : NOMAP_ID", -"map_definition : GEOMETRY_ID ':' h_justif ',' v_justif roomfill MAP_ID", -"map_definition : GEOMETRY_ID ':' coord_or_var roomfill MAP_ID", -"h_justif : LEFT_OR_RIGHT", -"h_justif : CENTER", -"v_justif : TOP_OR_BOT", -"v_justif : CENTER", -"monster_detail : MONSTER_ID ':' monster_desc", -"$$14 :", -"monster_detail : MONSTER_ID ':' monster_desc $$14 stmt_block", -"monster_desc : monster_or_var ',' coord_or_var monster_infos", -"monster_infos :", -"monster_infos : monster_infos ',' monster_info", -"monster_info : string_expr", -"monster_info : MON_ATTITUDE", -"monster_info : MON_ALERTNESS", -"monster_info : alignment_prfx", -"monster_info : MON_APPEARANCE string_expr", -"monster_info : FEMALE_ID", -"monster_info : INVIS_ID", -"monster_info : CANCELLED_ID", -"monster_info : REVIVED_ID", -"monster_info : AVENGE_ID", -"monster_info : FLEEING_ID ':' integer_or_var", -"monster_info : BLINDED_ID ':' integer_or_var", -"monster_info : PARALYZED_ID ':' integer_or_var", -"monster_info : STUNNED_ID", -"monster_info : CONFUSED_ID", -"monster_info : SEENTRAPS_ID ':' seen_trap_mask", -"seen_trap_mask : STRING", -"seen_trap_mask : ALL_ID", -"seen_trap_mask : STRING '|' seen_trap_mask", -"object_detail : OBJECT_ID ':' object_desc", -"$$15 :", -"object_detail : COBJECT_ID ':' object_desc $$15 stmt_block", -"object_desc : object_or_var object_infos", -"object_infos :", -"object_infos : object_infos ',' object_info", -"object_info : CURSE_TYPE", -"object_info : MONTYPE_ID ':' monster_or_var", -"object_info : all_ints_push", -"object_info : NAME_ID ':' string_expr", -"object_info : QUANTITY_ID ':' integer_or_var", -"object_info : BURIED_ID", -"object_info : LIGHT_STATE", -"object_info : ERODED_ID ':' integer_or_var", -"object_info : ERODEPROOF_ID", -"object_info : DOOR_STATE", -"object_info : TRAPPED_STATE", -"object_info : RECHARGED_ID ':' integer_or_var", -"object_info : INVIS_ID", -"object_info : GREASED_ID", -"object_info : coord_or_var", -"trap_detail : TRAP_ID ':' trap_name ',' coord_or_var", -"drawbridge_detail : DRAWBRIDGE_ID ':' coord_or_var ',' DIRECTION ',' door_state", -"mazewalk_detail : MAZEWALK_ID ':' coord_or_var ',' DIRECTION", -"mazewalk_detail : MAZEWALK_ID ':' coord_or_var ',' DIRECTION ',' BOOLEAN opt_fillchar", -"wallify_detail : WALLIFY_ID", -"wallify_detail : WALLIFY_ID ':' ter_selection", -"ladder_detail : LADDER_ID ':' coord_or_var ',' UP_OR_DOWN", -"stair_detail : STAIR_ID ':' coord_or_var ',' UP_OR_DOWN", -"stair_region : STAIR_ID ':' lev_region ',' lev_region ',' UP_OR_DOWN", -"portal_region : PORTAL_ID ':' lev_region ',' lev_region ',' STRING", -"teleprt_region : TELEPRT_ID ':' lev_region ',' lev_region teleprt_detail", -"branch_region : BRANCH_ID ':' lev_region ',' lev_region", -"teleprt_detail :", -"teleprt_detail : ',' UP_OR_DOWN", -"fountain_detail : FOUNTAIN_ID ':' ter_selection", -"sink_detail : SINK_ID ':' ter_selection", -"pool_detail : POOL_ID ':' ter_selection", -"terrain_type : CHAR", -"terrain_type : '(' CHAR ',' light_state ')'", -"replace_terrain_detail : REPLACE_TERRAIN_ID ':' region_or_var ',' mapchar_or_var ',' mapchar_or_var ',' SPERCENT", -"terrain_detail : TERRAIN_ID ':' ter_selection ',' mapchar_or_var", -"diggable_detail : NON_DIGGABLE_ID ':' region_or_var", -"passwall_detail : NON_PASSWALL_ID ':' region_or_var", -"$$16 :", -"region_detail : REGION_ID ':' region_or_var ',' light_state ',' room_type optroomregionflags $$16 region_detail_end", -"region_detail_end :", -"region_detail_end : stmt_block", -"altar_detail : ALTAR_ID ':' coord_or_var ',' alignment ',' altar_type", -"grave_detail : GRAVE_ID ':' coord_or_var ',' string_expr", -"grave_detail : GRAVE_ID ':' coord_or_var ',' RANDOM_TYPE", -"grave_detail : GRAVE_ID ':' coord_or_var", -"gold_detail : GOLD_ID ':' math_expr_var ',' coord_or_var", -"engraving_detail : ENGRAVING_ID ':' coord_or_var ',' engraving_type ',' string_expr", -"mineralize : MINERALIZE_ID ':' integer_or_var ',' integer_or_var ',' integer_or_var ',' integer_or_var", -"mineralize : MINERALIZE_ID", -"trap_name : STRING", -"trap_name : RANDOM_TYPE", -"room_type : STRING", -"room_type : RANDOM_TYPE", -"optroomregionflags :", -"optroomregionflags : ',' roomregionflags", -"roomregionflags : roomregionflag", -"roomregionflags : roomregionflag ',' roomregionflags", -"roomregionflag : FILLING", -"roomregionflag : IRREGULAR", -"roomregionflag : JOINED", -"door_state : DOOR_STATE", -"door_state : RANDOM_TYPE", -"light_state : LIGHT_STATE", -"light_state : RANDOM_TYPE", -"alignment : ALIGNMENT", -"alignment : a_register", -"alignment : RANDOM_TYPE", -"alignment_prfx : ALIGNMENT", -"alignment_prfx : a_register", -"alignment_prfx : A_REGISTER ':' RANDOM_TYPE", -"altar_type : ALTAR_TYPE", -"altar_type : RANDOM_TYPE", -"a_register : A_REGISTER '[' INTEGER ']'", -"string_or_var : STRING", -"string_or_var : VARSTRING_STRING", -"string_or_var : VARSTRING_STRING_ARRAY '[' math_expr_var ']'", -"integer_or_var : math_expr_var", -"coord_or_var : encodecoord", -"coord_or_var : rndcoord_ID '(' ter_selection ')'", -"coord_or_var : VARSTRING_COORD", -"coord_or_var : VARSTRING_COORD_ARRAY '[' math_expr_var ']'", -"encodecoord : '(' INTEGER ',' INTEGER ')'", -"encodecoord : RANDOM_TYPE", -"encodecoord : RANDOM_TYPE_BRACKET humidity_flags ']'", -"humidity_flags : HUMIDITY_TYPE", -"humidity_flags : HUMIDITY_TYPE ',' humidity_flags", -"region_or_var : encoderegion", -"region_or_var : VARSTRING_REGION", -"region_or_var : VARSTRING_REGION_ARRAY '[' math_expr_var ']'", -"encoderegion : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", -"mapchar_or_var : mapchar", -"mapchar_or_var : VARSTRING_MAPCHAR", -"mapchar_or_var : VARSTRING_MAPCHAR_ARRAY '[' math_expr_var ']'", -"mapchar : CHAR", -"mapchar : '(' CHAR ',' light_state ')'", -"monster_or_var : encodemonster", -"monster_or_var : VARSTRING_MONST", -"monster_or_var : VARSTRING_MONST_ARRAY '[' math_expr_var ']'", -"encodemonster : STRING", -"encodemonster : CHAR", -"encodemonster : '(' CHAR ',' STRING ')'", -"encodemonster : RANDOM_TYPE", -"object_or_var : encodeobj", -"object_or_var : VARSTRING_OBJ", -"object_or_var : VARSTRING_OBJ_ARRAY '[' math_expr_var ']'", -"encodeobj : STRING", -"encodeobj : CHAR", -"encodeobj : '(' CHAR ',' STRING ')'", -"encodeobj : RANDOM_TYPE", -"string_expr : string_or_var", -"string_expr : string_expr '.' string_or_var", -"math_expr_var : INTEGER", -"math_expr_var : dice", -"math_expr_var : '(' MINUS_INTEGER ')'", -"math_expr_var : VARSTRING_INT", -"math_expr_var : VARSTRING_INT_ARRAY '[' math_expr_var ']'", -"math_expr_var : math_expr_var '+' math_expr_var", -"math_expr_var : math_expr_var '-' math_expr_var", -"math_expr_var : math_expr_var '*' math_expr_var", -"math_expr_var : math_expr_var '/' math_expr_var", -"math_expr_var : math_expr_var '%' math_expr_var", -"math_expr_var : '(' math_expr_var ')'", -"func_param_type : CFUNC_INT", -"func_param_type : CFUNC_STR", -"func_param_part : any_var_or_arr ':' func_param_type", -"func_param_list : func_param_part", -"func_param_list : func_param_list ',' func_param_part", -"func_params_list :", -"func_params_list : func_param_list", -"func_call_param_part : math_expr_var", -"func_call_param_part : string_expr", -"func_call_param_list : func_call_param_part", -"func_call_param_list : func_call_param_list ',' func_call_param_part", -"func_call_params_list :", -"func_call_params_list : func_call_param_list", -"ter_selection_x : coord_or_var", -"ter_selection_x : rect_ID region_or_var", -"ter_selection_x : fillrect_ID region_or_var", -"ter_selection_x : line_ID coord_or_var ',' coord_or_var", -"ter_selection_x : randline_ID coord_or_var ',' coord_or_var ',' math_expr_var", -"ter_selection_x : grow_ID '(' ter_selection ')'", -"ter_selection_x : grow_ID '(' dir_list ',' ter_selection ')'", -"ter_selection_x : filter_ID '(' SPERCENT ',' ter_selection ')'", -"ter_selection_x : filter_ID '(' ter_selection ',' ter_selection ')'", -"ter_selection_x : filter_ID '(' mapchar_or_var ',' ter_selection ')'", -"ter_selection_x : flood_ID coord_or_var", -"ter_selection_x : circle_ID '(' coord_or_var ',' math_expr_var ')'", -"ter_selection_x : circle_ID '(' coord_or_var ',' math_expr_var ',' FILLING ')'", -"ter_selection_x : ellipse_ID '(' coord_or_var ',' math_expr_var ',' math_expr_var ')'", -"ter_selection_x : ellipse_ID '(' coord_or_var ',' math_expr_var ',' math_expr_var ',' FILLING ')'", -"ter_selection_x : gradient_ID '(' GRADIENT_TYPE ',' '(' math_expr_var '-' math_expr_var opt_limited ')' ',' coord_or_var opt_coord_or_var ')'", -"ter_selection_x : complement_ID ter_selection_x", -"ter_selection_x : VARSTRING_SEL", -"ter_selection_x : '(' ter_selection ')'", -"ter_selection : ter_selection_x", -"ter_selection : ter_selection_x '&' ter_selection", -"dice : DICE", -"all_integers : MINUS_INTEGER", -"all_integers : PLUS_INTEGER", -"all_integers : INTEGER", -"all_ints_push : MINUS_INTEGER", -"all_ints_push : PLUS_INTEGER", -"all_ints_push : INTEGER", -"all_ints_push : dice", -"objectid : object_ID", -"objectid : OBJECT_ID", -"monsterid : monster_ID", -"monsterid : MONSTER_ID", -"terrainid : terrain_ID", -"terrainid : TERRAIN_ID", -"engraving_type : ENGRAVING_TYPE", -"engraving_type : RANDOM_TYPE", -"lev_region : region", -"lev_region : LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", -"region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", -}; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE - -/*lev_comp.y*/ -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() -{ - register int yym, yyn, yystate; -#if YYDEBUG - register char *yys; - extern char *getenv(); - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) != 0 && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) != 0 && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - goto yynewerror; -yynewerror: - yyerror("syntax error"); - goto yyerrlab; -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) != 0 && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 5: -{ - if (fatal_error > 0) { - (void) fprintf(stderr, - "%s: %d errors detected for level \"%s\". No output created!\n", - fname, fatal_error, yyvsp[-2].map); - fatal_error = 0; - got_errors++; - } else if (!got_errors) { - if (!write_level_file(yyvsp[-2].map, splev)) { - lc_error("Can't write output file for '%s'!", - yyvsp[-2].map); - exit(EXIT_FAILURE); - } - } - Free(yyvsp[-2].map); - Free(splev); - splev = NULL; - vardef_free_all(vardefs); - vardefs = NULL; - } -break; -case 6: -{ - start_level_def(&splev, yyvsp[0].map); - yyval.map = yyvsp[0].map; - } -break; -case 7: -{ - start_level_def(&splev, yyvsp[-2].map); - if (yyvsp[0].i == -1) { - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_MAZEGRID, HWALL, 0,0, - 0,0,0,0, SPO_INITLEVEL)); - } else { - int bg = (int) what_map_char((char) yyvsp[0].i); - - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_SOLIDFILL, bg, 0,0, - 0,0,0,0, SPO_INITLEVEL)); - } - add_opvars(splev, "io", - VA_PASS2(MAZELEVEL, SPO_LEVEL_FLAGS)); - max_x_map = COLNO-1; - max_y_map = ROWNO; - yyval.map = yyvsp[-2].map; - } -break; -case 8: -{ - yyval.i = -1; - } -break; -case 9: -{ - yyval.i = what_map_char((char) yyvsp[0].i); - } -break; -case 10: -{ - int filling = (int) yyvsp[0].terr.ter; - - if (filling == INVALID_TYPE || filling >= MAX_TYPE) - lc_error("INIT_MAP: Invalid fill char type."); - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_SOLIDFILL, filling, - 0, (int) yyvsp[0].terr.lit, - 0,0,0,0, SPO_INITLEVEL)); - max_x_map = COLNO-1; - max_y_map = ROWNO; - } -break; -case 11: -{ - int filling = (int) what_map_char((char) yyvsp[0].i); - - if (filling == INVALID_TYPE || filling >= MAX_TYPE) - lc_error("INIT_MAP: Invalid fill char type."); - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_MAZEGRID, filling, 0,0, - 0,0,0,0, SPO_INITLEVEL)); - max_x_map = COLNO-1; - max_y_map = ROWNO; - } -break; -case 12: -{ - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_ROGUE,0,0,0, - 0,0,0,0, SPO_INITLEVEL)); - } -break; -case 13: -{ - int fg = (int) what_map_char((char) yyvsp[-11].i), - bg = (int) what_map_char((char) yyvsp[-9].i); - int smoothed = (int) yyvsp[-7].i, - joined = (int) yyvsp[-5].i, - lit = (int) yyvsp[-3].i, - walled = (int) yyvsp[-1].i, - filling = (int) yyvsp[0].i; - - if (fg == INVALID_TYPE || fg >= MAX_TYPE) - lc_error("INIT_MAP: Invalid foreground type."); - if (bg == INVALID_TYPE || bg >= MAX_TYPE) - lc_error("INIT_MAP: Invalid background type."); - if (joined && fg != CORR && fg != ROOM) - lc_error("INIT_MAP: Invalid foreground type for joined map."); - - if (filling == INVALID_TYPE) - lc_error("INIT_MAP: Invalid fill char type."); - - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_MINES, filling, walled, lit, - joined, smoothed, bg, fg, - SPO_INITLEVEL)); - max_x_map = COLNO-1; - max_y_map = ROWNO; - } -break; -case 14: -{ - yyval.i = 0; - } -break; -case 15: -{ - yyval.i = yyvsp[0].i; - } -break; -case 16: -{ - add_opvars(splev, "o", VA_PASS1(SPO_COPY)); - yyval.i = 0; - } -break; -case 17: -{ - yyval.i = 1; - } -break; -case 18: -{ - yyval.i = -1; - } -break; -case 19: -{ - yyval.i = what_map_char((char) yyvsp[0].i); - } -break; -case 22: -{ - add_opvars(splev, "io", VA_PASS2(0, SPO_LEVEL_FLAGS)); - } -break; -case 23: -{ - add_opvars(splev, "io", - VA_PASS2((int) yyvsp[0].i, SPO_LEVEL_FLAGS)); - } -break; -case 24: -{ - yyval.i = (yyvsp[-2].i | yyvsp[0].i); - } -break; -case 25: -{ - yyval.i = yyvsp[0].i; - } -break; -case 26: -{ - yyval.i = 0; - } -break; -case 27: -{ - yyval.i = 1 + yyvsp[0].i; - } -break; -case 28: -{ - yyval.i = yyvsp[-1].i; - } -break; -case 96: -{ - struct lc_vardefs *vd; - - if ((vd = vardef_defined(vardefs, yyvsp[0].map, 1))) { - if (!(vd->var_type & SPOVAR_ARRAY)) - lc_error("Trying to shuffle non-array variable '%s'", - yyvsp[0].map); - } else - lc_error("Trying to shuffle undefined variable '%s'", - yyvsp[0].map); - add_opvars(splev, "so", VA_PASS2(yyvsp[0].map, SPO_SHUFFLE_ARRAY)); - Free(yyvsp[0].map); - } -break; -case 97: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_INT); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); - Free(yyvsp[-2].map); - } -break; -case 98: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_SEL); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); - } -break; -case 99: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_STRING); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); - Free(yyvsp[-2].map); - } -break; -case 100: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_MAPCHAR); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); - } -break; -case 101: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_MONST); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); - } -break; -case 102: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_OBJ); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); - } -break; -case 103: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_COORD); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); - Free(yyvsp[-2].map); - } -break; -case 104: -{ - vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_REGION); - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT)); - Free(yyvsp[-2].map); - } -break; -case 105: -{ - int n_items = (int) yyvsp[-1].i; - - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, - SPOVAR_INT | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); - } -break; -case 106: -{ - int n_items = (int) yyvsp[-1].i; - - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, - SPOVAR_COORD | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); - } -break; -case 107: -{ - int n_items = (int) yyvsp[-1].i; - - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, - SPOVAR_REGION | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); - } -break; -case 108: -{ - int n_items = (int) yyvsp[-1].i; - - vardefs = add_vardef_type(vardefs, yyvsp[-6].map, - SPOVAR_MAPCHAR | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, yyvsp[-6].map, SPO_VAR_INIT)); - Free(yyvsp[-6].map); - } -break; -case 109: -{ - int n_items = (int) yyvsp[-1].i; - - vardefs = add_vardef_type(vardefs, yyvsp[-6].map, - SPOVAR_MONST | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, yyvsp[-6].map, SPO_VAR_INIT)); - Free(yyvsp[-6].map); - } -break; -case 110: -{ - int n_items = (int) yyvsp[-1].i; - - vardefs = add_vardef_type(vardefs, yyvsp[-6].map, - SPOVAR_OBJ | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, yyvsp[-6].map, SPO_VAR_INIT)); - Free(yyvsp[-6].map); - } -break; -case 111: -{ - int n_items = (int) yyvsp[-1].i; - - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, - SPOVAR_STRING | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT)); - Free(yyvsp[-4].map); - } -break; -case 112: -{ - add_opvars(splev, "O", VA_PASS1(yyvsp[0].i)); - yyval.i = 1; - } -break; -case 113: -{ - add_opvars(splev, "O", VA_PASS1(yyvsp[0].i)); - yyval.i = 1 + yyvsp[-2].i; - } -break; -case 114: -{ - add_opvars(splev, "M", VA_PASS1(yyvsp[0].i)); - yyval.i = 1; - } -break; -case 115: -{ - add_opvars(splev, "M", VA_PASS1(yyvsp[0].i)); - yyval.i = 1 + yyvsp[-2].i; - } -break; -case 116: -{ - add_opvars(splev, "m", VA_PASS1(yyvsp[0].i)); - yyval.i = 1; - } -break; -case 117: -{ - add_opvars(splev, "m", VA_PASS1(yyvsp[0].i)); - yyval.i = 1 + yyvsp[-2].i; - } -break; -case 118: -{ - yyval.i = 1; - } -break; -case 119: -{ - yyval.i = 1 + yyvsp[-2].i; - } -break; -case 120: -{ - add_opvars(splev, "c", VA_PASS1(yyvsp[0].i)); - yyval.i = 1; - } -break; -case 121: -{ - add_opvars(splev, "c", VA_PASS1(yyvsp[0].i)); - yyval.i = 1 + yyvsp[-2].i; - } -break; -case 122: -{ - yyval.i = 1; - } -break; -case 123: -{ - yyval.i = 1 + yyvsp[-2].i; - } -break; -case 124: -{ - yyval.i = 1; - } -break; -case 125: -{ - yyval.i = 1 + yyvsp[-2].i; - } -break; -case 126: -{ - struct lc_funcdefs *funcdef; - - if (in_function_definition) - lc_error("Recursively defined functions not allowed (function %s).", yyvsp[-1].map); - - in_function_definition++; - - if (funcdef_defined(function_definitions, yyvsp[-1].map, 1)) - lc_error("Function '%s' already defined once.", yyvsp[-1].map); - - funcdef = funcdef_new(-1, yyvsp[-1].map); - funcdef->next = function_definitions; - function_definitions = funcdef; - function_splev_backup = splev; - splev = &(funcdef->code); - Free(yyvsp[-1].map); - curr_function = funcdef; - function_tmp_var_defs = vardefs; - vardefs = NULL; - } -break; -case 127: -{ - /* nothing */ - } -break; -case 128: -{ - add_opvars(splev, "io", VA_PASS2(0, SPO_RETURN)); - splev = function_splev_backup; - in_function_definition--; - curr_function = NULL; - vardef_free_all(vardefs); - vardefs = function_tmp_var_defs; - } -break; -case 129: -{ - struct lc_funcdefs *tmpfunc; - - tmpfunc = funcdef_defined(function_definitions, yyvsp[-3].map, 1); - if (tmpfunc) { - int l; - int nparams = (int) strlen(yyvsp[-1].map); - char *fparamstr = funcdef_paramtypes(tmpfunc); - - if (strcmp(yyvsp[-1].map, fparamstr)) { - char *tmps = strdup(decode_parm_str(fparamstr)); - - lc_error("Function '%s' requires params '%s', got '%s' instead.", - yyvsp[-3].map, tmps, decode_parm_str(yyvsp[-1].map)); - Free(tmps); - } - Free(fparamstr); - Free(yyvsp[-1].map); - if (!(tmpfunc->n_called)) { - /* we haven't called the function yet, so insert it in the code */ - struct opvar *jmp = New(struct opvar); - - set_opvar_int(jmp, splev->n_opcodes+1); - add_opcode(splev, SPO_PUSH, jmp); - /* we must jump past it first, then CALL it, due to RETURN. */ - add_opcode(splev, SPO_JMP, NULL); - - tmpfunc->addr = splev->n_opcodes; - - { /* init function parameter variables */ - struct lc_funcdefs_parm *tfp = tmpfunc->params; - while (tfp) { - add_opvars(splev, "iso", - VA_PASS3(0, tfp->name, - SPO_VAR_INIT)); - tfp = tfp->next; - } - } - - splev_add_from(splev, &(tmpfunc->code)); - set_opvar_int(jmp, - splev->n_opcodes - jmp->vardata.l); - } - l = (int) (tmpfunc->addr - splev->n_opcodes - 2); - add_opvars(splev, "iio", - VA_PASS3(nparams, l, SPO_CALL)); - tmpfunc->n_called++; - } else { - lc_error("Function '%s' not defined.", yyvsp[-3].map); - } - Free(yyvsp[-3].map); - } -break; -case 130: -{ - add_opcode(splev, SPO_EXIT, NULL); - } -break; -case 131: -{ - yyval.i = 100; - } -break; -case 132: -{ - yyval.i = yyvsp[0].i; - } -break; -case 133: -{ - /* val > rn2(100) */ - add_opvars(splev, "iio", - VA_PASS3((int) yyvsp[0].i, 100, SPO_RN2)); - yyval.i = SPO_JG; - } -break; -case 134: -{ - yyval.i = yyvsp[-2].i; - } -break; -case 135: -{ - /* boolean, explicit foo != 0 */ - add_opvars(splev, "i", VA_PASS1(0)); - yyval.i = SPO_JNE; - } -break; -case 136: -{ - is_inconstant_number = 0; - } -break; -case 137: -{ - struct opvar *chkjmp; - - if (in_switch_statement > 0) - lc_error("Cannot nest switch-statements."); - - in_switch_statement++; - - n_switch_case_list = 0; - switch_default_case = NULL; - - if (!is_inconstant_number) - add_opvars(splev, "o", VA_PASS1(SPO_RN2)); - is_inconstant_number = 0; - - chkjmp = New(struct opvar); - set_opvar_int(chkjmp, splev->n_opcodes+1); - switch_check_jump = chkjmp; - add_opcode(splev, SPO_PUSH, chkjmp); - add_opcode(splev, SPO_JMP, NULL); - break_stmt_start(); - } -break; -case 138: -{ - struct opvar *endjump = New(struct opvar); - int i; - - set_opvar_int(endjump, splev->n_opcodes+1); - - add_opcode(splev, SPO_PUSH, endjump); - add_opcode(splev, SPO_JMP, NULL); - - set_opvar_int(switch_check_jump, - splev->n_opcodes - switch_check_jump->vardata.l); - - for (i = 0; i < n_switch_case_list; i++) { - add_opvars(splev, "oio", - VA_PASS3(SPO_COPY, - switch_case_value[i], SPO_CMP)); - set_opvar_int(switch_case_list[i], - switch_case_list[i]->vardata.l - splev->n_opcodes-1); - add_opcode(splev, SPO_PUSH, switch_case_list[i]); - add_opcode(splev, SPO_JE, NULL); - } - - if (switch_default_case) { - set_opvar_int(switch_default_case, - switch_default_case->vardata.l - splev->n_opcodes-1); - add_opcode(splev, SPO_PUSH, switch_default_case); - add_opcode(splev, SPO_JMP, NULL); - } - - set_opvar_int(endjump, splev->n_opcodes - endjump->vardata.l); - - break_stmt_end(splev); - - add_opcode(splev, SPO_POP, NULL); /* get rid of the value in stack */ - in_switch_statement--; - - - } -break; -case 141: -{ - if (n_switch_case_list < MAX_SWITCH_CASES) { - struct opvar *tmppush = New(struct opvar); - - set_opvar_int(tmppush, splev->n_opcodes); - switch_case_value[n_switch_case_list] = yyvsp[-1].i; - switch_case_list[n_switch_case_list++] = tmppush; - } else lc_error("Too many cases in a switch."); - } -break; -case 142: -{ - } -break; -case 143: -{ - struct opvar *tmppush = New(struct opvar); - - if (switch_default_case) - lc_error("Switch default case already used."); - - set_opvar_int(tmppush, splev->n_opcodes); - switch_default_case = tmppush; - } -break; -case 144: -{ - } -break; -case 145: -{ - if (!allow_break_statements) - lc_error("Cannot use BREAK outside a statement block."); - else { - break_stmt_new(splev, splev->n_opcodes); - } - } -break; -case 148: -{ - char buf[256], buf2[256]; - - if (n_forloops >= MAX_NESTED_IFS) { - lc_error("FOR: Too deeply nested loops."); - n_forloops = MAX_NESTED_IFS - 1; - } - - /* first, define a variable for the for-loop end value */ - Sprintf(buf, "%s end", yyvsp[-4].map); - /* the value of which is already in stack (the 2nd math_expr) */ - add_opvars(splev, "iso", VA_PASS3(0, buf, SPO_VAR_INIT)); - - vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_INT); - /* define the for-loop variable. value is in stack (1st math_expr) */ - add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT)); - - /* calculate value for the loop "step" variable */ - Sprintf(buf2, "%s step", yyvsp[-4].map); - /* end - start */ - add_opvars(splev, "vvo", - VA_PASS3(buf, yyvsp[-4].map, SPO_MATH_SUB)); - /* sign of that */ - add_opvars(splev, "o", VA_PASS1(SPO_MATH_SIGN)); - /* save the sign into the step var */ - add_opvars(splev, "iso", - VA_PASS3(0, buf2, SPO_VAR_INIT)); - - forloop_list[n_forloops].varname = strdup(yyvsp[-4].map); - forloop_list[n_forloops].jmp_point = splev->n_opcodes; - - n_forloops++; - Free(yyvsp[-4].map); - } -break; -case 149: -{ - /* nothing */ - break_stmt_start(); - } -break; -case 150: -{ - int l; - char buf[256], buf2[256]; - - n_forloops--; - Sprintf(buf, "%s step", forloop_list[n_forloops].varname); - Sprintf(buf2, "%s end", forloop_list[n_forloops].varname); - /* compare for-loop var to end value */ - add_opvars(splev, "vvo", - VA_PASS3(forloop_list[n_forloops].varname, - buf2, SPO_CMP)); - /* var + step */ - add_opvars(splev, "vvo", - VA_PASS3(buf, forloop_list[n_forloops].varname, - SPO_MATH_ADD)); - /* for-loop var = (for-loop var + step) */ - add_opvars(splev, "iso", - VA_PASS3(0, forloop_list[n_forloops].varname, - SPO_VAR_INIT)); - /* jump back if compared values were not equal */ - l = (int) (forloop_list[n_forloops].jmp_point - - splev->n_opcodes - 1); - add_opvars(splev, "io", VA_PASS2(l, SPO_JNE)); - Free(forloop_list[n_forloops].varname); - break_stmt_end(splev); - } -break; -case 151: -{ - struct opvar *tmppush = New(struct opvar); - - if (n_if_list >= MAX_NESTED_IFS) { - lc_error("LOOP: Too deeply nested conditionals."); - n_if_list = MAX_NESTED_IFS - 1; - } - set_opvar_int(tmppush, splev->n_opcodes); - if_list[n_if_list++] = tmppush; - - add_opvars(splev, "o", VA_PASS1(SPO_DEC)); - break_stmt_start(); - } -break; -case 152: -{ - struct opvar *tmppush; - - add_opvars(splev, "oio", VA_PASS3(SPO_COPY, 0, SPO_CMP)); - - tmppush = (struct opvar *) if_list[--n_if_list]; - set_opvar_int(tmppush, - tmppush->vardata.l - splev->n_opcodes-1); - add_opcode(splev, SPO_PUSH, tmppush); - add_opcode(splev, SPO_JG, NULL); - add_opcode(splev, SPO_POP, NULL); /* discard count */ - break_stmt_end(splev); - } -break; -case 153: -{ - struct opvar *tmppush2 = New(struct opvar); - - if (n_if_list >= MAX_NESTED_IFS) { - lc_error("IF: Too deeply nested conditionals."); - n_if_list = MAX_NESTED_IFS - 1; - } - - add_opcode(splev, SPO_CMP, NULL); - - set_opvar_int(tmppush2, splev->n_opcodes+1); - - if_list[n_if_list++] = tmppush2; - - add_opcode(splev, SPO_PUSH, tmppush2); - - add_opcode(splev, reverse_jmp_opcode( yyvsp[-1].i ), NULL); - - } -break; -case 154: -{ - if (n_if_list > 0) { - struct opvar *tmppush; - - tmppush = (struct opvar *) if_list[--n_if_list]; - set_opvar_int(tmppush, - splev->n_opcodes - tmppush->vardata.l); - } else lc_error("IF: Huh?! No start address?"); - } -break; -case 155: -{ - struct opvar *tmppush2 = New(struct opvar); - - if (n_if_list >= MAX_NESTED_IFS) { - lc_error("IF: Too deeply nested conditionals."); - n_if_list = MAX_NESTED_IFS - 1; - } - - add_opcode(splev, SPO_CMP, NULL); - - set_opvar_int(tmppush2, splev->n_opcodes+1); - - if_list[n_if_list++] = tmppush2; - - add_opcode(splev, SPO_PUSH, tmppush2); - - add_opcode(splev, reverse_jmp_opcode( yyvsp[0].i ), NULL); - - } -break; -case 156: -{ - /* do nothing */ - } -break; -case 157: -{ - if (n_if_list > 0) { - struct opvar *tmppush; - - tmppush = (struct opvar *) if_list[--n_if_list]; - set_opvar_int(tmppush, - splev->n_opcodes - tmppush->vardata.l); - } else lc_error("IF: Huh?! No start address?"); - } -break; -case 158: -{ - if (n_if_list > 0) { - struct opvar *tmppush = New(struct opvar); - struct opvar *tmppush2; - - set_opvar_int(tmppush, splev->n_opcodes+1); - add_opcode(splev, SPO_PUSH, tmppush); - - add_opcode(splev, SPO_JMP, NULL); - - tmppush2 = (struct opvar *) if_list[--n_if_list]; - - set_opvar_int(tmppush2, - splev->n_opcodes - tmppush2->vardata.l); - if_list[n_if_list++] = tmppush; - } else lc_error("IF: Huh?! No else-part address?"); - } -break; -case 159: -{ - if (n_if_list > 0) { - struct opvar *tmppush; - tmppush = (struct opvar *) if_list[--n_if_list]; - set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); - } else lc_error("IF: Huh?! No end address?"); - } -break; -case 160: -{ - add_opvars(splev, "o", VA_PASS1(SPO_MESSAGE)); - } -break; -case 161: -{ - add_opvars(splev, "iiiiiio", - VA_PASS7(-1, 0, -1, -1, -1, -1, SPO_CORRIDOR)); - } -break; -case 162: -{ - add_opvars(splev, "iiiiiio", - VA_PASS7(-1, yyvsp[0].i, -1, -1, -1, -1, SPO_CORRIDOR)); - } -break; -case 163: -{ - add_opvars(splev, "iiiiiio", - VA_PASS7(-1, -1, -1, -1, -1, -1, SPO_CORRIDOR)); - } -break; -case 164: -{ - add_opvars(splev, "iiiiiio", - VA_PASS7(yyvsp[-2].corpos.room, yyvsp[-2].corpos.door, yyvsp[-2].corpos.wall, - yyvsp[0].corpos.room, yyvsp[0].corpos.door, yyvsp[0].corpos.wall, - SPO_CORRIDOR)); - } -break; -case 165: -{ - add_opvars(splev, "iiiiiio", - VA_PASS7(yyvsp[-2].corpos.room, yyvsp[-2].corpos.door, yyvsp[-2].corpos.wall, - -1, -1, (long)yyvsp[0].i, - SPO_CORRIDOR)); - } -break; -case 166: -{ - yyval.corpos.room = yyvsp[-5].i; - yyval.corpos.wall = yyvsp[-3].i; - yyval.corpos.door = yyvsp[-1].i; - } -break; -case 167: -{ - if ((yyvsp[-2].i < 100) && (yyvsp[-3].i == OROOM)) - lc_error("Only typed rooms can have a chance."); - else { - add_opvars(splev, "iii", - VA_PASS3((long)yyvsp[-3].i, (long)yyvsp[-2].i, (long)yyvsp[0].i)); - } - } -break; -case 168: -{ - long rflags = yyvsp[0].i; - - if (rflags == -1) rflags = (1 << 0); - add_opvars(splev, "iiiiiiio", - VA_PASS8(rflags, ERR, ERR, - yyvsp[-3].crd.x, yyvsp[-3].crd.y, yyvsp[-1].sze.width, yyvsp[-1].sze.height, - SPO_SUBROOM)); - break_stmt_start(); - } -break; -case 169: -{ - break_stmt_end(splev); - add_opcode(splev, SPO_ENDROOM, NULL); - } -break; -case 170: -{ - long rflags = yyvsp[-2].i; - - if (rflags == -1) rflags = (1 << 0); - add_opvars(splev, "iiiiiiio", - VA_PASS8(rflags, - yyvsp[-3].crd.x, yyvsp[-3].crd.y, yyvsp[-5].crd.x, yyvsp[-5].crd.y, - yyvsp[-1].sze.width, yyvsp[-1].sze.height, SPO_ROOM)); - break_stmt_start(); - } -break; -case 171: -{ - break_stmt_end(splev); - add_opcode(splev, SPO_ENDROOM, NULL); - } -break; -case 172: -{ - yyval.i = 1; - } -break; -case 173: -{ - yyval.i = yyvsp[0].i; - } -break; -case 174: -{ - if ( yyvsp[-3].i < 1 || yyvsp[-3].i > 5 || - yyvsp[-1].i < 1 || yyvsp[-1].i > 5 ) { - lc_error("Room positions should be between 1-5: (%li,%li)!", yyvsp[-3].i, yyvsp[-1].i); - } else { - yyval.crd.x = yyvsp[-3].i; - yyval.crd.y = yyvsp[-1].i; - } - } -break; -case 175: -{ - yyval.crd.x = yyval.crd.y = ERR; - } -break; -case 176: -{ - if ( yyvsp[-3].i < 0 || yyvsp[-1].i < 0) { - lc_error("Invalid subroom position (%li,%li)!", yyvsp[-3].i, yyvsp[-1].i); - } else { - yyval.crd.x = yyvsp[-3].i; - yyval.crd.y = yyvsp[-1].i; - } - } -break; -case 177: -{ - yyval.crd.x = yyval.crd.y = ERR; - } -break; -case 178: -{ - yyval.crd.x = yyvsp[-3].i; - yyval.crd.y = yyvsp[-1].i; - } -break; -case 179: -{ - yyval.crd.x = yyval.crd.y = ERR; - } -break; -case 180: -{ - yyval.sze.width = yyvsp[-3].i; - yyval.sze.height = yyvsp[-1].i; - } -break; -case 181: -{ - yyval.sze.height = yyval.sze.width = ERR; - } -break; -case 182: -{ - /* ERR means random here */ - if (yyvsp[-2].i == ERR && yyvsp[0].i != ERR) { - lc_error("If the door wall is random, so must be its pos!"); - } else { - add_opvars(splev, "iiiio", - VA_PASS5((long)yyvsp[0].i, (long)yyvsp[-4].i, (long)yyvsp[-6].i, - (long)yyvsp[-2].i, SPO_ROOM_DOOR)); - } - } -break; -case 183: -{ - add_opvars(splev, "io", VA_PASS2((long)yyvsp[-2].i, SPO_DOOR)); - } -break; -case 188: -{ - yyval.i = yyvsp[0].i; - } -break; -case 189: -{ - yyval.i = (yyvsp[-2].i | yyvsp[0].i); - } -break; -case 192: -{ - add_opvars(splev, "ciisiio", - VA_PASS7(0, 0, 1, (char *) 0, 0, 0, SPO_MAP)); - max_x_map = COLNO-1; - max_y_map = ROWNO; - } -break; -case 193: -{ - add_opvars(splev, "cii", - VA_PASS3(SP_COORD_PACK((yyvsp[-4].i), (yyvsp[-2].i)), - 1, (int) yyvsp[-1].i)); - scan_map(yyvsp[0].map, splev); - Free(yyvsp[0].map); - } -break; -case 194: -{ - add_opvars(splev, "ii", VA_PASS2(2, (int) yyvsp[-1].i)); - scan_map(yyvsp[0].map, splev); - Free(yyvsp[0].map); - } -break; -case 199: -{ - add_opvars(splev, "io", VA_PASS2(0, SPO_MONSTER)); - } -break; -case 200: -{ - add_opvars(splev, "io", VA_PASS2(1, SPO_MONSTER)); - in_container_obj++; - break_stmt_start(); - } -break; -case 201: -{ - break_stmt_end(splev); - in_container_obj--; - add_opvars(splev, "o", VA_PASS1(SPO_END_MONINVENT)); - } -break; -case 202: -{ - /* nothing */ - } -break; -case 203: -{ - struct opvar *stopit = New(struct opvar); - - set_opvar_int(stopit, SP_M_V_END); - add_opcode(splev, SPO_PUSH, stopit); - yyval.i = 0x0000; - } -break; -case 204: -{ - if (( yyvsp[-2].i & yyvsp[0].i )) - lc_error("MONSTER extra info defined twice."); - yyval.i = ( yyvsp[-2].i | yyvsp[0].i ); - } -break; -case 205: -{ - add_opvars(splev, "i", VA_PASS1(SP_M_V_NAME)); - yyval.i = 0x0001; - } -break; -case 206: -{ - add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_M_V_PEACEFUL)); - yyval.i = 0x0002; - } -break; -case 207: -{ - add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_M_V_ASLEEP)); - yyval.i = 0x0004; - } -break; -case 208: -{ - add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_M_V_ALIGN)); - yyval.i = 0x0008; - } -break; -case 209: -{ - add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[-1].i, SP_M_V_APPEAR)); - yyval.i = 0x0010; - } -break; -case 210: -{ - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_FEMALE)); - yyval.i = 0x0020; - } -break; -case 211: -{ - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_INVIS)); - yyval.i = 0x0040; - } -break; -case 212: -{ - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_CANCELLED)); - yyval.i = 0x0080; - } -break; -case 213: -{ - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_REVIVED)); - yyval.i = 0x0100; - } -break; -case 214: -{ - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_AVENGE)); - yyval.i = 0x0200; - } -break; -case 215: -{ - add_opvars(splev, "i", VA_PASS1(SP_M_V_FLEEING)); - yyval.i = 0x0400; - } -break; -case 216: -{ - add_opvars(splev, "i", VA_PASS1(SP_M_V_BLINDED)); - yyval.i = 0x0800; - } -break; -case 217: -{ - add_opvars(splev, "i", VA_PASS1(SP_M_V_PARALYZED)); - yyval.i = 0x1000; - } -break; -case 218: -{ - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_STUNNED)); - yyval.i = 0x2000; - } -break; -case 219: -{ - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_CONFUSED)); - yyval.i = 0x4000; - } -break; -case 220: -{ - add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_M_V_SEENTRAPS)); - yyval.i = 0x8000; - } -break; -case 221: -{ - int token = get_trap_type(yyvsp[0].map); - - if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", yyvsp[0].map); - Free(yyvsp[0].map); - yyval.i = (1L << (token - 1)); - } -break; -case 222: -{ - yyval.i = (long) ~0; - } -break; -case 223: -{ - int token = get_trap_type(yyvsp[-2].map); - if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", yyvsp[-2].map); - - if ((1L << (token - 1)) & yyvsp[0].i) - lc_error("Monster seen_traps, trap '%s' listed twice.", yyvsp[-2].map); - Free(yyvsp[-2].map); - yyval.i = ((1L << (token - 1)) | yyvsp[0].i); - } -break; -case 224: -{ - int cnt = 0; - - if (in_container_obj) - cnt |= SP_OBJ_CONTENT; - add_opvars(splev, "io", VA_PASS2(cnt, SPO_OBJECT)); - } -break; -case 225: -{ - int cnt = SP_OBJ_CONTAINER; - - if (in_container_obj) - cnt |= SP_OBJ_CONTENT; - add_opvars(splev, "io", VA_PASS2(cnt, SPO_OBJECT)); - in_container_obj++; - break_stmt_start(); - } -break; -case 226: -{ - break_stmt_end(splev); - in_container_obj--; - add_opcode(splev, SPO_POP_CONTAINER, NULL); - } -break; -case 227: -{ - if (( yyvsp[0].i & 0x4000) && in_container_obj) - lc_error("Object cannot have a coord when contained."); - else if (!( yyvsp[0].i & 0x4000) && !in_container_obj) - lc_error("Object needs a coord when not contained."); - } -break; -case 228: -{ - struct opvar *stopit = New(struct opvar); - set_opvar_int(stopit, SP_O_V_END); - add_opcode(splev, SPO_PUSH, stopit); - yyval.i = 0x00; - } -break; -case 229: -{ - if (( yyvsp[-2].i & yyvsp[0].i )) - lc_error("OBJECT extra info '%s' defined twice.", curr_token); - yyval.i = ( yyvsp[-2].i | yyvsp[0].i ); - } -break; -case 230: -{ - add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_O_V_CURSE)); - yyval.i = 0x0001; - } -break; -case 231: -{ - add_opvars(splev, "i", VA_PASS1(SP_O_V_CORPSENM)); - yyval.i = 0x0002; - } -break; -case 232: -{ - add_opvars(splev, "i", VA_PASS1(SP_O_V_SPE)); - yyval.i = 0x0004; - } -break; -case 233: -{ - add_opvars(splev, "i", VA_PASS1(SP_O_V_NAME)); - yyval.i = 0x0008; - } -break; -case 234: -{ - add_opvars(splev, "i", VA_PASS1(SP_O_V_QUAN)); - yyval.i = 0x0010; - } -break; -case 235: -{ - add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_BURIED)); - yyval.i = 0x0020; - } -break; -case 236: -{ - add_opvars(splev, "ii", VA_PASS2((int) yyvsp[0].i, SP_O_V_LIT)); - yyval.i = 0x0040; - } -break; -case 237: -{ - add_opvars(splev, "i", VA_PASS1(SP_O_V_ERODED)); - yyval.i = 0x0080; - } -break; -case 238: -{ - add_opvars(splev, "ii", VA_PASS2(-1, SP_O_V_ERODED)); - yyval.i = 0x0080; - } -break; -case 239: -{ - if (yyvsp[0].i == D_LOCKED) { - add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_LOCKED)); - yyval.i = 0x0100; - } else if (yyvsp[0].i == D_BROKEN) { - add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_BROKEN)); - yyval.i = 0x0200; - } else - lc_error("DOOR state can only be locked or broken."); - } -break; -case 240: -{ - add_opvars(splev, "ii", - VA_PASS2((int) yyvsp[0].i, SP_O_V_TRAPPED)); - yyval.i = 0x0400; - } -break; -case 241: -{ - add_opvars(splev, "i", VA_PASS1(SP_O_V_RECHARGED)); - yyval.i = 0x0800; - } -break; -case 242: -{ - add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_INVIS)); - yyval.i = 0x1000; - } -break; -case 243: -{ - add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_GREASED)); - yyval.i = 0x2000; - } -break; -case 244: -{ - add_opvars(splev, "i", VA_PASS1(SP_O_V_COORD)); - yyval.i = 0x4000; - } -break; -case 245: -{ - add_opvars(splev, "io", VA_PASS2((int) yyvsp[-2].i, SPO_TRAP)); - } -break; -case 246: -{ - long dir, state = 0; - - /* convert dir from a DIRECTION to a DB_DIR */ - dir = yyvsp[-2].i; - switch (dir) { - case W_NORTH: dir = DB_NORTH; break; - case W_SOUTH: dir = DB_SOUTH; break; - case W_EAST: dir = DB_EAST; break; - case W_WEST: dir = DB_WEST; break; - default: - lc_error("Invalid drawbridge direction."); - break; - } - - if ( yyvsp[0].i == D_ISOPEN ) - state = 1; - else if ( yyvsp[0].i == D_CLOSED ) - state = 0; - else if ( yyvsp[0].i == -1 ) - state = -1; - else - lc_error("A drawbridge can only be open, closed or random!"); - add_opvars(splev, "iio", - VA_PASS3(state, dir, SPO_DRAWBRIDGE)); - } -break; -case 247: -{ - add_opvars(splev, "iiio", - VA_PASS4((int) yyvsp[0].i, 1, 0, SPO_MAZEWALK)); - } -break; -case 248: -{ - add_opvars(splev, "iiio", - VA_PASS4((int) yyvsp[-3].i, (int) yyvsp[-1].i, - (int) yyvsp[0].i, SPO_MAZEWALK)); - } -break; -case 249: -{ - add_opvars(splev, "rio", - VA_PASS3(SP_REGION_PACK(-1,-1,-1,-1), - 0, SPO_WALLIFY)); - } -break; -case 250: -{ - add_opvars(splev, "io", VA_PASS2(1, SPO_WALLIFY)); - } -break; -case 251: -{ - add_opvars(splev, "io", - VA_PASS2((int) yyvsp[0].i, SPO_LADDER)); - } -break; -case 252: -{ - add_opvars(splev, "io", - VA_PASS2((int) yyvsp[0].i, SPO_STAIR)); - } -break; -case 253: -{ - add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14(yyvsp[-4].lregn.x1, yyvsp[-4].lregn.y1, yyvsp[-4].lregn.x2, yyvsp[-4].lregn.y2, yyvsp[-4].lregn.area, - yyvsp[-2].lregn.x1, yyvsp[-2].lregn.y1, yyvsp[-2].lregn.x2, yyvsp[-2].lregn.y2, yyvsp[-2].lregn.area, - (long) ((yyvsp[0].i) ? LR_UPSTAIR : LR_DOWNSTAIR), - 0, (char *) 0, SPO_LEVREGION)); - } -break; -case 254: -{ - add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14(yyvsp[-4].lregn.x1, yyvsp[-4].lregn.y1, yyvsp[-4].lregn.x2, yyvsp[-4].lregn.y2, yyvsp[-4].lregn.area, - yyvsp[-2].lregn.x1, yyvsp[-2].lregn.y1, yyvsp[-2].lregn.x2, yyvsp[-2].lregn.y2, yyvsp[-2].lregn.area, - LR_PORTAL, 0, yyvsp[0].map, SPO_LEVREGION)); - Free(yyvsp[0].map); - } -break; -case 255: -{ - long rtyp = 0; - switch(yyvsp[0].i) { - case -1: rtyp = LR_TELE; break; - case 0: rtyp = LR_DOWNTELE; break; - case 1: rtyp = LR_UPTELE; break; - } - add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14(yyvsp[-3].lregn.x1, yyvsp[-3].lregn.y1, yyvsp[-3].lregn.x2, yyvsp[-3].lregn.y2, yyvsp[-3].lregn.area, - yyvsp[-1].lregn.x1, yyvsp[-1].lregn.y1, yyvsp[-1].lregn.x2, yyvsp[-1].lregn.y2, yyvsp[-1].lregn.area, - rtyp, 0, (char *)0, SPO_LEVREGION)); - } -break; -case 256: -{ - add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14(yyvsp[-2].lregn.x1, yyvsp[-2].lregn.y1, yyvsp[-2].lregn.x2, yyvsp[-2].lregn.y2, yyvsp[-2].lregn.area, - yyvsp[0].lregn.x1, yyvsp[0].lregn.y1, yyvsp[0].lregn.x2, yyvsp[0].lregn.y2, yyvsp[0].lregn.area, - (long) LR_BRANCH, 0, - (char *) 0, SPO_LEVREGION)); - } -break; -case 257: -{ - yyval.i = -1; - } -break; -case 258: -{ - yyval.i = yyvsp[0].i; - } -break; -case 259: -{ - add_opvars(splev, "o", VA_PASS1(SPO_FOUNTAIN)); - } -break; -case 260: -{ - add_opvars(splev, "o", VA_PASS1(SPO_SINK)); - } -break; -case 261: -{ - add_opvars(splev, "o", VA_PASS1(SPO_POOL)); - } -break; -case 262: -{ - yyval.terr.lit = -2; - yyval.terr.ter = what_map_char((char) yyvsp[0].i); - } -break; -case 263: -{ - yyval.terr.lit = yyvsp[-1].i; - yyval.terr.ter = what_map_char((char) yyvsp[-3].i); - } -break; -case 264: -{ - add_opvars(splev, "io", - VA_PASS2(yyvsp[0].i, SPO_REPLACETERRAIN)); - } -break; -case 265: -{ - add_opvars(splev, "o", VA_PASS1(SPO_TERRAIN)); - } -break; -case 266: -{ - add_opvars(splev, "o", VA_PASS1(SPO_NON_DIGGABLE)); - } -break; -case 267: -{ - add_opvars(splev, "o", VA_PASS1(SPO_NON_PASSWALL)); - } -break; -case 268: -{ - long irr; - long rt = yyvsp[-1].i; - long rflags = yyvsp[0].i; - - if (rflags == -1) rflags = (1 << 0); - if (!(rflags & 1)) rt += MAXRTYPE+1; - irr = ((rflags & 2) != 0); - add_opvars(splev, "iiio", - VA_PASS4((long)yyvsp[-3].i, rt, rflags, SPO_REGION)); - yyval.i = (irr || (rflags & 1) || rt != OROOM); - break_stmt_start(); - } -break; -case 269: -{ - break_stmt_end(splev); - if ( yyvsp[-1].i ) { - add_opcode(splev, SPO_ENDROOM, NULL); - } else if ( yyvsp[0].i ) - lc_error("Cannot use lev statements in non-permanent REGION"); - } -break; -case 270: -{ - yyval.i = 0; - } -break; -case 271: -{ - yyval.i = yyvsp[0].i; - } -break; -case 272: -{ - add_opvars(splev, "iio", - VA_PASS3((long)yyvsp[0].i, (long)yyvsp[-2].i, SPO_ALTAR)); - } -break; -case 273: -{ - add_opvars(splev, "io", VA_PASS2(2, SPO_GRAVE)); - } -break; -case 274: -{ - add_opvars(splev, "sio", - VA_PASS3((char *)0, 1, SPO_GRAVE)); - } -break; -case 275: -{ - add_opvars(splev, "sio", - VA_PASS3((char *)0, 0, SPO_GRAVE)); - } -break; -case 276: -{ - add_opvars(splev, "o", VA_PASS1(SPO_GOLD)); - } -break; -case 277: -{ - add_opvars(splev, "io", - VA_PASS2((long)yyvsp[-2].i, SPO_ENGRAVING)); - } -break; -case 278: -{ - add_opvars(splev, "o", VA_PASS1(SPO_MINERALIZE)); - } -break; -case 279: -{ - add_opvars(splev, "iiiio", - VA_PASS5(-1L, -1L, -1L, -1L, SPO_MINERALIZE)); - } -break; -case 280: -{ - int token = get_trap_type(yyvsp[0].map); - if (token == ERR) - lc_error("Unknown trap type '%s'!", yyvsp[0].map); - yyval.i = token; - Free(yyvsp[0].map); - } -break; -case 282: -{ - int token = get_room_type(yyvsp[0].map); - if (token == ERR) { - lc_warning("Unknown room type \"%s\"! Making ordinary room...", yyvsp[0].map); - yyval.i = OROOM; - } else - yyval.i = token; - Free(yyvsp[0].map); - } -break; -case 284: -{ - yyval.i = -1; - } -break; -case 285: -{ - yyval.i = yyvsp[0].i; - } -break; -case 286: -{ - yyval.i = yyvsp[0].i; - } -break; -case 287: -{ - yyval.i = yyvsp[-2].i | yyvsp[0].i; - } -break; -case 288: -{ - yyval.i = (yyvsp[0].i << 0); - } -break; -case 289: -{ - yyval.i = (yyvsp[0].i << 1); - } -break; -case 290: -{ - yyval.i = (yyvsp[0].i << 2); - } -break; -case 297: -{ - yyval.i = - MAX_REGISTERS - 1; - } -break; -case 300: -{ - yyval.i = - MAX_REGISTERS - 1; - } -break; -case 303: -{ - if ( yyvsp[-1].i >= 3 ) - lc_error("Register Index overflow!"); - else - yyval.i = - yyvsp[-1].i - 1; - } -break; -case 304: -{ - add_opvars(splev, "s", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); - } -break; -case 305: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_STRING); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); - } -break; -case 306: -{ - check_vardef_type(vardefs, yyvsp[-3].map, - SPOVAR_STRING | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); - } -break; -case 307: -{ - /* nothing */ - } -break; -case 308: -{ - add_opvars(splev, "c", VA_PASS1(yyvsp[0].i)); - } -break; -case 309: -{ - add_opvars(splev, "o", VA_PASS1(SPO_SEL_RNDCOORD)); - } -break; -case 310: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_COORD); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); - } -break; -case 311: -{ - check_vardef_type(vardefs, yyvsp[-3].map, - SPOVAR_COORD | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); - } -break; -case 312: -{ - if (yyvsp[-3].i < 0 || yyvsp[-1].i < 0 || yyvsp[-3].i >= COLNO || yyvsp[-1].i >= ROWNO) - lc_error("Coordinates (%li,%li) out of map range!", - yyvsp[-3].i, yyvsp[-1].i); - yyval.i = SP_COORD_PACK(yyvsp[-3].i, yyvsp[-1].i); - } -break; -case 313: -{ - yyval.i = SP_COORD_PACK_RANDOM(0); - } -break; -case 314: -{ - yyval.i = SP_COORD_PACK_RANDOM(yyvsp[-1].i); - } -break; -case 315: -{ - yyval.i = yyvsp[0].i; - } -break; -case 316: -{ - if ((yyvsp[-2].i & yyvsp[0].i)) - lc_warning("Humidity flag used twice."); - yyval.i = (yyvsp[-2].i | yyvsp[0].i); - } -break; -case 317: -{ - /* nothing */ - } -break; -case 318: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_REGION); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); - } -break; -case 319: -{ - check_vardef_type(vardefs, yyvsp[-3].map, - SPOVAR_REGION | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); - } -break; -case 320: -{ - long r = SP_REGION_PACK(yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); - - if (yyvsp[-7].i > yyvsp[-3].i || yyvsp[-5].i > yyvsp[-1].i) - lc_error("Region start > end: (%ld,%ld,%ld,%ld)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); - - add_opvars(splev, "r", VA_PASS1(r)); - yyval.i = r; - } -break; -case 321: -{ - add_opvars(splev, "m", VA_PASS1(yyvsp[0].i)); - } -break; -case 322: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_MAPCHAR); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); - } -break; -case 323: -{ - check_vardef_type(vardefs, yyvsp[-3].map, - SPOVAR_MAPCHAR | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); - } -break; -case 324: -{ - if (what_map_char((char) yyvsp[0].i) != INVALID_TYPE) - yyval.i = SP_MAPCHAR_PACK(what_map_char((char) yyvsp[0].i), -2); - else { - lc_error("Unknown map char type '%c'!", yyvsp[0].i); - yyval.i = SP_MAPCHAR_PACK(STONE, -2); - } - } -break; -case 325: -{ - if (what_map_char((char) yyvsp[-3].i) != INVALID_TYPE) - yyval.i = SP_MAPCHAR_PACK(what_map_char((char) yyvsp[-3].i), yyvsp[-1].i); - else { - lc_error("Unknown map char type '%c'!", yyvsp[-3].i); - yyval.i = SP_MAPCHAR_PACK(STONE, yyvsp[-1].i); - } - } -break; -case 326: -{ - add_opvars(splev, "M", VA_PASS1(yyvsp[0].i)); - } -break; -case 327: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_MONST); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); - } -break; -case 328: -{ - check_vardef_type(vardefs, yyvsp[-3].map, - SPOVAR_MONST | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); - } -break; -case 329: -{ - long m = get_monster_id(yyvsp[0].map, (char)0); - if (m == ERR) { - lc_error("Unknown monster \"%s\"!", yyvsp[0].map); - yyval.i = -1; - } else - yyval.i = SP_MONST_PACK(m, - def_monsyms[(int) mons[m].mlet].sym); - Free(yyvsp[0].map); - } -break; -case 330: -{ - if (check_monster_char((char) yyvsp[0].i)) - yyval.i = SP_MONST_PACK(-1, yyvsp[0].i); - else { - lc_error("Unknown monster class '%c'!", yyvsp[0].i); - yyval.i = -1; - } - } -break; -case 331: -{ - long m = get_monster_id(yyvsp[-1].map, (char) yyvsp[-3].i); - if (m == ERR) { - lc_error("Unknown monster ('%c', \"%s\")!", yyvsp[-3].i, yyvsp[-1].map); - yyval.i = -1; - } else - yyval.i = SP_MONST_PACK(m, yyvsp[-3].i); - Free(yyvsp[-1].map); - } -break; -case 332: -{ - yyval.i = -1; - } -break; -case 333: -{ - add_opvars(splev, "O", VA_PASS1(yyvsp[0].i)); - } -break; -case 334: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_OBJ); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); - } -break; -case 335: -{ - check_vardef_type(vardefs, yyvsp[-3].map, - SPOVAR_OBJ | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); - } -break; -case 336: -{ - long m = get_object_id(yyvsp[0].map, (char)0); - if (m == ERR) { - lc_error("Unknown object \"%s\"!", yyvsp[0].map); - yyval.i = -1; - } else - /* obj class != 0 to force generation of a specific item */ - yyval.i = SP_OBJ_PACK(m, 1); - Free(yyvsp[0].map); - } -break; -case 337: -{ - if (check_object_char((char) yyvsp[0].i)) - yyval.i = SP_OBJ_PACK(-1, yyvsp[0].i); - else { - lc_error("Unknown object class '%c'!", yyvsp[0].i); - yyval.i = -1; - } - } -break; -case 338: -{ - long m = get_object_id(yyvsp[-1].map, (char) yyvsp[-3].i); - if (m == ERR) { - lc_error("Unknown object ('%c', \"%s\")!", yyvsp[-3].i, yyvsp[-1].map); - yyval.i = -1; - } else - yyval.i = SP_OBJ_PACK(m, yyvsp[-3].i); - Free(yyvsp[-1].map); - } -break; -case 339: -{ - yyval.i = -1; - } -break; -case 340: -{ } -break; -case 341: -{ - add_opvars(splev, "o", VA_PASS1(SPO_MATH_ADD)); - } -break; -case 342: -{ - add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); - } -break; -case 343: -{ - is_inconstant_number = 1; - } -break; -case 344: -{ - add_opvars(splev, "i", VA_PASS1(yyvsp[-1].i)); - } -break; -case 345: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_INT); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); - is_inconstant_number = 1; - } -break; -case 346: -{ - check_vardef_type(vardefs, yyvsp[-3].map, - SPOVAR_INT | SPOVAR_ARRAY); - vardef_used(vardefs, yyvsp[-3].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map)); - Free(yyvsp[-3].map); - is_inconstant_number = 1; - } -break; -case 347: -{ - add_opvars(splev, "o", VA_PASS1(SPO_MATH_ADD)); - } -break; -case 348: -{ - add_opvars(splev, "o", VA_PASS1(SPO_MATH_SUB)); - } -break; -case 349: -{ - add_opvars(splev, "o", VA_PASS1(SPO_MATH_MUL)); - } -break; -case 350: -{ - add_opvars(splev, "o", VA_PASS1(SPO_MATH_DIV)); - } -break; -case 351: -{ - add_opvars(splev, "o", VA_PASS1(SPO_MATH_MOD)); - } -break; -case 352: -{ } -break; -case 353: -{ - if (!strcmp("int", yyvsp[0].map) || !strcmp("integer", yyvsp[0].map)) { - yyval.i = (int)'i'; - } else - lc_error("Unknown function parameter type '%s'", yyvsp[0].map); - } -break; -case 354: -{ - if (!strcmp("str", yyvsp[0].map) || !strcmp("string", yyvsp[0].map)) { - yyval.i = (int)'s'; - } else - lc_error("Unknown function parameter type '%s'", yyvsp[0].map); - } -break; -case 355: -{ - struct lc_funcdefs_parm *tmp = New(struct lc_funcdefs_parm); - - if (!curr_function) { - lc_error("Function parameters outside function definition."); - } else if (!tmp) { - lc_error("Could not alloc function params."); - } else { - long vt = SPOVAR_NULL; - - tmp->name = strdup(yyvsp[-2].map); - tmp->parmtype = (char) yyvsp[0].i; - tmp->next = curr_function->params; - curr_function->params = tmp; - curr_function->n_params++; - switch (tmp->parmtype) { - case 'i': - vt = SPOVAR_INT; - break; - case 's': - vt = SPOVAR_STRING; - break; - default: - lc_error("Unknown func param conversion."); - break; - } - vardefs = add_vardef_type( vardefs, yyvsp[-2].map, vt); - } - Free(yyvsp[-2].map); - } -break; -case 360: -{ - yyval.i = (int)'i'; - } -break; -case 361: -{ - yyval.i = (int)'s'; - } -break; -case 362: -{ - char tmpbuf[2]; - tmpbuf[0] = (char) yyvsp[0].i; - tmpbuf[1] = '\0'; - yyval.map = strdup(tmpbuf); - } -break; -case 363: -{ - long len = strlen( yyvsp[-2].map ); - char *tmp = (char *) alloc(len + 2); - sprintf(tmp, "%c%s", (char) yyvsp[0].i, yyvsp[-2].map ); - Free( yyvsp[-2].map ); - yyval.map = tmp; - } -break; -case 364: -{ - yyval.map = strdup(""); - } -break; -case 365: -{ - char *tmp = strdup( yyvsp[0].map ); - Free( yyvsp[0].map ); - yyval.map = tmp; - } -break; -case 366: -{ - add_opvars(splev, "o", VA_PASS1(SPO_SEL_POINT)); - } -break; -case 367: -{ - add_opvars(splev, "o", VA_PASS1(SPO_SEL_RECT)); - } -break; -case 368: -{ - add_opvars(splev, "o", VA_PASS1(SPO_SEL_FILLRECT)); - } -break; -case 369: -{ - add_opvars(splev, "o", VA_PASS1(SPO_SEL_LINE)); - } -break; -case 370: -{ - /* randline (x1,y1),(x2,y2), roughness */ - add_opvars(splev, "o", VA_PASS1(SPO_SEL_RNDLINE)); - } -break; -case 371: -{ - add_opvars(splev, "io", VA_PASS2(W_ANY, SPO_SEL_GROW)); - } -break; -case 372: -{ - add_opvars(splev, "io", VA_PASS2(yyvsp[-3].i, SPO_SEL_GROW)); - } -break; -case 373: -{ - add_opvars(splev, "iio", - VA_PASS3(yyvsp[-3].i, SPOFILTER_PERCENT, SPO_SEL_FILTER)); - } -break; -case 374: -{ - add_opvars(splev, "io", - VA_PASS2(SPOFILTER_SELECTION, SPO_SEL_FILTER)); - } -break; -case 375: -{ - add_opvars(splev, "io", - VA_PASS2(SPOFILTER_MAPCHAR, SPO_SEL_FILTER)); - } -break; -case 376: -{ - add_opvars(splev, "o", VA_PASS1(SPO_SEL_FLOOD)); - } -break; -case 377: -{ - add_opvars(splev, "oio", - VA_PASS3(SPO_COPY, 1, SPO_SEL_ELLIPSE)); - } -break; -case 378: -{ - add_opvars(splev, "oio", - VA_PASS3(SPO_COPY, yyvsp[-1].i, SPO_SEL_ELLIPSE)); - } -break; -case 379: -{ - add_opvars(splev, "io", VA_PASS2(1, SPO_SEL_ELLIPSE)); - } -break; -case 380: -{ - add_opvars(splev, "io", VA_PASS2(yyvsp[-1].i, SPO_SEL_ELLIPSE)); - } -break; -case 381: -{ - add_opvars(splev, "iio", - VA_PASS3(yyvsp[-5].i, yyvsp[-11].i, SPO_SEL_GRADIENT)); - } -break; -case 382: -{ - add_opvars(splev, "o", VA_PASS1(SPO_SEL_COMPLEMENT)); - } -break; -case 383: -{ - check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_SEL); - vardef_used(vardefs, yyvsp[0].map); - add_opvars(splev, "v", VA_PASS1(yyvsp[0].map)); - Free(yyvsp[0].map); - } -break; -case 384: -{ - /* nothing */ - } -break; -case 385: -{ - /* nothing */ - } -break; -case 386: -{ - add_opvars(splev, "o", VA_PASS1(SPO_SEL_ADD)); - } -break; -case 387: -{ - add_opvars(splev, "iio", - VA_PASS3(yyvsp[0].dice.num, yyvsp[0].dice.die, SPO_DICE)); - } -break; -case 391: -{ - add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); - } -break; -case 392: -{ - add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); - } -break; -case 393: -{ - add_opvars(splev, "i", VA_PASS1(yyvsp[0].i)); - } -break; -case 394: -{ - /* nothing */ - } -break; -case 403: -{ - yyval.lregn = yyvsp[0].lregn; - } -break; -case 404: -{ - if (yyvsp[-7].i <= 0 || yyvsp[-7].i >= COLNO) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of level range (x1)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); - else if (yyvsp[-5].i < 0 || yyvsp[-5].i >= ROWNO) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of level range (y1)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); - else if (yyvsp[-3].i <= 0 || yyvsp[-3].i >= COLNO) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of level range (x2)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); - else if (yyvsp[-1].i < 0 || yyvsp[-1].i >= ROWNO) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of level range (y2)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); - yyval.lregn.x1 = yyvsp[-7].i; - yyval.lregn.y1 = yyvsp[-5].i; - yyval.lregn.x2 = yyvsp[-3].i; - yyval.lregn.y2 = yyvsp[-1].i; - yyval.lregn.area = 1; - } -break; -case 405: -{ -/* This series of if statements is a hack for MSC 5.1. It seems that its - tiny little brain cannot compile if these are all one big if statement. */ - if (yyvsp[-7].i < 0 || yyvsp[-7].i > (int) max_x_map) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of map range (x1)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); - else if (yyvsp[-5].i < 0 || yyvsp[-5].i > (int) max_y_map) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of map range (y1)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); - else if (yyvsp[-3].i < 0 || yyvsp[-3].i > (int) max_x_map) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of map range (x2)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); - else if (yyvsp[-1].i < 0 || yyvsp[-1].i > (int) max_y_map) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of map range (y2)!", - yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i); - yyval.lregn.area = 0; - yyval.lregn.x1 = yyvsp[-7].i; - yyval.lregn.y1 = yyvsp[-5].i; - yyval.lregn.x2 = yyvsp[-3].i; - yyval.lregn.y2 = yyvsp[-1].i; - } -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 6c59b8c00..872a1bfdb 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -185,17 +185,17 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ int fd; boolean have_syscf = FALSE; - (void) strncpy(hackdir, dir, PATHLEN - 1); - hackdir[PATHLEN - 1] = '\0'; + (void) strncpy(g.hackdir, dir, PATHLEN - 1); + g.hackdir[PATHLEN - 1] = '\0'; #ifdef NOCWD_ASSUMPTIONS { int prefcnt; - fqn_prefix[0] = (char *) alloc(strlen(hackdir) + 2); - Strcpy(fqn_prefix[0], hackdir); - append_slash(fqn_prefix[0]); + g.fqn_prefix[0] = (char *) alloc(strlen(g.hackdir) + 2); + Strcpy(g.fqn_prefix[0], g.hackdir); + append_slash(g.fqn_prefix[0]); for (prefcnt = 1; prefcnt < PREFIX_COUNT; prefcnt++) - fqn_prefix[prefcnt] = fqn_prefix[0]; + g.fqn_prefix[prefcnt] = g.fqn_prefix[0]; #if defined(MSDOS) /* sysconf should be searched for in this location */ @@ -204,11 +204,11 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ if ((sptr = index(envp, ';')) != 0) *sptr = '\0'; if (strlen(envp) > 0) { - fqn_prefix[SYSCONFPREFIX] = + g.fqn_prefix[SYSCONFPREFIX] = (char *) alloc(strlen(envp) + 10); - Strcpy(fqn_prefix[SYSCONFPREFIX], envp); - append_slash(fqn_prefix[SYSCONFPREFIX]); - Strcat(fqn_prefix[SYSCONFPREFIX], "NetHack\\"); + Strcpy(g.fqn_prefix[SYSCONFPREFIX], envp); + append_slash(g.fqn_prefix[SYSCONFPREFIX]); + Strcat(g.fqn_prefix[SYSCONFPREFIX], "NetHack\\"); } } @@ -229,7 +229,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ /* No SYSCF_FILE where there should be one, and without an installer, a user may not be able to place one there. So, let's try somewhere else... */ - fqn_prefix[SYSCONFPREFIX] = fqn_prefix[0]; + g.fqn_prefix[SYSCONFPREFIX] = g.fqn_prefix[0]; /* Is there a SYSCF_FILE there? */ fd = open(fqname(SYSCF_FILE, SYSCONFPREFIX, 0), O_RDONLY); @@ -247,10 +247,10 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ if ((sptr = index(envp, ';')) != 0) *sptr = '\0'; if (strlen(envp) > 0) { - fqn_prefix[CONFIGPREFIX] = + g.fqn_prefix[CONFIGPREFIX] = (char *) alloc(strlen(envp) + 2); - Strcpy(fqn_prefix[CONFIGPREFIX], envp); - append_slash(fqn_prefix[CONFIGPREFIX]); + Strcpy(g.fqn_prefix[CONFIGPREFIX], envp); + append_slash(g.fqn_prefix[CONFIGPREFIX]); } } #endif @@ -286,11 +286,11 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ if (iflags.BIOS && iflags.use_color) set_colors(); #endif - if (!hackdir[0]) + if (!g.hackdir[0]) #if !defined(LATTICE) && !defined(AMIGA) - Strcpy(hackdir, orgdir); + Strcpy(g.hackdir, orgdir); #else - Strcpy(hackdir, HACKDIR); + Strcpy(g.hackdir, HACKDIR); #endif if (argc > 1) { if (argcheck(argc, argv, ARG_VERSION) == 2) @@ -317,7 +317,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ } if (!*dir) error("Flag -d must be followed by a directory name."); - Strcpy(hackdir, dir); + Strcpy(g.hackdir, dir); } if (argc > 1) { /* @@ -326,7 +326,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ */ if (!strncmp(argv[1], "-s", 2)) { #if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) - chdirx(hackdir, 0); + chdirx(g.hackdir, 0); #endif #ifdef SYSCF initoptions(); @@ -366,7 +366,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ * code parallel to other ports. */ #if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) - chdirx(hackdir, 1); + chdirx(g.hackdir, 1); #endif #if defined(MSDOS) diff --git a/sys/unix/Makefile.dat b/sys/unix/Makefile.dat index 466a14f63..975978f92 100644 --- a/sys/unix/Makefile.dat +++ b/sys/unix/Makefile.dat @@ -19,9 +19,6 @@ all: $(VARDAT) spec_levs quest_levs dungeon ../util/dgn_comp: (cd ../util ; $(MAKE) dgn_comp) -../util/lev_comp: - (cd ../util ; $(MAKE) lev_comp) - ../util/tile2x11: (cd ../util ; $(MAKE) tile2x11) @@ -126,39 +123,10 @@ options: ../util/makedefs ../util/makedefs -v -spec_levs: ../util/lev_comp \ - bigroom.des castle.des endgame.des gehennom.des knox.des medusa.des \ - mines.des oracle.des sokoban.des tower.des yendor.des - ../util/lev_comp bigroom.des - ../util/lev_comp castle.des - ../util/lev_comp endgame.des - ../util/lev_comp gehennom.des - ../util/lev_comp knox.des - ../util/lev_comp medusa.des - ../util/lev_comp mines.des - ../util/lev_comp oracle.des - ../util/lev_comp sokoban.des - ../util/lev_comp tower.des - ../util/lev_comp yendor.des +spec_levs: touch spec_levs -quest_levs: ../util/lev_comp \ - Arch.des Barb.des Caveman.des Healer.des Knight.des Monk.des \ - Priest.des Ranger.des Rogue.des Samurai.des Tourist.des Valkyrie.des \ - Wizard.des - ../util/lev_comp Arch.des - ../util/lev_comp Barb.des - ../util/lev_comp Caveman.des - ../util/lev_comp Healer.des - ../util/lev_comp Knight.des - ../util/lev_comp Monk.des - ../util/lev_comp Priest.des - ../util/lev_comp Ranger.des - ../util/lev_comp Rogue.des - ../util/lev_comp Samurai.des - ../util/lev_comp Tourist.des - ../util/lev_comp Valkyrie.des - ../util/lev_comp Wizard.des +quest_levs: touch quest_levs dungeon: dungeon.def ../util/makedefs ../util/dgn_comp diff --git a/sys/unix/Makefile.doc b/sys/unix/Makefile.doc index 1d2f53532..a9683288a 100644 --- a/sys/unix/Makefile.doc +++ b/sys/unix/Makefile.doc @@ -67,14 +67,12 @@ MANEXT = 6 # manual installation for most BSD-style systems GAMEMANCREATE = cat nethack.6 | $(NHGREP) > -LEVMANCREATE = cat lev_comp.6 | $(NHGREP) > DGNMANCREATE = cat dgn_comp.6 | $(NHGREP) > RCVRMANCREATE = cat recover.6 | $(NHGREP) > DLBMANCREATE = cat dlb.6 | $(NHGREP) > MDMANCREATE = cat makedefs.6 | $(NHGREP) > # manual installation for most SYSV-style systems # GAMEMANCREATE = cat nethack.6 | $(NHGREP) | nroff -man - > -# LEVMANCREATE = cat lev_comp.6 | $(NHGREP) | nroff -man - > # DGNMANCREATE = cat dgn_comp.6 | $(NHGREP) | nroff -man - > # RCVRMANCREATE = cat recover.6 | $(NHGREP) | nroff -man - > # DLBMANCREATE = cat dlb.6 | $(NHGREP) | nroff -man - > @@ -82,14 +80,13 @@ MDMANCREATE = cat makedefs.6 | $(NHGREP) > manpages: -$(GAMEMANCREATE) $(MANDIR)/$(GAME).$(MANEXT) - -$(LEVMANCREATE) $(MANDIR)/lev_comp.$(MANEXT) -$(DGNMANCREATE) $(MANDIR)/dgn_comp.$(MANEXT) -$(RCVRMANCREATE) $(MANDIR)/recover.$(MANEXT) -$(DLBMANCREATE) $(MANDIR)/dlb.$(MANEXT) -$(MDMANCREATE) $(MANDIR)/makedefs.$(MANEXT) # manual creation for distribution -DISTRIB = Guidebook.txt nethack.txt lev_comp.txt dgn_comp.txt recover.txt \ +DISTRIB = Guidebook.txt nethack.txt dgn_comp.txt recover.txt \ dlb.txt makedefs.txt distrib: $(DISTRIB) @@ -100,8 +97,6 @@ Guidebook.txt : Guidebook.mn tmac.n tmac.nh MAN2TXT = $(NHGREP) | nroff -man - | $(COLCMD) nethack.txt : nethack.6 cat nethack.6 | $(MAN2TXT) > nethack.txt -lev_comp.txt : lev_comp.6 - cat lev_comp.6 | $(MAN2TXT) > lev_comp.txt dgn_comp.txt : dgn_comp.6 cat dgn_comp.6 | $(MAN2TXT) > dgn_comp.txt recover.txt : recover.6 diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 0162bdaf0..095a3e931 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -49,7 +49,7 @@ SHELL=/bin/sh # for UNIX systems SYSSRC = ../sys/share/ioctl.c ../sys/share/unixtty.c ../sys/unix/unixmain.c \ ../sys/unix/unixunix.c ../sys/unix/unixres.c -SYSOBJ = ioctl.o unixmain.o unixtty.o unixunix.o unixres.o +SYSOBJ = ioctl.o unixmain.o unixtty.o unixunix.o unixres.o liblua.a # # for Systos # SYSSRC = ../sys/atari/tos.c ../sys/share/pcmain.c ../sys/share/pcsys.c \ @@ -173,6 +173,10 @@ GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome #CFLAGS = -O -I../include #LFLAGS = +CFLAGS += -I../lib/lua-5.3.5/src +# -lm required by lua +LIBS += -lm + # The Qt and Be window systems are written in C++, while the rest of # NetHack is standard C. If using Qt, uncomment the LINK line here to get # the C++ libraries linked in. @@ -360,7 +364,7 @@ WINCURSESLIB = -lncurses # If ZLIB_COMP is defined in config.h this is necessary to link with zlib. # LIBS = -lz # -LIBS = +# LIBS = # make NetHack GAME = nethack @@ -443,7 +447,7 @@ HACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c \ dungeon.c eat.c end.c engrave.c exper.c explode.c extralev.c \ files.c fountain.c hack.c hacklib.c invent.c isaac64.c light.c \ lock.c mail.c makemon.c mapglyph.c mcastu.c mhitm.c mhitu.c \ - minion.c mklev.c mkmap.c \ + minion.c mklev.c mkmap.c nhlua.c nhlsel.c \ mkmaze.c mkobj.c mkroom.c mon.c mondata.c monmove.c monst.c \ mplayer.c mthrowu.c muse.c music.c o_init.c objects.c objnam.c \ options.c pager.c pickup.c pline.c polyself.c potion.c pray.c \ @@ -487,7 +491,7 @@ CSOURCES = $(HACKCSRC) $(SYSCSRC) $(WINCSRC) $(CHAINSRC) $(GENCSRC) # all .h files except date.h, onames.h, pm.h, and vis_tab.h which would # cause dependency loops if run through "make depend" -# and dgn_comp.h, dgn_file.h, lev_comp.h, special level & dungeon files. +# and dgn_comp.h, dgn_file.h, special level & dungeon files. # HACKINCL = align.h amiconf.h artifact.h artilist.h attrib.h beconf.h botl.h \ color.h config.h config1.h context.h coord.h decl.h def_os2.h \ @@ -501,7 +505,7 @@ HACKINCL = align.h amiconf.h artifact.h artilist.h attrib.h beconf.h botl.h \ wincurs.h winX.h winprocs.h wintype.h you.h youprop.h HSOURCES = $(HACKINCL) date.h onames.h pm.h vis_tab.h \ - lev_comp.h dgn_comp.h dgn_file.h + dgn_comp.h dgn_file.h # the following .o's _must_ be made before any others (for makedefs) FIRSTOBJ = monst.o objects.o @@ -512,7 +516,7 @@ HOBJ = $(FIRSTOBJ) allmain.o alloc.o apply.o artifact.o attrib.o ball.o \ drawing.o dungeon.o eat.o end.o engrave.o exper.o explode.o \ extralev.o files.o fountain.o hack.o hacklib.o invent.o isaac64.o \ light.o lock.o mail.o makemon.o mapglyph.o mcastu.o mhitm.o mhitu.o \ - minion.o mklev.o mkmap.o \ + minion.o mklev.o mkmap.o nhlua.o nhlsel.o \ mkmaze.o mkobj.o mkroom.o mon.o mondata.o monmove.o \ mplayer.o mthrowu.o muse.o music.o o_init.o objnam.o options.o \ pager.o pickup.o pline.o polyself.o potion.o pray.o priest.o \ @@ -1061,6 +1065,8 @@ mplayer.o: mplayer.c $(HACK_H) mthrowu.o: mthrowu.c $(HACK_H) muse.o: muse.c $(HACK_H) music.o: music.c $(HACK_H) #interp.c +nhlua.o: nhlua.c $(HACK_H) +nhlsel.o: nhlsel.c $(HACK_H) o_init.o: o_init.c $(HACK_H) ../include/lev.h objects.o: objects.c $(CONFIG_H) ../include/obj.h ../include/objclass.h \ ../include/prop.h ../include/skills.h ../include/color.h diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top index 5aea4e8d6..6c0bb2a56 100644 --- a/sys/unix/Makefile.top +++ b/sys/unix/Makefile.top @@ -80,18 +80,19 @@ VARDAT = $(VARDATD) $(VARDATND) DATHELP = help hh cmdhelp keyhelp history opthelp wizhelp -SPEC_LEVS = asmodeus.lev baalz.lev bigrm-*.lev castle.lev fakewiz?.lev \ - juiblex.lev knox.lev medusa-?.lev minend-?.lev minefill.lev \ - minetn-?.lev oracle.lev orcus.lev sanctum.lev soko?-?.lev \ - tower?.lev valley.lev wizard?.lev \ - astral.lev air.lev earth.lev fire.lev water.lev -QUEST_LEVS = ???-goal.lev ???-fil?.lev ???-loca.lev ???-strt.lev +SPEC_LEVS = asmodeus.lua baalz.lua bigrm-*.lua castle.lua fakewiz?.lua \ + juiblex.lua knox.lua medusa-?.lua minend-?.lua minefill.lua \ + minetn-?.lua oracle.lua orcus.lua sanctum.lua soko?-?.lua \ + tower?.lua valley.lua wizard?.lua nhlib.lua \ + astral.lua air.lua earth.lua fire.lua water.lua +QUEST_LEVS = ???-goal.lua ???-fil?.lua ???-loca.lua ???-strt.lua DATNODLB = $(VARDATND) license symbols DATDLB = $(DATHELP) dungeon tribute $(SPEC_LEVS) $(QUEST_LEVS) $(VARDATD) DAT = $(DATNODLB) $(DATDLB) $(GAME): + ( cd lib/lua-5.3.5/src && make a && cp liblua.a ../../../src/ ) ( cd src ; $(MAKE) ) all: $(GAME) recover Guidebook $(VARDAT) dungeon spec_levs check-dlb @@ -133,7 +134,6 @@ quest.dat: $(GAME) ( cd dat ; $(MAKE) quest.dat ) spec_levs: dungeon - ( cd util ; $(MAKE) lev_comp ) ( cd dat ; $(MAKE) spec_levs ) ( cd dat ; $(MAKE) quest_levs ) @@ -288,6 +288,7 @@ clean: ( cd src ; $(MAKE) clean ) ( cd util ; $(MAKE) clean ) ( cd doc ; $(MAKE) clean ) + ( cd lib/lua-5.3.5/src && $(MAKE) clean ) # 'make spotless' returns the source tree to near-distribution condition. # it removes .o files, executables, and compiled data files diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index 9c7896266..5c7ae6c0b 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -97,6 +97,9 @@ NHSROOT=.. #CFLAGS = -O -I../include #LFLAGS = +CFLAGS += -I../lib/lua-5.3.5/src +LFLAGS += -lm + # we specify C preprocessor flags via CFLAGS; files built with default rules # might include $(CPPFLAGS) which could get a value from user's environment; # we avoid that by forcing it empty rather than by overriding default rules @@ -183,11 +186,10 @@ HACK_H = ../src/hack.h-t # utility .c files MAKESRC = makedefs.c -SPLEVSRC = lev_yacc.c lev_lex.c lev_main.c DGNCOMPSRC = dgn_yacc.c dgn_lex.c dgn_main.c RECOVSRC = recover.c DLBSRC = dlb_main.c -UTILSRCS = $(MAKESRC) panic.c $(SPLEVSRC) $(DGNCOMPSRC) $(RECOVSRC) $(DLBSRC) +UTILSRCS = $(MAKESRC) panic.c $(DGNCOMPSRC) $(RECOVSRC) $(DLBSRC) READTAGSSRC = readtags.c # files that define all monsters and objects @@ -203,9 +205,6 @@ OALLOC = $(OBJDIR)/alloc.o panic.o # object files for makedefs MAKEOBJS = makedefs.o $(OMONOBJ) -# object files for special levels compiler -SPLEVOBJS = lev_yacc.o lev_lex.o lev_main.o $(OALLOC) $(ONAMING) - # object files for dungeon compiler DGNCOMPOBJS = dgn_yacc.o dgn_lex.o dgn_main.o $(OALLOC) @@ -268,52 +267,6 @@ lintdefs: panic.o: panic.c $(CONFIG_H) -# dependencies for lev_comp -# -lev_comp: $(SPLEVOBJS) - $(CC) $(LFLAGS) -o lev_comp $(SPLEVOBJS) $(LIBS) - -lev_yacc.o: lev_yacc.c $(HACK_H) ../include/sp_lev.h -lev_main.o: lev_main.c $(HACK_H) ../include/sp_lev.h ../include/tcap.h \ - ../include/date.h - -# see lev_comp.l for WEIRD_LEX discussion -# egrep will return failure if it doesn't find anything, but we know there -# is one "_cplusplus" inside a comment -lev_lex.o: lev_lex.c $(HACK_H) ../include/lev_comp.h ../include/sp_lev.h - $(CC) -c $(CFLAGS) -DWEIRD_LEX=`egrep -c _cplusplus lev_lex.c` lev_lex.c - -# '$(YACC) -d' generates both $(YTABC) and $(YTABH) in one run -../include/lev_comp.h: lev_yacc.c - -lev_yacc.c: lev_comp.y - $(YACC) $(YACCDIST) -d lev_comp.y - sed -e 's#"$(YTABC)"#"$@"#' -e 's#$(YTABC):#$@:#' $(YTABC) > $@ \ - && rm $(YTABC) - sed -e 's#"$(YTABH)"#"lev_comp.h"#' $(YTABH) > ../include/lev_comp.h \ - && rm $(YTABH) - -lev_lex.c: lev_comp.l - $(LEX) $(FLEXDIST) lev_comp.l - sed -e 's#"$(LEXYYC)"#"$@"#' -e 's# *$$##' \ - -e 's#static void yyunput#void yyunput#' $(LEXYYC) > $@ \ - && rm $(LEXYYC) -# note: flex code construction using m4 macros results in some trailing -# spaces; is basic RE substitute for -# and we don't bother stripping trailing tabs because that gets messy; -# make expands into which is RE end-of-line. -# flex also creates yyunput() as a static routine, but lev_comp doesn't -# use it so compiler complaints can ensue; recent flex versions honor -# NO_YY_UNPUT to suppress it, but older ones don't; making it global to -# avoid an "unused function" warning is simpler than trying to remove -# the whole thing (although full 'lint' may still complain). - -# with all of extern.h's functions to complain about, we drown in -# 'defined but not used' without -u -lintlev: - @lint -axhu -I../include -DLINT $(SPLEVSRC) $(CALLOC) $(CNAMING) | sed '/_flsbuf/d' - - # dependencies for dgn_comp # dgn_comp: $(DGNCOMPOBJS) @@ -550,12 +503,6 @@ $(CONFIG_H): ../include/config.h # 'make dist' => put generated lex and yacc sources into place for distribution SYSSHARE=../sys/share/ -$(SYSSHARE)lev_lex.c: lev_lex.c - cp lev_lex.c $@ -$(SYSSHARE)lev_yacc.c: lev_yacc.c - cp lev_yacc.c $@ -$(SYSSHARE)lev_comp.h: ../include/lev_comp.h - cp ../include/lev_comp.h $@ $(SYSSHARE)dgn_lex.c: dgn_lex.c cp dgn_lex.c $@ $(SYSSHARE)dgn_yacc.c: dgn_yacc.c @@ -563,8 +510,7 @@ $(SYSSHARE)dgn_yacc.c: dgn_yacc.c $(SYSSHARE)dgn_comp.h: ../include/dgn_comp.h cp ../include/dgn_comp.h $@ -dist: $(SYSSHARE)lev_lex.c $(SYSSHARE)lev_yacc.c $(SYSSHARE)lev_comp.h \ - $(SYSSHARE)dgn_lex.c $(SYSSHARE)dgn_yacc.c $(SYSSHARE)dgn_comp.h +dist: $(SYSSHARE)dgn_lex.c $(SYSSHARE)dgn_yacc.c $(SYSSHARE)dgn_comp.h @echo 'pre-generated lex and yacc sources are in place in sys/share' tags: $(UTILSRCS) @@ -574,9 +520,9 @@ clean: -rm -f *.o spotless: clean - -rm -f lev_lex.c lev_yacc.c dgn_lex.c dgn_yacc.c - -rm -f ../include/lev_comp.h ../include/dgn_comp.h + -rm -f dgn_lex.c dgn_yacc.c + -rm -f ../include/dgn_comp.h -rm -f ../include/tile.h tiletxt.c - -rm -f makedefs lev_comp dgn_comp recover dlb + -rm -f makedefs dgn_comp recover dlb -rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp \ tilemap tileedit tile2bmp diff --git a/sys/unix/hints/linux b/sys/unix/hints/linux index 1d9c45509..dcdee332d 100644 --- a/sys/unix/hints/linux +++ b/sys/unix/hints/linux @@ -20,7 +20,8 @@ VARDIR = $(HACKDIR) POSTINSTALL=cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; -CFLAGS=-g -O -I../include -DNOTPARMDECL -DDLB +CFLAGS=-g -O -I../include -DNOTPARMDECL +CFLAGS+=-DDLB CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\" CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE CFLAGS+=-DTIMED_DELAY @@ -33,7 +34,6 @@ CFLAGS+=-DCURSES_GRAPHICS #CFLAGS+=-DSCORE_ON_BOTL #CFLAGS+=-DMSGHANDLER #CFLAGS+=-DTTY_TILES_ESCCODES -#CFLAGS+=-DDLB LINK=$(CC) # Only needed for GLIBC stack trace: diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index 5fd3181da..b85c527e3 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -1,4 +1,4 @@ -# NetHack 3.6 Makefile.gcc $NHDT-Date: 1546174698 2018/12/30 12:58:18 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.71 $ +# NetHack 3.7 Makefile.gcc $NHDT-Date: 1546174698 2018/12/30 12:58:18 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.71 $ # Copyright (c) 2010 by Michael Allison # NetHack may be freely redistributed. See license for details. # @@ -30,15 +30,24 @@ # If you have any questions read the sys/winnt/Install.nt file included # with the distribution. #============================================================================== -# BUILD DECISIONS SECTION +# DECISIONS SECTION # -# There are currently only 4 decisions that you have to make. +# Build Options Decisions +# +# There are currently 4 decisions that you can choose to make. +# None of the 4 decisions are absolutely required because defaults are in place: # 1. Where do you want your build to end up? # 2. Do you want debug information in the executable? # 3. Do you want to explicitly override auto-detection of a 32-bit or 64-bit target? # 4. Do you want to include any optional interfaces in the port? # 4a) curses # 4b) Qt +# +# Mandatory LUA source Location +# +# LUA source code or is required to build NetHack-3.7. +# LUATOP must point to the location of the LUA sources. +# #----------------------------------------------------------------------------------------- #========================================================================================= @@ -116,7 +125,19 @@ TARGET_CPU=x86 # Other libraries are placed in a subdirectory of your home directory, either # x86libs or x64libs depending on whether you're building for 64 bits. # - +#--------------------------------------------------------------- +# Location of LUA +# +# Original source needs to be obtained from: +# http://www.lua.org/ftp/lua-5.3.5.tar.gz +# +# This build assumes that the LUA sources are located +# at the specified location. If they are actually elsewhere +# you'll need to specify the correct spot below in order to +# successfully build NetHack-3.7. +# +ADD_LUA=Y +LUATOP=../../lua-5.3.5 # #============================================================================== # This marks the end of the BUILD DECISIONS section. @@ -251,16 +272,10 @@ U = $(UTIL)/ MAKESRC = $(U)makedefs.c -SPLEVSRC = $(U)lev_yacc.c $(U)lev_lex.c $(U)lev_main.c $(U)panic.c - DGNCOMPSRC = $(U)dgn_yacc.c $(U)dgn_lex.c $(U)dgn_main.c MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o -LEVCOMPOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ - $(O)alloc.o $(O)decl.o $(O)drawing.o \ - $(O)monst.o $(O)objects.o $(O)panic.o - DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \ $(O)alloc.o $(O)panic.o @@ -313,7 +328,13 @@ VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o -#VOBJ28 = $(O)win10.o +VOBJ28 = $(O)sfbase.o $(O)sfdata.o +VOBJ29 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o +#VOBJ31 = $(O)win10.o + +ifeq "$(ADD_LUA)" "Y" +LUAOBJ = $(O)nhlua.c $(O)nhlsel.c +endif DLBOBJ = $(O)dlb.o @@ -389,10 +410,39 @@ SOUND = $(OBJ)/ntsound.o VVOBJ = $(O)version.o -ALLOBJ = $(SOBJ) $(DLBOBJ) $(WOBJ) $(OBJS) $(VVOBJ) +ALLOBJ = $(SOBJ) $(DLBOBJ) $(WOBJ) $(OBJS) $(VVOBJ) $(LUAOBJ) OPTIONS_FILE = $(DAT)\options +#===============-================================================= +# LUA library +# Source from http://www.lua.org/ftp/lua-5.3.5.tar.gz +#================================================================= + +LUASRC = $(LUATOP)/src +LUALIB = $(O)lua-5.3.5.static.a +LUADLL = $(O)lua-5.3.5.a +LUAINCL = -I$(LUASRC) +#LUAFLAGS = unix added -lm here? +LUATARGETS = lua.exe luac.exe $(LUADLL) $(LUALIB) + +LUASRCFILES = lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c \ + lcorolib.c lctype.c ldblib.c ldebug.c ldo.c \ + ldump.c lfunc.c lgc.c linit.c liolib.c llex.c \ + lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c \ + loslib.c lparser.c lstate.c lstring.c lstrlib.c \ + ltable.c ltablib.c ltm.c lundump.c lutf8lib.c \ + lvm.c lzio.c + +LUAOBJFILES = $(O)lapi.o $(O)lauxlib.o $(O)lbaselib.o $(O)lbitlib.o \ + $(O)lcode.o $(O)lcorolib.o $(O)lctype.o $(O)ldblib.o \ + $(O)ldebug.o $(O)ldo.o $(O)ldump.o $(O)lfunc.o \ + $(O)lgc.o $(O)linit.o $(O)liolib.o $(O)llex.o \ + $(O)lmathlib.o $(O)lmem.o $(O)loadlib.o $(O)lobject.o \ + $(O)lopcodes.o $(O)loslib.o $(O)lparser.o $(O)lstate.o \ + $(O)lstring.o $(O)lstrlib.o $(O)ltable.o $(O)ltablib.o \ + $(O)ltm.o $(O)lundump.o $(O)lutf8lib.o $(O)lvm.o $(O)lzio.o + ifeq "$(ADD_CURSES)" "Y" #========================================== # PDCurses build macros @@ -448,7 +498,6 @@ HACK_H = $(INCL)/hack.h $(CONFIG_H) $(INCL)/align.h $(INCL)/context.h \ LEV_H = $(INCL)/lev.h DGN_FILE_H = $(INCL)/dgn_file.h -LEV_COMP_H = $(INCL)/lev_comp.h SP_LEV_H = $(INCL)/sp_lev.h TILE_H = ../win/share/tile.h @@ -469,11 +518,7 @@ CURSDEF= CURSESLIB= endif -ifneq "$(ADD_CURSES)" "Y" -INCLDIR=-I../include -I../sys/winnt -else -INCLDIR=-I../include -I../sys/winnt -endif +INCLDIR=-I../include -I../sys/winnt $(LUAINCL) #========================================== #========================================== @@ -655,49 +700,11 @@ $(OBJ)/%.o : $(PDCWINCON)/%.c $(cc) $(PDCINCL) $(CFLAGS) -o$@ $< #========================================== -# Level Compiler Info +# Rules for LUA files #========================================== -# Yacc/Lex ... if you got 'em. -# -# If you have yacc and lex programs (or work-alike such as bison -# and flex), comment out the upper two macros and uncomment -# the lower two. -# - -DO_YACC = YACC_MSG -DO_LEX = LEX_MSG -#DO_YACC = YACC_ACT -#DO_LEX = LEX_ACT - -# - Specify your yacc and lex programs (or work-alikes) here. - -#YACC = bison -y -#YACC = byacc -#YACC = yacc -YACC= - -#LEX = lex -#LEX = flex -LEX= - -# -# - Specify your flex skeleton file (if needed). -# - -FLEXSKEL = -#FLEXSKEL = -S../tools/flex.ske - -YTABC = y_tab.c -YTABH = y_tab.h -LEXYYC = lexyy.c - -export YACC -export LEX -export FLEXSKEL -export YTABC -export YTABH -export LEXYYC +$(OBJ)/%.o : $(LUASRC)/%.c + $(cc) $(CFLAGS) -o$@ $< #========================================== # Rules for files in win/Qt4 @@ -762,7 +769,7 @@ ifeq "$(USE_DLB)" "Y" else $(subst /,\,copy $(DAT)/*. $(GAMEDIR)) $(subst /,\,copy $(DAT)/*.dat $(GAMEDIR)) - $(subst /,\,copy $(DAT)/*.lev $(GAMEDIR)) +# $(subst /,\,copy $(DAT)/*.lua $(GAMEDIR)) $(subst /,\,if exist $(GAMEDIR)/makefile del $(GAMEDIR)/makefile) endif $(subst /,\,if not exist $(GAMEDIR)/sysconf copy $(MSWSYS)/sysconf $(GAMEDIR)) @@ -781,44 +788,11 @@ recover: $(U)recover.exe $(subst /,\,if exist $(U)recover.exe copy $(U)recover.exe $(GAMEDIR)) $(subst /,\,if exist $(DOC)/recover.txt copy $(DOC)/recover.txt $(GAMEDIR)/recover.txt) -$(O)sp_lev.tag: $(O)utility.tag $(DAT)/bigroom.des $(DAT)/castle.des \ - $(DAT)/endgame.des $(DAT)/gehennom.des $(DAT)/knox.des \ - $(DAT)/medusa.des $(DAT)/oracle.des $(DAT)/tower.des \ - $(DAT)/yendor.des $(DAT)/arch.des $(DAT)/barb.des \ - $(DAT)/caveman.des $(DAT)/healer.des $(DAT)/knight.des \ - $(DAT)/monk.des $(DAT)/priest.des $(DAT)/ranger.des \ - $(DAT)/rogue.des $(DAT)/samurai.des $(DAT)/sokoban.des \ - $(DAT)/tourist.des $(DAT)/valkyrie.des $(DAT)/wizard.des - $(subst /,\,$(U)levcomp $(DAT)/bigroom.des) - $(subst /,\,$(U)levcomp $(DAT)/castle.des) - $(subst /,\,$(U)levcomp $(DAT)/endgame.des) - $(subst /,\,$(U)levcomp $(DAT)/gehennom.des) - $(subst /,\,$(U)levcomp $(DAT)/knox.des) - $(subst /,\,$(U)levcomp $(DAT)/mines.des) - $(subst /,\,$(U)levcomp $(DAT)/medusa.des) - $(subst /,\,$(U)levcomp $(DAT)/oracle.des) - $(subst /,\,$(U)levcomp $(DAT)/sokoban.des) - $(subst /,\,$(U)levcomp $(DAT)/tower.des) - $(subst /,\,$(U)levcomp $(DAT)/yendor.des) - $(subst /,\,$(U)levcomp $(DAT)/arch.des) - $(subst /,\,$(U)levcomp $(DAT)/barb.des) - $(subst /,\,$(U)levcomp $(DAT)/caveman.des) - $(subst /,\,$(U)levcomp $(DAT)/healer.des) - $(subst /,\,$(U)levcomp $(DAT)/knight.des) - $(subst /,\,$(U)levcomp $(DAT)/monk.des) - $(subst /,\,$(U)levcomp $(DAT)/priest.des) - $(subst /,\,$(U)levcomp $(DAT)/ranger.des) - $(subst /,\,$(U)levcomp $(DAT)/rogue.des) - $(subst /,\,$(U)levcomp $(DAT)/samurai.des) - $(subst /,\,$(U)levcomp $(DAT)/tourist.des) - $(subst /,\,$(U)levcomp $(DAT)/valkyrie.des) - $(subst /,\,$(U)levcomp $(DAT)/wizard.des) - $(subst /,\,copy *.lev $(DAT)) - $(subst /,\,del *.lev) +$(O)sp_lev.tag: $(O)utility.tag $(subst /,\,echo sp_levs done > $(O)sp_lev.tag) $(O)utility.tag: $(INCL)/date.h $(INCL)/onames.h $(INCL)/pm.h \ - $(SRC)/vis_tab.c $(U)levcomp.exe $(INCL)/vis_tab.h \ + $(SRC)/vis_tab.c $(INCL)/vis_tab.h \ $(U)dgncomp.exe $(TILEUTIL16) $(subst /,\,@echo utilities made >$@) @echo utilities made. @@ -845,10 +819,11 @@ gamedir.tag: test -d $(GAMEDIR) && echo directory created > $@ $(GAMEDIR)/NetHack.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistub.o \ - $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)conres.o $(KEYDLLS) + $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)conres.o $(KEYDLLS) \ + $(LUATARGETS) @echo Linking $@... $(link) $(lflags) -o$@ $(ALLOBJ) $(TTYOBJ) $(O)nttty.o $(O)tile.o \ - $(O)guistub.o $(O)conres.o $(PDCLIB) $(conlibs) -static -lstdc++ + $(O)guistub.o $(O)conres.o $(PDCLIB) $(LUALIB) $(conlibs) -static -lstdc++ $(subst /,\,@if exist $(O)install.tag del $(O)install.tag) # NetHackW @@ -861,10 +836,11 @@ $(GAMEDIR)/NetHack.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistu ifneq "$(SKIP_NETHACKW)" "Y" $(GAMEDIR)/NetHackW.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)ttystub.o \ - $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)winres.o $(KEYDLLS) + $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)winres.o $(KEYDLLS) \ + $(LUATARGETS) @echo Linking $@... $(link) $(lflags) -mwindows -o$@ $(ALLOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o \ - $(O)winres.o $(PDCLIB) $(guilibs) -static -lstdc++ + $(O)winres.o $(PDCLIB) $(guilibs) $(LUALIB) -static -lstdc++ $(subst /,\,@if exist $(O)install.tag del $(O)install.tag) endif @@ -1022,35 +998,6 @@ $(MSWIN)/splash.bmp: $(U)uudecode.exe $(MSWIN)/splash.uu $(subst /,\,copy splash.bmp $@) del splash.bmp - -#========================================== -# Level Compiler Stuff -#========================================== - -LEVCFLAGS=$(cflags) -c -DWIN32 -D_WIN32 -I../include $(cdebug) -DDLB - -$(U)lev_yacc.c: $(U)lev_comp.y - mingw32-make -C ../util -f ../win/win32/levstuff-mingw32.mak $(U)lev_yacc.c - -$(U)lev_lex.c: $(HACK_H) $(U)lev_comp.l - mingw32-make -C ../util -f ../win/win32/levstuff-mingw32.mak $(U)lev_lex.c - -$(INCL)/lev_comp.h: - mingw32-make -C ../include -f ../win/win32/levstuff-mingw32.mak $(INCL)/lev_comp.h - -$(O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)/lev_comp.h $(U)lev_yacc.c - $(cc) $(LEVCFLAGS) -o$@ $(U)lev_yacc.c - -$(O)lev_lex.o: $(HACK_H) $(INCL)/lev_comp.h $(SP_LEV_H) $(U)lev_lex.c - $(cc) $(LEVCFLAGS) -o$@ $(U)lev_lex.c - -$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H) - $(cc) $(LEVCFLAGS) -o$@ $(U)lev_main.c - -$(U)levcomp.exe: $(LEVCOMPOBJS) - @echo Linking $@... - $(link) $(LFLAGSU) -o$@ $(LEVCOMPOBJS) - #========================================== # Dungeon Compiler Stuff #========================================== @@ -1144,7 +1091,7 @@ nhdat$(NHV): $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \ $(subst /,\,echo epitaph >>$(DAT)/dlb.lst) $(subst /,\,echo bogusmon >>$(DAT)/dlb.lst) $(subst /,\,echo tribute >>$(DAT)/dlb.lst) - dir /l /b /-p $(subst /,\,$(DAT)/*.lev >>$(DAT)/dlb.lst) + dir /l /b /-p $(subst /,\,*.lua >>$(DAT)/dlb.lst) $(subst /,\,$(U)dlb_main CcIf $(DAT) dlb.lst $(SRC)/nhdat) #========================================== @@ -1239,6 +1186,27 @@ $(O)til2bm32.o: $(WSHR)/til2bm32.c $(HACK_H) $(TILE_H) $(MSWSYS)/win32api.h $(O)pdcurses.a : $(PDCLIBOBJS) $(PDCOBJS) ar rcs $@ $(PDCLIBOBJS) $(PDCOBJS) + +#============================================================= +# LUA +#============================================================= + +lua.exe: $(O)lua.o $(LUALIB) + $(link) $(LFLAGSU) -o$@ $(O)lua.o $(LUALIB) + +luac.exe: $(O)luac.o $(LUALIB) + $(link) $(LFLAGSU) -o$@ $(O)luac.o $(LUALIB) + +lua5.3.5.dll: $(LUAOBJFILES) + $(cc) -shared -Wl,--export-all-symbols \ + -Wl,--add-stdcall-alias -o $@ $< + +lua5.3.5-static.a: $(LUAOBJFILES) + ar rcs $@ $(LUAOBJFILES) + +$(O)lua.o: $(LUASRC)/lua.c +$(O)luac.o: $(LUASRC)/luac.c + #========================================== # Housekeeping #========================================== @@ -1269,42 +1237,44 @@ ifneq "$(W_DAT)" "" if exist $(W_DAT)\engrave del $(W_DAT)\engrave if exist $(W_DAT)\epitaph del $(W_DAT)\epitaph if exist $(W_DAT)\bogusmon del $(W_DAT)\bogusmon - if exist $(W_DAT)\???-fil?.lev del $(W_DAT)\???-fil?.lev - if exist $(W_DAT)\???-goal.lev del $(W_DAT)\???-goal.lev - if exist $(W_DAT)\???-loca.lev del $(W_DAT)\???-loca.lev - if exist $(W_DAT)\???-strt.lev del $(W_DAT)\???-strt.lev - if exist $(W_DAT)\air.lev del $(W_DAT)\air.lev - if exist $(W_DAT)\asmodeus.lev del $(W_DAT)\asmodeus.lev - if exist $(W_DAT)\astral.lev del $(W_DAT)\astral.lev - if exist $(W_DAT)\baalz.lev del $(W_DAT)\baalz.lev - if exist $(W_DAT)\bigrm-*.lev del $(W_DAT)\bigrm-*.lev - if exist $(W_DAT)\castle.lev del $(W_DAT)\castle.lev - if exist $(W_DAT)\data del $(W_DAT)\data + if exist $(W_DAT)\oracles del $(W_DAT)\oracles + if exist $(W_DAT)\rumors del $(W_DAT)\rumors + if exist $(W_DAT)\quest.dat del $(W_DAT)\quest.dat if exist $(W_DAT)\dungeon del $(W_DAT)\dungeon if exist $(W_DAT)\dungeon.pdf del $(W_DAT)\dungeon.pdf - if exist $(W_DAT)\earth.lev del $(W_DAT)\earth.lev - if exist $(W_DAT)\fakewiz?.lev del $(W_DAT)\fakewiz?.lev - if exist $(W_DAT)\fire.lev del $(W_DAT)\fire.lev - if exist $(W_DAT)\juiblex.lev del $(W_DAT)\juiblex.lev - if exist $(W_DAT)\knox.lev del $(W_DAT)\knox.lev - if exist $(W_DAT)\medusa-?.lev del $(W_DAT)\medusa-?.lev - if exist $(W_DAT)\mine*.lev del $(W_DAT)\mine*.lev + if exist $(W_DAT)\data del $(W_DAT)\data if exist $(W_DAT)\options del $(W_DAT)\options if exist $(W_DAT)\ttyoptions del $(W_DAT)\ttyoptions if exist $(W_DAT)\guioptions del $(W_DAT)\guioptions - if exist $(W_DAT)\oracle.lev del $(W_DAT)\oracle.lev - if exist $(W_DAT)\oracles del $(W_DAT)\oracles - if exist $(W_DAT)\orcus.lev del $(W_DAT)\orcus.lev - if exist $(W_DAT)\rumors del $(W_DAT)\rumors - if exist $(W_DAT)\quest.dat del $(W_DAT)\quest.dat - if exist $(W_DAT)\sanctum.lev del $(W_DAT)\sanctum.lev - if exist $(W_DAT)\soko?-?.lev del $(W_DAT)\soko?-?.lev - if exist $(W_DAT)\tower?.lev del $(W_DAT)\tower?.lev - if exist $(W_DAT)\valley.lev del $(W_DAT)\valley.lev - if exist $(W_DAT)\water.lev del $(W_DAT)\water.lev - if exist $(W_DAT)\wizard?.lev del $(W_DAT)\wizard?.lev if exist $(W_DAT)\dlb.lst del $(W_DAT)\dlb.lst if exist $(W_DAT)\porthelp del $(W_DAT)\porthelp +ifdef OBSOLETE_LEVEL_COMPILER + if exist $(W_DAT)\???-fil?.des del $(W_DAT)\???-fil?.des + if exist $(W_DAT)\???-goal.des del $(W_DAT)\???-goal.des + if exist $(W_DAT)\???-loca.des del $(W_DAT)\???-loca.des + if exist $(W_DAT)\???-strt.des del $(W_DAT)\???-strt.des + if exist $(W_DAT)\air.des del $(W_DAT)\air.des + if exist $(W_DAT)\asmodeus.des del $(W_DAT)\asmodeus.des + if exist $(W_DAT)\astral.des del $(W_DAT)\astral.des + if exist $(W_DAT)\baalz.des del $(W_DAT)\baalz.des + if exist $(W_DAT)\bigrm-*.des del $(W_DAT)\bigrm-*.des + if exist $(W_DAT)\castle.des del $(W_DAT)\castle.des + if exist $(W_DAT)\earth.des del $(W_DAT)\earth.des + if exist $(W_DAT)\fakewiz?.des del $(W_DAT)\fakewiz?.des + if exist $(W_DAT)\fire.des del $(W_DAT)\fire.des + if exist $(W_DAT)\juiblex.des del $(W_DAT)\juiblex.des + if exist $(W_DAT)\knox.des del $(W_DAT)\knox.des + if exist $(W_DAT)\medusa-?.des del $(W_DAT)\medusa-?.des + if exist $(W_DAT)\mine*.des del $(W_DAT)\mine*.des + if exist $(W_DAT)\oracle.des del $(W_DAT)\oracle.des + if exist $(W_DAT)\orcus.des del $(W_DAT)\orcus.des + if exist $(W_DAT)\sanctum.des del $(W_DAT)\sanctum.des + if exist $(W_DAT)\soko?-?.des del $(W_DAT)\soko?-?.des + if exist $(W_DAT)\tower?.des del $(W_DAT)\tower?.des + if exist $(W_DAT)\valley.des del $(W_DAT)\valley.des + if exist $(W_DAT)\water.des del $(W_DAT)\water.des + if exist $(W_DAT)\wizard?.des del $(W_DAT)\wizard?.des +endif endif ifneq "$(W_OBJ)" "" if exist $(W_OBJ)\sp_lev.tag del $(W_OBJ)\sp_lev.tag @@ -1358,7 +1328,6 @@ clean: if exist $(O)utility.tag del $(O)utility.tag ifneq "$(W_UTIL)" "" if exist $(W_UTIL)\makedefs.exe del $(W_UTIL)\makedefs.exe - if exist $(W_UTIL)\levcomp.exe del $(W_UTIL)\levcomp.exe if exist $(W_UTIL)\dgncomp.exe del $(W_UTIL)\dgncomp.exe endif ifneq "$(W_SRC)" "" @@ -1375,8 +1344,6 @@ ifneq "$(W_OBJ)" "" if exist $(W_OBJ)\dlb_main.MAP del $(W_OBJ)\dlb_main.MAP if exist $(W_OBJ)\dlb_main.PDB del $(W_OBJ)\dlb_main.PDB if exist $(W_OBJ)\gamedir.tag del $(W_OBJ)\gamedir.tag - if exist $(W_OBJ)\levcomp.MAP del $(W_OBJ)\levcomp.MAP - if exist $(W_OBJ)\levcomp.PDB del $(W_OBJ)\levcomp.PDB if exist $(W_OBJ)\makedefs.MAP del $(W_OBJ)\makedefs.MAP if exist $(W_OBJ)\makedefs.PDB del $(W_OBJ)\makedefs.PDB if exist $(W_OBJ)\NetHack.MAP del $(W_OBJ)\NetHack.MAP @@ -1708,6 +1675,8 @@ $(O)mplayer.o: mplayer.c $(HACK_H) $(O)mthrowu.o: mthrowu.c $(HACK_H) $(O)muse.o: muse.c $(HACK_H) $(O)music.o: music.c $(HACK_H) #interp.c +$(O)nhlua.o: nhlua.c $(HACK_H) +$(O)nhlsel.o: nhlsel.c $(HACK_H) $(O)o_init.o: o_init.c $(HACK_H) $(INCL)/lev.h $(O)objects.o: objects.c $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \ $(INCL)/prop.h $(INCL)/skills.h $(INCL)/color.h diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 7954b30c2..664c7ca05 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -4,7 +4,7 @@ #============================================================================== # Build Tools Environment # -# NetHack 3.6.x Makefile for MS Visual Studio Visual C++ compiler +# NetHack 3.7 Makefile for MS Visual Studio Visual C++ compiler # # Visual Studio Compilers Tested: # - Microsoft Visual Studio 2017 Community Edition @@ -29,15 +29,22 @@ # If you have any questions read the sys/winnt/Install.nt file included # with the distribution. #======================================================================================== -# BUILD DECISIONS SECTION +# DECISIONS SECTION # -# There are currently only 4 decisions that you can choose to make, and none are -# absolutely required because defaults are in place: +# Build Options Decisions +# +# There are currently 4 decisions that you can choose to make. +# none of the 4 decisions are absolutely required because defaults are in place: # 1. Where do you want your build to end up? # 2. Do you want debug information in the executable? # 3. Do you want to explicitly override auto-detection of a 32-bit or 64-bit target? # 4. Do you want to include the optional curses port? # +# Mandatory LUA source Location +# +# LUA source code or is required to build NetHack-3.7. +# LUATOP must point to the location of the LUA sources. +# #----------------------------------------------------------------------------------------- #========================================================================================= @@ -72,8 +79,21 @@ DEBUGINFO = Y # PDCurses header (.h) files and PDCURSES_C to the location # of your PDCurses C files. # -#ADD_CURSES=Y -#PDCURSES_TOP=..\..\pdcurses +ADD_CURSES=Y +PDCURSES_TOP=..\..\pdcurses +# +#--------------------------------------------------------------- +# Location of LUA +# +# Original source needs to be obtained from: +# http://www.lua.org/ftp/lua-5.3.5.tar.gz +# +# This build assumes that the LUA sources are located +# at the specified location. If they are actually elsewhere +# you'll need to specify the correct spot below in order to +# successfully build NetHack-3.7. +# +LUATOP=..\..\lua-5.3.5 # #============================================================================== # This marks the end of the BUILD DECISIONS section. @@ -88,7 +108,6 @@ DEBUGINFO = Y # Nothing below here should have to be changed.# # # ################################################ - # #============================================================================== # @@ -181,8 +200,10 @@ MAKESRC = $(U)makedefs.c MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o +!IFDEF OBSOLETE_LEVEL_COMPILER LEVCOMPOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ $(O)alloc.o $(O)decl.o $(O)drawing.o $(O)monst.o $(O)objects.o $(O)panic.o +!ENDIF DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \ $(O)alloc.o $(O)panic.o @@ -239,6 +260,8 @@ VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o VOBJ28 = $(O)sfbase.o $(O)sfdata.o VOBJ29 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o +LUAOBJ = $(O)nhlua.o $(O)nhlsel.o + DLBOBJ = $(O)dlb.o REGEX = $(O)cppregex.o @@ -287,10 +310,38 @@ SOUND = $(OBJ)\ntsound.o VVOBJ = $(O)version.o -ALLOBJ = $(SOBJ) $(DLBOBJ) $(WOBJ) $(OBJS) $(VVOBJ) +ALLOBJ = $(SOBJ) $(DLBOBJ) $(WOBJ) $(OBJS) $(VVOBJ) $(LUAOBJ) OPTIONS_FILE = $(DAT)\options +#===============-================================================= +# LUA library +# Source from http://www.lua.org/ftp/lua-5.3.5.tar.gz +#================================================================= + +LUASRC = $(LUATOP)\src +LUALIB = $(O)lua5.3.5-static.lib +LUADLL = $(O)lua5.3.5.dll +LUAINCL = /I$(LUASRC) +LUATARGETS = lua.exe luac.exe $(LUADLL) $(LUALIB) + +LUASRCFILES = lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c \ + lcorolib.c lctype.c ldblib.c ldebug.c ldo.c \ + ldump.c lfunc.c lgc.c linit.c liolib.c llex.c \ + lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c \ + loslib.c lparser.c lstate.c lstring.c lstrlib.c \ + ltable.c ltablib.c ltm.c lundump.c lutf8lib.c \ + lvm.c lzio.c + +LUAOBJFILES = $(O)lapi.o $(O)lauxlib.o $(O)lbaselib.o $(O)lbitlib.o \ + $(O)lcode.o $(O)lcorolib.o $(O)lctype.o $(O)ldblib.o \ + $(O)ldebug.o $(O)ldo.o $(O)ldump.o $(O)lfunc.o \ + $(O)lgc.o $(O)linit.o $(O)liolib.o $(O)llex.o \ + $(O)lmathlib.o $(O)lmem.o $(O)loadlib.o $(O)lobject.o \ + $(O)lopcodes.o $(O)loslib.o $(O)lparser.o $(O)lstate.o \ + $(O)lstring.o $(O)lstrlib.o $(O)ltable.o $(O)ltablib.o \ + $(O)ltm.o $(O)lundump.o $(O)lutf8lib.o $(O)lvm.o $(O)lzio.o + !IF "$(ADD_CURSES)" == "Y" #===============-================================================= # PDCurses build macros @@ -349,7 +400,9 @@ HACK_H = $(INCL)\hack.h $(CONFIG_H) $(INCL)\align.h $(INCL)\context.h \ LEV_H = $(INCL)\lev.h DGN_FILE_H = $(INCL)\dgn_file.h +!IFDEF OBSOLETE_LEVEL_COMPILER LEV_COMP_H = $(INCL)\lev_comp.h +!ENDIF SP_LEV_H = $(INCL)\sp_lev.h TILE_H = ..\win\share\tile.h @@ -548,11 +601,7 @@ conlibs = $(baselibs) guilibs = $(winlibs) # -!IFNDEF ADD_CURSES -INCLDIR= /I..\include /I..\sys\winnt -!ELSE -INCLDIR= /I..\include /I..\sys\winnt -!ENDIF +INCLDIR= /I..\include /I..\sys\winnt $(LUAINCL) #========================================== # Util builds @@ -667,6 +716,13 @@ DLB = {$(PDCWINCON)}.c{$(OBJ)}.o: @$(cc) $(PDCINCL) $(cflagsBuild) -Fo$@ $< +#========================================== +# Rules for LUA files +#========================================== + +{$(LUASRC)}.c{$(OBJ)}.o: + @$(cc) $(cflagsBuild) -Fo$@ $< + #========================================== #=============== TARGETS ================== #========================================== @@ -679,7 +735,6 @@ default : install # # The game target. # - # # Everything # @@ -689,92 +744,8 @@ all : install install: $(O)envchk.tag $(O)obj.tag $(O)utility.tag $(GAMEDIR)\NetHack.exe $(GAMEDIR)\NetHackW.exe $(O)install.tag @echo Done. -$(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ - $(DAT)\oracles $(DAT)\quest.dat $(O)sp_lev.tag $(DLB) -! IF ("$(USE_DLB)"=="Y") - copy nhdat$(NHV) $(GAMEDIR) - copy $(DAT)\license $(GAMEDIR) - copy $(DAT)\opthelp $(GAMEDIR) -! ELSE - copy $(DAT)\*. $(GAMEDIR) - copy $(DAT)\*.dat $(GAMEDIR) - copy $(DAT)\*.lev $(GAMEDIR) - if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile -! ENDIF - if not exist $(GAMEDIR)\sysconf copy $(MSWSYS)\sysconf $(GAMEDIR) - if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR) - if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt - if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt - @if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space - @if exist $(GAMEDIR)\NetHackW.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHackW.PDB to conserve space - -if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh - -if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record. - echo install done > $@ - -# copy $(MSWSYS)\winnt.hlp $(GAMEDIR) - -recover: $(U)recover.exe - if exist $(U)recover.exe copy $(U)recover.exe $(GAMEDIR) - if exist $(DOC)\recover.txt copy $(DOC)\recover.txt $(GAMEDIR)\recover.txt - -$(O)sp_lev.tag: $(O)utility.tag $(DAT)\bigroom.des $(DAT)\castle.des \ - $(DAT)\endgame.des $(DAT)\gehennom.des $(DAT)\knox.des \ - $(DAT)\medusa.des $(DAT)\oracle.des $(DAT)\tower.des \ - $(DAT)\yendor.des $(DAT)\arch.des $(DAT)\barb.des \ - $(DAT)\caveman.des $(DAT)\healer.des $(DAT)\knight.des \ - $(DAT)\monk.des $(DAT)\priest.des $(DAT)\ranger.des \ - $(DAT)\rogue.des $(DAT)\samurai.des $(DAT)\sokoban.des \ - $(DAT)\tourist.des $(DAT)\valkyrie.des $(DAT)\wizard.des - cd $(DAT) - $(U)levcomp bigroom.des - $(U)levcomp castle.des - $(U)levcomp endgame.des - $(U)levcomp gehennom.des - $(U)levcomp knox.des - $(U)levcomp mines.des - $(U)levcomp medusa.des - $(U)levcomp oracle.des - $(U)levcomp sokoban.des - $(U)levcomp tower.des - $(U)levcomp yendor.des - $(U)levcomp arch.des - $(U)levcomp barb.des - $(U)levcomp caveman.des - $(U)levcomp healer.des - $(U)levcomp knight.des - $(U)levcomp monk.des - $(U)levcomp priest.des - $(U)levcomp ranger.des - $(U)levcomp rogue.des - $(U)levcomp samurai.des - $(U)levcomp tourist.des - $(U)levcomp valkyrie.des - $(U)levcomp wizard.des - cd $(SRC) - echo sp_levs done > $(O)sp_lev.tag - -$(O)utility.tag: $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \ - $(SRC)\vis_tab.c \ - $(U)levcomp.exe $(INCL)\vis_tab.h \ - $(U)dgncomp.exe $(TILEUTIL16) - @echo utilities made >$@ - @echo utilities made. - -tileutil: $(U)gif2txt.exe $(U)gif2tx32.exe $(U)txt2ppm.exe - @echo Optional tile development utilities are up to date. - -$(O)NetHackW.res: $(TILEBMP16) $(MSWIN)\NetHackW.rc $(MSWIN)\mnsel.bmp \ - $(MSWIN)\mnselcnt.bmp $(MSWIN)\mnunsel.bmp \ - $(MSWIN)\petmark.bmp $(MSWIN)\pilemark.bmp $(MSWIN)\NetHack.ico $(MSWIN)\rip.bmp \ - $(MSWIN)\splash.bmp - @$(rc) -r -fo$@ -i$(MSWIN) -dNDEBUG $(MSWIN)\NetHackW.rc - -$(O)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico - @$(rc) -r -fo$@ -i$(MSWSYS) -dNDEBUG $(MSWSYS)\console.rc - - #========================================== -# The game targets. +# Main game targets. #========================================== # The section for linking the NetHack image looks a little strange at @@ -818,11 +789,13 @@ GAMEOBJ=$(GAMEOBJ:^ =^ $(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistub.o \ - $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)console.res $(KEYDLLS) + $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)console.res $(KEYDLLS) \ + $(LUATARGETS) @if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR) @echo Linking $(@:\=/) $(link) $(lflagsBuild) $(conlflags) /STACK:2048 /PDB:$(GAMEDIR)\$(@B).PDB /MAP:$(O)$(@B).MAP \ - $(LIBS) $(PDCLIB) $(conlibs) $(BCRYPT) -out:$@ @<<$(@B).lnk + $(LIBS) $(PDCLIB) $(LUALIB) \ + $(conlibs) $(BCRYPT) -out:$@ @<<$(@B).lnk $(GAMEOBJ) $(TTYOBJ) $(O)nttty.o @@ -834,18 +807,21 @@ $(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)gu # NetHackW # full tty linkage libs: -# libs: $(LIBS) $(guilibs) $(COMCTRL) +# libs: $(LIBS) $(PDCLIB) $(LUALIB) $(guilibs) $(COMCTRL) # objs: $(GAMEOBJ) $(GUIOBJ) $(TTYOBJ) $(O)tile.o $(O)nttty.o # otherwise: -# libs: $(LIBS) $(guilibs) $(COMCTRL) +# libs: $(LIBS) $(PDCLIB) $(LUALIB) $(guilibs) $(COMCTRL) # objs: $(GAMEOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o $(GAMEDIR)\NetHackW.exe : $(O)gamedir.tag $(O)tile.o $(O)ttystub.o \ - $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)NetHackW.res $(O)gamedir.tag $(KEYDLLS) + $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)NetHackW.res \ + $(O)gamedir.tag $(KEYDLLS) \ + $(LUATARGETS) @if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR) @echo Linking $(@:\=/) $(link) $(lflagsBuild) $(guilflags) /STACK:2048 /PDB:$(GAMEDIR)\$(@B).PDB \ - /MAP:$(O)$(@B).MAP $(LIBS) $(PDCLIB) $(guilibs) $(COMCTRL) $(BCRYPT) -out:$@ @<<$(@B).lnk + /MAP:$(O)$(@B).MAP $(LIBS) $(PDCLIB) $(LUALIB) \ + $(guilibs) $(COMCTRL) $(BCRYPT) -out:$@ @<<$(@B).lnk $(GAMEOBJ) $(GUIOBJ) $(O)tile.o @@ -915,6 +891,92 @@ $(GAMEDIR)\nhraykey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).map" /DEF:$(O)$(@B).def \ /IMPLIB:$(O)$(@B).lib -out:$@ $(O)$(@B).o +$(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ + $(DAT)\oracles $(DAT)\quest.dat $(O)sp_lev.tag $(DLB) +! IF ("$(USE_DLB)"=="Y") + copy nhdat$(NHV) $(GAMEDIR) + copy $(DAT)\license $(GAMEDIR) + copy $(DAT)\opthelp $(GAMEDIR) +! ELSE + copy $(DAT)\*. $(GAMEDIR) + copy $(DAT)\*.dat $(GAMEDIR) + if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile +! ENDIF + if not exist $(GAMEDIR)\sysconf copy $(MSWSYS)\sysconf $(GAMEDIR) + if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR) + if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt + if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt + @if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space + @if exist $(GAMEDIR)\NetHackW.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHackW.PDB to conserve space + -if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh + -if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record. + echo install done > $@ + +# copy $(MSWSYS)\winnt.hlp $(GAMEDIR) + +recover: $(U)recover.exe + if exist $(U)recover.exe copy $(U)recover.exe $(GAMEDIR) + if exist $(DOC)\recover.txt copy $(DOC)\recover.txt $(GAMEDIR)\recover.txt + +!IFDEF OBSOLETE_LEVEL_COMPILER +$(O)sp_lev.tag: $(O)utility.tag $(DAT)\bigroom.des $(DAT)\castle.des \ + $(DAT)\endgame.des $(DAT)\gehennom.des $(DAT)\knox.des \ + $(DAT)\medusa.des $(DAT)\oracle.des $(DAT)\tower.des \ + $(DAT)\yendor.des $(DAT)\arch.des $(DAT)\barb.des \ + $(DAT)\caveman.des $(DAT)\healer.des $(DAT)\knight.des \ + $(DAT)\monk.des $(DAT)\priest.des $(DAT)\ranger.des \ + $(DAT)\rogue.des $(DAT)\samurai.des $(DAT)\sokoban.des \ + $(DAT)\tourist.des $(DAT)\valkyrie.des $(DAT)\wizard.des + cd $(DAT) + $(U)levcomp bigroom.des + $(U)levcomp castle.des + $(U)levcomp endgame.des + $(U)levcomp gehennom.des + $(U)levcomp knox.des + $(U)levcomp mines.des + $(U)levcomp medusa.des + $(U)levcomp oracle.des + $(U)levcomp sokoban.des + $(U)levcomp tower.des + $(U)levcomp yendor.des + $(U)levcomp arch.des + $(U)levcomp barb.des + $(U)levcomp caveman.des + $(U)levcomp healer.des + $(U)levcomp knight.des + $(U)levcomp monk.des + $(U)levcomp priest.des + $(U)levcomp ranger.des + $(U)levcomp rogue.des + $(U)levcomp samurai.des + $(U)levcomp tourist.des + $(U)levcomp valkyrie.des + $(U)levcomp wizard.des + cd $(SRC) + echo sp_levs done > $(O)sp_lev.tag +!ELSE +$(O)sp_lev.tag: + echo sp_levs done > $(O)sp_lev.tag +!ENDIF + +$(O)utility.tag: $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \ + $(SRC)\vis_tab.c $(INCL)\vis_tab.h \ + $(U)dgncomp.exe $(TILEUTIL16) + @echo utilities made >$@ + @echo utilities made. + +tileutil: $(U)gif2txt.exe $(U)gif2tx32.exe $(U)txt2ppm.exe + @echo Optional tile development utilities are up to date. + +$(O)NetHackW.res: $(TILEBMP16) $(MSWIN)\NetHackW.rc $(MSWIN)\mnsel.bmp \ + $(MSWIN)\mnselcnt.bmp $(MSWIN)\mnunsel.bmp \ + $(MSWIN)\petmark.bmp $(MSWIN)\pilemark.bmp $(MSWIN)\NetHack.ico $(MSWIN)\rip.bmp \ + $(MSWIN)\splash.bmp + @$(rc) -r -fo$@ -i$(MSWIN) -dNDEBUG $(MSWIN)\NetHackW.rc + +$(O)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico + @$(rc) -r -fo$@ -i$(MSWSYS) -dNDEBUG $(MSWSYS)\console.rc + # # Secondary Targets. # @@ -1023,6 +1085,7 @@ $(MSWIN)\splash.bmp: $(U)uudecode.exe $(MSWIN)\splash.uu # defer to the steps in ..\win\win32\levstuff.mak # +!IFDEF OBSOLETE_LEVEL_COMPILER $(U)lev_yacc.c: $(U)lev_comp.y nmake -nologo -f ..\win\win32\levstuff.mak $(U)lev_yacc.c @@ -1047,6 +1110,7 @@ $(U)levcomp.exe: $(LEVCOMPOBJS) $(LEVCOMPOBJS:^ =^ ) << +!ENDIF #================================================= # Dungeon Compiler Stuff @@ -1153,10 +1217,6 @@ nhdat$(NHV): $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ if exist porthelp echo porthelp >>dlb.lst echo quest.dat >>dlb.lst echo rumors >>dlb.lst - echo engrave >>dlb.lst - echo epitaph >>dlb.lst - echo bogusmon >>dlb.lst - echo tribute >>dlb.lst echo help >>dlb.lst echo hh >>dlb.lst echo cmdhelp >>dlb.lst @@ -1166,7 +1226,11 @@ nhdat$(NHV): $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ echo wizhelp >>dlb.lst echo dungeon >>dlb.lst echo license >>dlb.lst - for %%N in (*.lev) do echo %%N >>dlb.lst + echo engrave >>dlb.lst + echo epitaph >>dlb.lst + echo bogusmon >>dlb.lst + echo tribute >>dlb.lst + for %%N in (*.lua) do echo %%N >>dlb.lst $(U)dlb_main cIf dlb.lst $(SRC)\nhdat cd $(SRC) @@ -1288,6 +1352,25 @@ $(O)pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS) $(O)pdcscrn.o : $(PDCURSES_HEADERS) $(PDCWINCON)\pdcscrn.c $(MSWSYS)\stub-pdcscrn.c $(cc) $(PDCINCL) $(cflagsBuild) -Fo$@ $(MSWSYS)\stub-pdcscrn.c +#=============================================================================== +# LUA +#=============================================================================== + +lua.exe: $(O)lua.o $(LUALIB) + link /OUT:$@ $(O)lua.o $(LUALIB) + +luac.exe: $(O)luac.o $(LUALIB) + link /OUT:$@ $(O)luac.o $(LUALIB) + +$(O)lua5.3.5.dll: $(LUAOBJFILES) + link /DLL /IMPLIB:lua5.3.5.lib /OUT:$@ $(LUAOBJFILES) + +$(O)lua5.3.5-static.lib: $(LUAOBJFILES) + lib /OUT:$@ $(LUAOBJFILES) + +$(O)lua.o: $(LUASRC)\lua.c +$(O)luac.o: $(LUASRC)\luac.c + #=============================================================================== # Housekeeping #=============================================================================== @@ -1315,40 +1398,6 @@ spotless: clean if exist $(DAT)\engrave del $(DAT)\engrave if exist $(DAT)\epitaph del $(DAT)\epitaph if exist $(DAT)\bogusmon del $(DAT)\bogusmon - if exist $(DAT)\???-fil?.lev del $(DAT)\???-fil?.lev - if exist $(DAT)\???-goal.lev del $(DAT)\???-goal.lev - if exist $(DAT)\???-loca.lev del $(DAT)\???-loca.lev - if exist $(DAT)\???-strt.lev del $(DAT)\???-strt.lev - if exist $(DAT)\air.lev del $(DAT)\air.lev - if exist $(DAT)\asmodeus.lev del $(DAT)\asmodeus.lev - if exist $(DAT)\astral.lev del $(DAT)\astral.lev - if exist $(DAT)\baalz.lev del $(DAT)\baalz.lev - if exist $(DAT)\bigrm-*.lev del $(DAT)\bigrm-*.lev - if exist $(DAT)\castle.lev del $(DAT)\castle.lev - if exist $(DAT)\data del $(DAT)\data - if exist $(DAT)\dungeon del $(DAT)\dungeon - if exist $(DAT)\dungeon.pdf del $(DAT)\dungeon.pdf - if exist $(DAT)\earth.lev del $(DAT)\earth.lev - if exist $(DAT)\fakewiz?.lev del $(DAT)\fakewiz?.lev - if exist $(DAT)\fire.lev del $(DAT)\fire.lev - if exist $(DAT)\juiblex.lev del $(DAT)\juiblex.lev - if exist $(DAT)\knox.lev del $(DAT)\knox.lev - if exist $(DAT)\medusa-?.lev del $(DAT)\medusa-?.lev - if exist $(DAT)\mine*.lev del $(DAT)\mine*.lev - if exist $(DAT)\options del $(DAT)\options - if exist $(DAT)\ttyoptions del $(DAT)\ttyoptions - if exist $(DAT)\guioptions del $(DAT)\guioptions - if exist $(DAT)\oracle.lev del $(DAT)\oracle.lev - if exist $(DAT)\oracles del $(DAT)\oracles - if exist $(DAT)\orcus.lev del $(DAT)\orcus.lev - if exist $(DAT)\rumors del $(DAT)\rumors - if exist $(DAT)\quest.dat del $(DAT)\quest.dat - if exist $(DAT)\sanctum.lev del $(DAT)\sanctum.lev - if exist $(DAT)\soko?-?.lev del $(DAT)\soko?-?.lev - if exist $(DAT)\tower?.lev del $(DAT)\tower?.lev - if exist $(DAT)\valley.lev del $(DAT)\valley.lev - if exist $(DAT)\water.lev del $(DAT)\water.lev - if exist $(DAT)\wizard?.lev del $(DAT)\wizard?.lev if exist $(DAT)\dlb.lst del $(DAT)\dlb.lst if exist $(DAT)\porthelp del $(DAT)\porthelp if exist $(O)sp_lev.tag del $(O)sp_lev.tag @@ -1374,12 +1423,50 @@ spotless: clean if exist $(U)dlb_main.exe del $(U)dlb_main.exe !IF "$(ADD_CURSES)" == "Y" if exist $(O)pdcurses.lib del $(O)pdcurses.lib +!ENDIF + if exist $(DAT)\oracles del $(DAT)\oracles + if exist $(DAT)\rumors del $(DAT)\rumors + if exist $(DAT)\quest.dat del $(DAT)\quest.dat + if exist $(DAT)\options del $(DAT)\options + if exist $(DAT)\ttyoptions del $(DAT)\ttyoptions + if exist $(DAT)\guioptions del $(DAT)\guioptions + if exist $(DAT)\data del $(DAT)\data + if exist $(DAT)\dungeon del $(DAT)\dungeon + if exist $(DAT)\dungeon.pdf del $(DAT)\dungeon.pdf +!IFDEF OBSOLETE_LEVEL_COMPILER + if exist $(DAT)\???-fil?.lev del $(DAT)\???-fil?.lev + if exist $(DAT)\???-goal.lev del $(DAT)\???-goal.lev + if exist $(DAT)\???-loca.lev del $(DAT)\???-loca.lev + if exist $(DAT)\???-strt.lev del $(DAT)\???-strt.lev + if exist $(DAT)\air.lev del $(DAT)\air.lev + if exist $(DAT)\asmodeus.lev del $(DAT)\asmodeus.lev + if exist $(DAT)\astral.lev del $(DAT)\astral.lev + if exist $(DAT)\baalz.lev del $(DAT)\baalz.lev + if exist $(DAT)\bigrm-*.lev del $(DAT)\bigrm-*.lev + if exist $(DAT)\castle.lev del $(DAT)\castle.lev + if exist $(DAT)\earth.lev del $(DAT)\earth.lev + if exist $(DAT)\fakewiz?.lev del $(DAT)\fakewiz?.lev + if exist $(DAT)\fire.lev del $(DAT)\fire.lev + if exist $(DAT)\juiblex.lev del $(DAT)\juiblex.lev + if exist $(DAT)\knox.lev del $(DAT)\knox.lev + if exist $(DAT)\medusa-?.lev del $(DAT)\medusa-?.lev + if exist $(DAT)\mine*.lev del $(DAT)\mine*.lev + if exist $(DAT)\oracle.lev del $(DAT)\oracle.lev + if exist $(DAT)\orcus.lev del $(DAT)\orcus.lev + if exist $(DAT)\sanctum.lev del $(DAT)\sanctum.lev + if exist $(DAT)\soko?-?.lev del $(DAT)\soko?-?.lev + if exist $(DAT)\tower?.lev del $(DAT)\tower?.lev + if exist $(DAT)\valley.lev del $(DAT)\valley.lev + if exist $(DAT)\water.lev del $(DAT)\water.lev + if exist $(DAT)\wizard?.lev del $(DAT)\wizard?.lev !ENDIF clean: if exist $(O)*.o del $(O)*.o if exist $(O)utility.tag del $(O)utility.tag if exist $(U)makedefs.exe del $(U)makedefs.exe +!IFDEF OBSOLETE_LEVEL_COMPILER if exist $(U)levcomp.exe del $(U)levcomp.exe +!ENDIF if exist $(U)dgncomp.exe del $(U)dgncomp.exe if exist $(SRC)\*.lnk del $(SRC)\*.lnk if exist $(SRC)\*.map del $(SRC)\*.map @@ -1390,8 +1477,10 @@ clean: if exist $(O)dlb_main.MAP del $(O)dlb_main.MAP if exist $(O)dlb_main.PDB del $(O)dlb_main.PDB if exist $(O)gamedir.tag del $(O)gamedir.tag +!IFDEF OBSOLETE_LEVEL_COMPILER if exist $(O)levcomp.MAP del $(O)levcomp.MAP if exist $(O)levcomp.PDB del $(O)levcomp.PDB +!ENDIF if exist $(O)makedefs.MAP del $(O)makedefs.MAP if exist $(O)makedefs.PDB del $(O)makedefs.PDB if exist $(O)NetHack.MAP del $(O)NetHack.MAP @@ -1802,6 +1891,8 @@ $(O)mplayer.o: mplayer.c $(HACK_H) $(O)mthrowu.o: mthrowu.c $(HACK_H) $(O)muse.o: muse.c $(HACK_H) $(O)music.o: music.c $(HACK_H) #interp.c +$(O)nhlua.o: nhlua.c $(HACK_H) +$(O)nhlsel.o: nhlsel.c $(HACK_H) $(O)o_init.o: o_init.c $(HACK_H) $(INCL)\lev.h $(O)objects.o: objects.c $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h \ $(INCL)\prop.h $(INCL)\skills.h $(INCL)\color.h diff --git a/sys/winnt/nhsetup.bat b/sys/winnt/nhsetup.bat index a5c9ce75b..25ac9fee7 100755 --- a/sys/winnt/nhsetup.bat +++ b/sys/winnt/nhsetup.bat @@ -23,7 +23,7 @@ goto :EOF echo Checking to see if source tree directories are set up properly... if not exist ..\..\include\hack.h goto :err_dir if not exist ..\..\src\hack.c goto :err_dir -if not exist ..\..\dat\wizard.des goto :err_dir +if not exist ..\..\dat\wizard1.lua goto :err_dir if not exist ..\..\util\makedefs.c goto :err_dir if not exist ..\..\sys\winnt\winnt.c goto :err_dir echo Directories look ok. diff --git a/test_des.lua b/test_des.lua new file mode 100644 index 000000000..5a82efb1d --- /dev/null +++ b/test_des.lua @@ -0,0 +1,377 @@ + +-- Test the des-file commands +-- reset_level is only needed here, not in normal special level scripts. + +function is_map_at(x,y, mapch, lit) + local rm = nh.getmap(x + 1, y); -- + 1 == g.xstart + if rm.mapchr ~= mapch then + error("Terrain at (" .. x .. "," .. y .. ") is not \"" .. mapch .. "\", but \"" .. rm.mapchr .. "\""); + end + if lit ~= nil then + if rm.lit ~= lit then + error("light state at (" .. x .. "," .. y .. ") is not \"" .. lit .. "\", but \"" .. tostring(rm.lit) .. "\""); + end + end +end + +function test_level_init() + des.reset_level(); + des.level_init(); + + des.reset_level(); + des.level_init({ style = "solidfill" }); + + des.reset_level(); + des.level_init({ style = "solidfill", fg = " " }); + + des.reset_level(); + des.level_init({ style = "mazegrid", bg ="-" }); + + des.reset_level(); + des.level_init({ style = "rogue" }); + + des.reset_level(); + des.level_init({ style = "mines" }); + + des.reset_level(); + des.level_init({ style = "mines", fg = ".", bg = " ", smoothed = true }); + + des.reset_level(); + des.level_init({ style = "mines", fg = ".", bg = "}", joined = true }); + + des.reset_level(); + des.level_init({ style = "mines", fg = ".", bg = "L", smoothed = 1, joined = 1, lit = 0 }); + + des.reset_level(); + des.level_init({ style = "mines", fg = ".", bg = " ", smoothed = true, joined = true, walled = true }); + + des.reset_level(); + des.level_init({ style = "solidfill", fg = ".", lit = 1 }); +end + +function test_message() + des.message("Test message"); + des.message("Message 2"); +end + +function test_monster() + des.monster(); + des.monster("gnome") + des.monster("S") + des.monster("giant eel",11,06); + des.monster("hill giant", {08,06}); + des.monster({ id = "ogre" }) + des.monster({ class = "D" }) + des.monster({ id = "ogre", x = 10, y = 15 }) + des.monster({ class = "D", coord = {11,16} }) + des.monster({ x = 73, y = 16 }); + des.monster({ id = "watchman", peaceful = 1 }) + des.monster({ class = "H", peaceful = 0 }) + des.monster({ id = "giant mimic", appear_as = "obj:boulder" }); + des.monster({ id = "giant mimic", appear_as = "ter:altar" }); + des.monster({ id = "chameleon", appear_as = "mon:bat" }); + des.monster({ class = "H", asleep = 1, female = 1, invisible = 1, cancelled = 1, revived = 1, avenge = 1, fleeing = 20, blinded = 20, paralyzed = 20, stunned = 20, confused = 20 }) + des.monster({ id = "ogre", x = 10, y = 15, name = "Fred", + inventory = function() + des.object(); + des.object("["); + des.object({ class = "/" }); + des.object({ id = "statue", contents=0 }) + end + }); + des.reset_level(); + des.level_init(); +end + +function test_object() + des.reset_level(); + des.level_init(); + des.object() + des.object("*") + des.object({ class = "%" }); + des.object({ id = "statue", contents=0 }) + des.object("sack") + des.object({ x = 41, y = 03 }) + des.object({ coord = {42, 03} }); + des.object({ id = "boulder", coord = {03,12} }); + des.object("diamond", 69, 04) + des.object("diamond", {68, 04}) + des.object({ id = "egg", x = 05, y = 04, montype = "yellow dragon" }); + des.object({ id = "egg", x = 06, y = 04, montype = "yellow dragon", laid_by_you = true }); + des.object({ id = "corpse", montype = "valkyrie" }) + des.object({ id = "statue", montype = "C", historic = true, male = true }); + des.object({ id = "statue", montype = "C", historic = true, female = true }); + des.object({ id = "chest", buried = true, locked = true, + contents = function() + des.object(); + des.object("*") + des.object({ class = "%" }); + des.object({ id = "statue", contents=0 }) + end + }); + des.object({ id = "chest", greased = true, broken = true, contents = 0 }); + des.object({ id = "chest", trapped = 1, broken = true, contents = 0 }); + des.object({ id = "oil lamp", lit = 1 }); + des.object({ id = "silver dagger", spe = 127, buc = "cursed" }); + des.object({ id = "silver dagger", spe = -127, buc = "blessed" }); + des.object({ id = "bamboo arrow", quantity = 100 }); + des.object({ id = "leather armor", eroded = 1 }); + des.object({ id = "probing", recharged = 2, spe = 3 }); + des.object({ name = "Random object" }); + des.object({ class = "*", name = "Random stone" }); + des.object({ id ="broadsword", name = "Dragonbane" }) + des.reset_level(); + des.level_init(); +end + +function test_level_flags() + des.level_flags("noteleport") + des.level_flags("noteleport", "hardfloor", "nommap", "shortsighted", "arboreal") + des.level_flags("mazelevel", "shroud", "graveyard", "icedpools", "corrmaze") + des.level_flags("premapped", "solidify", "inaccessibles") +end + +function test_engraving() + des.engraving({02,04},"engrave","Trespassers will be persecuted!") + des.engraving({ x = 1, y = 2, type = "burn", text = "Elbereth" }); + des.engraving({ type = "dust", text = "X marks the spot." }) + des.engraving({ text = "Foobar" }) + des.engraving({ type = "mark", text = "X" }) + des.engraving({ type = "blood", text = "redrum" }) +end + +function test_mineralize() + des.mineralize(); + des.mineralize({ gem_prob = 1, gold_prob = 10, kelp_moat = 25, kelp_pool = 100 }) +end + +function test_grave() + des.grave(); + des.grave({ text = "Lil Miss Marker" }); + des.grave({ x = 40, y = 11 }); + des.grave({ x = 41, y = 12, text = "Bongo" }); + des.grave({ x = 42, y = 13, text = "" }); +end + +function test_altar() + des.altar(); + des.altar({ x = 44, y = 20 }); + des.altar({ coord = {46, 20 } }); + des.altar({ coord = {48, 20 }, type = "altar", align = "law" }); + des.altar({ coord = {50, 20 }, type = "shrine", align = "noalign" }); + des.altar({ coord = {52, 20 }, type = "sanctum", align = "coaligned" }); +end + +function test_map() + des.map([[ +TTT +LTL +LTL]]) + des.map({ x = 60, y = 5, map = [[ +FFF +F.F +FFF]] }) + des.map({ halign = "left", valign = "bottom", map = [[ +III +.I. +III]] }) +end + +function test_feature() + des.feature("fountain", 40, 08); + des.feature("sink", {41, 08}); + des.feature({ type = "pool", x = 42, y = 08 }); +end + +function test_gold() + des.gold({ amount = 999, x = 40, y = 07 }); +end + +function test_trap() + des.trap("pit", 41, 06); + des.trap("level teleport", {42, 06}); + des.trap({ type = "hole", x = 43, y = 06 }); + des.trap({ type = "hole", coord = {44, 06} }); + des.trap(); + des.trap("rust"); +end + +function test_wall_prop() + des.wall_property({ x1 = 0, y1 = 0, x2 = 78, y2 = 20, property = "nondiggable" }); + des.wall_property({ region={0,0, 78,20}, property = "nondiggable" }); + des.non_diggable(); + des.non_diggable(selection.area(5,5, 15, 15)); + des.non_passwall(); + des.non_passwall(selection.area(5,5, 15, 15)); +end + +function test_wallify() + des.wallify(); + des.wallify({ x1 = 0, y1 = 0, x2 = 78, y2 = 20 }); +end + +function test_teleport_region() + des.teleport_region({ region = {69,00,79,20} }) + des.teleport_region({ region = {69,00,79,20}, dir="up" }) + des.teleport_region({ region = {69,00,79,20}, region_islev=1, dir="up" }) + des.teleport_region({ region = {01,00,10,20}, region_islev=1, exclude={1,1,61,15}, dir="down" }) + des.teleport_region({ region = {01,00,10,20}, region_islev=1, exclude={1,1,61,15}, exclude_islev=1 }) +end + +function test_region() + des.region(selection.area(08,03,54,03),"unlit") + des.region(selection.area(56,02,60,03),"lit") + des.region({ region={16,05, 25,06}, lit=1, type="barracks", prefilled=0 }) + des.region({ region={1,5, 3,7}, lit=1, irregular=true, prefilled=true, joined=false }) +end + +function test_door() + des.door("nodoor", 12,12); + des.door({ x = 13, y = 12, state = "open" }); + des.room({ type = "graveyard", contents = function() + des.door({ wall = "north", pos = 1 }); + des.door({ wall = "random", state = "locked" }); + end + }); +end + +function test_mazewalk() + des.reset_level(); + des.level_init({ style = "mazegrid", bg ="-" }); + des.mazewalk(01,10,"east") + + des.reset_level(); + des.level_init({ style = "mazegrid", bg ="-" }); + des.mazewalk({ x=2,y=10, dir="north", typ="L", stocked=true }); +end + +function test_room() + des.reset_level(); + des.level_init({ style = "solidfill", fg=" " }); + des.room({ type = " ordinary", lit = 1, + x=3, y=3, xalign="center", yalign="center", + w=11, h=9, contents = function() + des.room({ x=4, y=3, w=3,h=3 }); + end + }); + des.room(); + des.room({ contents = function() + des.object(); + des.monster(); + end + }); + des.random_corridors(); +end + +function test_stair() + des.reset_level(); + des.level_init(); + + des.stair("up"); + des.stair("down", 4, 7); + des.stair({ dir = "down", x = 5, y = 7 }); + des.stair({ dir = "down", coord = {6, 7} }); +end + +function test_ladder() + des.reset_level(); + des.level_init(); + + des.ladder("up"); + des.ladder("down", 4, 7); + des.ladder({ dir = "down", x = 5, y = 7 }); + des.ladder({ dir = "down", coord = {6, 7} }); +end + +function test_terrain() + des.reset_level(); + des.level_init(); + + des.terrain(2, 2, "L"); + is_map_at(2,2, "L"); + + des.terrain({6,7}, "L"); + is_map_at(6,7, "L"); + + des.terrain({ x = 5, y = 5, typ = "L" }); + is_map_at(5,5, "L"); + + -- TODO: allow lit = false + -- des.terrain({ x = 5, y = 5, typ = ".", lit = false }); + -- is_map_at(5,5, ".", false); + + des.terrain({ x = 5, y = 5, typ = ".", lit = 1 }); + is_map_at(5,5, ".", true); + + des.terrain({ x = 5, y = 5, typ = " ", lit = 0 }); + is_map_at(5,5, " ", false); + + des.terrain({ selection = selection.area(4,4, 6,6), typ = "L", lit = 0 }); + for x = 4,6 do + for y = 4,6 do + is_map_at(x,y, "L", true); + end + end + + des.terrain(selection.area(2,2, 4,4), "T"); + for x = 2,4 do + for y = 2,4 do + is_map_at(x,y, "T"); + end + end +end + +function test_replace_terrain() + des.replace_terrain({ x1=1, y1=1, x2=70,y2=19, fromterrain=".", toterrain="I", lit=1 }); + des.replace_terrain({ x1=1, y1=1, x2=70,y2=19, fromterrain=".", toterrain="I", chance=50 }); + des.replace_terrain({ region={1,1, 70,19}, fromterrain=".", toterrain="L", chance=25 }); +end + +function test_corridor() + des.reset_level(); + des.level_init({ style = "solidfill", fg=" " }); + des.room({ x=2, y=2, xalign="center", yalign="center", w=4, h=4, + contents = function() + des.door({ wall = "south", pos = 2 }); + end + }); + des.room({ x=1, y=3, xalign="center", yalign="center", w=6, h=6, + contents = function() + des.door({ wall = "north", pos = 1 }); + end + }); + des.corridor({ srcroom=0, srcwall="south", srcdoor=0, destroom=1, destwall="north", destdoor=0 }); +end + +function run_tests() + test_level_init(); + test_message(); + test_monster(); + test_object(); + test_level_flags(); + test_engraving(); + test_mineralize(); + test_grave(); + test_altar(); + test_feature(); + test_gold(); + test_trap(); + test_door(); + test_map(); + test_wall_prop(); + test_wallify(); + test_teleport_region(); + test_region(); + test_mazewalk(); + test_room(); + test_stair(); + test_ladder(); + test_terrain(); + test_replace_terrain(); + test_corridor(); + + des.reset_level(); + des.level_init(); +end + +run_tests(); diff --git a/test_lev.lua b/test_lev.lua new file mode 100644 index 000000000..076689a26 --- /dev/null +++ b/test_lev.lua @@ -0,0 +1,75 @@ + +-- Test all of the special levels + +local special_levels = { +"air", +"asmodeus", +"astral", +"baalz", +"bigrm-10", +"bigrm-1", +"bigrm-2", +"bigrm-3", +"bigrm-4", +"bigrm-5", +"bigrm-6", +"bigrm-7", +"bigrm-8", +"bigrm-9", +"castle", +"earth", +"fakewiz1", +"fakewiz2", +"fire", +"juiblex", +"knox", +"medusa-1", +"medusa-2", +"medusa-3", +"medusa-4", +"minefill", +"minend-1", +"minend-2", +"minend-3", +"minetn-1", +"minetn-2", +"minetn-3", +"minetn-4", +"minetn-5", +"minetn-6", +"minetn-7", +"oracle", +"orcus", +"sanctum", +"soko1-1", +"soko1-2", +"soko2-1", +"soko2-2", +"soko3-1", +"soko3-2", +"soko4-1", +"soko4-2", +"tower1", +"tower2", +"tower3", +"valley", +"water", +"wizard1", +"wizard2", +"wizard3" +} + +local roles = { "Arc", "Bar", "Cav", "Hea", "Kni", "Mon", "Pri", "Ran", "Rog", "Sam", "Tou", "Val", "Wiz" } +local questlevs = { "fila", "filb", "goal", "loca", "strt" } + +for _,role in ipairs(roles) do + for _,qlev in ipairs(questlevs) do + local lev = role .. "-" .. qlev + table.insert(special_levels, lev) + end +end + +for _,lev in ipairs(special_levels) do + des.reset_level(); + require(lev) +end diff --git a/test_sel.lua b/test_sel.lua new file mode 100644 index 000000000..8d71eec2b --- /dev/null +++ b/test_sel.lua @@ -0,0 +1,85 @@ + + +-- Test the selection + +function test_selection() + local sel = selection.new(); + + -- test set & get + local ret = sel:get(1,2) + if ret == 1 then + error("sel:get returned " .. ret .. " instead of 0"); + end + + sel:set(1, 2); + ret = sel:get(1, 2); + if ret ~= 1 then + error("sel:get returned " .. ret .. " instead of 1"); + end + + local x,y = sel:rndcoord(1); + if x ~= 1 or y ~= 2 then + error("sel:rndcoord returned unset coordinate"); + end + + x,y = sel:rndcoord(1); + if x ~= -2 and y ~= -1 then + error("sel:rndcoord returned (" .. x .. "," .. y .. ") coordinate"); + end + + -- OO style + sel:negate(); + sel:percentage(50); + sel:rndcoord(1); + sel:line(1,2, 50,20); + sel:randline(1,2, 50,20, 7); + sel:rect(1,2, 7,8); + sel:fillrect(1,2, 7,8); + sel:area(1,2, 7,8); + sel:grow(); + sel:filter_mapchar(' '); + sel:floodfill(1,1); + sel:circle(40, 10, 9); + sel:circle(40, 10, 9, 1); + sel:ellipse(40, 10, 20, 8); + sel:ellipse(40, 10, 20, 8, 1); + + -- variable as param + selection.get(sel, 1, 2); + selection.set(sel, 1, 2); + selection.negate(sel); + selection.percentage(sel, 50); + selection.rndcoord(sel, 1); + selection.line(sel, 1,2, 50,20); + selection.randline(sel, 1,2, 50,20, 7); + selection.rect(sel, 1,2, 7,8); + selection.fillrect(sel, 1,2, 7,8); + selection.area(sel, 1,2, 7,8); + selection.grow(sel); + selection.filter_mapchar(sel, ' '); + selection.floodfill(sel, 1,1); + selection.circle(sel, 40, 10, 9); + selection.circle(sel, 40, 10, 9, 1); + selection.ellipse(sel, 40, 10, 20, 8); + selection.ellipse(sel, 40, 10, 20, 8, 1); + + -- initializers + selection.set(1, 2); + selection.negate(); + selection.line(1,2, 50,20); + selection.randline(1,2, 50,20, 7); + selection.rect(1,2, 7,8); + selection.fillrect(1,2, 7,8); + selection.area(1,2, 7,8); + selection.floodfill(1,1); + selection.circle(40, 10, 9); + selection.circle(40, 10, 9, 1); + selection.ellipse(40, 10, 20, 8); + selection.ellipse(40, 10, 20, 8, 1); + + local sel2 = selection.clone(sel); + local sel3 = sel2:clone(); +end -- selection_tests() + + +test_selection(); diff --git a/test_src.lua b/test_src.lua new file mode 100644 index 000000000..57686d05b --- /dev/null +++ b/test_src.lua @@ -0,0 +1,88 @@ + +-- Test different src functions + +local tests = { + makeplural = { + stamen = "stamens", + caveman = "cavemen", + zorkmid = "zorkmids", + shaman = "shamans", + algae = "algae", + larvae = "larvae", + woman = "women", + nerf = "nerfs", + serf = "serfs", + knife = "knives", + baluchitherium = "baluchitheria", + mycelium = "mycelia", + hyphae = "hyphae", + amoeba = "amoebae", + vertebra = "vertebrae", + fungus = "fungi", + homunculus = "homunculi", + bus = "buses", + lotus = "lotuses", + wumpus = "wumpuses", + nemesis = "nemeses", + matzoh = "matzot", + matzah = "matzot", + gateau = "gateaus", + gateaux = "gateauxes", + bordeau = "bordeaus", + ox = "oxen", + VAX = "VAXES", + goose = "geese", + tomato = "tomatoes", + potato = "potatoes", + dingo = "dingoes", + fox = "foxes", + cookie = "cookies", + ["bunch of grapes"] = "bunches of grapes", + candelabrum = "candelabra", + deer = "deer", + fish = "fish", + foot = "feet", + tuna = "tuna", + manes = "manes", + ninja = "ninja", + sheep = "sheep", + ronin = "ronin", + roshi = "roshi", + shito = "shito", + tengu = "tengu", + vortex = "vortices", + child = "children", + scale = "scales", + tooth = "teeth", + gauntlet = "gauntlets", + ["gauntlet of power"] = "gauntlets of power", + priestess = "priestesses", + valkyrie = "valkyries", + hoof = "hooves", + louse = "lice", + mouse = "mice", + ["slice of cake"] = "slices of cake", + }, + an = { + a = "an a", + b = "a b", + ["the foo"] = "the foo", + ["molten lava"] = "molten lava", + ["iron bars"] = "iron bars", + ice = "ice", + unicorn = "a unicorn", + uranium = "a uranium", + ["one-eyed"] = "a one-eyed", + candy = "a candy", + eucalyptus = "a eucalyptus", + } +} + +for func, fval in pairs(tests) do + for instr, outstr in pairs(fval) do + local ret = nh[func](instr) + if ret ~= outstr then + error(func .. "(\"" .. instr .. "\") != \"" .. outstr .. "\" (returned \"" .. ret .. "\") instead") + end + end +end diff --git a/util/lev_comp.l b/util/lev_comp.l deleted file mode 100644 index 8866e3f6f..000000000 --- a/util/lev_comp.l +++ /dev/null @@ -1,437 +0,0 @@ -%{ -/* NetHack 3.6 lev_comp.l $NHDT-Date: 1543371690 2018/11/28 02:21:30 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.25 $ */ -/* Copyright (c) 1989 by Jean-Christophe Collet */ -/* NetHack may be freely redistributed. See license for details. */ - -#define LEV_LEX_C - -#include "hack.h" -#include "lev_comp.h" -#include "sp_lev.h" - -/* Most of these don't exist in flex, yywrap is macro and - * yyunput is properly declared in flex.skel. - */ -#if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) -int FDECL(yyback, (int *,int)); -int NDECL(yylook); -int NDECL(yyinput); -int NDECL(yywrap); -int NDECL(yylex); - /* Traditional lexes let yyunput() and yyoutput() default to int; - * newer ones may declare them as void since they don't return - * values. For even more fun, the lex supplied as part of the - * newer unbundled compiler for SunOS 4.x adds the void declarations - * (under __STDC__ or _cplusplus ifdefs -- otherwise they remain - * int) while the bundled lex and the one with the older unbundled - * compiler do not. To detect this, we need help from outside -- - * sys/unix/Makefile.utl. - * - * Digital UNIX is difficult and still has int in spite of all - * other signs. - */ -# if defined(NeXT) || defined(SVR4) || defined(_AIX32) -# define VOIDYYPUT -# endif -# if !defined(VOIDYYPUT) && defined(POSIX_TYPES) -# if !defined(BOS) && !defined(HISX) && !defined(_M_UNIX) && !defined(VMS) -# define VOIDYYPUT -# endif -# endif -# if !defined(VOIDYYPUT) && defined(WEIRD_LEX) -# if defined(SUNOS4) && defined(__STDC__) && (WEIRD_LEX > 1) -# define VOIDYYPUT -# endif -# endif -# if defined(VOIDYYPUT) && defined(__osf__) -# undef VOIDYYPUT -# endif -# ifdef VOIDYYPUT -void FDECL(yyunput, (int)); -void FDECL(yyoutput, (int)); -# else -int FDECL(yyunput, (int)); -int FDECL(yyoutput, (int)); -# endif - -#else /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ -/* most recent flex allows suppressing yyunput() altogether when not needed */ -#define YY_NO_UNPUT -#define YY_NO_INPUT -#endif - -#if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) -/* older flex wants this */ -#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t, size_t)); -/* newer flex assumes so needs this in case it's been suppressed */ -YY_MALLOC_DECL -#endif - -void FDECL(init_yyin, (FILE *)); -void FDECL(init_yyout, (FILE *)); - -long NDECL(handle_varstring_check); -long FDECL(corefunc_str_check, (char *, long)); - -extern void VDECL(lc_error, (const char *, ...)); -extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); - -extern struct lc_vardefs *vardefs; - -extern long FDECL(method_defined, (char *, long, long *)); - -void FDECL(savetoken, (char *)); -void NDECL(newline); -void FDECL(advancepos, (char *)); - -/* - * This doesn't always get put in lev_comp.h - * (esp. when using older versions of bison). - */ -extern YYSTYPE yylval; - -int nh_line_number = 1; -int token_start_pos = 0; -char curr_token[512]; -static char map[4096]; -static int map_cnt = 0; - -FILE *orig_yyin = NULL; - -#define ST_RET(x) do { savetoken(yytext); return x; } while (0); -#define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0); - -%} -%e 2500 -%p 10000 -%n 1500 -%s MAPC -%% -ENDMAP { - savetoken(yytext); - BEGIN(INITIAL); - yylval.map = (char *) alloc(map_cnt + 1); - (void) strncpy(yylval.map, map, map_cnt); - yylval.map[map_cnt] = 0; - map_cnt = 0; - return MAP_ID; - } -[-|}{+xABCISHKPLWTF\\#. 0123456789]*\r?\n { - int len = yyleng; - savetoken(yytext); - /* convert \r\n to \n */ - if (len >= 2 && yytext[len - 2] == '\r') - len -= 1; - (void) strncpy(map + map_cnt, yytext, len); - map_cnt += len; - map[map_cnt - 1] = '\n'; - map[map_cnt] = '\0'; - newline(); - } -^[ \t]*#.*\n { savetoken(yytext); newline(); } -MESSAGE ST_RET(MESSAGE_ID); -NOMAP ST_RET(NOMAP_ID); -MAZE ST_RET(MAZE_ID); -LEVEL ST_RET(LEVEL_ID); -INIT_MAP ST_RET(LEV_INIT_ID); -mazegrid ST_RET(MAZE_GRID_ID); -solidfill ST_RET(SOLID_FILL_ID); -mines ST_RET(MINES_ID); -rogue ST_RET(ROGUELEV_ID); -FLAGS ST_RET(FLAGS_ID); -GEOMETRY ST_RET(GEOMETRY_ID); -^MAP\r?\n { savetoken(yytext); BEGIN(MAPC); newline(); } -obj(ect)? ST_RET(object_ID); -OBJECT ST_RET(OBJECT_ID); -CONTAINER ST_RET(COBJECT_ID); -MONSTER ST_RET(MONSTER_ID); -monster ST_RET(monster_ID); -TRAP ST_RET(TRAP_ID); -DOOR ST_RET(DOOR_ID); -ROOMDOOR ST_RET(ROOMDOOR_ID); -DRAWBRIDGE ST_RET(DRAWBRIDGE_ID); -MAZEWALK ST_RET(MAZEWALK_ID); -WALLIFY ST_RET(WALLIFY_ID); -REGION ST_RET(REGION_ID); -ALTAR ST_RET(ALTAR_ID); -LADDER ST_RET(LADDER_ID); -STAIR ST_RET(STAIR_ID); -PORTAL ST_RET(PORTAL_ID); -TELEPORT_REGION ST_RET(TELEPRT_ID); -BRANCH ST_RET(BRANCH_ID); -FOUNTAIN ST_RET(FOUNTAIN_ID); -SINK ST_RET(SINK_ID); -POOL ST_RET(POOL_ID); -NON_DIGGABLE ST_RET(NON_DIGGABLE_ID); -NON_PASSWALL ST_RET(NON_PASSWALL_ID); -IF ST_RET(IF_ID); -ELSE ST_RET(ELSE_ID); -EXIT ST_RET(EXIT_ID); -ROOM ST_RET(ROOM_ID); -SUBROOM ST_RET(SUBROOM_ID); -RANDOM_CORRIDORS ST_RET(RAND_CORRIDOR_ID); -CORRIDOR ST_RET(CORRIDOR_ID); -TERRAIN ST_RET(TERRAIN_ID); -terrain ST_RET(terrain_ID); -REPLACE_TERRAIN ST_RET(REPLACE_TERRAIN_ID); -GOLD ST_RET(GOLD_ID); -GRAVE ST_RET(GRAVE_ID); -ENGRAVING ST_RET(ENGRAVING_ID); -MINERALIZE ST_RET(MINERALIZE_ID); -(NAME|name) ST_RET(NAME_ID); -FOR ST_RET(FOR_ID); -TO ST_RET(TO_ID); -LOOP ST_RET(LOOP_ID); -SWITCH ST_RET(SWITCH_ID); -CASE ST_RET(CASE_ID); -BREAK ST_RET(BREAK_ID); -DEFAULT ST_RET(DEFAULT_ID); -FUNCTION ST_RET(FUNCTION_ID); -SHUFFLE ST_RET(SHUFFLE_ID); -montype ST_RET(MONTYPE_ID); -selection ST_RET(selection_ID); -rect ST_RET(rect_ID); -fillrect ST_RET(fillrect_ID); -line ST_RET(line_ID); -randline ST_RET(randline_ID); -grow ST_RET(grow_ID); -floodfill ST_RET(flood_ID); -rndcoord ST_RET(rndcoord_ID); -circle ST_RET(circle_ID); -ellipse ST_RET(ellipse_ID); -filter ST_RET(filter_ID); -gradient ST_RET(gradient_ID); -complement ST_RET(complement_ID); -radial { savetoken(yytext); yylval.i=SEL_GRADIENT_RADIAL; return GRADIENT_TYPE; } -square { savetoken(yytext); yylval.i=SEL_GRADIENT_SQUARE; return GRADIENT_TYPE; } -dry { savetoken(yytext); yylval.i=DRY; return HUMIDITY_TYPE; } -wet { savetoken(yytext); yylval.i=WET; return HUMIDITY_TYPE; } -hot { savetoken(yytext); yylval.i=HOT; return HUMIDITY_TYPE; } -solid { savetoken(yytext); yylval.i=SOLID; return HUMIDITY_TYPE; } -any { savetoken(yytext); yylval.i=ANY_LOC; return HUMIDITY_TYPE; } -levregion ST_RET(LEV); -quantity ST_RET(QUANTITY_ID); -buried ST_RET(BURIED_ID); -eroded ST_RET(ERODED_ID); -erodeproof ST_RET(ERODEPROOF_ID); -trapped { savetoken(yytext); yylval.i=1; return TRAPPED_STATE; } -not_trapped { savetoken(yytext); yylval.i=0; return TRAPPED_STATE; } -recharged ST_RET(RECHARGED_ID); -invisible ST_RET(INVIS_ID); -greased ST_RET(GREASED_ID); -female ST_RET(FEMALE_ID); -cancelled ST_RET(CANCELLED_ID); -revived ST_RET(REVIVED_ID); -avenge ST_RET(AVENGE_ID); -fleeing ST_RET(FLEEING_ID); -blinded ST_RET(BLINDED_ID); -paralyzed ST_RET(PARALYZED_ID); -stunned ST_RET(STUNNED_ID); -confused ST_RET(CONFUSED_ID); -seen_traps ST_RET(SEENTRAPS_ID); -all ST_RET(ALL_ID); -horizontal ST_RETF((yylval.i=1), HORIZ_OR_VERT); -vertical { savetoken(yytext); yylval.i=2; return HORIZ_OR_VERT; } -open { savetoken(yytext); yylval.i=D_ISOPEN; return DOOR_STATE; } -closed { savetoken(yytext); yylval.i=D_CLOSED; return DOOR_STATE; } -locked { savetoken(yytext); yylval.i=D_LOCKED; return DOOR_STATE; } -nodoor { savetoken(yytext); yylval.i=D_NODOOR; return DOOR_STATE; } -broken { savetoken(yytext); yylval.i=D_BROKEN; return DOOR_STATE; } -secret { savetoken(yytext); yylval.i=D_SECRET; return DOOR_STATE; } -north { savetoken(yytext); yylval.i=W_NORTH; return DIRECTION; } -east { savetoken(yytext); yylval.i=W_EAST; return DIRECTION; } -south { savetoken(yytext); yylval.i=W_SOUTH; return DIRECTION; } -west { savetoken(yytext); yylval.i=W_WEST; return DIRECTION; } -random { savetoken(yytext); yylval.i = -1; return RANDOM_TYPE; } -random\[ { savetoken(yytext); yylval.i = -1; return RANDOM_TYPE_BRACKET; } -none { savetoken(yytext); yylval.i = -2; return NONE; } -align ST_RET(A_REGISTER); -left { savetoken(yytext); yylval.i=1; return LEFT_OR_RIGHT; } -half-left { savetoken(yytext); yylval.i=2; return LEFT_OR_RIGHT; } -center { savetoken(yytext); yylval.i=3; return CENTER; } -half-right { savetoken(yytext); yylval.i=4; return LEFT_OR_RIGHT; } -right { savetoken(yytext); yylval.i=5; return LEFT_OR_RIGHT; } -top { savetoken(yytext); yylval.i=1; return TOP_OR_BOT; } -bottom { savetoken(yytext); yylval.i=5; return TOP_OR_BOT; } -lit { savetoken(yytext); yylval.i=1; return LIGHT_STATE; } -unlit { savetoken(yytext); yylval.i=0; return LIGHT_STATE; } -filled { savetoken(yytext); yylval.i=1; return FILLING; } -unfilled { savetoken(yytext); yylval.i=0; return FILLING; } -regular { savetoken(yytext); yylval.i=0; return IRREGULAR; } -irregular { savetoken(yytext); yylval.i=1; return IRREGULAR; } -unjoined { savetoken(yytext); yylval.i=1; return JOINED; } -joined { savetoken(yytext); yylval.i=0; return JOINED; } -limited { savetoken(yytext); yylval.i=1; return LIMITED; } -unlimited { savetoken(yytext); yylval.i=0; return LIMITED; } -noalign { savetoken(yytext); yylval.i= AM_NONE; return ALIGNMENT; } -law { savetoken(yytext); yylval.i= AM_LAWFUL; return ALIGNMENT; } -neutral { savetoken(yytext); yylval.i= AM_NEUTRAL; return ALIGNMENT; } -chaos { savetoken(yytext); yylval.i= AM_CHAOTIC; return ALIGNMENT; } -coaligned { savetoken(yytext); yylval.i= AM_SPLEV_CO; return ALIGNMENT; } -noncoaligned { savetoken(yytext); yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } -peaceful { savetoken(yytext); yylval.i=1; return MON_ATTITUDE; } -hostile { savetoken(yytext); yylval.i=0; return MON_ATTITUDE; } -asleep { savetoken(yytext); yylval.i=1; return MON_ALERTNESS; } -awake { savetoken(yytext); yylval.i=0; return MON_ALERTNESS; } -m_feature { savetoken(yytext); yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } -m_monster { savetoken(yytext); yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } -m_object { savetoken(yytext); yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } -sanctum { savetoken(yytext); yylval.i=2; return ALTAR_TYPE; } -shrine { savetoken(yytext); yylval.i=1; return ALTAR_TYPE; } -altar { savetoken(yytext); yylval.i=0; return ALTAR_TYPE; } -up { savetoken(yytext); yylval.i=1; return UP_OR_DOWN; } -down { savetoken(yytext); yylval.i=0; return UP_OR_DOWN; } -false { savetoken(yytext); yylval.i=0; return BOOLEAN; } -true { savetoken(yytext); yylval.i=1; return BOOLEAN; } -dust { savetoken(yytext); yylval.i=DUST; return ENGRAVING_TYPE; } -engrave { savetoken(yytext); yylval.i=ENGRAVE; return ENGRAVING_TYPE; } -burn { savetoken(yytext); yylval.i=BURN; return ENGRAVING_TYPE; } -mark { savetoken(yytext); yylval.i=MARK; return ENGRAVING_TYPE; } -blood { savetoken(yytext); yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } -blessed { savetoken(yytext); yylval.i=1; return CURSE_TYPE; } -uncursed { savetoken(yytext); yylval.i=2; return CURSE_TYPE; } -cursed { savetoken(yytext); yylval.i=3; return CURSE_TYPE; } -noteleport { savetoken(yytext); yylval.i=NOTELEPORT; return FLAG_TYPE; } -hardfloor { savetoken(yytext); yylval.i=HARDFLOOR; return FLAG_TYPE; } -nommap { savetoken(yytext); yylval.i=NOMMAP; return FLAG_TYPE; } -arboreal { savetoken(yytext); yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ -shortsighted { savetoken(yytext); yylval.i=SHORTSIGHTED; return FLAG_TYPE; } -mazelevel { savetoken(yytext); yylval.i=MAZELEVEL; return FLAG_TYPE; } -premapped { savetoken(yytext); yylval.i=PREMAPPED; return FLAG_TYPE; } -shroud { savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; } -graveyard { savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } -icedpools { savetoken(yytext); yylval.i=ICEDPOOLS; return FLAG_TYPE; } -solidify { savetoken(yytext); yylval.i=SOLIDIFY; return FLAG_TYPE; } -corrmaze { savetoken(yytext); yylval.i=CORRMAZE; return FLAG_TYPE; } -inaccessibles { savetoken(yytext); yylval.i=CHECK_INACCESSIBLES; return FLAG_TYPE; } -[0-9]+d[0-9]+ { char *p = index(yytext, 'd'); - savetoken(yytext); - if (p) { - *p++ = '\0'; - yylval.dice.num = atoi(yytext); - yylval.dice.die = atoi(p); - } else { - yylval.dice.num = yylval.dice.die = 1; - } - return DICE; - } -\[\ *[0-9]+\%\ *\] { savetoken(yytext); yylval.i = atoi(yytext + 1); - if (yylval.i < 0 || yylval.i > 100) - lc_error("Unexpected percentile '%li%%'", yylval.i); - return PERCENT; } --[0-9]+ { savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } -\+[0-9]+ { savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } -[0-9]+\% { savetoken(yytext); yylval.i = atoi(yytext); - if (yylval.i < 0 || yylval.i > 100) - lc_error("Unexpected percentile '%li%%'", yylval.i); - return SPERCENT; } -[0-9]+ { savetoken(yytext); yylval.i=atoi(yytext); return INTEGER; } -\"[^"]*\" { savetoken(yytext); - yytext[yyleng - 1] = '\0'; /* discard the trailing \" */ - yylval.map = dupstr(yytext + 1); /* skip the first \" */ - return STRING; } -\$[a-zA-Z_]+ { savetoken(yytext); return handle_varstring_check(); } -"==" { savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } -"!=" { savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } -"<>" { savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } -"<=" { savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } -">=" { savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } -"<" { savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } -">" { savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } -\r?\n { newline(); } -[ \t]+ { advancepos(yytext); } -'\\.' { savetoken(yytext); yylval.i = yytext[2]; return CHAR; } -'.' { savetoken(yytext); yylval.i = yytext[1]; return CHAR; } -[-_a-zA-Z0-9]+ ST_RET(UNKNOWN_TYPE); -. { savetoken(yytext); return yytext[0]; } -%% -#ifdef AMIGA -long * -alloc(n) - unsigned n; -{ - return (long *) malloc(n); -} -#endif - -/* routine to switch to another input file; needed for flex */ -void -init_yyin( input_f ) -FILE *input_f; -{ -#if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) - if (yyin) - yyrestart(input_f); - else -#endif - yyin = input_f; - - if (!orig_yyin) - orig_yyin = yyin; -} -/* analogous routine (for completeness) */ -void -init_yyout( output_f ) -FILE *output_f; -{ - yyout = output_f; -} - -long -handle_varstring_check() -{ - struct lc_vardefs *vd; - - yylval.map = dupstr(yytext); - if ((vd = vardef_defined(vardefs, yytext, 1)) != 0) { - long l = vd->var_type; - int a = ((l & SPOVAR_ARRAY) == SPOVAR_ARRAY); - - l &= ~SPOVAR_ARRAY; - if (l == SPOVAR_INT) - return (a ? VARSTRING_INT_ARRAY : VARSTRING_INT); - if (l == SPOVAR_STRING) - return (a ? VARSTRING_STRING_ARRAY : VARSTRING_STRING); - if (l == SPOVAR_VARIABLE) - return (a ? VARSTRING_VAR_ARRAY : VARSTRING_VAR); - if (l == SPOVAR_COORD) - return (a ? VARSTRING_COORD_ARRAY : VARSTRING_COORD); - if (l == SPOVAR_REGION) - return (a ? VARSTRING_REGION_ARRAY : VARSTRING_REGION); - if (l == SPOVAR_MAPCHAR) - return (a ? VARSTRING_MAPCHAR_ARRAY : VARSTRING_MAPCHAR); - if (l == SPOVAR_MONST) - return (a ? VARSTRING_MONST_ARRAY : VARSTRING_MONST); - if (l == SPOVAR_OBJ) - return (a ? VARSTRING_OBJ_ARRAY : VARSTRING_OBJ); - if (l == SPOVAR_SEL) - return (a ? VARSTRING_SEL_ARRAY : VARSTRING_SEL); - } - return VARSTRING; -} - -void -newline() -{ - nh_line_number++; - token_start_pos = 0; - (void) memset((genericptr_t) curr_token, 0, 512); -} - -void -savetoken(s) -char *s; -{ - Sprintf(curr_token, "%s", s); - advancepos(s); -} - -void -advancepos(s) -char *s; -{ - token_start_pos += strlen(s); -} - -/*lev_comp.l*/ diff --git a/util/lev_comp.y b/util/lev_comp.y deleted file mode 100644 index 1b1c93056..000000000 --- a/util/lev_comp.y +++ /dev/null @@ -1,2721 +0,0 @@ -%{ -/* NetHack 3.6 lev_comp.y $NHDT-Date: 1543371691 2018/11/28 02:21:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.22 $ */ -/* Copyright (c) 1989 by Jean-Christophe Collet */ -/* NetHack may be freely redistributed. See license for details. */ - -/* - * This file contains the Level Compiler code - * It may handle special mazes & special room-levels - */ - -/* In case we're using bison in AIX. This definition must be - * placed before any other C-language construct in the file - * excluding comments and preprocessor directives (thanks IBM - * for this wonderful feature...). - * - * Note: some cpps barf on this 'undefined control' (#pragma). - * Addition of the leading space seems to prevent barfage for now, - * and AIX will still see the directive. - */ -#ifdef _AIX - #pragma alloca /* keep leading space! */ -#endif - -#define SPEC_LEV /* for USE_OLDARGS (sp_lev.h) */ -#include "hack.h" -#include "sp_lev.h" - -#define ERR (-1) -/* many types of things are put in chars for transference to NetHack. - * since some systems will use signed chars, limit everybody to the - * same number for portability. - */ -#define MAX_OF_TYPE 128 - -#define MAX_NESTED_IFS 20 -#define MAX_SWITCH_CASES 20 - -#define New(type) \ - (type *) memset((genericptr_t) alloc(sizeof (type)), 0, sizeof (type)) -#define NewTab(type, size) (type **) alloc(sizeof (type *) * size) -#define Free(ptr) free((genericptr_t) ptr) - -extern void VDECL(lc_error, (const char *, ...)); -extern void VDECL(lc_warning, (const char *, ...)); -extern void FDECL(yyerror, (const char *)); -extern void FDECL(yywarning, (const char *)); -extern int NDECL(yylex); -int NDECL(yyparse); - -extern int FDECL(get_floor_type, (CHAR_P)); -extern int FDECL(get_room_type, (char *)); -extern int FDECL(get_trap_type, (char *)); -extern int FDECL(get_monster_id, (char *,CHAR_P)); -extern int FDECL(get_object_id, (char *,CHAR_P)); -extern boolean FDECL(check_monster_char, (CHAR_P)); -extern boolean FDECL(check_object_char, (CHAR_P)); -extern char FDECL(what_map_char, (CHAR_P)); -extern void FDECL(scan_map, (char *, sp_lev *)); -extern void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); -extern genericptr_t FDECL(get_last_opcode_data1, (sp_lev *, int)); -extern genericptr_t FDECL(get_last_opcode_data2, (sp_lev *, int, int)); -extern boolean FDECL(check_subrooms, (sp_lev *)); -extern boolean FDECL(write_level_file, (char *,sp_lev *)); -extern struct opvar *FDECL(set_opvar_int, (struct opvar *, long)); -extern void VDECL(add_opvars, (sp_lev *, const char *, ...)); -extern void FDECL(start_level_def, (sp_lev * *, char *)); - -extern struct lc_funcdefs *FDECL(funcdef_new, (long,char *)); -extern void FDECL(funcdef_free_all, (struct lc_funcdefs *)); -extern struct lc_funcdefs *FDECL(funcdef_defined, (struct lc_funcdefs *, - char *, int)); -extern char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *)); -extern char *FDECL(decode_parm_str, (char *)); - -extern struct lc_vardefs *FDECL(vardef_new, (long,char *)); -extern void FDECL(vardef_free_all, (struct lc_vardefs *)); -extern struct lc_vardefs *FDECL(vardef_defined, (struct lc_vardefs *, - char *, int)); - -extern void NDECL(break_stmt_start); -extern void FDECL(break_stmt_end, (sp_lev *)); -extern void FDECL(break_stmt_new, (sp_lev *, long)); - -extern void FDECL(splev_add_from, (sp_lev *, sp_lev *)); - -extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long)); -extern void FDECL(vardef_used, (struct lc_vardefs *, char *)); -extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *, - char *, long)); - -extern int FDECL(reverse_jmp_opcode, (int)); - -struct coord { - long x; - long y; -}; - -struct forloopdef { - char *varname; - long jmp_point; -}; -static struct forloopdef forloop_list[MAX_NESTED_IFS]; -static short n_forloops = 0; - - -sp_lev *splev = NULL; - -static struct opvar *if_list[MAX_NESTED_IFS]; - -static short n_if_list = 0; - -unsigned int max_x_map, max_y_map; -int obj_containment = 0; - -int in_container_obj = 0; - -/* integer value is possibly an inconstant value (eg. dice notation - or a variable) */ -int is_inconstant_number = 0; - -int in_switch_statement = 0; -static struct opvar *switch_check_jump = NULL; -static struct opvar *switch_default_case = NULL; -static struct opvar *switch_case_list[MAX_SWITCH_CASES]; -static long switch_case_value[MAX_SWITCH_CASES]; -int n_switch_case_list = 0; - -int allow_break_statements = 0; -struct lc_breakdef *break_list = NULL; - -extern struct lc_vardefs *vardefs; /* variable definitions */ - - -struct lc_vardefs *function_tmp_var_defs = NULL; -extern struct lc_funcdefs *function_definitions; -struct lc_funcdefs *curr_function = NULL; -struct lc_funcdefs_parm * curr_function_param = NULL; -int in_function_definition = 0; -sp_lev *function_splev_backup = NULL; - -extern int fatal_error; -extern int got_errors; -extern int line_number; -extern const char *fname; - -extern char curr_token[512]; - -%} - -%union -{ - long i; - char *map; - struct { - long room; - long wall; - long door; - } corpos; - struct { - long area; - long x1; - long y1; - long x2; - long y2; - } lregn; - struct { - long x; - long y; - } crd; - struct { - long ter; - long lit; - } terr; - struct { - long height; - long width; - } sze; - struct { - long die; - long num; - } dice; - struct { - long cfunc; - char *varstr; - } meth; -} - - -%token CHAR INTEGER BOOLEAN PERCENT SPERCENT -%token MINUS_INTEGER PLUS_INTEGER -%token MAZE_GRID_ID SOLID_FILL_ID MINES_ID ROGUELEV_ID -%token MESSAGE_ID MAZE_ID LEVEL_ID LEV_INIT_ID GEOMETRY_ID NOMAP_ID -%token OBJECT_ID COBJECT_ID MONSTER_ID TRAP_ID DOOR_ID DRAWBRIDGE_ID -%token object_ID monster_ID terrain_ID -%token MAZEWALK_ID WALLIFY_ID REGION_ID FILLING IRREGULAR JOINED -%token ALTAR_ID LADDER_ID STAIR_ID NON_DIGGABLE_ID NON_PASSWALL_ID ROOM_ID -%token PORTAL_ID TELEPRT_ID BRANCH_ID LEV MINERALIZE_ID -%token CORRIDOR_ID GOLD_ID ENGRAVING_ID FOUNTAIN_ID POOL_ID SINK_ID NONE -%token RAND_CORRIDOR_ID DOOR_STATE LIGHT_STATE CURSE_TYPE ENGRAVING_TYPE -%token DIRECTION RANDOM_TYPE RANDOM_TYPE_BRACKET A_REGISTER -%token ALIGNMENT LEFT_OR_RIGHT CENTER TOP_OR_BOT ALTAR_TYPE UP_OR_DOWN -%token SUBROOM_ID NAME_ID FLAGS_ID FLAG_TYPE MON_ATTITUDE MON_ALERTNESS -%token MON_APPEARANCE ROOMDOOR_ID IF_ID ELSE_ID -%token TERRAIN_ID HORIZ_OR_VERT REPLACE_TERRAIN_ID -%token EXIT_ID SHUFFLE_ID -%token QUANTITY_ID BURIED_ID LOOP_ID -%token FOR_ID TO_ID -%token SWITCH_ID CASE_ID BREAK_ID DEFAULT_ID -%token ERODED_ID TRAPPED_STATE RECHARGED_ID INVIS_ID GREASED_ID -%token FEMALE_ID CANCELLED_ID REVIVED_ID AVENGE_ID FLEEING_ID BLINDED_ID -%token PARALYZED_ID STUNNED_ID CONFUSED_ID SEENTRAPS_ID ALL_ID -%token MONTYPE_ID -%token GRAVE_ID ERODEPROOF_ID -%token FUNCTION_ID -%token MSG_OUTPUT_TYPE -%token COMPARE_TYPE -%token UNKNOWN_TYPE -%token rect_ID fillrect_ID line_ID randline_ID grow_ID -%token selection_ID flood_ID -%token rndcoord_ID circle_ID ellipse_ID filter_ID complement_ID -%token gradient_ID GRADIENT_TYPE LIMITED HUMIDITY_TYPE -%token ',' ':' '(' ')' '[' ']' '{' '}' -%token STRING MAP_ID -%token NQSTRING VARSTRING -%token CFUNC CFUNC_INT CFUNC_STR CFUNC_COORD CFUNC_REGION -%token VARSTRING_INT VARSTRING_INT_ARRAY -%token VARSTRING_STRING VARSTRING_STRING_ARRAY -%token VARSTRING_VAR VARSTRING_VAR_ARRAY -%token VARSTRING_COORD VARSTRING_COORD_ARRAY -%token VARSTRING_REGION VARSTRING_REGION_ARRAY -%token VARSTRING_MAPCHAR VARSTRING_MAPCHAR_ARRAY -%token VARSTRING_MONST VARSTRING_MONST_ARRAY -%token VARSTRING_OBJ VARSTRING_OBJ_ARRAY -%token VARSTRING_SEL VARSTRING_SEL_ARRAY -%token METHOD_INT METHOD_INT_ARRAY -%token METHOD_STRING METHOD_STRING_ARRAY -%token METHOD_VAR METHOD_VAR_ARRAY -%token METHOD_COORD METHOD_COORD_ARRAY -%token METHOD_REGION METHOD_REGION_ARRAY -%token METHOD_MAPCHAR METHOD_MAPCHAR_ARRAY -%token METHOD_MONST METHOD_MONST_ARRAY -%token METHOD_OBJ METHOD_OBJ_ARRAY -%token METHOD_SEL METHOD_SEL_ARRAY -%token DICE -%type h_justif v_justif trap_name room_type door_state light_state -%type alignment altar_type a_register roomfill door_pos -%type alignment_prfx -%type door_wall walled secret -%type dir_list teleprt_detail -%type object_infos object_info monster_infos monster_info -%type levstatements stmt_block region_detail_end -%type engraving_type flag_list roomregionflag roomregionflags -%type optroomregionflags -%type humidity_flags -%type comparestmt encodecoord encoderegion mapchar -%type seen_trap_mask -%type encodemonster encodeobj encodeobj_list -%type integer_list string_list encodecoord_list encoderegion_list -%type mapchar_list encodemonster_list -%type opt_percent opt_fillchar -%type all_integers -%type ter_selection ter_selection_x -%type func_param_type -%type objectid monsterid terrainid -%type opt_coord_or_var opt_limited -%type mazefiller -%type level_def -%type any_var any_var_array any_var_or_arr any_var_or_unk -%type func_call_params_list func_call_param_list -%type func_call_param_part -%type corr_spec -%type region lev_region -%type room_pos subroom_pos room_align -%type room_size -%type terrain_type -%left '+' '-' -%left '*' '/' '%' -%start file - -%% -file : /* nothing */ - | levels - ; - -levels : level - | level levels - ; - -level : level_def flags levstatements - { - if (fatal_error > 0) { - (void) fprintf(stderr, - "%s: %d errors detected for level \"%s\". No output created!\n", - fname, fatal_error, $1); - fatal_error = 0; - got_errors++; - } else if (!got_errors) { - if (!write_level_file($1, splev)) { - lc_error("Can't write output file for '%s'!", - $1); - exit(EXIT_FAILURE); - } - } - Free($1); - Free(splev); - splev = NULL; - vardef_free_all(vardefs); - vardefs = NULL; - } - ; - -level_def : LEVEL_ID ':' STRING - { - start_level_def(&splev, $3); - $$ = $3; - } - | MAZE_ID ':' STRING ',' mazefiller - { - start_level_def(&splev, $3); - if ($5 == -1) { - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_MAZEGRID, HWALL, 0,0, - 0,0,0,0, SPO_INITLEVEL)); - } else { - int bg = (int) what_map_char((char) $5); - - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_SOLIDFILL, bg, 0,0, - 0,0,0,0, SPO_INITLEVEL)); - } - add_opvars(splev, "io", - VA_PASS2(MAZELEVEL, SPO_LEVEL_FLAGS)); - max_x_map = COLNO-1; - max_y_map = ROWNO; - $$ = $3; - } - ; - -mazefiller : RANDOM_TYPE - { - $$ = -1; - } - | CHAR - { - $$ = what_map_char((char) $1); - } - ; - -lev_init : LEV_INIT_ID ':' SOLID_FILL_ID ',' terrain_type - { - int filling = (int) $5.ter; - - if (filling == INVALID_TYPE || filling >= MAX_TYPE) - lc_error("INIT_MAP: Invalid fill char type."); - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_SOLIDFILL, filling, - 0, (int) $5.lit, - 0,0,0,0, SPO_INITLEVEL)); - max_x_map = COLNO-1; - max_y_map = ROWNO; - } - | LEV_INIT_ID ':' MAZE_GRID_ID ',' CHAR - { - int filling = (int) what_map_char((char) $5); - - if (filling == INVALID_TYPE || filling >= MAX_TYPE) - lc_error("INIT_MAP: Invalid fill char type."); - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_MAZEGRID, filling, 0,0, - 0,0,0,0, SPO_INITLEVEL)); - max_x_map = COLNO-1; - max_y_map = ROWNO; - } - | LEV_INIT_ID ':' ROGUELEV_ID - { - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_ROGUE,0,0,0, - 0,0,0,0, SPO_INITLEVEL)); - } - | LEV_INIT_ID ':' MINES_ID ',' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled opt_fillchar - { - int fg = (int) what_map_char((char) $5), - bg = (int) what_map_char((char) $7); - int smoothed = (int) $9, - joined = (int) $11, - lit = (int) $13, - walled = (int) $15, - filling = (int) $16; - - if (fg == INVALID_TYPE || fg >= MAX_TYPE) - lc_error("INIT_MAP: Invalid foreground type."); - if (bg == INVALID_TYPE || bg >= MAX_TYPE) - lc_error("INIT_MAP: Invalid background type."); - if (joined && fg != CORR && fg != ROOM) - lc_error("INIT_MAP: Invalid foreground type for joined map."); - - if (filling == INVALID_TYPE) - lc_error("INIT_MAP: Invalid fill char type."); - - add_opvars(splev, "iiiiiiiio", - VA_PASS9(LVLINIT_MINES, filling, walled, lit, - joined, smoothed, bg, fg, - SPO_INITLEVEL)); - max_x_map = COLNO-1; - max_y_map = ROWNO; - } - ; - -opt_limited : /* nothing */ - { - $$ = 0; - } - | ',' LIMITED - { - $$ = $2; - } - ; - -opt_coord_or_var : /* nothing */ - { - add_opvars(splev, "o", VA_PASS1(SPO_COPY)); - $$ = 0; - } - | ',' coord_or_var - { - $$ = 1; - } - ; - -opt_fillchar : /* nothing */ - { - $$ = -1; - } - | ',' CHAR - { - $$ = what_map_char((char) $2); - } - ; - - -walled : BOOLEAN - | RANDOM_TYPE - ; - -flags : /* nothing */ - { - add_opvars(splev, "io", VA_PASS2(0, SPO_LEVEL_FLAGS)); - } - | FLAGS_ID ':' flag_list - { - add_opvars(splev, "io", - VA_PASS2((int) $3, SPO_LEVEL_FLAGS)); - } - ; - -flag_list : FLAG_TYPE ',' flag_list - { - $$ = ($1 | $3); - } - | FLAG_TYPE - { - $$ = $1; - } - ; - -levstatements : /* nothing */ - { - $$ = 0; - } - | levstatement levstatements - { - $$ = 1 + $2; - } - ; - -stmt_block : '{' levstatements '}' - { - $$ = $2; - } - ; - -levstatement : message - | lev_init - | altar_detail - | grave_detail - | branch_region - | corridor - | variable_define - | shuffle_detail - | diggable_detail - | door_detail - | drawbridge_detail - | engraving_detail - | mineralize - | fountain_detail - | gold_detail - | switchstatement - | forstatement - | loopstatement - | ifstatement - | chancestatement - | exitstatement - | breakstatement - | function_define - | function_call - | ladder_detail - | map_definition - | mazewalk_detail - | monster_detail - | object_detail - | passwall_detail - | pool_detail - | portal_region - | random_corridors - | region_detail - | room_def - | subroom_def - | sink_detail - | terrain_detail - | replace_terrain_detail - | stair_detail - | stair_region - | teleprt_region - | trap_detail - | wallify_detail - ; - -any_var_array : VARSTRING_INT_ARRAY - | VARSTRING_STRING_ARRAY - | VARSTRING_VAR_ARRAY - | VARSTRING_COORD_ARRAY - | VARSTRING_REGION_ARRAY - | VARSTRING_MAPCHAR_ARRAY - | VARSTRING_MONST_ARRAY - | VARSTRING_OBJ_ARRAY - | VARSTRING_SEL_ARRAY - ; - -any_var : VARSTRING_INT - | VARSTRING_STRING - | VARSTRING_VAR - | VARSTRING_COORD - | VARSTRING_REGION - | VARSTRING_MAPCHAR - | VARSTRING_MONST - | VARSTRING_OBJ - | VARSTRING_SEL - ; - -any_var_or_arr : any_var_array - | any_var - | VARSTRING - ; - -any_var_or_unk : VARSTRING - | any_var - ; - -shuffle_detail : SHUFFLE_ID ':' any_var_array - { - struct lc_vardefs *vd; - - if ((vd = vardef_defined(vardefs, $3, 1))) { - if (!(vd->var_type & SPOVAR_ARRAY)) - lc_error("Trying to shuffle non-array variable '%s'", - $3); - } else - lc_error("Trying to shuffle undefined variable '%s'", - $3); - add_opvars(splev, "so", VA_PASS2($3, SPO_SHUFFLE_ARRAY)); - Free($3); - } - ; - -variable_define : any_var_or_arr '=' math_expr_var - { - vardefs = add_vardef_type(vardefs, $1, SPOVAR_INT); - add_opvars(splev, "iso", VA_PASS3(0, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' selection_ID ':' ter_selection - { - vardefs = add_vardef_type(vardefs, $1, SPOVAR_SEL); - add_opvars(splev, "iso", VA_PASS3(0, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' string_expr - { - vardefs = add_vardef_type(vardefs, $1, SPOVAR_STRING); - add_opvars(splev, "iso", VA_PASS3(0, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' terrainid ':' mapchar_or_var - { - vardefs = add_vardef_type(vardefs, $1, SPOVAR_MAPCHAR); - add_opvars(splev, "iso", VA_PASS3(0, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' monsterid ':' monster_or_var - { - vardefs = add_vardef_type(vardefs, $1, SPOVAR_MONST); - add_opvars(splev, "iso", VA_PASS3(0, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' objectid ':' object_or_var - { - vardefs = add_vardef_type(vardefs, $1, SPOVAR_OBJ); - add_opvars(splev, "iso", VA_PASS3(0, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' coord_or_var - { - vardefs = add_vardef_type(vardefs, $1, SPOVAR_COORD); - add_opvars(splev, "iso", VA_PASS3(0, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' region_or_var - { - vardefs = add_vardef_type(vardefs, $1, SPOVAR_REGION); - add_opvars(splev, "iso", VA_PASS3(0, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' '{' integer_list '}' - { - int n_items = (int) $4; - - vardefs = add_vardef_type(vardefs, $1, - SPOVAR_INT | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' '{' encodecoord_list '}' - { - int n_items = (int) $4; - - vardefs = add_vardef_type(vardefs, $1, - SPOVAR_COORD | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' '{' encoderegion_list '}' - { - int n_items = (int) $4; - - vardefs = add_vardef_type(vardefs, $1, - SPOVAR_REGION | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' terrainid ':' '{' mapchar_list '}' - { - int n_items = (int) $6; - - vardefs = add_vardef_type(vardefs, $1, - SPOVAR_MAPCHAR | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' monsterid ':' '{' encodemonster_list '}' - { - int n_items = (int) $6; - - vardefs = add_vardef_type(vardefs, $1, - SPOVAR_MONST | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' objectid ':' '{' encodeobj_list '}' - { - int n_items = (int) $6; - - vardefs = add_vardef_type(vardefs, $1, - SPOVAR_OBJ | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, $1, SPO_VAR_INIT)); - Free($1); - } - | any_var_or_arr '=' '{' string_list '}' - { - int n_items = (int) $4; - - vardefs = add_vardef_type(vardefs, $1, - SPOVAR_STRING | SPOVAR_ARRAY); - add_opvars(splev, "iso", - VA_PASS3(n_items, $1, SPO_VAR_INIT)); - Free($1); - } - ; - -encodeobj_list : encodeobj - { - add_opvars(splev, "O", VA_PASS1($1)); - $$ = 1; - } - | encodeobj_list ',' encodeobj - { - add_opvars(splev, "O", VA_PASS1($3)); - $$ = 1 + $1; - } - ; - -encodemonster_list : encodemonster - { - add_opvars(splev, "M", VA_PASS1($1)); - $$ = 1; - } - | encodemonster_list ',' encodemonster - { - add_opvars(splev, "M", VA_PASS1($3)); - $$ = 1 + $1; - } - ; - -mapchar_list : mapchar - { - add_opvars(splev, "m", VA_PASS1($1)); - $$ = 1; - } - | mapchar_list ',' mapchar - { - add_opvars(splev, "m", VA_PASS1($3)); - $$ = 1 + $1; - } - ; - -encoderegion_list : encoderegion - { - $$ = 1; - } - | encoderegion_list ',' encoderegion - { - $$ = 1 + $1; - } - ; - -encodecoord_list : encodecoord - { - add_opvars(splev, "c", VA_PASS1($1)); - $$ = 1; - } - | encodecoord_list ',' encodecoord - { - add_opvars(splev, "c", VA_PASS1($3)); - $$ = 1 + $1; - } - ; - -integer_list : math_expr_var - { - $$ = 1; - } - | integer_list ',' math_expr_var - { - $$ = 1 + $1; - } - ; - -string_list : string_expr - { - $$ = 1; - } - | string_list ',' string_expr - { - $$ = 1 + $1; - } - ; - -function_define : FUNCTION_ID NQSTRING '(' - { - struct lc_funcdefs *funcdef; - - if (in_function_definition) - lc_error("Recursively defined functions not allowed (function %s).", $2); - - in_function_definition++; - - if (funcdef_defined(function_definitions, $2, 1)) - lc_error("Function '%s' already defined once.", $2); - - funcdef = funcdef_new(-1, $2); - funcdef->next = function_definitions; - function_definitions = funcdef; - function_splev_backup = splev; - splev = &(funcdef->code); - Free($2); - curr_function = funcdef; - function_tmp_var_defs = vardefs; - vardefs = NULL; - } - func_params_list ')' - { - /* nothing */ - } - stmt_block - { - add_opvars(splev, "io", VA_PASS2(0, SPO_RETURN)); - splev = function_splev_backup; - in_function_definition--; - curr_function = NULL; - vardef_free_all(vardefs); - vardefs = function_tmp_var_defs; - } - ; - -function_call : NQSTRING '(' func_call_params_list ')' - { - struct lc_funcdefs *tmpfunc; - - tmpfunc = funcdef_defined(function_definitions, $1, 1); - if (tmpfunc) { - int l; - int nparams = (int) strlen($3); - char *fparamstr = funcdef_paramtypes(tmpfunc); - - if (strcmp($3, fparamstr)) { - char *tmps = strdup(decode_parm_str(fparamstr)); - - lc_error("Function '%s' requires params '%s', got '%s' instead.", - $1, tmps, decode_parm_str($3)); - Free(tmps); - } - Free(fparamstr); - Free($3); - if (!(tmpfunc->n_called)) { - /* we haven't called the function yet, so insert it in the code */ - struct opvar *jmp = New(struct opvar); - - set_opvar_int(jmp, splev->n_opcodes+1); - add_opcode(splev, SPO_PUSH, jmp); - /* we must jump past it first, then CALL it, due to RETURN. */ - add_opcode(splev, SPO_JMP, NULL); - - tmpfunc->addr = splev->n_opcodes; - - { /* init function parameter variables */ - struct lc_funcdefs_parm *tfp = tmpfunc->params; - while (tfp) { - add_opvars(splev, "iso", - VA_PASS3(0, tfp->name, - SPO_VAR_INIT)); - tfp = tfp->next; - } - } - - splev_add_from(splev, &(tmpfunc->code)); - set_opvar_int(jmp, - splev->n_opcodes - jmp->vardata.l); - } - l = (int) (tmpfunc->addr - splev->n_opcodes - 2); - add_opvars(splev, "iio", - VA_PASS3(nparams, l, SPO_CALL)); - tmpfunc->n_called++; - } else { - lc_error("Function '%s' not defined.", $1); - } - Free($1); - } - ; - -exitstatement : EXIT_ID - { - add_opcode(splev, SPO_EXIT, NULL); - } - ; - -opt_percent : /* nothing */ - { - $$ = 100; - } - | PERCENT - { - $$ = $1; - } - ; - -comparestmt : PERCENT - { - /* val > rn2(100) */ - add_opvars(splev, "iio", - VA_PASS3((int) $1, 100, SPO_RN2)); - $$ = SPO_JG; - } - | '[' math_expr_var COMPARE_TYPE math_expr_var ']' - { - $$ = $3; - } - | '[' math_expr_var ']' - { - /* boolean, explicit foo != 0 */ - add_opvars(splev, "i", VA_PASS1(0)); - $$ = SPO_JNE; - } - ; - -switchstatement : SWITCH_ID - { - is_inconstant_number = 0; - } - '[' integer_or_var ']' - { - struct opvar *chkjmp; - - if (in_switch_statement > 0) - lc_error("Cannot nest switch-statements."); - - in_switch_statement++; - - n_switch_case_list = 0; - switch_default_case = NULL; - - if (!is_inconstant_number) - add_opvars(splev, "o", VA_PASS1(SPO_RN2)); - is_inconstant_number = 0; - - chkjmp = New(struct opvar); - set_opvar_int(chkjmp, splev->n_opcodes+1); - switch_check_jump = chkjmp; - add_opcode(splev, SPO_PUSH, chkjmp); - add_opcode(splev, SPO_JMP, NULL); - break_stmt_start(); - } - '{' switchcases '}' - { - struct opvar *endjump = New(struct opvar); - int i; - - set_opvar_int(endjump, splev->n_opcodes+1); - - add_opcode(splev, SPO_PUSH, endjump); - add_opcode(splev, SPO_JMP, NULL); - - set_opvar_int(switch_check_jump, - splev->n_opcodes - switch_check_jump->vardata.l); - - for (i = 0; i < n_switch_case_list; i++) { - add_opvars(splev, "oio", - VA_PASS3(SPO_COPY, - switch_case_value[i], SPO_CMP)); - set_opvar_int(switch_case_list[i], - switch_case_list[i]->vardata.l - splev->n_opcodes-1); - add_opcode(splev, SPO_PUSH, switch_case_list[i]); - add_opcode(splev, SPO_JE, NULL); - } - - if (switch_default_case) { - set_opvar_int(switch_default_case, - switch_default_case->vardata.l - splev->n_opcodes-1); - add_opcode(splev, SPO_PUSH, switch_default_case); - add_opcode(splev, SPO_JMP, NULL); - } - - set_opvar_int(endjump, splev->n_opcodes - endjump->vardata.l); - - break_stmt_end(splev); - - add_opcode(splev, SPO_POP, NULL); /* get rid of the value in stack */ - in_switch_statement--; - - - } - ; - -switchcases : /* nothing */ - | switchcase switchcases - ; - -switchcase : CASE_ID all_integers ':' - { - if (n_switch_case_list < MAX_SWITCH_CASES) { - struct opvar *tmppush = New(struct opvar); - - set_opvar_int(tmppush, splev->n_opcodes); - switch_case_value[n_switch_case_list] = $2; - switch_case_list[n_switch_case_list++] = tmppush; - } else lc_error("Too many cases in a switch."); - } - levstatements - { - } - | DEFAULT_ID ':' - { - struct opvar *tmppush = New(struct opvar); - - if (switch_default_case) - lc_error("Switch default case already used."); - - set_opvar_int(tmppush, splev->n_opcodes); - switch_default_case = tmppush; - } - levstatements - { - } - ; - -breakstatement : BREAK_ID - { - if (!allow_break_statements) - lc_error("Cannot use BREAK outside a statement block."); - else { - break_stmt_new(splev, splev->n_opcodes); - } - } - ; - -for_to_span : '.' '.' - | TO_ID - ; - -forstmt_start : FOR_ID any_var_or_unk '=' math_expr_var for_to_span math_expr_var - { - char buf[256], buf2[256]; - - if (n_forloops >= MAX_NESTED_IFS) { - lc_error("FOR: Too deeply nested loops."); - n_forloops = MAX_NESTED_IFS - 1; - } - - /* first, define a variable for the for-loop end value */ - Sprintf(buf, "%s end", $2); - /* the value of which is already in stack (the 2nd math_expr) */ - add_opvars(splev, "iso", VA_PASS3(0, buf, SPO_VAR_INIT)); - - vardefs = add_vardef_type(vardefs, $2, SPOVAR_INT); - /* define the for-loop variable. value is in stack (1st math_expr) */ - add_opvars(splev, "iso", VA_PASS3(0, $2, SPO_VAR_INIT)); - - /* calculate value for the loop "step" variable */ - Sprintf(buf2, "%s step", $2); - /* end - start */ - add_opvars(splev, "vvo", - VA_PASS3(buf, $2, SPO_MATH_SUB)); - /* sign of that */ - add_opvars(splev, "o", VA_PASS1(SPO_MATH_SIGN)); - /* save the sign into the step var */ - add_opvars(splev, "iso", - VA_PASS3(0, buf2, SPO_VAR_INIT)); - - forloop_list[n_forloops].varname = strdup($2); - forloop_list[n_forloops].jmp_point = splev->n_opcodes; - - n_forloops++; - Free($2); - } - ; - -forstatement : forstmt_start - { - /* nothing */ - break_stmt_start(); - } - stmt_block - { - int l; - char buf[256], buf2[256]; - - n_forloops--; - Sprintf(buf, "%s step", forloop_list[n_forloops].varname); - Sprintf(buf2, "%s end", forloop_list[n_forloops].varname); - /* compare for-loop var to end value */ - add_opvars(splev, "vvo", - VA_PASS3(forloop_list[n_forloops].varname, - buf2, SPO_CMP)); - /* var + step */ - add_opvars(splev, "vvo", - VA_PASS3(buf, forloop_list[n_forloops].varname, - SPO_MATH_ADD)); - /* for-loop var = (for-loop var + step) */ - add_opvars(splev, "iso", - VA_PASS3(0, forloop_list[n_forloops].varname, - SPO_VAR_INIT)); - /* jump back if compared values were not equal */ - l = (int) (forloop_list[n_forloops].jmp_point - - splev->n_opcodes - 1); - add_opvars(splev, "io", VA_PASS2(l, SPO_JNE)); - Free(forloop_list[n_forloops].varname); - break_stmt_end(splev); - } - ; - -loopstatement : LOOP_ID '[' integer_or_var ']' - { - struct opvar *tmppush = New(struct opvar); - - if (n_if_list >= MAX_NESTED_IFS) { - lc_error("LOOP: Too deeply nested conditionals."); - n_if_list = MAX_NESTED_IFS - 1; - } - set_opvar_int(tmppush, splev->n_opcodes); - if_list[n_if_list++] = tmppush; - - add_opvars(splev, "o", VA_PASS1(SPO_DEC)); - break_stmt_start(); - } - stmt_block - { - struct opvar *tmppush; - - add_opvars(splev, "oio", VA_PASS3(SPO_COPY, 0, SPO_CMP)); - - tmppush = (struct opvar *) if_list[--n_if_list]; - set_opvar_int(tmppush, - tmppush->vardata.l - splev->n_opcodes-1); - add_opcode(splev, SPO_PUSH, tmppush); - add_opcode(splev, SPO_JG, NULL); - add_opcode(splev, SPO_POP, NULL); /* discard count */ - break_stmt_end(splev); - } - ; - -chancestatement : comparestmt ':' - { - struct opvar *tmppush2 = New(struct opvar); - - if (n_if_list >= MAX_NESTED_IFS) { - lc_error("IF: Too deeply nested conditionals."); - n_if_list = MAX_NESTED_IFS - 1; - } - - add_opcode(splev, SPO_CMP, NULL); - - set_opvar_int(tmppush2, splev->n_opcodes+1); - - if_list[n_if_list++] = tmppush2; - - add_opcode(splev, SPO_PUSH, tmppush2); - - add_opcode(splev, reverse_jmp_opcode( $1 ), NULL); - - } - levstatement - { - if (n_if_list > 0) { - struct opvar *tmppush; - - tmppush = (struct opvar *) if_list[--n_if_list]; - set_opvar_int(tmppush, - splev->n_opcodes - tmppush->vardata.l); - } else lc_error("IF: Huh?! No start address?"); - } - ; - -ifstatement : IF_ID comparestmt - { - struct opvar *tmppush2 = New(struct opvar); - - if (n_if_list >= MAX_NESTED_IFS) { - lc_error("IF: Too deeply nested conditionals."); - n_if_list = MAX_NESTED_IFS - 1; - } - - add_opcode(splev, SPO_CMP, NULL); - - set_opvar_int(tmppush2, splev->n_opcodes+1); - - if_list[n_if_list++] = tmppush2; - - add_opcode(splev, SPO_PUSH, tmppush2); - - add_opcode(splev, reverse_jmp_opcode( $2 ), NULL); - - } - if_ending - { - /* do nothing */ - } - ; - -if_ending : stmt_block - { - if (n_if_list > 0) { - struct opvar *tmppush; - - tmppush = (struct opvar *) if_list[--n_if_list]; - set_opvar_int(tmppush, - splev->n_opcodes - tmppush->vardata.l); - } else lc_error("IF: Huh?! No start address?"); - } - | stmt_block - { - if (n_if_list > 0) { - struct opvar *tmppush = New(struct opvar); - struct opvar *tmppush2; - - set_opvar_int(tmppush, splev->n_opcodes+1); - add_opcode(splev, SPO_PUSH, tmppush); - - add_opcode(splev, SPO_JMP, NULL); - - tmppush2 = (struct opvar *) if_list[--n_if_list]; - - set_opvar_int(tmppush2, - splev->n_opcodes - tmppush2->vardata.l); - if_list[n_if_list++] = tmppush; - } else lc_error("IF: Huh?! No else-part address?"); - } - ELSE_ID stmt_block - { - if (n_if_list > 0) { - struct opvar *tmppush; - tmppush = (struct opvar *) if_list[--n_if_list]; - set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); - } else lc_error("IF: Huh?! No end address?"); - } - ; - -message : MESSAGE_ID ':' string_expr - { - add_opvars(splev, "o", VA_PASS1(SPO_MESSAGE)); - } - ; - -random_corridors: RAND_CORRIDOR_ID - { - add_opvars(splev, "iiiiiio", - VA_PASS7(-1, 0, -1, -1, -1, -1, SPO_CORRIDOR)); - } - | RAND_CORRIDOR_ID ':' all_integers - { - add_opvars(splev, "iiiiiio", - VA_PASS7(-1, $3, -1, -1, -1, -1, SPO_CORRIDOR)); - } - | RAND_CORRIDOR_ID ':' RANDOM_TYPE - { - add_opvars(splev, "iiiiiio", - VA_PASS7(-1, -1, -1, -1, -1, -1, SPO_CORRIDOR)); - } - ; - -corridor : CORRIDOR_ID ':' corr_spec ',' corr_spec - { - add_opvars(splev, "iiiiiio", - VA_PASS7($3.room, $3.door, $3.wall, - $5.room, $5.door, $5.wall, - SPO_CORRIDOR)); - } - | CORRIDOR_ID ':' corr_spec ',' all_integers - { - add_opvars(splev, "iiiiiio", - VA_PASS7($3.room, $3.door, $3.wall, - -1, -1, (long)$5, - SPO_CORRIDOR)); - } - ; - -corr_spec : '(' INTEGER ',' DIRECTION ',' door_pos ')' - { - $$.room = $2; - $$.wall = $4; - $$.door = $6; - } - ; - -room_begin : room_type opt_percent ',' light_state - { - if (($2 < 100) && ($1 == OROOM)) - lc_error("Only typed rooms can have a chance."); - else { - add_opvars(splev, "iii", - VA_PASS3((long)$1, (long)$2, (long)$4)); - } - } - ; - -subroom_def : SUBROOM_ID ':' room_begin ',' subroom_pos ',' room_size optroomregionflags - { - long rflags = $8; - - if (rflags == -1) rflags = (1 << 0); - add_opvars(splev, "iiiiiiio", - VA_PASS8(rflags, ERR, ERR, - $5.x, $5.y, $7.width, $7.height, - SPO_SUBROOM)); - break_stmt_start(); - } - stmt_block - { - break_stmt_end(splev); - add_opcode(splev, SPO_ENDROOM, NULL); - } - ; - -room_def : ROOM_ID ':' room_begin ',' room_pos ',' room_align ',' room_size optroomregionflags - { - long rflags = $8; - - if (rflags == -1) rflags = (1 << 0); - add_opvars(splev, "iiiiiiio", - VA_PASS8(rflags, - $7.x, $7.y, $5.x, $5.y, - $9.width, $9.height, SPO_ROOM)); - break_stmt_start(); - } - stmt_block - { - break_stmt_end(splev); - add_opcode(splev, SPO_ENDROOM, NULL); - } - ; - -roomfill : /* nothing */ - { - $$ = 1; - } - | ',' BOOLEAN - { - $$ = $2; - } - ; - -room_pos : '(' INTEGER ',' INTEGER ')' - { - if ( $2 < 1 || $2 > 5 || - $4 < 1 || $4 > 5 ) { - lc_error("Room positions should be between 1-5: (%li,%li)!", $2, $4); - } else { - $$.x = $2; - $$.y = $4; - } - } - | RANDOM_TYPE - { - $$.x = $$.y = ERR; - } - ; - -subroom_pos : '(' INTEGER ',' INTEGER ')' - { - if ( $2 < 0 || $4 < 0) { - lc_error("Invalid subroom position (%li,%li)!", $2, $4); - } else { - $$.x = $2; - $$.y = $4; - } - } - | RANDOM_TYPE - { - $$.x = $$.y = ERR; - } - ; - -room_align : '(' h_justif ',' v_justif ')' - { - $$.x = $2; - $$.y = $4; - } - | RANDOM_TYPE - { - $$.x = $$.y = ERR; - } - ; - -room_size : '(' INTEGER ',' INTEGER ')' - { - $$.width = $2; - $$.height = $4; - } - | RANDOM_TYPE - { - $$.height = $$.width = ERR; - } - ; - -door_detail : ROOMDOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos - { - /* ERR means random here */ - if ($7 == ERR && $9 != ERR) { - lc_error("If the door wall is random, so must be its pos!"); - } else { - add_opvars(splev, "iiiio", - VA_PASS5((long)$9, (long)$5, (long)$3, - (long)$7, SPO_ROOM_DOOR)); - } - } - | DOOR_ID ':' door_state ',' ter_selection - { - add_opvars(splev, "io", VA_PASS2((long)$3, SPO_DOOR)); - } - ; - -secret : BOOLEAN - | RANDOM_TYPE - ; - -door_wall : dir_list - | RANDOM_TYPE - ; - -dir_list : DIRECTION - { - $$ = $1; - } - | DIRECTION '|' dir_list - { - $$ = ($1 | $3); - } - ; - -door_pos : INTEGER - | RANDOM_TYPE - ; - -map_definition : NOMAP_ID - { - add_opvars(splev, "ciisiio", - VA_PASS7(0, 0, 1, (char *) 0, 0, 0, SPO_MAP)); - max_x_map = COLNO-1; - max_y_map = ROWNO; - } - | GEOMETRY_ID ':' h_justif ',' v_justif roomfill MAP_ID - { - add_opvars(splev, "cii", - VA_PASS3(SP_COORD_PACK(($3), ($5)), - 1, (int) $6)); - scan_map($7, splev); - Free($7); - } - | GEOMETRY_ID ':' coord_or_var roomfill MAP_ID - { - add_opvars(splev, "ii", VA_PASS2(2, (int) $4)); - scan_map($5, splev); - Free($5); - } - ; - -h_justif : LEFT_OR_RIGHT - | CENTER - ; - -v_justif : TOP_OR_BOT - | CENTER - ; - -monster_detail : MONSTER_ID ':' monster_desc - { - add_opvars(splev, "io", VA_PASS2(0, SPO_MONSTER)); - } - | MONSTER_ID ':' monster_desc - { - add_opvars(splev, "io", VA_PASS2(1, SPO_MONSTER)); - in_container_obj++; - break_stmt_start(); - } - stmt_block - { - break_stmt_end(splev); - in_container_obj--; - add_opvars(splev, "o", VA_PASS1(SPO_END_MONINVENT)); - } - ; - -monster_desc : monster_or_var ',' coord_or_var monster_infos - { - /* nothing */ - } - ; - -monster_infos : /* nothing */ - { - struct opvar *stopit = New(struct opvar); - - set_opvar_int(stopit, SP_M_V_END); - add_opcode(splev, SPO_PUSH, stopit); - $$ = 0x0000; - } - | monster_infos ',' monster_info - { - if (( $1 & $3 )) - lc_error("MONSTER extra info defined twice."); - $$ = ( $1 | $3 ); - } - ; - -monster_info : string_expr - { - add_opvars(splev, "i", VA_PASS1(SP_M_V_NAME)); - $$ = 0x0001; - } - | MON_ATTITUDE - { - add_opvars(splev, "ii", - VA_PASS2((int) $1, SP_M_V_PEACEFUL)); - $$ = 0x0002; - } - | MON_ALERTNESS - { - add_opvars(splev, "ii", - VA_PASS2((int) $1, SP_M_V_ASLEEP)); - $$ = 0x0004; - } - | alignment_prfx - { - add_opvars(splev, "ii", - VA_PASS2((int) $1, SP_M_V_ALIGN)); - $$ = 0x0008; - } - | MON_APPEARANCE string_expr - { - add_opvars(splev, "ii", - VA_PASS2((int) $1, SP_M_V_APPEAR)); - $$ = 0x0010; - } - | FEMALE_ID - { - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_FEMALE)); - $$ = 0x0020; - } - | INVIS_ID - { - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_INVIS)); - $$ = 0x0040; - } - | CANCELLED_ID - { - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_CANCELLED)); - $$ = 0x0080; - } - | REVIVED_ID - { - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_REVIVED)); - $$ = 0x0100; - } - | AVENGE_ID - { - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_AVENGE)); - $$ = 0x0200; - } - | FLEEING_ID ':' integer_or_var - { - add_opvars(splev, "i", VA_PASS1(SP_M_V_FLEEING)); - $$ = 0x0400; - } - | BLINDED_ID ':' integer_or_var - { - add_opvars(splev, "i", VA_PASS1(SP_M_V_BLINDED)); - $$ = 0x0800; - } - | PARALYZED_ID ':' integer_or_var - { - add_opvars(splev, "i", VA_PASS1(SP_M_V_PARALYZED)); - $$ = 0x1000; - } - | STUNNED_ID - { - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_STUNNED)); - $$ = 0x2000; - } - | CONFUSED_ID - { - add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_CONFUSED)); - $$ = 0x4000; - } - | SEENTRAPS_ID ':' seen_trap_mask - { - add_opvars(splev, "ii", - VA_PASS2((int) $3, SP_M_V_SEENTRAPS)); - $$ = 0x8000; - } - ; - -seen_trap_mask : STRING - { - int token = get_trap_type($1); - - if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", $1); - Free($1); - $$ = (1L << (token - 1)); - } - | ALL_ID - { - $$ = (long) ~0; - } - | STRING '|' seen_trap_mask - { - int token = get_trap_type($1); - if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", $1); - - if ((1L << (token - 1)) & $3) - lc_error("Monster seen_traps, trap '%s' listed twice.", $1); - Free($1); - $$ = ((1L << (token - 1)) | $3); - } - ; - -object_detail : OBJECT_ID ':' object_desc - { - int cnt = 0; - - if (in_container_obj) - cnt |= SP_OBJ_CONTENT; - add_opvars(splev, "io", VA_PASS2(cnt, SPO_OBJECT)); - } - | COBJECT_ID ':' object_desc - { - int cnt = SP_OBJ_CONTAINER; - - if (in_container_obj) - cnt |= SP_OBJ_CONTENT; - add_opvars(splev, "io", VA_PASS2(cnt, SPO_OBJECT)); - in_container_obj++; - break_stmt_start(); - } - stmt_block - { - break_stmt_end(splev); - in_container_obj--; - add_opcode(splev, SPO_POP_CONTAINER, NULL); - } - ; - -object_desc : object_or_var object_infos - { - if (( $2 & 0x4000) && in_container_obj) - lc_error("Object cannot have a coord when contained."); - else if (!( $2 & 0x4000) && !in_container_obj) - lc_error("Object needs a coord when not contained."); - } - ; - -object_infos : /* nothing */ - { - struct opvar *stopit = New(struct opvar); - set_opvar_int(stopit, SP_O_V_END); - add_opcode(splev, SPO_PUSH, stopit); - $$ = 0x00; - } - | object_infos ',' object_info - { - if (( $1 & $3 )) - lc_error("OBJECT extra info '%s' defined twice.", curr_token); - $$ = ( $1 | $3 ); - } - ; - -object_info : CURSE_TYPE - { - add_opvars(splev, "ii", - VA_PASS2((int) $1, SP_O_V_CURSE)); - $$ = 0x0001; - } - | MONTYPE_ID ':' monster_or_var - { - add_opvars(splev, "i", VA_PASS1(SP_O_V_CORPSENM)); - $$ = 0x0002; - } - | all_ints_push - { - add_opvars(splev, "i", VA_PASS1(SP_O_V_SPE)); - $$ = 0x0004; - } - | NAME_ID ':' string_expr - { - add_opvars(splev, "i", VA_PASS1(SP_O_V_NAME)); - $$ = 0x0008; - } - | QUANTITY_ID ':' integer_or_var - { - add_opvars(splev, "i", VA_PASS1(SP_O_V_QUAN)); - $$ = 0x0010; - } - | BURIED_ID - { - add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_BURIED)); - $$ = 0x0020; - } - | LIGHT_STATE - { - add_opvars(splev, "ii", VA_PASS2((int) $1, SP_O_V_LIT)); - $$ = 0x0040; - } - | ERODED_ID ':' integer_or_var - { - add_opvars(splev, "i", VA_PASS1(SP_O_V_ERODED)); - $$ = 0x0080; - } - | ERODEPROOF_ID - { - add_opvars(splev, "ii", VA_PASS2(-1, SP_O_V_ERODED)); - $$ = 0x0080; - } - | DOOR_STATE - { - if ($1 == D_LOCKED) { - add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_LOCKED)); - $$ = 0x0100; - } else if ($1 == D_BROKEN) { - add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_BROKEN)); - $$ = 0x0200; - } else - lc_error("DOOR state can only be locked or broken."); - } - | TRAPPED_STATE - { - add_opvars(splev, "ii", - VA_PASS2((int) $1, SP_O_V_TRAPPED)); - $$ = 0x0400; - } - | RECHARGED_ID ':' integer_or_var - { - add_opvars(splev, "i", VA_PASS1(SP_O_V_RECHARGED)); - $$ = 0x0800; - } - | INVIS_ID - { - add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_INVIS)); - $$ = 0x1000; - } - | GREASED_ID - { - add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_GREASED)); - $$ = 0x2000; - } - | coord_or_var - { - add_opvars(splev, "i", VA_PASS1(SP_O_V_COORD)); - $$ = 0x4000; - } - ; - -trap_detail : TRAP_ID ':' trap_name ',' coord_or_var - { - add_opvars(splev, "io", VA_PASS2((int) $3, SPO_TRAP)); - } - ; - -drawbridge_detail: DRAWBRIDGE_ID ':' coord_or_var ',' DIRECTION ',' door_state - { - long dir, state = 0; - - /* convert dir from a DIRECTION to a DB_DIR */ - dir = $5; - switch (dir) { - case W_NORTH: dir = DB_NORTH; break; - case W_SOUTH: dir = DB_SOUTH; break; - case W_EAST: dir = DB_EAST; break; - case W_WEST: dir = DB_WEST; break; - default: - lc_error("Invalid drawbridge direction."); - break; - } - - if ( $7 == D_ISOPEN ) - state = 1; - else if ( $7 == D_CLOSED ) - state = 0; - else if ( $7 == -1 ) - state = -1; - else - lc_error("A drawbridge can only be open, closed or random!"); - add_opvars(splev, "iio", - VA_PASS3(state, dir, SPO_DRAWBRIDGE)); - } - ; - -mazewalk_detail : MAZEWALK_ID ':' coord_or_var ',' DIRECTION - { - add_opvars(splev, "iiio", - VA_PASS4((int) $5, 1, 0, SPO_MAZEWALK)); - } - | MAZEWALK_ID ':' coord_or_var ',' DIRECTION ',' BOOLEAN opt_fillchar - { - add_opvars(splev, "iiio", - VA_PASS4((int) $5, (int) $7, - (int) $8, SPO_MAZEWALK)); - } - ; - -wallify_detail : WALLIFY_ID - { - add_opvars(splev, "rio", - VA_PASS3(SP_REGION_PACK(-1,-1,-1,-1), - 0, SPO_WALLIFY)); - } - | WALLIFY_ID ':' ter_selection - { - add_opvars(splev, "io", VA_PASS2(1, SPO_WALLIFY)); - } - ; - -ladder_detail : LADDER_ID ':' coord_or_var ',' UP_OR_DOWN - { - add_opvars(splev, "io", - VA_PASS2((int) $5, SPO_LADDER)); - } - ; - -stair_detail : STAIR_ID ':' coord_or_var ',' UP_OR_DOWN - { - add_opvars(splev, "io", - VA_PASS2((int) $5, SPO_STAIR)); - } - ; - -stair_region : STAIR_ID ':' lev_region ',' lev_region ',' UP_OR_DOWN - { - add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14($3.x1, $3.y1, $3.x2, $3.y2, $3.area, - $5.x1, $5.y1, $5.x2, $5.y2, $5.area, - (long) (($7) ? LR_UPSTAIR : LR_DOWNSTAIR), - 0, (char *) 0, SPO_LEVREGION)); - } - ; - -portal_region : PORTAL_ID ':' lev_region ',' lev_region ',' STRING - { - add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14($3.x1, $3.y1, $3.x2, $3.y2, $3.area, - $5.x1, $5.y1, $5.x2, $5.y2, $5.area, - LR_PORTAL, 0, $7, SPO_LEVREGION)); - Free($7); - } - ; - -teleprt_region : TELEPRT_ID ':' lev_region ',' lev_region teleprt_detail - { - long rtyp = 0; - switch($6) { - case -1: rtyp = LR_TELE; break; - case 0: rtyp = LR_DOWNTELE; break; - case 1: rtyp = LR_UPTELE; break; - } - add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14($3.x1, $3.y1, $3.x2, $3.y2, $3.area, - $5.x1, $5.y1, $5.x2, $5.y2, $5.area, - rtyp, 0, (char *)0, SPO_LEVREGION)); - } - ; - -branch_region : BRANCH_ID ':' lev_region ',' lev_region - { - add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14($3.x1, $3.y1, $3.x2, $3.y2, $3.area, - $5.x1, $5.y1, $5.x2, $5.y2, $5.area, - (long) LR_BRANCH, 0, - (char *) 0, SPO_LEVREGION)); - } - ; - -teleprt_detail : /* empty */ - { - $$ = -1; - } - | ',' UP_OR_DOWN - { - $$ = $2; - } - ; - -fountain_detail : FOUNTAIN_ID ':' ter_selection - { - add_opvars(splev, "o", VA_PASS1(SPO_FOUNTAIN)); - } - ; - -sink_detail : SINK_ID ':' ter_selection - { - add_opvars(splev, "o", VA_PASS1(SPO_SINK)); - } - ; - -pool_detail : POOL_ID ':' ter_selection - { - add_opvars(splev, "o", VA_PASS1(SPO_POOL)); - } - ; - -terrain_type : CHAR - { - $$.lit = -2; - $$.ter = what_map_char((char) $1); - } - | '(' CHAR ',' light_state ')' - { - $$.lit = $4; - $$.ter = what_map_char((char) $2); - } - ; - -replace_terrain_detail : REPLACE_TERRAIN_ID ':' region_or_var ',' mapchar_or_var ',' mapchar_or_var ',' SPERCENT - { - add_opvars(splev, "io", - VA_PASS2($9, SPO_REPLACETERRAIN)); - } - ; - -terrain_detail : TERRAIN_ID ':' ter_selection ',' mapchar_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_TERRAIN)); - } - ; - -diggable_detail : NON_DIGGABLE_ID ':' region_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_NON_DIGGABLE)); - } - ; - -passwall_detail : NON_PASSWALL_ID ':' region_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_NON_PASSWALL)); - } - ; - -region_detail : REGION_ID ':' region_or_var ',' light_state ',' room_type optroomregionflags - { - long irr; - long rt = $7; - long rflags = $8; - - if (rflags == -1) rflags = (1 << 0); - if (!(rflags & 1)) rt += MAXRTYPE+1; - irr = ((rflags & 2) != 0); - add_opvars(splev, "iiio", - VA_PASS4((long)$5, rt, rflags, SPO_REGION)); - $$ = (irr || (rflags & 1) || rt != OROOM); - break_stmt_start(); - } - region_detail_end - { - break_stmt_end(splev); - if ( $9 ) { - add_opcode(splev, SPO_ENDROOM, NULL); - } else if ( $10 ) - lc_error("Cannot use lev statements in non-permanent REGION"); - } - ; - -region_detail_end : /* nothing */ - { - $$ = 0; - } - | stmt_block - { - $$ = $1; - } - ; - -altar_detail : ALTAR_ID ':' coord_or_var ',' alignment ',' altar_type - { - add_opvars(splev, "iio", - VA_PASS3((long)$7, (long)$5, SPO_ALTAR)); - } - ; - -grave_detail : GRAVE_ID ':' coord_or_var ',' string_expr - { - add_opvars(splev, "io", VA_PASS2(2, SPO_GRAVE)); - } - | GRAVE_ID ':' coord_or_var ',' RANDOM_TYPE - { - add_opvars(splev, "sio", - VA_PASS3((char *)0, 1, SPO_GRAVE)); - } - | GRAVE_ID ':' coord_or_var - { - add_opvars(splev, "sio", - VA_PASS3((char *)0, 0, SPO_GRAVE)); - } - ; - -gold_detail : GOLD_ID ':' math_expr_var ',' coord_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_GOLD)); - } - ; - -engraving_detail: ENGRAVING_ID ':' coord_or_var ',' engraving_type ',' string_expr - { - add_opvars(splev, "io", - VA_PASS2((long)$5, SPO_ENGRAVING)); - } - ; - -mineralize : MINERALIZE_ID ':' integer_or_var ',' integer_or_var ',' integer_or_var ',' integer_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_MINERALIZE)); - } - | MINERALIZE_ID - { - add_opvars(splev, "iiiio", - VA_PASS5(-1L, -1L, -1L, -1L, SPO_MINERALIZE)); - } - ; - -trap_name : STRING - { - int token = get_trap_type($1); - if (token == ERR) - lc_error("Unknown trap type '%s'!", $1); - $$ = token; - Free($1); - } - | RANDOM_TYPE - ; - -room_type : STRING - { - int token = get_room_type($1); - if (token == ERR) { - lc_warning("Unknown room type \"%s\"! Making ordinary room...", $1); - $$ = OROOM; - } else - $$ = token; - Free($1); - } - | RANDOM_TYPE - ; - -optroomregionflags : /* empty */ - { - $$ = -1; - } - | ',' roomregionflags - { - $$ = $2; - } - ; - -roomregionflags : roomregionflag - { - $$ = $1; - } - | roomregionflag ',' roomregionflags - { - $$ = $1 | $3; - } - ; - -/* 0 is the "default" here */ -roomregionflag : FILLING - { - $$ = ($1 << 0); - } - | IRREGULAR - { - $$ = ($1 << 1); - } - | JOINED - { - $$ = ($1 << 2); - } - ; - -door_state : DOOR_STATE - | RANDOM_TYPE - ; - -light_state : LIGHT_STATE - | RANDOM_TYPE - ; - -alignment : ALIGNMENT - | a_register - | RANDOM_TYPE - { - $$ = - MAX_REGISTERS - 1; - } - ; - -alignment_prfx : ALIGNMENT - | a_register - | A_REGISTER ':' RANDOM_TYPE - { - $$ = - MAX_REGISTERS - 1; - } - ; - -altar_type : ALTAR_TYPE - | RANDOM_TYPE - ; - -a_register : A_REGISTER '[' INTEGER ']' - { - if ( $3 >= 3 ) - lc_error("Register Index overflow!"); - else - $$ = - $3 - 1; - } - ; - -string_or_var : STRING - { - add_opvars(splev, "s", VA_PASS1($1)); - Free($1); - } - | VARSTRING_STRING - { - check_vardef_type(vardefs, $1, SPOVAR_STRING); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - | VARSTRING_STRING_ARRAY '[' math_expr_var ']' - { - check_vardef_type(vardefs, $1, - SPOVAR_STRING | SPOVAR_ARRAY); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - ; - - -integer_or_var : math_expr_var - { - /* nothing */ - } - ; - -coord_or_var : encodecoord - { - add_opvars(splev, "c", VA_PASS1($1)); - } - | rndcoord_ID '(' ter_selection ')' - { - add_opvars(splev, "o", VA_PASS1(SPO_SEL_RNDCOORD)); - } - | VARSTRING_COORD - { - check_vardef_type(vardefs, $1, SPOVAR_COORD); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - | VARSTRING_COORD_ARRAY '[' math_expr_var ']' - { - check_vardef_type(vardefs, $1, - SPOVAR_COORD | SPOVAR_ARRAY); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - ; - -encodecoord : '(' INTEGER ',' INTEGER ')' - { - if ($2 < 0 || $4 < 0 || $2 >= COLNO || $4 >= ROWNO) - lc_error("Coordinates (%li,%li) out of map range!", - $2, $4); - $$ = SP_COORD_PACK($2, $4); - } - | RANDOM_TYPE - { - $$ = SP_COORD_PACK_RANDOM(0); - } - | RANDOM_TYPE_BRACKET humidity_flags ']' - { - $$ = SP_COORD_PACK_RANDOM($2); - } - ; - -humidity_flags : HUMIDITY_TYPE - { - $$ = $1; - } - | HUMIDITY_TYPE ',' humidity_flags - { - if (($1 & $3)) - lc_warning("Humidity flag used twice."); - $$ = ($1 | $3); - } - ; - -region_or_var : encoderegion - { - /* nothing */ - } - | VARSTRING_REGION - { - check_vardef_type(vardefs, $1, SPOVAR_REGION); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - | VARSTRING_REGION_ARRAY '[' math_expr_var ']' - { - check_vardef_type(vardefs, $1, - SPOVAR_REGION | SPOVAR_ARRAY); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - ; - -encoderegion : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' - { - long r = SP_REGION_PACK($2, $4, $6, $8); - - if ($2 > $6 || $4 > $8) - lc_error("Region start > end: (%ld,%ld,%ld,%ld)!", - $2, $4, $6, $8); - - add_opvars(splev, "r", VA_PASS1(r)); - $$ = r; - } - ; - -mapchar_or_var : mapchar - { - add_opvars(splev, "m", VA_PASS1($1)); - } - | VARSTRING_MAPCHAR - { - check_vardef_type(vardefs, $1, SPOVAR_MAPCHAR); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - | VARSTRING_MAPCHAR_ARRAY '[' math_expr_var ']' - { - check_vardef_type(vardefs, $1, - SPOVAR_MAPCHAR | SPOVAR_ARRAY); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - ; - -mapchar : CHAR - { - if (what_map_char((char) $1) != INVALID_TYPE) - $$ = SP_MAPCHAR_PACK(what_map_char((char) $1), -2); - else { - lc_error("Unknown map char type '%c'!", $1); - $$ = SP_MAPCHAR_PACK(STONE, -2); - } - } - | '(' CHAR ',' light_state ')' - { - if (what_map_char((char) $2) != INVALID_TYPE) - $$ = SP_MAPCHAR_PACK(what_map_char((char) $2), $4); - else { - lc_error("Unknown map char type '%c'!", $2); - $$ = SP_MAPCHAR_PACK(STONE, $4); - } - } - ; - -monster_or_var : encodemonster - { - add_opvars(splev, "M", VA_PASS1($1)); - } - | VARSTRING_MONST - { - check_vardef_type(vardefs, $1, SPOVAR_MONST); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - | VARSTRING_MONST_ARRAY '[' math_expr_var ']' - { - check_vardef_type(vardefs, $1, - SPOVAR_MONST | SPOVAR_ARRAY); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - ; - -encodemonster : STRING - { - long m = get_monster_id($1, (char)0); - if (m == ERR) { - lc_error("Unknown monster \"%s\"!", $1); - $$ = -1; - } else - $$ = SP_MONST_PACK(m, - def_monsyms[(int) mons[m].mlet].sym); - Free($1); - } - | CHAR - { - if (check_monster_char((char) $1)) - $$ = SP_MONST_PACK(-1, $1); - else { - lc_error("Unknown monster class '%c'!", $1); - $$ = -1; - } - } - | '(' CHAR ',' STRING ')' - { - long m = get_monster_id($4, (char) $2); - if (m == ERR) { - lc_error("Unknown monster ('%c', \"%s\")!", $2, $4); - $$ = -1; - } else - $$ = SP_MONST_PACK(m, $2); - Free($4); - } - | RANDOM_TYPE - { - $$ = -1; - } - ; - -object_or_var : encodeobj - { - add_opvars(splev, "O", VA_PASS1($1)); - } - | VARSTRING_OBJ - { - check_vardef_type(vardefs, $1, SPOVAR_OBJ); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - | VARSTRING_OBJ_ARRAY '[' math_expr_var ']' - { - check_vardef_type(vardefs, $1, - SPOVAR_OBJ | SPOVAR_ARRAY); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - ; - -encodeobj : STRING - { - long m = get_object_id($1, (char)0); - if (m == ERR) { - lc_error("Unknown object \"%s\"!", $1); - $$ = -1; - } else - /* obj class != 0 to force generation of a specific item */ - $$ = SP_OBJ_PACK(m, 1); - Free($1); - } - | CHAR - { - if (check_object_char((char) $1)) - $$ = SP_OBJ_PACK(-1, $1); - else { - lc_error("Unknown object class '%c'!", $1); - $$ = -1; - } - } - | '(' CHAR ',' STRING ')' - { - long m = get_object_id($4, (char) $2); - if (m == ERR) { - lc_error("Unknown object ('%c', \"%s\")!", $2, $4); - $$ = -1; - } else - $$ = SP_OBJ_PACK(m, $2); - Free($4); - } - | RANDOM_TYPE - { - $$ = -1; - } - ; - - -string_expr : string_or_var { } - | string_expr '.' string_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_MATH_ADD)); - } - ; - -math_expr_var : INTEGER - { - add_opvars(splev, "i", VA_PASS1($1)); - } - | dice - { - is_inconstant_number = 1; - } - | '(' MINUS_INTEGER ')' - { - add_opvars(splev, "i", VA_PASS1($2)); - } - | VARSTRING_INT - { - check_vardef_type(vardefs, $1, SPOVAR_INT); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - is_inconstant_number = 1; - } - | VARSTRING_INT_ARRAY '[' math_expr_var ']' - { - check_vardef_type(vardefs, $1, - SPOVAR_INT | SPOVAR_ARRAY); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - is_inconstant_number = 1; - } - | math_expr_var '+' math_expr_var - { - add_opvars(splev, "o", VA_PASS1(SPO_MATH_ADD)); - } - | math_expr_var '-' math_expr_var - { - add_opvars(splev, "o", VA_PASS1(SPO_MATH_SUB)); - } - | math_expr_var '*' math_expr_var - { - add_opvars(splev, "o", VA_PASS1(SPO_MATH_MUL)); - } - | math_expr_var '/' math_expr_var - { - add_opvars(splev, "o", VA_PASS1(SPO_MATH_DIV)); - } - | math_expr_var '%' math_expr_var - { - add_opvars(splev, "o", VA_PASS1(SPO_MATH_MOD)); - } - | '(' math_expr_var ')' { } - ; - -func_param_type : CFUNC_INT - { - if (!strcmp("int", $1) || !strcmp("integer", $1)) { - $$ = (int)'i'; - } else - lc_error("Unknown function parameter type '%s'", $1); - } - | CFUNC_STR - { - if (!strcmp("str", $1) || !strcmp("string", $1)) { - $$ = (int)'s'; - } else - lc_error("Unknown function parameter type '%s'", $1); - } - ; - -func_param_part : any_var_or_arr ':' func_param_type - { - struct lc_funcdefs_parm *tmp = New(struct lc_funcdefs_parm); - - if (!curr_function) { - lc_error("Function parameters outside function definition."); - } else if (!tmp) { - lc_error("Could not alloc function params."); - } else { - long vt = SPOVAR_NULL; - - tmp->name = strdup($1); - tmp->parmtype = (char) $3; - tmp->next = curr_function->params; - curr_function->params = tmp; - curr_function->n_params++; - switch (tmp->parmtype) { - case 'i': - vt = SPOVAR_INT; - break; - case 's': - vt = SPOVAR_STRING; - break; - default: - lc_error("Unknown func param conversion."); - break; - } - vardefs = add_vardef_type( vardefs, $1, vt); - } - Free($1); - } - ; - -func_param_list : func_param_part - | func_param_list ',' func_param_part - ; - -func_params_list : /* nothing */ - | func_param_list - ; - -func_call_param_part : math_expr_var - { - $$ = (int)'i'; - } - | string_expr - { - $$ = (int)'s'; - } - ; - - -func_call_param_list : func_call_param_part - { - char tmpbuf[2]; - tmpbuf[0] = (char) $1; - tmpbuf[1] = '\0'; - $$ = strdup(tmpbuf); - } - | func_call_param_list ',' func_call_param_part - { - long len = strlen( $1 ); - char *tmp = (char *) alloc(len + 2); - sprintf(tmp, "%c%s", (char) $3, $1 ); - Free( $1 ); - $$ = tmp; - } - ; - -func_call_params_list : /* nothing */ - { - $$ = strdup(""); - } - | func_call_param_list - { - char *tmp = strdup( $1 ); - Free( $1 ); - $$ = tmp; - } - ; - -ter_selection_x : coord_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_SEL_POINT)); - } - | rect_ID region_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_SEL_RECT)); - } - | fillrect_ID region_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_SEL_FILLRECT)); - } - | line_ID coord_or_var ',' coord_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_SEL_LINE)); - } - | randline_ID coord_or_var ',' coord_or_var ',' math_expr_var - { - /* randline (x1,y1),(x2,y2), roughness */ - add_opvars(splev, "o", VA_PASS1(SPO_SEL_RNDLINE)); - } - | grow_ID '(' ter_selection ')' - { - add_opvars(splev, "io", VA_PASS2(W_ANY, SPO_SEL_GROW)); - } - | grow_ID '(' dir_list ',' ter_selection ')' - { - add_opvars(splev, "io", VA_PASS2($3, SPO_SEL_GROW)); - } - | filter_ID '(' SPERCENT ',' ter_selection ')' - { - add_opvars(splev, "iio", - VA_PASS3($3, SPOFILTER_PERCENT, SPO_SEL_FILTER)); - } - | filter_ID '(' ter_selection ',' ter_selection ')' - { - add_opvars(splev, "io", - VA_PASS2(SPOFILTER_SELECTION, SPO_SEL_FILTER)); - } - | filter_ID '(' mapchar_or_var ',' ter_selection ')' - { - add_opvars(splev, "io", - VA_PASS2(SPOFILTER_MAPCHAR, SPO_SEL_FILTER)); - } - | flood_ID coord_or_var - { - add_opvars(splev, "o", VA_PASS1(SPO_SEL_FLOOD)); - } - | circle_ID '(' coord_or_var ',' math_expr_var ')' - { - add_opvars(splev, "oio", - VA_PASS3(SPO_COPY, 1, SPO_SEL_ELLIPSE)); - } - | circle_ID '(' coord_or_var ',' math_expr_var ',' FILLING ')' - { - add_opvars(splev, "oio", - VA_PASS3(SPO_COPY, $7, SPO_SEL_ELLIPSE)); - } - | ellipse_ID '(' coord_or_var ',' math_expr_var ',' math_expr_var ')' - { - add_opvars(splev, "io", VA_PASS2(1, SPO_SEL_ELLIPSE)); - } - | ellipse_ID '(' coord_or_var ',' math_expr_var ',' math_expr_var ',' FILLING ')' - { - add_opvars(splev, "io", VA_PASS2($9, SPO_SEL_ELLIPSE)); - } - | gradient_ID '(' GRADIENT_TYPE ',' '(' math_expr_var '-' math_expr_var opt_limited ')' ',' coord_or_var opt_coord_or_var ')' - { - add_opvars(splev, "iio", - VA_PASS3($9, $3, SPO_SEL_GRADIENT)); - } - | complement_ID ter_selection_x - { - add_opvars(splev, "o", VA_PASS1(SPO_SEL_COMPLEMENT)); - } - | VARSTRING_SEL - { - check_vardef_type(vardefs, $1, SPOVAR_SEL); - vardef_used(vardefs, $1); - add_opvars(splev, "v", VA_PASS1($1)); - Free($1); - } - | '(' ter_selection ')' - { - /* nothing */ - } - ; - -ter_selection : ter_selection_x - { - /* nothing */ - } - | ter_selection_x '&' ter_selection - { - add_opvars(splev, "o", VA_PASS1(SPO_SEL_ADD)); - } - ; - -dice : DICE - { - add_opvars(splev, "iio", - VA_PASS3($1.num, $1.die, SPO_DICE)); - } - ; - -all_integers : MINUS_INTEGER - | PLUS_INTEGER - | INTEGER - ; - -all_ints_push : MINUS_INTEGER - { - add_opvars(splev, "i", VA_PASS1($1)); - } - | PLUS_INTEGER - { - add_opvars(splev, "i", VA_PASS1($1)); - } - | INTEGER - { - add_opvars(splev, "i", VA_PASS1($1)); - } - | dice - { - /* nothing */ - } - ; - -objectid : object_ID - | OBJECT_ID - ; - -monsterid : monster_ID - | MONSTER_ID - ; - -terrainid : terrain_ID - | TERRAIN_ID - ; - -engraving_type : ENGRAVING_TYPE - | RANDOM_TYPE - ; - -lev_region : region - { - $$ = $1; - } - | LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' - { - if ($3 <= 0 || $3 >= COLNO) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of level range (x1)!", - $3, $5, $7, $9); - else if ($5 < 0 || $5 >= ROWNO) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of level range (y1)!", - $3, $5, $7, $9); - else if ($7 <= 0 || $7 >= COLNO) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of level range (x2)!", - $3, $5, $7, $9); - else if ($9 < 0 || $9 >= ROWNO) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of level range (y2)!", - $3, $5, $7, $9); - $$.x1 = $3; - $$.y1 = $5; - $$.x2 = $7; - $$.y2 = $9; - $$.area = 1; - } - ; - -region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' - { -/* This series of if statements is a hack for MSC 5.1. It seems that its - tiny little brain cannot compile if these are all one big if statement. */ - if ($2 < 0 || $2 > (int) max_x_map) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of map range (x1)!", - $2, $4, $6, $8); - else if ($4 < 0 || $4 > (int) max_y_map) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of map range (y1)!", - $2, $4, $6, $8); - else if ($6 < 0 || $6 > (int) max_x_map) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of map range (x2)!", - $2, $4, $6, $8); - else if ($8 < 0 || $8 > (int) max_y_map) - lc_error( - "Region (%ld,%ld,%ld,%ld) out of map range (y2)!", - $2, $4, $6, $8); - $$.area = 0; - $$.x1 = $2; - $$.y1 = $4; - $$.x2 = $6; - $$.y2 = $8; - } - ; - - -%% - -/*lev_comp.y*/ diff --git a/util/lev_main.c b/util/lev_main.c deleted file mode 100644 index d540cb5fd..000000000 --- a/util/lev_main.c +++ /dev/null @@ -1,1646 +0,0 @@ -/* NetHack 3.6 lev_main.c $NHDT-Date: 1543371692 2018/11/28 02:21:32 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.56 $ */ -/* Copyright (c) 1989 by Jean-Christophe Collet */ -/* NetHack may be freely redistributed. See license for details. */ - -/* - * This file contains the main function for the parser - * and some useful functions needed by yacc - */ -#define SPEC_LEV /* for USE_OLDARGS (sp_lev.h) and for MPW (macconf.h) */ - -#define NEED_VARARGS -#include "hack.h" -#include "date.h" -#include "sp_lev.h" -#ifdef STRICT_REF_DEF -#include "tcap.h" -#endif -#include - -#ifdef MAC -#if defined(__SC__) || defined(__MRC__) -#define MPWTOOL -#define PREFIX ":dungeon:" /* place output files here */ -#include -#else -#if !defined(__MACH__) -#define PREFIX ":lib:" /* place output files here */ -#endif -#endif -#endif - -#ifdef WIN_CE -#define PREFIX "\\nethack\\dat\\" -#endif - -#ifndef MPWTOOL -#define SpinCursor(x) -#endif - -#if defined(AMIGA) && defined(DLB) -#define PREFIX "NH:slib/" -#endif - -#ifndef O_WRONLY -#include -#endif -#ifndef O_CREAT /* some older BSD systems do not define O_CREAT in \ - */ -#include -#endif -#ifndef O_BINARY /* used for micros, no-op for others */ -#define O_BINARY 0 -#endif - -#if defined(MICRO) || defined(WIN32) -#define OMASK FCMASK -#else -#define OMASK 0644 -#endif - -#define ERR (-1) - -#define NewTab(type, size) (type **) alloc(sizeof(type *) * size) -#define Free(ptr) \ - if (ptr) \ - free((genericptr_t)(ptr)) -/* write() returns a signed value but its size argument is unsigned; - types might be int and unsigned or ssize_t and size_t; casting - to long should be safe for all permutations (even if size_t is - bigger, since the values involved won't be too big for long) */ -#define Write(fd, item, size) \ - if ((long) write(fd, (genericptr_t)(item), size) != (long) (size)) \ - return FALSE; - -#if defined(__BORLANDC__) && !defined(_WIN32) -extern unsigned _stklen = STKSIZ; -#endif -#define MAX_ERRORS 25 - -extern int NDECL(yyparse); -extern void FDECL(init_yyin, (FILE *)); -extern void FDECL(init_yyout, (FILE *)); - -int FDECL(main, (int, char **)); -void FDECL(yyerror, (const char *)); -void FDECL(yywarning, (const char *)); -int NDECL(yywrap); -int FDECL(get_floor_type, (CHAR_P)); -int FDECL(get_room_type, (char *)); -int FDECL(get_trap_type, (char *)); -int FDECL(get_monster_id, (char *, CHAR_P)); -int FDECL(get_object_id, (char *, CHAR_P)); -boolean FDECL(check_monster_char, (CHAR_P)); -boolean FDECL(check_object_char, (CHAR_P)); -char FDECL(what_map_char, (CHAR_P)); -void FDECL(scan_map, (char *, sp_lev *)); -boolean NDECL(check_subrooms); -boolean FDECL(write_level_file, (char *, sp_lev *)); - -struct lc_funcdefs *FDECL(funcdef_new, (long, char *)); -void FDECL(funcdef_free_all, (struct lc_funcdefs *)); -struct lc_funcdefs *FDECL(funcdef_defined, - (struct lc_funcdefs *, char *, int)); - -struct lc_vardefs *FDECL(vardef_new, (long, char *)); -void FDECL(vardef_free_all, (struct lc_vardefs *)); -struct lc_vardefs *FDECL(vardef_defined, (struct lc_vardefs *, char *, int)); - -void FDECL(splev_add_from, (sp_lev *, sp_lev *)); - -void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); - -static boolean FDECL(write_common_data, (int)); -static boolean FDECL(write_maze, (int, sp_lev *)); -static void NDECL(init_obj_classes); -static int FDECL(case_insensitive_comp, (const char *, const char *)); - -void VDECL(lc_pline, (const char *, ...)); -void VDECL(lc_error, (const char *, ...)); -void VDECL(lc_warning, (const char *, ...)); -char *FDECL(decode_parm_chr, (CHAR_P)); -char *FDECL(decode_parm_str, (char *)); -struct opvar *FDECL(set_opvar_int, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_coord, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_region, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_mapchar, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_monst, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_obj, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_str, (struct opvar *, const char *)); -struct opvar *FDECL(set_opvar_var, (struct opvar *, const char *)); -void VDECL(add_opvars, (sp_lev *, const char *, ...)); -void NDECL(break_stmt_start); -void FDECL(break_stmt_end, (sp_lev *)); -void FDECL(break_stmt_new, (sp_lev *, long)); -char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *)); -const char *FDECL(spovar2str, (long)); -void FDECL(vardef_used, (struct lc_vardefs *, char *)); -void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long)); -struct lc_vardefs *FDECL(add_vardef_type, - (struct lc_vardefs *, char *, long)); -int FDECL(reverse_jmp_opcode, (int)); -struct opvar *FDECL(opvar_clone, (struct opvar *)); -void FDECL(start_level_def, (sp_lev **, char *)); - -static struct { - const char *name; - int type; -} trap_types[] = { { "arrow", ARROW_TRAP }, - { "dart", DART_TRAP }, - { "falling rock", ROCKTRAP }, - { "board", SQKY_BOARD }, - { "bear", BEAR_TRAP }, - { "land mine", LANDMINE }, - { "rolling boulder", ROLLING_BOULDER_TRAP }, - { "sleep gas", SLP_GAS_TRAP }, - { "rust", RUST_TRAP }, - { "fire", FIRE_TRAP }, - { "pit", PIT }, - { "spiked pit", SPIKED_PIT }, - { "hole", HOLE }, - { "trap door", TRAPDOOR }, - { "teleport", TELEP_TRAP }, - { "level teleport", LEVEL_TELEP }, - { "magic portal", MAGIC_PORTAL }, - { "web", WEB }, - { "statue", STATUE_TRAP }, - { "magic", MAGIC_TRAP }, - { "anti magic", ANTI_MAGIC }, - { "polymorph", POLY_TRAP }, - { "vibrating square", VIBRATING_SQUARE }, - { 0, 0 } }; - -static struct { - const char *name; - int type; -} room_types[] = { - /* for historical reasons, room types are not contiguous numbers */ - /* (type 1 is skipped) */ - { "ordinary", OROOM }, - { "throne", COURT }, - { "swamp", SWAMP }, - { "vault", VAULT }, - { "beehive", BEEHIVE }, - { "morgue", MORGUE }, - { "barracks", BARRACKS }, - { "zoo", ZOO }, - { "delphi", DELPHI }, - { "temple", TEMPLE }, - { "anthole", ANTHOLE }, - { "cocknest", COCKNEST }, - { "leprehall", LEPREHALL }, - { "shop", SHOPBASE }, - { "armor shop", ARMORSHOP }, - { "scroll shop", SCROLLSHOP }, - { "potion shop", POTIONSHOP }, - { "weapon shop", WEAPONSHOP }, - { "food shop", FOODSHOP }, - { "ring shop", RINGSHOP }, - { "wand shop", WANDSHOP }, - { "tool shop", TOOLSHOP }, - { "book shop", BOOKSHOP }, - { "health food shop", FODDERSHOP }, - { "candle shop", CANDLESHOP }, - { 0, 0 } -}; - -const char *fname = "(stdin)"; -int fatal_error = 0; -int got_errors = 0; -int be_verbose = 0; -int fname_counter = 1; - -#ifdef FLEX23_BUG -/* Flex 2.3 bug work around; not needed for 2.3.6 or later */ -int yy_more_len = 0; -#endif - -extern unsigned int max_x_map, max_y_map; - -extern int nh_line_number; - -extern int token_start_pos; -extern char curr_token[512]; - -struct lc_vardefs *vardefs = NULL; -struct lc_funcdefs *function_definitions = NULL; - -extern int allow_break_statements; -extern struct lc_breakdef *break_list; - -int -main(argc, argv) -int argc; -char **argv; -{ - FILE *fin; - int i; - boolean errors_encountered = FALSE; -#if defined(MAC) && (defined(THINK_C) || defined(__MWERKS__)) - static char *mac_argv[] = { - "lev_comp", /* dummy argv[0] */ - ":dat:Arch.des", ":dat:Barb.des", ":dat:Caveman.des", - ":dat:Healer.des", ":dat:Knight.des", ":dat:Monk.des", - ":dat:Priest.des", ":dat:Ranger.des", ":dat:Rogue.des", - ":dat:Samurai.des", ":dat:Tourist.des", ":dat:Valkyrie.des", - ":dat:Wizard.des", ":dat:bigroom.des", ":dat:castle.des", - ":dat:endgame.des", ":dat:gehennom.des", ":dat:knox.des", - ":dat:medusa.des", ":dat:mines.des", ":dat:oracle.des", - ":dat:sokoban.des", ":dat:tower.des", ":dat:yendor.des" - }; - - argc = SIZE(mac_argv); - argv = mac_argv; -#endif - - decl_globals_init(); - objects_globals_init(); - monst_globals_init(); - - /* this one does something... */ - init_obj_classes(); - - init_yyout(stdout); - if (argc == 1) { /* Read standard input */ - init_yyin(stdin); - (void) yyparse(); - if (fatal_error > 0) { - errors_encountered = TRUE; - } - } else { /* Otherwise every argument is a filename */ - for (i = 1; i < argc; i++) { - fname = argv[i]; - if (!strcmp(fname, "-v")) { - be_verbose++; - continue; - } - fin = freopen(fname, "r", stdin); - if (!fin) { - lc_pline("Can't open \"%s\" for input.\n", VA_PASS1(fname)); - perror(fname); - errors_encountered = TRUE; - } else { - fname_counter = 1; - init_yyin(fin); - (void) yyparse(); - nh_line_number = 1; - if (fatal_error > 0 || got_errors > 0) { - errors_encountered = TRUE; - fatal_error = 0; - } - } - } - } - exit(errors_encountered ? EXIT_FAILURE : EXIT_SUCCESS); - /*NOTREACHED*/ - return 0; -} - -/* - * Each time the parser detects an error, it uses this function. - * Here we take count of the errors. To continue farther than - * MAX_ERRORS wouldn't be reasonable. - * Assume that explicit calls from lev_comp.y have the 1st letter - * capitalized, to allow printing of the line containing the start of - * the current declaration, instead of the beginning of the next declaration. - */ -void -yyerror(s) -const char *s; -{ - char *e = ((char *) s + strlen(s) - 1); - - (void) fprintf(stderr, "%s: line %d, pos %d: %s", fname, nh_line_number, - token_start_pos - (int) strlen(curr_token), s); - if (*e != '.' && *e != '!') - (void) fprintf(stderr, " at \"%s\"", curr_token); - (void) fprintf(stderr, "\n"); - - if (++fatal_error > MAX_ERRORS) { - (void) fprintf(stderr, "Too many errors, good bye!\n"); - exit(EXIT_FAILURE); - } -} - -/* - * Just display a warning (that is : a non fatal error) - */ -void -yywarning(s) -const char *s; -{ - (void) fprintf(stderr, "%s: line %d : WARNING : %s\n", fname, - nh_line_number, s); -} - -/* - * Stub needed for lex interface. - */ -int -yywrap() -{ - return 1; -} - -/* - * lc_pline(): lev_comp version of pline(), stripped down version of - * core's pline(), with convoluted handling for variadic arguments to - * support , , and neither of the above. - * - * Using state for message/warning/error mode simplifies calling interface. - */ -#define LC_PLINE_MESSAGE 0 -#define LC_PLINE_WARNING 1 -#define LC_PLINE_ERROR 2 -static int lc_pline_mode = LC_PLINE_MESSAGE; - -#if defined(USE_STDARG) || defined(USE_VARARGS) -static void FDECL(lc_vpline, (const char *, va_list)); - -void lc_pline -VA_DECL(const char *, line) -{ - VA_START(line); - VA_INIT(line, char *); - lc_vpline(line, VA_ARGS); - VA_END(); -} - -#ifdef USE_STDARG -static void -lc_vpline(const char *line, va_list the_args) -#else -static void -lc_vpline(line, the_args) -const char *line; -va_list the_args; -#endif - -#else /* USE_STDARG | USE_VARARG */ - -#define lc_vpline lc_pline - -void -lc_pline -VA_DECL(const char *, line) -#endif /* USE_STDARG | USE_VARARG */ -{ /* opening brace for lc_vpline, nested block for USE_OLDARGS lc_pline */ - - char pbuf[3 * BUFSZ]; - static char nomsg[] = "(no message)"; - /* Do NOT use VA_START and VA_END in here... see above */ - - if (!line || !*line) - line = nomsg; /* shouldn't happen */ - if (index(line, '%')) { - Vsprintf(pbuf, line, VA_ARGS); - pbuf[BUFSZ - 1] = '\0'; /* truncate if long */ - line = pbuf; - } - switch (lc_pline_mode) { - case LC_PLINE_ERROR: - yyerror(line); - break; - case LC_PLINE_WARNING: - yywarning(line); - break; - default: - (void) fprintf(stderr, "%s\n", line); - break; - } - lc_pline_mode = LC_PLINE_MESSAGE; /* reset to default */ - return; -#if !(defined(USE_STDARG) || defined(USE_VARARGS)) - VA_END(); /* closing brace ofr USE_OLDARGS's nested block */ -#endif -} - -/*VARARGS1*/ -void -lc_error -VA_DECL(const char *, line) -{ - VA_START(line); - VA_INIT(line, const char *); - lc_pline_mode = LC_PLINE_ERROR; - lc_vpline(line, VA_ARGS); - VA_END(); - return; -} - -/*VARARGS1*/ -void -lc_warning -VA_DECL(const char *, line) -{ - VA_START(line); - VA_INIT(line, const char *); - lc_pline_mode = LC_PLINE_WARNING; - lc_vpline(line, VA_ARGS); - VA_END(); - return; -} - -char * -decode_parm_chr(chr) -char chr; -{ - static char buf[32]; - - switch (chr) { - default: - Strcpy(buf, "unknown"); - break; - case 'i': - Strcpy(buf, "int"); - break; - case 'r': - Strcpy(buf, "region"); - break; - case 's': - Strcpy(buf, "str"); - break; - case 'O': - Strcpy(buf, "obj"); - break; - case 'c': - Strcpy(buf, "coord"); - break; - case ' ': - Strcpy(buf, "nothing"); - break; - case 'm': - Strcpy(buf, "mapchar"); - break; - case 'M': - Strcpy(buf, "monster"); - break; - } - return buf; -} - -char * -decode_parm_str(str) -char *str; -{ - static char tmpbuf[1024]; - char *p = str; - tmpbuf[0] = '\0'; - if (str) { - for (; *p; p++) { - Strcat(tmpbuf, decode_parm_chr(*p)); - if (*(p + 1)) - Strcat(tmpbuf, ", "); - } - } - return tmpbuf; -} - -struct opvar * -set_opvar_int(ov, val) -struct opvar *ov; -long val; -{ - if (ov) { - ov->spovartyp = SPOVAR_INT; - ov->vardata.l = val; - } - return ov; -} - -struct opvar * -set_opvar_coord(ov, val) -struct opvar *ov; -long val; -{ - if (ov) { - ov->spovartyp = SPOVAR_COORD; - ov->vardata.l = val; - } - return ov; -} - -struct opvar * -set_opvar_region(ov, val) -struct opvar *ov; -long val; -{ - if (ov) { - ov->spovartyp = SPOVAR_REGION; - ov->vardata.l = val; - } - return ov; -} - -struct opvar * -set_opvar_mapchar(ov, val) -struct opvar *ov; -long val; -{ - if (ov) { - ov->spovartyp = SPOVAR_MAPCHAR; - ov->vardata.l = val; - } - return ov; -} - -struct opvar * -set_opvar_monst(ov, val) -struct opvar *ov; -long val; -{ - if (ov) { - ov->spovartyp = SPOVAR_MONST; - ov->vardata.l = val; - } - return ov; -} - -struct opvar * -set_opvar_obj(ov, val) -struct opvar *ov; -long val; -{ - if (ov) { - ov->spovartyp = SPOVAR_OBJ; - ov->vardata.l = val; - } - return ov; -} - -struct opvar * -set_opvar_str(ov, val) -struct opvar *ov; -const char *val; -{ - if (ov) { - ov->spovartyp = SPOVAR_STRING; - ov->vardata.str = (val) ? strdup(val) : NULL; - } - return ov; -} - -struct opvar * -set_opvar_var(ov, val) -struct opvar *ov; -const char *val; -{ - if (ov) { - ov->spovartyp = SPOVAR_VARIABLE; - ov->vardata.str = (val) ? strdup(val) : NULL; - } - return ov; -} - -#define New(type) \ - (type *) memset((genericptr_t) alloc(sizeof(type)), 0, sizeof(type)) - -#if defined(USE_STDARG) || defined(USE_VARARGS) -static void FDECL(vadd_opvars, (sp_lev *, const char *, va_list)); - -void add_opvars -VA_DECL2(sp_lev *, sp, const char *, fmt) -{ - VA_START(fmt); - VA_INIT(fmt, char *); - vadd_opvars(sp, fmt, VA_ARGS); - VA_END(); -} - -#ifdef USE_STDARG -static void -vadd_opvars(sp_lev *sp, const char *fmt, va_list the_args) - -#else -static void -vadd_opvars(sp, fmt, the_args) -sp_lev *sp; -const char *fmt; -va_list the_args; - -#endif - -#else /* USE_STDARG | USE_VARARG */ - -#define vadd_opvars add_opvars - -void add_opvars -VA_DECL2(sp_lev *, sp, const char *, fmt) -#endif /* USE_STDARG | USE_VARARG */ -{ - const char *p, *lp; - long la; - /* Do NOT use VA_START and VA_END in here... see above */ - - for (p = fmt; *p != '\0'; p++) { - switch (*p) { - case ' ': - break; - case 'i': /* integer (via plain 'int') */ - { - struct opvar *ov = New(struct opvar); - - set_opvar_int(ov, (long) VA_NEXT(la, int)); - add_opcode(sp, SPO_PUSH, ov); - break; - } - case 'l': /* integer (via 'long int') */ - { - struct opvar *ov = New(struct opvar); - - set_opvar_int(ov, VA_NEXT(la, long)); - add_opcode(sp, SPO_PUSH, ov); - break; - } - case 'c': /* coordinate */ - { - struct opvar *ov = New(struct opvar); - set_opvar_coord(ov, VA_NEXT(la, long)); - add_opcode(sp, SPO_PUSH, ov); - break; - } - case 'r': /* region */ - { - struct opvar *ov = New(struct opvar); - set_opvar_region(ov, VA_NEXT(la, long)); - add_opcode(sp, SPO_PUSH, ov); - break; - } - case 'm': /* mapchar */ - { - struct opvar *ov = New(struct opvar); - set_opvar_mapchar(ov, VA_NEXT(la, long)); - add_opcode(sp, SPO_PUSH, ov); - break; - } - case 'M': /* monster */ - { - struct opvar *ov = New(struct opvar); - set_opvar_monst(ov, VA_NEXT(la, long)); - add_opcode(sp, SPO_PUSH, ov); - break; - } - case 'O': /* object */ - { - struct opvar *ov = New(struct opvar); - set_opvar_obj(ov, VA_NEXT(la, long)); - add_opcode(sp, SPO_PUSH, ov); - break; - } - case 's': /* string */ - { - struct opvar *ov = New(struct opvar); - set_opvar_str(ov, VA_NEXT(lp, const char *)); - add_opcode(sp, SPO_PUSH, ov); - break; - } - case 'v': /* variable */ - { - struct opvar *ov = New(struct opvar); - set_opvar_var(ov, VA_NEXT(lp, const char *)); - add_opcode(sp, SPO_PUSH, ov); - break; - } - case 'o': /* opcode */ - { - long i = VA_NEXT(la, int); - if (i < 0 || i >= MAX_SP_OPCODES) - lc_pline("add_opvars: unknown opcode '%ld'.", VA_PASS1(i)); - add_opcode(sp, i, NULL); - break; - } - default: - lc_pline("add_opvars: illegal format character '%ld'.", - VA_PASS1((long) *p)); - break; - } - } - -#if !(defined(USE_STDARG) || defined(USE_VARARGS)) - /* provide closing brace for USE_OLDARGS nested block from VA_DECL2() */ - VA_END(); -#endif -} - -void -break_stmt_start() -{ - allow_break_statements++; -} - -void -break_stmt_end(splev) -sp_lev *splev; -{ - struct lc_breakdef *tmp = break_list; - struct lc_breakdef *prv = NULL; - - while (tmp) { - if (tmp->break_depth == allow_break_statements) { - struct lc_breakdef *nxt = tmp->next; - set_opvar_int(tmp->breakpoint, - splev->n_opcodes - tmp->breakpoint->vardata.l - 1); - tmp->next = NULL; - Free(tmp); - if (!prv) - break_list = NULL; - else - prv->next = nxt; - tmp = nxt; - } else { - prv = tmp; - tmp = tmp->next; - } - } - allow_break_statements--; -} - -void -break_stmt_new(splev, i) -sp_lev *splev; -long i; -{ - struct lc_breakdef *tmp = New(struct lc_breakdef); - - tmp->breakpoint = New(struct opvar); - tmp->break_depth = allow_break_statements; - tmp->next = break_list; - break_list = tmp; - set_opvar_int(tmp->breakpoint, i); - add_opcode(splev, SPO_PUSH, tmp->breakpoint); - add_opcode(splev, SPO_JMP, NULL); -} - -struct lc_funcdefs * -funcdef_new(addr, name) -long addr; -char *name; -{ - struct lc_funcdefs *f = New(struct lc_funcdefs); - - if (!f) { - lc_error("Could not alloc function definition for '%s'.", - VA_PASS1(name)); - return NULL; - } - f->next = NULL; - f->addr = addr; - f->name = strdup(name); - f->n_called = 0; - f->n_params = 0; - f->params = NULL; - f->code.opcodes = NULL; - f->code.n_opcodes = 0; - return f; -} - -void -funcdef_free_all(fchain) -struct lc_funcdefs *fchain; -{ - struct lc_funcdefs *tmp = fchain; - struct lc_funcdefs *nxt; - struct lc_funcdefs_parm *tmpparam; - - while (tmp) { - nxt = tmp->next; - Free(tmp->name); - while (tmp->params) { - tmpparam = tmp->params->next; - Free(tmp->params->name); - tmp->params = tmpparam; - } - /* FIXME: free tmp->code */ - Free(tmp); - tmp = nxt; - } -} - -char * -funcdef_paramtypes(f) -struct lc_funcdefs *f; -{ - int i = 0; - struct lc_funcdefs_parm *fp = f->params; - char *tmp = (char *) alloc((f->n_params) + 1); - - if (!tmp) - return NULL; - while (fp) { - tmp[i++] = fp->parmtype; - fp = fp->next; - } - tmp[i] = '\0'; - return tmp; -} - -struct lc_funcdefs * -funcdef_defined(f, name, casesense) -struct lc_funcdefs *f; -char *name; -int casesense; -{ - while (f) { - if (casesense) { - if (!strcmp(name, f->name)) - return f; - } else { - if (!case_insensitive_comp(name, f->name)) - return f; - } - f = f->next; - } - return NULL; -} - -struct lc_vardefs * -vardef_new(typ, name) -long typ; -char *name; -{ - struct lc_vardefs *f = New(struct lc_vardefs); - - if (!f) { - lc_error("Could not alloc variable definition for '%s'.", - VA_PASS1(name)); - return NULL; - } - f->next = NULL; - f->var_type = typ; - f->name = strdup(name); - f->n_used = 0; - return f; -} - -void -vardef_free_all(fchain) -struct lc_vardefs *fchain; -{ - struct lc_vardefs *tmp = fchain; - struct lc_vardefs *nxt; - - while (tmp) { - if (be_verbose && (tmp->n_used == 0)) - lc_warning("Unused variable '%s'", VA_PASS1(tmp->name)); - nxt = tmp->next; - Free(tmp->name); - Free(tmp); - tmp = nxt; - } -} - -struct lc_vardefs * -vardef_defined(f, name, casesense) -struct lc_vardefs *f; -char *name; -int casesense; -{ - while (f) { - if (casesense) { - if (!strcmp(name, f->name)) - return f; - } else { - if (!case_insensitive_comp(name, f->name)) - return f; - } - f = f->next; - } - return NULL; -} - -const char * -spovar2str(spovar) -long spovar; -{ - static int togl = 0; - static char buf[2][128]; - const char *n = NULL; - int is_array = (spovar & SPOVAR_ARRAY); - - spovar &= ~SPOVAR_ARRAY; - switch (spovar) { - default: - lc_error("spovar2str(%ld)", VA_PASS1(spovar)); - break; - case SPOVAR_INT: - n = "integer"; - break; - case SPOVAR_STRING: - n = "string"; - break; - case SPOVAR_VARIABLE: - n = "variable"; - break; - case SPOVAR_COORD: - n = "coordinate"; - break; - case SPOVAR_REGION: - n = "region"; - break; - case SPOVAR_MAPCHAR: - n = "mapchar"; - break; - case SPOVAR_MONST: - n = "monster"; - break; - case SPOVAR_OBJ: - n = "object"; - break; - } - - togl = ((togl + 1) % 2); - - Sprintf(buf[togl], "%s%s", n, (is_array ? " array" : "")); - return buf[togl]; -} - -void -vardef_used(vd, varname) -struct lc_vardefs *vd; -char *varname; -{ - struct lc_vardefs *tmp; - - if ((tmp = vardef_defined(vd, varname, 1)) != 0) - tmp->n_used++; -} - -void -check_vardef_type(vd, varname, vartype) -struct lc_vardefs *vd; -char *varname; -long vartype; -{ - struct lc_vardefs *tmp; - - if ((tmp = vardef_defined(vd, varname, 1)) != 0) { - if (tmp->var_type != vartype) - lc_error("Trying to use variable '%s' as %s, when it is %s.", - VA_PASS3(varname, - spovar2str(vartype), - spovar2str(tmp->var_type))); - } else - lc_error("Variable '%s' not defined.", VA_PASS1(varname)); -} - -struct lc_vardefs * -add_vardef_type(vd, varname, vartype) -struct lc_vardefs *vd; -char *varname; -long vartype; -{ - struct lc_vardefs *tmp; - - if ((tmp = vardef_defined(vd, varname, 1)) != 0) { - if (tmp->var_type != vartype) - lc_error("Trying to redefine variable '%s' as %s, when it is %s.", - VA_PASS3(varname, - spovar2str(vartype), - spovar2str(tmp->var_type))); - } else { - tmp = vardef_new(vartype, varname); - tmp->next = vd; - return tmp; - } - return vd; -} - -int -reverse_jmp_opcode(opcode) -int opcode; -{ - switch (opcode) { - case SPO_JE: - return SPO_JNE; - case SPO_JNE: - return SPO_JE; - case SPO_JL: - return SPO_JGE; - case SPO_JG: - return SPO_JLE; - case SPO_JLE: - return SPO_JG; - case SPO_JGE: - return SPO_JL; - default: - lc_error("Cannot reverse comparison jmp opcode %ld.", - VA_PASS1((long) opcode)); - return SPO_NULL; - } -} - -/* basically copied from src/sp_lev.c */ -struct opvar * -opvar_clone(ov) -struct opvar *ov; -{ - if (ov) { - struct opvar *tmpov = (struct opvar *) alloc(sizeof(struct opvar)); - - if (!tmpov) { /* lint suppression */ - /*NOTREACHED*/ -#if 0 - /* not possible; alloc() never returns Null */ - panic("could not alloc opvar struct"); - /*NOTREACHED*/ -#endif - return (struct opvar *) 0; - } - switch (ov->spovartyp) { - case SPOVAR_COORD: - case SPOVAR_REGION: - case SPOVAR_MAPCHAR: - case SPOVAR_MONST: - case SPOVAR_OBJ: - case SPOVAR_INT: { - tmpov->spovartyp = ov->spovartyp; - tmpov->vardata.l = ov->vardata.l; - } break; - case SPOVAR_VARIABLE: - case SPOVAR_STRING: { - int len = strlen(ov->vardata.str); - tmpov->spovartyp = ov->spovartyp; - tmpov->vardata.str = (char *) alloc(len + 1); - (void) memcpy((genericptr_t) tmpov->vardata.str, - (genericptr_t) ov->vardata.str, len); - tmpov->vardata.str[len] = '\0'; - } break; - default: { - lc_error("Unknown opvar_clone value type (%ld)!", - VA_PASS1((long) ov->spovartyp)); - } /* default */ - } /* switch */ - return tmpov; - } - return (struct opvar *) 0; -} - -void -splev_add_from(splev, from_splev) -sp_lev *splev; -sp_lev *from_splev; -{ - int i; - - if (splev && from_splev) - for (i = 0; i < from_splev->n_opcodes; i++) - add_opcode(splev, from_splev->opcodes[i].opcode, - opvar_clone(from_splev->opcodes[i].opdat)); -} - -void -start_level_def(splev, ldfname) -sp_lev **splev; -char *ldfname; -{ - struct lc_funcdefs *f; - - if (index(ldfname, '.')) - lc_error("Invalid dot ('.') in level name '%s'.", VA_PASS1(ldfname)); - if ((int) strlen(ldfname) > 14) - lc_error("Level names limited to 14 characters ('%s').", - VA_PASS1(ldfname)); - f = function_definitions; - while (f) { - f->n_called = 0; - f = f->next; - } - *splev = (sp_lev *) alloc(sizeof(sp_lev)); - (*splev)->n_opcodes = 0; - (*splev)->opcodes = NULL; - - vardef_free_all(vardefs); - vardefs = NULL; -} - -/* - * Find the type of floor, knowing its char representation. - */ -int -get_floor_type(c) -char c; -{ - int val; - - SpinCursor(3); - val = what_map_char(c); - if (val == INVALID_TYPE) { - val = ERR; - yywarning("Invalid fill character in MAZE declaration"); - } - return val; -} - -/* - * Find the type of a room in the table, knowing its name. - */ -int -get_room_type(s) -char *s; -{ - register int i; - - SpinCursor(3); - for (i = 0; room_types[i].name; i++) - if (!strcmp(s, room_types[i].name)) - return ((int) room_types[i].type); - return ERR; -} - -/* - * Find the type of a trap in the table, knowing its name. - */ -int -get_trap_type(s) -char *s; -{ - register int i; - - SpinCursor(3); - for (i = 0; trap_types[i].name; i++) - if (!strcmp(s, trap_types[i].name)) - return trap_types[i].type; - return ERR; -} - -/* - * Find the index of a monster in the table, knowing its name. - */ -int -get_monster_id(s, c) -char *s; -char c; -{ - register int i, class; - - SpinCursor(3); - class = c ? def_char_to_monclass(c) : 0; - if (class == MAXMCLASSES) - return ERR; - - for (i = LOW_PM; i < NUMMONS; i++) - if (!class || class == mons[i].mlet) - if (!strcmp(s, mons[i].mname)) - return i; - /* didn't find it; lets try case insensitive search */ - for (i = LOW_PM; i < NUMMONS; i++) - if (!class || class == mons[i].mlet) - if (!case_insensitive_comp(s, mons[i].mname)) { - if (be_verbose) - lc_warning("Monster type \"%s\" matches \"%s\".", - VA_PASS2(s, mons[i].mname)); - return i; - } - return ERR; -} - -/* - * Find the index of an object in the table, knowing its name. - */ -int -get_object_id(s, c) -char *s; -char c; /* class */ -{ - int i, class; - const char *objname; - - SpinCursor(3); - class = (c > 0) ? def_char_to_objclass(c) : 0; - if (class == MAXOCLASSES) - return ERR; - - for (i = class ? g.bases[class] : 0; i < NUM_OBJECTS; i++) { - if (class && objects[i].oc_class != class) - break; - objname = obj_descr[i].oc_name; - if (objname && !strcmp(s, objname)) - return i; - } - for (i = class ? g.bases[class] : 0; i < NUM_OBJECTS; i++) { - if (class && objects[i].oc_class != class) - break; - objname = obj_descr[i].oc_name; - if (objname && !case_insensitive_comp(s, objname)) { - if (be_verbose) - lc_warning("Object type \"%s\" matches \"%s\".", - VA_PASS2(s, objname)); - return i; - } - } - return ERR; -} - -static void -init_obj_classes() -{ - int i, class, prev_class; - - prev_class = -1; - for (i = 0; i < NUM_OBJECTS; i++) { - class = objects[i].oc_class; - if (class != prev_class) { - g.bases[class] = i; - prev_class = class; - } - } -} - -/* - * Is the character 'c' a valid monster class ? - */ -boolean -check_monster_char(c) -char c; -{ - return (def_char_to_monclass(c) != MAXMCLASSES); -} - -/* - * Is the character 'c' a valid object class ? - */ -boolean -check_object_char(c) -char c; -{ - return (def_char_to_objclass(c) != MAXOCLASSES); -} - -/* - * Convert .des map letter into floor type. - */ -char -what_map_char(c) -char c; -{ - SpinCursor(3); - switch (c) { - case ' ': - return (STONE); - case '#': - return (CORR); - case '.': - return (ROOM); - case '-': - return (HWALL); - case '|': - return (VWALL); - case '+': - return (DOOR); - case 'A': - return (AIR); - case 'B': - return (CROSSWALL); /* hack: boundary location */ - case 'C': - return (CLOUD); - case 'S': - return (SDOOR); - case 'H': - return (SCORR); - case '{': - return (FOUNTAIN); - case '\\': - return (THRONE); - case 'K': - return (SINK); - case '}': - return (MOAT); - case 'P': - return (POOL); - case 'L': - return (LAVAPOOL); - case 'I': - return (ICE); - case 'W': - return (WATER); - case 'T': - return (TREE); - case 'F': - return (IRONBARS); /* Fe = iron */ - case 'x': - return (MAX_TYPE); /* "see-through" */ - } - return (INVALID_TYPE); -} - -void -add_opcode(sp, opc, dat) -sp_lev *sp; -int opc; -genericptr_t dat; -{ - long nop = sp->n_opcodes; - _opcode *tmp; - - if ((opc < 0) || (opc >= MAX_SP_OPCODES)) - lc_error("Unknown opcode '%ld'", VA_PASS1((long) opc)); - - tmp = (_opcode *) alloc(sizeof(_opcode) * (nop + 1)); - if (!tmp) { /* lint suppression */ - /*NOTREACHED*/ -#if 0 - /* not possible; alloc() never returns Null */ - lc_error("%s", VA_PASS1("Could not alloc opcode space")); -#endif - return; - } - - if (sp->opcodes && nop) { - (void) memcpy(tmp, sp->opcodes, sizeof(_opcode) * nop); - free(sp->opcodes); - } - sp->opcodes = tmp; - - sp->opcodes[nop].opcode = opc; - sp->opcodes[nop].opdat = dat; - - sp->n_opcodes++; -} - -/* - * Yep! LEX gives us the map in a raw mode. - * Just analyze it here. - */ -void -scan_map(map, sp) -char *map; -sp_lev *sp; -{ - register int i, len; - register char *s1, *s2; - int max_len = 0; - int max_hig = 0; - char *tmpmap[MAP_Y_LIM+1]; - int dx, dy; - char *mbuf; - - /* First, strip out digits 0-9 (line numbering) */ - for (s1 = s2 = map; *s1; s1++) - if (*s1 < '0' || *s1 > '9') - *s2++ = *s1; - *s2 = '\0'; - - /* Second, find the max width of the map */ - s1 = map; - while (s1 && *s1) { - s2 = index(s1, '\n'); - if (s2) { - len = (int) (s2 - s1); - s1 = s2 + 1; - } else { - len = (int) strlen(s1); - s1 = (char *) 0; - } - if (len > max_len) - max_len = len; - } - - /* Then parse it now */ - while (map && *map) { - if (max_hig > MAP_Y_LIM) - break; - tmpmap[max_hig] = (char *) alloc(max_len); - s1 = index(map, '\n'); - if (s1) { - len = (int) (s1 - map); - s1++; - } else { - len = (int) strlen(map); - s1 = map + len; - } - for (i = 0; i < len; i++) - if ((tmpmap[max_hig][i] = what_map_char(map[i])) - == INVALID_TYPE) { - lc_warning( - "Invalid character '%ld' @ (%ld, %ld) - replacing with stone", - VA_PASS3((long) map[i], (long) max_hig, (long) i)); - tmpmap[max_hig][i] = STONE; - } - while (i < max_len) - tmpmap[max_hig][i++] = STONE; - map = s1; - max_hig++; - } - - /* Memorize boundaries */ - - max_x_map = max_len - 1; - max_y_map = max_hig - 1; - - if (max_len > MAP_X_LIM || max_hig > MAP_Y_LIM) { - lc_error("Map too large at (%ld x %ld), max is (%ld x %ld)", - VA_PASS4((long) max_len, (long) max_hig, - (long) MAP_X_LIM, (long) MAP_Y_LIM)); - } - - mbuf = (char *) alloc(((max_hig - 1) * max_len) + (max_len - 1) + 2); - for (dy = 0; dy < max_hig; dy++) - for (dx = 0; dx < max_len; dx++) - mbuf[(dy * max_len) + dx] = (tmpmap[dy][dx] + 1); - - mbuf[((max_hig - 1) * max_len) + (max_len - 1) + 1] = '\0'; - - add_opvars(sp, "sllo", VA_PASS4(mbuf, (long) max_hig, (long) max_len, - SPO_MAP)); - - for (dy = 0; dy < max_hig; dy++) - Free(tmpmap[dy]); - Free(mbuf); -} - -/* - * Output some info common to all special levels. - */ -static boolean -write_common_data(fd) -int fd; -{ - static struct version_info version_data = { - VERSION_NUMBER, VERSION_FEATURES, VERSION_SANITY1, VERSION_SANITY2, - VERSION_SANITY3 - }; - - Write(fd, &version_data, sizeof version_data); - return TRUE; -} - -/* - * Here we write the sp_lev structure in the specified file (fd). - * Also, we have to free the memory allocated via alloc(). - */ -static boolean -write_maze(fd, maze) -int fd; -sp_lev *maze; -{ - int i; - - if (!write_common_data(fd)) - return FALSE; - - Write(fd, &(maze->n_opcodes), sizeof(maze->n_opcodes)); - - for (i = 0; i < maze->n_opcodes; i++) { - _opcode tmpo = maze->opcodes[i]; - - Write(fd, &(tmpo.opcode), sizeof(tmpo.opcode)); - - if (tmpo.opcode < SPO_NULL || tmpo.opcode >= MAX_SP_OPCODES) - panic("write_maze: unknown opcode (%d).", tmpo.opcode); - - if (tmpo.opcode == SPO_PUSH) { - genericptr_t opdat = tmpo.opdat; - if (opdat) { - struct opvar *ov = (struct opvar *) opdat; - int size; - Write(fd, &(ov->spovartyp), sizeof(ov->spovartyp)); - switch (ov->spovartyp) { - case SPOVAR_NULL: - break; - case SPOVAR_COORD: - case SPOVAR_REGION: - case SPOVAR_MAPCHAR: - case SPOVAR_MONST: - case SPOVAR_OBJ: - case SPOVAR_INT: - Write(fd, &(ov->vardata.l), sizeof(ov->vardata.l)); - break; - case SPOVAR_VARIABLE: - case SPOVAR_STRING: - if (ov->vardata.str) - size = strlen(ov->vardata.str); - else - size = 0; - Write(fd, &size, sizeof(size)); - if (size) { - Write(fd, ov->vardata.str, size); - Free(ov->vardata.str); - } - break; - default: - panic("write_maze: unknown data type (%d).", - ov->spovartyp); - } - } else - panic("write_maze: PUSH with no data."); - } else { - /* sanity check */ - genericptr_t opdat = tmpo.opdat; - if (opdat) - panic("write_maze: opcode (%d) has data.", tmpo.opcode); - } - - Free(tmpo.opdat); - } - /* clear the struct for next user */ - Free(maze->opcodes); - maze->opcodes = NULL; - /*(void) memset((genericptr_t) &maze->init_lev, 0, sizeof - * maze->init_lev);*/ - - return TRUE; -} - -/* - * Open and write maze or rooms file, based on which pointer is non-null. - * Return TRUE on success, FALSE on failure. - */ -boolean -write_level_file(filename, lvl) -char *filename; -sp_lev *lvl; -{ - int fout; - char lbuf[60]; - - lbuf[0] = '\0'; -#ifdef PREFIX - Strcat(lbuf, PREFIX); -#endif - Strcat(lbuf, filename); - Strcat(lbuf, LEV_EXT); - -#if defined(MAC) && (defined(__SC__) || defined(__MRC__)) - fout = open(lbuf, O_WRONLY | O_CREAT | O_BINARY); -#else - fout = open(lbuf, O_WRONLY | O_CREAT | O_BINARY, OMASK); -#endif - if (fout < 0) - return FALSE; - - if (!lvl) - panic("write_level_file"); - - if (be_verbose) - fprintf(stdout, "File: '%s', opcodes: %ld\n", lbuf, lvl->n_opcodes); - - if (!write_maze(fout, lvl)) - return FALSE; - - (void) close(fout); - - return TRUE; -} - -static int -case_insensitive_comp(s1, s2) -const char *s1; -const char *s2; -{ - uchar u1, u2; - - for (;; s1++, s2++) { - u1 = (uchar) *s1; - if (isupper(u1)) - u1 = tolower(u1); - u2 = (uchar) *s2; - if (isupper(u2)) - u2 = tolower(u2); - if (u1 == '\0' || u1 != u2) - break; - } - return u1 - u2; -} - -#ifdef STRICT_REF_DEF -/* - * Any globals declared in hack.h and descendents which aren't defined - * in the modules linked into lev_comp should be defined here. These - * definitions can be dummies: their sizes shouldn't matter as long as - * as their types are correct; actual values are irrelevant. - */ -#define ARBITRARY_SIZE 1 -/* attrib.c */ -struct attribs attrmax, attrmin; -/* files.c */ -const char *configfile; -/* termcap.c */ -struct tc_lcl_data tc_lcl_data; -#ifdef TEXTCOLOR -#ifdef TOS -const char *hilites[CLR_MAX]; -#else -char NEARDATA *hilites[CLR_MAX]; -#endif -#endif -/* trap.c */ -const char *traps[TRAPNUM]; -/* window.c */ -#ifdef HANGUPHANDLING -volatile -#endif - struct window_procs windowprocs; -/* xxxtty.c */ -#ifdef DEFINE_OSPEED -short ospeed; -#endif -#endif /* STRICT_REF_DEF */ - -/* nhassert_failed is called when an nhassert's condition is false */ -void nhassert_failed(const char * exp, const char * file, int line) -{ - fprintf(stderr, "NHASSERT(%s) in '%s' at line %d\n", exp, file, line); - exit(EXIT_FAILURE); -} - -/*lev_main.c*/ diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index 1cc97815e..feadfe389 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -5,7 +5,11 @@ #include "curses.h" #include "hack.h" +#ifdef SHORT_FILENAMES +#include "patchlev.h" +#else #include "patchlevel.h" +#endif #include "color.h" #include "wincurs.h" diff --git a/x.lua b/x.lua new file mode 100644 index 000000000..347eb350c --- /dev/null +++ b/x.lua @@ -0,0 +1,99 @@ + +-- s = string.format("(%i,%i),[%i,%i,%i]", u.ux, u.uy, u.dx, u.dy, u.dz); +-- nh.pline(s); + + +nh.test({ x = 3, y = 7, name="foo" }); + +local l = nh.getmap(u.ux, u.uy); + +nh.pline(string.format("map(%i,%i): glyph=%i, typ=%i, lit=%i, candig=%i", + u.ux, u.uy, + l.glyph, l.typ, l.lit, l.candig)); + +-- nh.pline("lit: " .. x.lit .. ". ") + +-- str = nh.getlin("What do you call it?"); +-- nh.verbalize("Hello, this is " .. str .. " speaking"); + + +-- nh.pline("COLNOxROWNO=(" .. nhc.COLNO .. "x" .. nhc.ROWNO .. ")") + + +-- local opts = { a = "valinta a", b = "bbbbb", c = "option c" } +-- local ret = nh.menu("Chooooooose one", "a", "one", opts) +-- nh.pline("You chose: '" .. ret .. "', that is: '" .. opts[ret] .. "'"); + + +-- nh.pline("makeplural: " .. nh.makeplural("zorkmid")); +-- nh.pline("makesingular: " .. nh.makesingular("zorkmids")); + + +-- local opts = { +-- { key = "a", text = "valinta a" }, +-- { key = "b", text = "bbbbb" }, +-- { key = "c", text = "option c" } +-- } +--local ret = nh.menu("Choose one (1)", nil, nil, opts) +--nh.pline("You chose: '" .. ret .. "'") + + +--local ret = nh.menu("Choose one (2)", opts) +--nh.pline("You chose: '" .. ret .. "'") + +--[[ + +nh.level_init({ + style = "none", -- or "fill", "grid", "mines", "rogue" + filling = "tree", + init_present = 1, + padding = 1, + fg = "floor", + bg = "wall", + smoothed = 0, + joined = 1, + lit = -1, + walled = 0, + icedpools = 0 +}); + +nh.level_flags({"noteleport", "hardfloor"}); + +nh.message("What a strange feeling!"); + +nh.map({horiz = "center", + vert = "center", + map = " +..... +.L.L. +..... +" }); + +nh.monster({ + class = "V", + typename = "vampire", + coord = {5, 10}, + name = "Phil", + attitude = "peaceful", + alertness = "asleep", + alignment = "lawful", + -- appearance = ...? + female = 1, + invisible = 1, + cancelled = 1, + revived = 1, + avenge = 1, + fleeing = 23, + blinded = 23, + paralyzed = 23, + stunned = 1, + confused = 1, + seentraps = { "pit", "magic trap" }, -- could be "all" + -- how to add inventory for this monster? + -- should be able to just directly set struct monst fields +}); + +nh.object({ +}); + +-- ]] diff --git a/y.lua b/y.lua new file mode 100644 index 000000000..aba85d261 --- /dev/null +++ b/y.lua @@ -0,0 +1,210 @@ + +-- run tests on the des-level commands + +-- des.level_init({ style = "mines", joined = 1, lit = 1 }); +-- des.level_init({ style = "mazegrid", lit = 1 }); +-- des.level_init({ style = "solidfill" }); +-- des.level_init({ style = "rogue" }); +des.level_init(); + +function selection_tests () + -- OO style + local sel = selection.new(); + sel:get(1, 2); + sel:set(1, 2); + sel:negate(); + sel:percentage(50); + sel:rndcoord(1); + sel:line(1,2, 50,20); + sel:randline(1,2, 50,20, 7); + sel:rect(1,2, 7,8); + sel:fillrect(1,2, 7,8); + sel:area(1,2, 7,8); + sel:grow(); + sel:filter_mapchar(' '); + sel:floodfill(1,1); + sel:circle(40, 10, 9); + sel:circle(40, 10, 9, 1); + sel:ellipse(40, 10, 20, 8); + sel:ellipse(40, 10, 20, 8, 1); + + -- initializers + selection.set(1, 2); + selection.negate(); + selection.line(1,2, 50,20); + selection.randline(1,2, 50,20, 7); + selection.rect(1,2, 7,8); + selection.fillrect(1,2, 7,8); + selection.area(1,2, 7,8); + selection.floodfill(1,1); + selection.circle(40, 10, 9); + selection.circle(40, 10, 9, 1); + selection.ellipse(40, 10, 20, 8); + selection.ellipse(40, 10, 20, 8, 1); + + -- variable as param + selection.get(sel, 1, 2); + selection.set(sel, 1, 2); + selection.negate(sel); + selection.percentage(sel, 50); + selection.rndcoord(sel, 1); + selection.line(sel, 1,2, 50,20); + selection.randline(sel, 1,2, 50,20, 7); + selection.rect(sel, 1,2, 7,8); + selection.fillrect(sel, 1,2, 7,8); + selection.area(sel, 1,2, 7,8); + selection.grow(sel); + selection.filter_mapchar(sel, ' '); + selection.floodfill(sel, 1,1); + selection.circle(sel, 40, 10, 9); + selection.circle(sel, 40, 10, 9, 1); + selection.ellipse(sel, 40, 10, 20, 8); + selection.ellipse(sel, 40, 10, 20, 8, 1); +end -- selection_tests() + +-- set coordinate 4,5 to value 1 +-- selection.set(sel, 4, 5); + +-- set coordinate 7,7 to value 1 +-- sel:set(7, 7); + +-- set 5,5 to value 2 +-- sel:set(5,5, 2); + +-- get 3 coordinates, removing the coordinates from the selection +-- local tx1, ty1 = selection.rndcoord(sel, 1); +-- local tx2, ty2 = selection.rndcoord(sel, 1); +-- local tx3, ty3 = selection.rndcoord(sel, 1); + +-- filter randomly 50% of the selection +-- local sel2 = selection.percentage(sel, 50); + +-- negate the selection +-- local sel3 = selection.negate(sel); + +-- negate first, then 50% +-- local sel4 = selection.percentage(selection.negate(sel), 50); + +-- local yyy = sel:get(6, 7); + +-- des.mazewalk({ x = 4, y = 6, stocked = 0 }); + +-- draw a line from (1,1) to (40,15) +-- selection.line(sel, 1,1, 40,15); + +-- draw a rectangle with upper left at (1,1) to lower right at (10,10) +-- selection.rect(sel, 1,1, 10,10); + +-- draw a filled rectangle with upper left at (1,1) to lower right at (10,10) +-- selection.fillrect(sel, 40,2, 50,5); + +-- alias to fillrect +-- selection.area(sel, 40,2, 50,5); + +-- randomized line from (73,1) to (1,20), with roughness 7 +-- selection.randline(sel, 73, 1, 1, 20, 7); + +-- grow selection to all directions +-- selection.grow(sel); + +-- floodfill from (2,7), matching the same terrain type +-- sel:floodfill(2, 5); + +-- draw a circle at (40,10) with radius 9 +-- selection.circle(sel, 40, 10, 9); + +-- draw a filled circle at (40,10) with radius 9 +-- selection.circle(sel, 40, 10, 9, 1); + +-- draw an ellipse at (40,10) with radii 20 and 8 +-- selection.ellipse(sel, 40, 10, 20, 8); + +-- draw a filled ellipse at (40,10) with radii 20 and 8 +-- sel:ellipse(40, 10, 20, 8, 1); + +-- filter selection by matching terrain +-- selection.filter_mapchar(sel, ' '); + +-- set lava in the selection +local sel = selection.area(4,5, 40,10) ~ selection.rect(7,8, 60,14); +des.terrain(sel, "L"); + +-- des.terrain({ x = tx1, y = ty1, typ = "L" }); +-- des.terrain({ x = tx2, y = ty2, typ = "T" }); +-- des.terrain({ x = tx3, y = ty3, typ = "F" }); + +-- des.wall_property({ property = "nondiggable", x1 = 0, y1 = 0, x2 = 40, y2 = 20 }); +-- des.wall_property(); + +des.wallify(); + + + +function test () +rectroom = [[ +---- +|..| +|... +|..| +----]]; + +des.map({ + -- halign = "center", valign = "center", + x = 5, y = 5, + keepregion = 1, + map = [[ +------ +|..... +|....| +|....| +.....| +|....| +|....| +------]]}); + +--[[ +for i = 0, 5 do + xp = math.random(70); + yp = math.random(20); + -- des.message("i=" .. i .. " (" .. xp .. "," .. yp .. ")"); + -- des.map({ x = xp, y = yp , map = rectroom, keepregion = 1 }); +end +]] + +-- des.wallify(); + +-- des.message("viesti"); + + +for i = 1, 10 do + mx = i; + my = i; + des.message(i .."=(" .. mx .. "," .. my .. ")"); + des.monster({ x = mx, y = my, + name = "foo" .. mx .. "x" .. my, + -- class = "F", + id = "red mold", + peaceful = 1, + asleep = 1, + female = 1 + }); + des.object({ x = mx + 1, y = my, + -- class = "=", + id = "silver dagger", + buc = "blessed", + quantity = 1, + spe = "random" + }); +end + +for i = 1, 1000 do + des.object({ x = 40, y = 10, + -- class = "=", + id = "silver dagger", + buc = "blessed", + quantity = 1, + -- spe = "random" + }); +end + +end -- function test()