Skip to content
Snippets Groups Projects
Commit 7b71d72a authored by dg's avatar dg
Browse files

move back correctly from dream

git-svn-id: http://svn.net-core.org/repos/t-engine4@5500 51575b47-30f0-44d4-a5cc-537603b46e54
parent bbb18c47
No related branches found
No related tags found
No related merge requests found
......@@ -225,8 +225,8 @@ return {
local danger = game.level.data.real_death
game.level:addEntity(self.summoner)
game:onTickEnd(function()
local x, y = game.level.data.caldera_x, game.level.data.caldera_y
game:changeLevel(2, "noxious-caldera")
local x, y, z = game.level.data.caldera_x, game.level.data.caldera_y, game.level.data.caldera_z
game:changeLevel(z, "noxious-caldera")
game.player:move(x, y, true)
if self.success then
require("engine.ui.Dialog"):simpleLongPopup("Deep slumber...", [[As your mind-mouse enters the dream portal you suddenly wake up.
......@@ -286,8 +286,8 @@ You feel like running away!]], 600)
local danger = game.level.data.real_death
game.level:addEntity(self.summoner)
game:onTickEnd(function()
local x, y = game.level.data.caldera_x, game.level.data.caldera_y
game:changeLevel(2, "noxious-caldera")
local x, y, z = game.level.data.caldera_x, game.level.data.caldera_y, game.level.data.caldera_z
game:changeLevel(z, "noxious-caldera")
game.player:move(x, y, true)
if self.success then
require("engine.ui.Dialog"):simpleLongPopup("Deep slumber...", [[As you enter the dream portal you suddenly wake up.
......
......@@ -151,11 +151,13 @@ return {
end,
run_dream = function(dangerous)
local x, y = game.player.x, game.player.y
if game.player.runStop then game.player:runStop("dream") end
local x, y, lev = game.player.x, game.player.y, game.level.level
local dream = rng.range(1, 2)
game:changeLevel(dream, "dreams")
game.level.data.real_death = dangerous
game.level.data.caldera_x = x
game.level.data.caldera_y = y
game.level.data.caldera_z = lev
end,
}
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