Themerooms: Engraving hints the location of buried treasure
Add two new themeroom functions that are called when generating the level: pre_themerooms_generate and post_themerooms_generate, calles before and after themerooms_generate. Allow the buried treasure -themeroom to put down an engraving anywhere on the level, hinting at the location of the treasure. des.object contents function now gets the generated object passed to it as a parameter.
This commit is contained in:
16
src/mklev.c
16
src/mklev.c
@@ -289,6 +289,13 @@ makerooms(void)
|
||||
|
||||
if (themes) {
|
||||
create_des_coder();
|
||||
iflags.in_lua = g.in_mk_themerooms = TRUE;
|
||||
g.themeroom_failed = FALSE;
|
||||
lua_getglobal(themes, "pre_themerooms_generate");
|
||||
if ( nhl_pcall(themes, 0, 0)){
|
||||
impossible("Lua error: %s", lua_tostring(themes, -1));
|
||||
}
|
||||
iflags.in_lua = g.in_mk_themerooms = FALSE;
|
||||
}
|
||||
|
||||
/* make rooms until satisfied */
|
||||
@@ -321,6 +328,15 @@ makerooms(void)
|
||||
}
|
||||
}
|
||||
if (themes) {
|
||||
reset_xystart_size();
|
||||
iflags.in_lua = g.in_mk_themerooms = TRUE;
|
||||
g.themeroom_failed = FALSE;
|
||||
lua_getglobal(themes, "post_themerooms_generate");
|
||||
if ( nhl_pcall(themes, 0, 0)){
|
||||
impossible("Lua error: %s", lua_tostring(themes, -1));
|
||||
}
|
||||
iflags.in_lua = g.in_mk_themerooms = FALSE;
|
||||
|
||||
wallification(1, 0, COLNO - 1, ROWNO - 1);
|
||||
free(g.coder);
|
||||
g.coder = NULL;
|
||||
|
||||
Reference in New Issue
Block a user