Expose stairway data to lua

This commit is contained in:
Pasi Kallinen
2021-06-24 18:55:20 +03:00
parent 420863252a
commit 1e7b75eb8b
2 changed files with 52 additions and 0 deletions

View File

@@ -253,6 +253,26 @@ Example:
local str = nh.s_suffix("foo");
=== stairways
Returns an array of stairway data. Each entry is a hash with the following keys:
|===
| x, y | location of the stairs on the map
| up | boolean, is it up stairs?
| ladder | boolean, is it a ladder?
| dnum | dungeon number where the stairs lead to
| dlevel | dungeon level where the stairs lead to
|===
Example:
local stairs = nh.stairways();
for k, v in pairs(stairs) do
nh.pline("stair[" .. k .. "]:(" .. v.x .. "," .. v.y .. ")," .. tostring(v.up));
end
=== verbalize
Show the text in the message area as if someone said it, obeying eg. hero's deafness.