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.
This commit is contained in:
Pasi Kallinen
2019-11-06 18:43:20 +02:00
parent 3e029d2900
commit fd55d9118e
189 changed files with 16653 additions and 27346 deletions
+2 -2
View File
@@ -62,7 +62,7 @@ extern int attrib_text_normal; /* text mode normal attribute */
extern int attrib_gr_normal; /* graphics mode normal attribute */
extern int attrib_gr_intense; /* graphics mode intense attribute */
extern boolean inmap; /* in the map window */
extern boolean restoring;
/* extern boolean g.restoring; */
/*
* Global Variables
@@ -609,7 +609,7 @@ int x, y;
clipx = clipxmax - (viewport_size - 1);
}
if (clipx != oldx) {
if (on_level(&u.uz0, &u.uz) && !restoring)
if (on_level(&u.uz0, &u.uz) && !g.restoring)
/* (void) doredraw(); */
vesa_redrawmap();
}