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

Can not teleport forward in Mount Doom

git-svn-id: http://svn.net-core.org/repos/t-engine4@1231 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2019cd31
No related branches found
No related tags found
No related merge requests found
-- TE4 - T-Engine 4
-- Copyright (C) 2009, 2010 Nicolas Casalini
--
......@@ -240,6 +241,7 @@ function _M:getEntityFinalSurface(tiles, w, h)
if mos[i] then list[#list+1] = mos[i] end
end
local tex = core.map.mapObjectsToTexture(w, h, unpack(list))
if not tex then return nil end
_M.__mo_final_repo[self] = _M.__mo_final_repo[self] or {}
_M.__mo_final_repo[self][id] = {surface=tex:toSurface(), tex=tex}
return _M.__mo_final_repo[self][id].surface, _M.__mo_final_repo[self][id].tex
......
......@@ -276,10 +276,12 @@ getmetatable(tmps).__index.drawColorString = function(s, font, str, x, y, r, g,
local e = __uids[uid]
if e then
local surf = e:getEntityFinalSurface(game.level.map.tiles, font:lineSkip(), font:lineSkip())
local w, h = surf:getSize()
s:merge(surf, x, y)
if h > max_h then max_h = h end
x = x + (w or 0)
if surf then
local w, h = surf:getSize()
s:merge(surf, x, y)
if h > max_h then max_h = h end
x = x + (w or 0)
end
end
elseif fontstyle then
font:setStyle(fontstyle)
......@@ -328,10 +330,12 @@ getmetatable(tmps).__index.drawColorStringBlended = function(s, font, str, x, y,
local e = __uids[uid]
if e then
local surf = e:getEntityFinalSurface(game.level.map.tiles, font:lineSkip(), font:lineSkip())
local w, h = surf:getSize()
s:merge(surf, x, y)
if h > max_h then max_h = h end
x = x + (w or 0)
if surf then
local w, h = surf:getSize()
s:merge(surf, x, y)
if h > max_h then max_h = h end
x = x + (w or 0)
end
end
elseif fontstyle then
font:setStyle(fontstyle)
......
......@@ -322,7 +322,9 @@ end
-- @param min_dist the minimun radius of of the effect, will never teleport closer. Defaults to 0 if not set
-- @return true if the teleport worked
function _M:teleportRandom(x, y, dist, min_dist)
if game.level.data.no_teleport_south and y + dist > self.y then
y = self.y - dist
end
return engine.Actor.teleportRandom(self, x, y, dist, min_dist)
end
......
......@@ -30,6 +30,7 @@ return {
persistant = "zone",
no_level_connectivity = true,
no_worldport = true,
no_teleport_south = true,
ambiant_music = "Hold the Line.ogg",
generator = {
map = {
......@@ -54,7 +55,7 @@ return {
},
post_process = function(level)
level.turn_counter = 700 * 10
level.turn_counter = 640 * 10
end,
on_enter = function(lev, old_lev, newzone)
......
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