Skip to content
Snippets Groups Projects
Commit 9032f49c authored by dg's avatar dg
Browse files

Sometimes the last level of Nur will be flooded by a failing barrier

git-svn-id: http://svn.net-core.org/repos/t-engine4@6642 51575b47-30f0-44d4-a5cc-537603b46e54
parent f4eebee4
No related branches found
No related tags found
No related merge requests found
......@@ -166,7 +166,7 @@ end
--- Called when the game is focused/unfocused
function _M:idling(focus)
self.has_os_focus = focus
print("Game got focus/unfocus", focus)
-- print("Game got focus/unfocus", focus)
end
--- Receives a profile event
......
......@@ -17,6 +17,9 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
local p = rng.range(1, 3)
local is_flooded = p == 3
return {
name = "Lake of Nur",
level_range = {15, 25},
......@@ -33,6 +36,7 @@ return {
ambient_music = "Woods of Eremae.ogg",
min_material_level = 2,
max_material_level = 3,
is_flooded = is_flooded,
generator = {
map = {
class = "engine.generator.map.Roomer",
......@@ -87,7 +91,16 @@ return {
},
},
[3] = {
generator = {
generator = is_flooded and {
map = {
down = "SHERTUL_FORTRESS",
force_last_stair = true,
},
actor = {
filters = {{special_rarity="water_rarity"}},
nb_npc = {30, 35},
},
} or {
map = {
['.'] = "FLOOR",
['#'] = "WALL",
......@@ -116,9 +129,12 @@ return {
if lev == 2 and not game.level.shown_warning then
Dialog:simplePopup("Lake of Nur", "You descend into the submerged ruins. The walls look extremely ancient, yet you feel power within this place.")
game.level.shown_warning = true
elseif lev == 3 and not game.level.shown_warning then
elseif lev == 3 and not game.level.shown_warning and not game.level.data.is_flooded then
Dialog:simplePopup("Lake of Nur", "As you descend to the next level you traverse a kind of magical barrier keeping the water away. You hear terrible screams.")
game.level.shown_warning = true
elseif lev == 3 and not game.level.shown_warning and game.level.data.is_flooded then
Dialog:simpleLongPopup("Lake of Nur", "As you descend to the next level you traverse a kind of magical barrier keeping the water away. The barrier seems to be failing however and the next level is flooded too.", 400)
game.level.shown_warning = true
end
end,
}
......@@ -67,7 +67,7 @@ function _M:generateList()
for i, dir in ipairs(fs.list("/data/zones/")) do
local f = loadfile("/data/zones/"..dir.."/zone.lua")
if f then
setfenv(f, {})
setfenv(f, setmetatable({}, {__index=_G}))
local ok, z = pcall(f)
if ok then
list[#list+1] = {name=z.name, zone=dir, min=1, max=z.max_level}
......
......@@ -1278,7 +1278,7 @@ int main(int argc, char *argv[])
case SDL_WINDOWEVENT_FOCUS_GAINED:
SDL_SetModState(KMOD_NONE);
/* break from idle */
printf("[EVENT HANDLER]: Got a SHOW/FOCUS_GAINED event, restoring full FPS.\n");
//printf("[EVENT HANDLER]: Got a SHOW/FOCUS_GAINED event, restoring full FPS.\n");
handleIdleTransition(0);
break;
......@@ -1286,7 +1286,7 @@ int main(int argc, char *argv[])
case SDL_WINDOWEVENT_FOCUS_LOST:
/* go idle */
SDL_SetModState(KMOD_NONE);
printf("[EVENT HANDLER]: Got a HIDDEN/FOCUS_LOST event, going idle.\n");
//printf("[EVENT HANDLER]: Got a HIDDEN/FOCUS_LOST event, going idle.\n");
handleIdleTransition(1);
break;
default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment