Add cloud layers. Add teleporter graphics.

This commit is contained in:
Duane 2016-06-11 19:25:54 -05:00
parent ac2096246e
commit b5d48307cb
7 changed files with 72 additions and 2 deletions

61
cloudgen.lua Normal file
View file

@ -0,0 +1,61 @@
dofile(fun_caves.path .. "/deco_clouds.lua")
local rand = math.random
local min = math.min
local floor = math.floor
local ceil = math.ceil
local abs = math.ceil
local map_max = 31000
local cloud_noise_1 = {offset = 10, scale = 10, seed = 3721, spread = {x = 120, y = 120, z = 120}, octaves = 3, persist = 1, lacunarity = 2}
fun_caves.cloudgen = function(minp, maxp, data, area, node)
local clouds = ceil(minp.y / floor(map_max / 7))
if abs(clouds * floor(map_max / 7) - minp.y) > 80 then
return
end
local csize = vector.add(vector.subtract(maxp, minp), 1)
local cloud_1 = minetest.get_perlin_map(cloud_noise_1, {x=csize.x, y=csize.z}):get2dMap_flat({x=minp.x, y=minp.z})
local write = false
local index = 0
local index3d = 0
for z = minp.z, maxp.z do
for x = minp.x, maxp.x do
index = index + 1
--index3d = noise_area:index(x, minp.y-1, z)
index3d = (z - minp.z) * (csize.y + 2) * csize.x + (x - minp.x) + 1
--local height = cloud_1[index] + minp.y + 32
local ivm = area:index(x, minp.y-1, z)
if cloud_1[index] > 0 then
for y = minp.y, maxp.y do
local dy = y - minp.y
if dy > 32 and cloud_1[index] > 15 then
if dy < 47 then
if dy < 47 - (cloud_1[index] - 15) then
data[ivm] = node['fun_caves:cloud']
else
data[ivm] = node['default:water_source']
end
write = true
end
elseif dy >= 32 - cloud_1[index] and dy <= 32 + cloud_1[index] then
data[ivm] = node['fun_caves:cloud']
write = true
end
ivm = ivm + area.ystride
index3d = index3d + csize.x
end
end
end
end
return write
end

6
deco_clouds.lua Normal file
View file

@ -0,0 +1,6 @@
local newnode = fun_caves.clone_node("default:dirt")
newnode.description = "Cloud"
newnode.tiles = {'fun_caves_storm_cloud.png'}
newnode.sunlight_propagates = true
minetest.register_node("fun_caves:cloud", newnode)

View file

@ -302,7 +302,9 @@ local function generate(p_minp, p_maxp, seed)
end end
end end
if not underzone and fun_caves.is_fortress(minp, csize) then if minp.y > 3000 then
write = fun_caves.cloudgen(minp, maxp, data, area, node)
elseif not underzone and fun_caves.is_fortress(minp, csize) then
--if not underzone then --if not underzone then
fun_caves.fortress(minp, maxp, data, area, node) fun_caves.fortress(minp, maxp, data, area, node)
write = true write = true
@ -342,6 +344,7 @@ end
dofile(fun_caves.path .. "/cavegen.lua") dofile(fun_caves.path .. "/cavegen.lua")
dofile(fun_caves.path .. "/cloudgen.lua")
dofile(fun_caves.path .. "/decogen.lua") dofile(fun_caves.path .. "/decogen.lua")
dofile(fun_caves.path .. "/fortress.lua") dofile(fun_caves.path .. "/fortress.lua")

View file

@ -383,7 +383,7 @@ minetest.register_craftitem("fun_caves:meteoritic_iron_crucible", {
description = "Crucible of Meteoritic Iron", description = "Crucible of Meteoritic Iron",
drawtype = "plantlike", drawtype = "plantlike",
paramtype = "light", paramtype = "light",
tiles = {"crucible.png"}, tiles = {"fun_caves_crucible.png"},
inventory_image = "crucible.png", inventory_image = "crucible.png",
groups = {dig_immediate = 3}, groups = {dig_immediate = 3},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB