Complex concrete dungeon materials

Use all base concrete materials in dungeon gen.

- From y=+32 to y=+64, transition from stone to a 50/50 mix
  of adobe and sandstone.
- From y=-640 to y=-768, transition from stone to tarstone.

Adds some more variety and reason to explore dungeons.
This commit is contained in:
Aaron Suen 2021-09-27 07:55:35 -04:00
parent b5eb58d2bb
commit 2e9d342110
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,39 @@
-- LUALOCALS < ---------------------------------------------------------
local minetest, nodecore
= minetest, nodecore
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
local function profile(name)
return {
fill = modname .. ":" .. name,
brick = "nc_stonework:bricks_" .. name,
bonded = "nc_stonework:bricks_" .. name .. "_bonded",
}
end
local dirty = profile("adobe")
local sandy = profile("sandstone")
local tarry = profile("coalstone")
local heightperlin
local surfperlin
minetest.after(0, function()
heightperlin = minetest.get_perlin(4367, 3, 0.5, 8)
surfperlin = minetest.get_perlin(865, 3, 0.5, 64)
end)
local oldbricks = nodecore.dungeon_bricks
function nodecore.dungeon_bricks(pos, rng)
if pos.y >= 32 then
if pos.y >= 64 or heightperlin:get_3d(pos) < (pos.y / 16 - 3) then
return surfperlin:get_3d(pos) > 0 and dirty or sandy
end
return oldbricks(pos, rng)
end
if pos.y >= -640 then return oldbricks(pos, rng) end
if pos.y < -768 then return tarry end
if heightperlin:get_3d(pos) > (pos.y / 64 + 11) then return tarry end
return oldbricks(pos, rng)
end

View File

@ -11,4 +11,5 @@ include("patterns")
include("node")
include("register")
include("stylus")
include("dungeon")
include("hints")