Files
nethack/dat/astral.lua
copperwater 0fef8fce9f Unify all special level filling options
The existing system was a confusing mess of competing names (filled,
needfill, prefilled, etc) that had varying semantics, with prefilled
being the worst offender as it meant at least three different things in
various contexts. This commit unifies everything in the code under
"needfill", and everything in Lua under "filled", which defaults to 0
everywhere.

This also removes the second argument to fill_special_room; that
function now just checks the needfill of the room it's passed. As
before, a filled == 2 value is used for a special room to indicate that
the room should set the appropriate level flag, but shouldn't actually
be stocked with anything (for instance, King Arthur's throne room); the
difference is that this now comes directly from the lua script instead
of being manipulated within sp_lev.c.

The prefilled argument had one use case that is occasionally used in the
level files: if the level designer had specified an ordinary region with
prefilled = 1, it would become a room to control monster arrivals on a
level -- monsters that arrive within the bounds of a room are supposed
to stay there.
However, not all of the places where the comments indicated this was
being used were using it correctly; I tested this by letting a few
monsters fall through the knox portal (they're supposed to be
constrained to the entry room) and waiting a hundred turns, then going
through the portal; they were not constrained to the room and had
"wandered" through its walls.
Instead of trying to maintain this special case, I have added an
optional "arrival_room" boolean argument to des.region, which forces it
to create a room for the purposes of constraining monster arrival.

I have gone through and replaced occurrences of prefilled in lua files
with the appropriate filled option (or arrival, as needed). In some
cases, that resulted in questionable regions such as a filled ordinary
area in a non-themeroom (I just dropped the filled=1), or an area which
didn't do anything, not even lighting (which I deleted).
2020-09-27 18:54:15 +03:00

188 lines
9.3 KiB
Lua

-- NetHack 3.7 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;
if percent(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 = selection.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 = selection.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 percent(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",irregular=1 })
des.region({ region={31,01,44,10},lit=1,type="ordinary",irregular=1 })
des.region({ region={61,05,74,14},lit=1,type="ordinary",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 })