Shaped and themed rooms

Allows creating shaped or themed rooms for the Dungeons of Doom
via lua script.

Invalidates bones and saves.

Makefiles updated for unix/linux by adding themerms.lua, but other
OSes need to have that added.
This commit is contained in:
Pasi Kallinen
2020-04-09 07:22:22 +03:00
parent 2d43c6d62a
commit 9b74ea0b22
16 changed files with 842 additions and 53 deletions

View File

@@ -842,6 +842,7 @@ init_dungeons()
i = 0;
while (lua_next(L, tidx) != 0) {
char *dgn_name, *dgn_bonetag, *dgn_protoname, *dgn_fill;
char *dgn_themerms;
int dgn_base, dgn_range, dgn_align, dgn_entry, dgn_chance, dgn_flags;
if (!lua_istable(L, -1))
@@ -858,6 +859,7 @@ init_dungeons()
dgn_chance = get_table_int_opt(L, "chance", 100);
dgn_flags = get_dgn_flags(L);
dgn_fill = get_table_str_opt(L, "lvlfill", emptystr);
dgn_themerms = get_table_str_opt(L, "themerooms", emptystr);
debugpline4("DUNGEON[%i]: %s, base=(%i,%i)",
i, dgn_name, dgn_base, dgn_range);
@@ -870,6 +872,7 @@ init_dungeons()
free((genericptr_t) dgn_bonetag);
free((genericptr_t) dgn_protoname);
free((genericptr_t) dgn_fill);
free((genericptr_t) dgn_themerms);
continue;
}
@@ -1023,10 +1026,13 @@ init_dungeons()
Strcpy(g.dungeons[i].fill_lvl, dgn_fill); /* FIXME: fill_lvl len */
Strcpy(g.dungeons[i].dname, dgn_name); /* FIXME: dname length */
Strcpy(g.dungeons[i].proto, dgn_protoname); /* FIXME: proto length */
Strcpy(g.dungeons[i].themerms, dgn_themerms); /* FIXME: length */
g.dungeons[i].themelua = (lua_State *) 0;
g.dungeons[i].boneid = *dgn_bonetag ? *dgn_bonetag : 0;
free((genericptr) dgn_fill);
/* free((genericptr) dgn_protoname); -- stored in pd.tmpdungeon[] */
free((genericptr) dgn_bonetag);
free((genericptr) dgn_themerms);
if (dgn_range)
g.dungeons[i].num_dunlevs = (xchar) rn1(dgn_range, dgn_base);