Skip to content
Snippets Groups Projects
Commit 01ff0cb2 authored by DarkGod's avatar DarkGod
Browse files

its a thing

parent adbe48ca
No related branches found
No related tags found
No related merge requests found
......@@ -38,11 +38,12 @@ local function doclone(g, full)
return g
end
function _M:getTile(name)
function _M:getTile(name, baseid)
if not name then return end
if type(name) == "table" then
local n = name[1]
if type(n) == "table" then n = n[baseid] end
if rng.percent(name[2]) then n = n..rng.range(name[3], name[4]) end
name = n
end
......@@ -660,6 +661,23 @@ function _M:niceTileReplace(level, i, j, g, nt)
self:replace(i, j, self:getTile(nt.base))
end
function _M:niceTileReplaceVisible(level, i, j, g, nt)
local g8 = not level.map:checkEntity(i, j-1, Map.TERRAIN, "block_sight")
local g2 = not level.map:checkEntity(i, j+1, Map.TERRAIN, "block_sight")
local g4 = not level.map:checkEntity(i-1, j, Map.TERRAIN, "block_sight")
local g6 = not level.map:checkEntity(i+1, j, Map.TERRAIN, "block_sight")
local g7 = not level.map:checkEntity(i-1, j-1, Map.TERRAIN, "block_sight")
local g9 = not level.map:checkEntity(i+1, j-1, Map.TERRAIN, "block_sight")
local g1 = not level.map:checkEntity(i-1, j+1, Map.TERRAIN, "block_sight")
local g3 = not level.map:checkEntity(i+1, j+1, Map.TERRAIN, "block_sight")
if g1 or g2 or g3 or g4 or g6 or g7 or g8 or g9 then
self:replace(i, j, self:getTile(nt.base, 2))
else
self:replace(i, j, self:getTile(nt.base, 1))
end
end
--- Make water have nice transition to other stuff
function _M:niceTileGenericBorders(level, i, j, g, nt, type, allow, outside)
......
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