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

Dying while recalling will cancel the recall

git-svn-id: http://svn.net-core.org/repos/t-engine4@4106 51575b47-30f0-44d4-a5cc-537603b46e54
parent fc8d1100
No related branches found
No related tags found
No related merge requests found
......@@ -116,7 +116,10 @@ function _M:onEnterLevel(zone, level)
-- Cancel effects
local effs = {}
for eff_id, p in pairs(self.tmp) do
if self.tempeffect_def[eff_id].cancel_on_level_change then effs[#effs+1] = eff_id end
if self.tempeffect_def[eff_id].cancel_on_level_change then
effs[#effs+1] = eff_id
if type(self.tempeffect_def[eff_id].cancel_on_level_change) == "function" then self.tempeffect_def[eff_id].cancel_on_level_change(self, p) end
end
end
for i, eff_id in ipairs(effs) do self:removeEffect(eff_id) end
end
......
......@@ -2396,14 +2396,18 @@ newEffect{
long_desc = function(self, eff) return "The target is waiting to be recalled back to the worldmap." end,
type = "magical",
status = "beneficial",
cancel_on_level_change = true,
parameters = { },
activate = function(self, eff)
eff.leveid = game.zone.short_name.."-"..game.level.level
end,
deactivate = function(self, eff)
if eff.allow_override or (self:canBe("worldport") and not self:attr("never_move")) then
game:onTickEnd(function()
game.logPlayer(self, "You are yanked out of this place!")
game:changeLevel(1, eff.where or game.player.last_wilderness)
if eff.leveid == game.zone.short_name.."-"..game.level.level then
game.logPlayer(self, "You are yanked out of this place!")
game:changeLevel(1, eff.where or game.player.last_wilderness)
end
end)
else
game.logPlayer(self, "Space restabilizes around you.")
......@@ -2417,8 +2421,10 @@ newEffect{
long_desc = function(self, eff) return "The target is waiting to be recalled back to Angolwen." end,
type = "magical",
status = "beneficial",
cancel_on_level_change = true,
parameters = { },
activate = function(self, eff)
eff.leveid = game.zone.short_name.."-"..game.level.level
end,
deactivate = function(self, eff)
local seen = false
......@@ -2434,8 +2440,10 @@ newEffect{
if self:canBe("worldport") and not self:attr("never_move") then
game:onTickEnd(function()
game.logPlayer(self, "You are yanked out of this place!")
game:changeLevel(1, "town-angolwen")
if eff.leveid == game.zone.short_name.."-"..game.level.level then
game.logPlayer(self, "You are yanked out of this place!")
game:changeLevel(1, "town-angolwen")
end
end)
else
game.logPlayer(self, "Space restabilizes around you.")
......
......@@ -35,7 +35,7 @@ function _M:init(actor)
self:generateList()
if self.dont_show then return end
game:saveGame()
if not config.settings.cheat then game:saveGame() end
self.c_desc = Textzone.new{width=self.iw, auto_height=true, text=[[You have #LIGHT_RED#died#LAST#!
Death in ToME is usually permanent, but if you have a means of resurrection it will be proposed in the menu below.
......@@ -161,7 +161,7 @@ function _M:eidolonPlane()
game.log("#LIGHT_RED#From the brink of death you seem to be yanked to another plane.")
game.player:updateMainShader()
game:saveGame()
if not config.settings.cheat then game:saveGame() end
end)
return true
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