Lua tests: monster creation coverage

Expose constants NUMMONS, LOW_PM, and HIGH_PM to lua.
Allow converting an int to monster type name.
Create one of each type of monster in the lua tests.
This commit is contained in:
Pasi Kallinen
2026-01-25 18:32:43 +02:00
parent 62f3969899
commit 92a8d1dab3
3 changed files with 42 additions and 0 deletions

View File

@@ -259,6 +259,15 @@ Example:
local str = nh.ing_suffix("foo");
=== int_to_pmname
Convert integer value to monster type name.
Example:
local pmname = nh.int_to_pmname(12);
=== is_genocided
Is specific monster type genocided? Returns a boolean value.
@@ -1564,6 +1573,9 @@ These constants are in the `nhc` table.
|===
| COLNO | Number of map columns
| ROWNO | Number of map rows
| NUMMONS | Number of different monster types
| LOW_PM | First monster type id. See <<_int_to_pmname>>.
| HIGH_PM | Last monster type id. See <<_int_to_pmname>>.
| DLB | 1 or 0, depending if NetHack is compiled with DLB
|===