Split themeroom shape from themeroom contents

Previously, the tetris-shaped rooms were always either
normal rooms, or turned into shops or other special rooms
in NetHack core. Now, the themed room lua code first picks
the themed room (which can be a themed or shaped), and some
of those will then pick a random filling (eg. ice floor,
traps, corpses, 3 altars).

Adds a new lua binding to create a selection picking locations
in current room.

The content-function in special level regions now get passed
the room data as a parameter.
This commit is contained in:
Pasi Kallinen
2022-09-15 18:08:32 +03:00
parent 1c177dcb39
commit 3605f18a8e
5 changed files with 270 additions and 187 deletions

View File

@@ -1070,6 +1070,20 @@ Example:
local coord = selection.rndcoord(sel);
local coord = selection.rndcoord(sel, 1);
=== room
Create a selection of locations inside the (current) room.
Example:
des.room({ type = "ordinary", contents = function(rm)
local sel = selection.room();
des.terrain(sel, "I");
end
});
=== set
Set the value for location (x,y) in the selection.