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

Autoexplore will try to avoid bad minor events effects

git-svn-id: http://svn.net-core.org/repos/t-engine4@5753 51575b47-30f0-44d4-a5cc-537603b46e54
parent ce3e7824
No related branches found
No related tags found
No related merge requests found
......@@ -1943,6 +1943,9 @@ function _M:autoExplore()
elseif terrain.mindam or terrain.maxdam then
move_cost = move_cost + 32
is_slow = true
elseif terrain.on_stand and not terrain.on_stand_safe then
move_cost = move_cost + 21
is_slow = true
elseif terrain.air_level and terrain.air_level < 0 and not ((self.can_breath.water or 0) > 0) then
move_cost = move_cost + 15
is_slow = true
......@@ -1989,9 +1992,14 @@ function _M:autoExplore()
end
else -- door is safe to move through
node[3] = move_cost + 1
values[c] = move_cost + 1
current_tiles_next[#current_tiles_next + 1] = node
safe_doors[c] = true
if is_slow then
slow_values[c] = move_cost + 1
slow_tiles[#slow_tiles + 1] = node
else
values[c] = move_cost + 1
current_tiles_next[#current_tiles_next + 1] = node
end
end
-- go to next level, exit, previous level, or orb portal (in that order of precedence)
elseif terrain.change_level then
......
......@@ -44,6 +44,7 @@ local grids = core.fov.circle_grids(x, y, 2, "do not block")
for x, yy in pairs(grids) do for y, _ in pairs(yy) do
local g = game.level.map(x, y, engine.Map.TERRAIN):cloneFull()
g.on_stand = g.on_stand or on_stand
g.on_stand_safe = true
game.zone:addEntity(game.level, g, "terrain", x, y)
end end
game.log("==== FONT at %dx%d", x,y)
......
......@@ -41,6 +41,7 @@ local grids = core.fov.circle_grids(x, y, 1, "do not block")
for x, yy in pairs(grids) do for y, _ in pairs(yy) do
local g = game.level.map(x, y, engine.Map.TERRAIN):cloneFull()
g.on_stand = g.on_stand or on_stand
g.on_stand_safe = true
game.zone:addEntity(game.level, g, "terrain", x, y)
end 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