Commit Graph

13 Commits

Author SHA1 Message Date
Pasi Kallinen
f68f15e3b5 Simplify some special level lua
These were generated by a script that converted the des-file
format to lua.
2026-03-30 18:27:10 +03:00
Pasi Kallinen
c0f5d2dd92 Allow monster level adjustments in special levels
Add a new parameter to des.monster, m_lev_adj, which is a level
adjustment for the monster.  This only applies to the monster's
level, so basically only affects the spellcasting, it does not
change the monster's hit die or inventory.

Change one of the shamans in Orctown to be 3 levels higher.
2026-03-23 12:51:50 +02:00
Pasi Kallinen
d4c0f6bb75 Fix minetn-1 regions
Fuzzer encountered an error because the game couldn't place
a level region; allow placing the stairs to the left or right
edge of the fixed map part, just in case the randomly generated
map didn't extend out of it.

Fix the teleport region preventing falling into the orctown.
2023-12-13 17:55:42 +02:00
nhmall
0602a3b89f update lua file headers 2022-05-10 11:26:52 -04:00
vultur-cadens
3571934c59 Allow specifying object classes in the object name given to des.object()
and actually do so in the lua files.

Before this, it was not possible to specify (for example) "scroll of
teleportation" in des.object() because there is actually no object
defined in objects.h named "scroll of teleportation", so
find_objtype() failed to find it.  Instead, one had to request
"teleportation", but that is ambiguous, and find_objtype() would find
the first defined item with that name instead (ring of teleportation).

In cases of ambiguity, I referred to the des files from 3.6.6 (before
the lua conversion).
2022-04-24 00:35:25 -07:00
Pasi Kallinen
27898340b9 Lua: coordinate tweaking
Make selection rndcoord return a table with x and y keys.
Allow (most) coordinate parameters accept such a table.
Fix selection and des lua tests broken by the above changes and
an earlier change, because selections tried to set terrain
at column 0, and it now causes a complaint.
2022-03-22 09:16:19 +02:00
Pasi Kallinen
043cd7e108 Lua: lit="random" is not allowed anymore
Random is the default lit state, so leave it out.
2021-07-22 19:38:04 +03:00
nhmall
1cf9d0323a pmnames follow-up
replace references to "aligned priest" in several lua files with "aligned cleric"

also accept "aligned priest" during ^G parsing
2020-12-30 18:57:24 -05:00
nhmall
ac9ba38449 file header bump from "NetHack 3.6" to "NetHack 3.7" 2020-08-03 22:07:36 -04:00
copperwater
35a2f6e3ed Convert math.random percentage computations into percent() 2020-04-06 19:48:28 +03:00
Pasi Kallinen
dc70132da8 Change lua selection floodfill and add some tests 2020-02-22 18:35:41 +02:00
PatR
625a9a7b79 fix 'Couldn't place lregion type 1' on Orc town
Stairs up from Orcish Town variation of Mine Town were being forced
to be near the bottom of the left side of the level due to a bogus
exclusion region in the level description.  If that small area was all
solid rock then a warning was issued and no stairs up were created.
2020-01-31 12:58:24 -08:00
Pasi Kallinen
fd55d9118e Use lua for special level files
Game is playable, and should compile on linux and Windows.
Assumes you have a lua 5.3 library available.

Removes level compiler and associated files.
Replaces special level des-files with lua scripts.
Exposes some NetHack internals to lua:
 - des-table with commands to create special levels
 - nh-table with NetHack core commands
 - nhc-table with some constants
 - u-table with some player-specific data (u-struct)
 - selection userdata

Adds some rudimentary tests.

Adds new extended command #wizloadlua to run a specific script,
and #wizloaddes to run a specific level-creation script.

nhlib.lua is loaded for every lua script.

Download and untar lua:
  mkdir lib
  cd lib
  curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz
  tar zxf lua-5.3.5.tar.gz

Then make nethack normally.
2019-11-06 18:43:20 +02:00