Adjust salt and biome spread.
This commit is contained in:
parent
36597871fb
commit
0ad60d974b
2 changed files with 108 additions and 117 deletions
88
mapgen.lua
88
mapgen.lua
|
@ -236,56 +236,66 @@ function fun_caves.generate(p_minp, p_maxp, seed)
|
||||||
local ivm_above = ivm + area.ystride
|
local ivm_above = ivm + area.ystride
|
||||||
local dy = y - minp.y
|
local dy = y - minp.y
|
||||||
|
|
||||||
if data[ivm] == node("air") then
|
-------------------
|
||||||
-------------------
|
local stone_type = node("default:stone")
|
||||||
local stone_type = node("default:stone")
|
local stone_depth = 1
|
||||||
local stone_depth = 1
|
local biome_val = biome_n[index3d]
|
||||||
local biome_val = biome_n[index3d]
|
-------------------
|
||||||
if biome_val < -0.8 then
|
--biome_val = 0.3
|
||||||
if true then
|
-------------------
|
||||||
stone_type = node("default:ice")
|
if biome_val < -0.6 then
|
||||||
stone_depth = 2
|
if true then
|
||||||
else
|
stone_type = node("default:ice")
|
||||||
stone_type = node("fun_caves:thinice")
|
|
||||||
stone_depth = 2
|
|
||||||
end
|
|
||||||
elseif biome_val < -0.7 then
|
|
||||||
stone_type = node("fun_caves:stone_with_lichen")
|
|
||||||
elseif biome_val < -0.4 then
|
|
||||||
stone_type = node("fun_caves:stone_with_moss")
|
|
||||||
elseif biome_val < 0.1 then
|
|
||||||
stone_type = node("fun_caves:stone_with_lichen")
|
|
||||||
elseif biome_val < 0.4 then
|
|
||||||
stone_type = node("fun_caves:stone_with_algae")
|
|
||||||
elseif biome_val < 0.55 then
|
|
||||||
stone_type = node("fun_caves:stone_with_salt")
|
|
||||||
stone_depth = 2
|
|
||||||
elseif biome_val < 0.7 then
|
|
||||||
stone_type = node("default:sand")
|
|
||||||
stone_depth = 2
|
|
||||||
elseif biome_val < 0.8 then
|
|
||||||
stone_type = node("default:coalblock")
|
|
||||||
stone_depth = 2
|
stone_depth = 2
|
||||||
else
|
else
|
||||||
stone_type = node("fun_caves:hot_cobble")
|
stone_type = node("fun_caves:thinice")
|
||||||
|
stone_depth = 2
|
||||||
end
|
end
|
||||||
-- "glow"
|
elseif biome_val < -0.5 then
|
||||||
|
stone_type = node("fun_caves:stone_with_lichen")
|
||||||
|
elseif biome_val < -0.3 then
|
||||||
|
stone_type = node("fun_caves:stone_with_moss")
|
||||||
|
elseif biome_val < -0.0 then
|
||||||
|
stone_type = node("fun_caves:stone_with_lichen")
|
||||||
|
elseif biome_val < 0.2 then
|
||||||
|
stone_type = node("fun_caves:stone_with_algae")
|
||||||
|
elseif biome_val < 0.35 then
|
||||||
|
stone_type = node("fun_caves:stone_with_salt")
|
||||||
|
stone_depth = 2
|
||||||
|
if data[ivm] == node("default:stone") then
|
||||||
|
data[ivm] = stone_type
|
||||||
|
end
|
||||||
|
elseif biome_val < 0.5 then
|
||||||
|
stone_type = node("default:sand")
|
||||||
|
stone_depth = 2
|
||||||
|
elseif biome_val < 0.6 then
|
||||||
|
stone_type = node("default:coalblock")
|
||||||
|
stone_depth = 2
|
||||||
|
else
|
||||||
|
stone_type = node("fun_caves:hot_cobble")
|
||||||
|
end
|
||||||
|
-- "glow"
|
||||||
|
|
||||||
|
if data[ivm] == node("air") then
|
||||||
-- Change stone per biome.
|
-- Change stone per biome.
|
||||||
if data[ivm_below] == node("default:stone") then
|
if data[ivm_below] == node("default:stone") or (stone_type == node("fun_caves:stone_with_salt") and data[ivm_below] ~= node("fun_caves:stone_with_salt") and data[ivm_below] ~= node("air")) then
|
||||||
data[ivm_below] = stone_type
|
data[ivm_below] = stone_type
|
||||||
if stone_depth == 2 then
|
if stone_type == node("fun_caves:stone_with_salt") and math.random(500) == 1 then
|
||||||
|
data[ivm_below - area.ystride] = node("fun_caves:radioactive_ore")
|
||||||
|
elseif stone_depth == 2 then
|
||||||
data[ivm_below - area.ystride] = stone_type
|
data[ivm_below - area.ystride] = stone_type
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if data[ivm_above] == node("default:stone") then
|
if data[ivm_above] == node("default:stone") or (stone_type == node("fun_caves:stone_with_salt") and data[ivm_above] ~= node("fun_caves:stone_with_salt") and data[ivm_above] ~= node("air")) then
|
||||||
data[ivm_above] = stone_type
|
data[ivm_above] = stone_type
|
||||||
if stone_depth == 2 then
|
if stone_type == node("fun_caves:stone_with_salt") and math.random(500) == 1 then
|
||||||
|
data[ivm_above - area.ystride] = node("fun_caves:radioactive_ore")
|
||||||
|
elseif stone_depth == 2 then
|
||||||
data[ivm_above + area.ystride] = stone_type
|
data[ivm_above + area.ystride] = stone_type
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if (data[ivm_above] == node("fun_caves:stone_with_lichen") or data[ivm_above] == node("fun_caves:stone_with_moss")) and math.random(1,20) == 1 then
|
if (data[ivm_above] == node("fun_caves:stone_with_lichen") or data[ivm_above] == node("fun_caves:stone_with_moss")) and math.random(1,50) == 1 then
|
||||||
data[ivm_above] = node("fun_caves:glowing_fungal_stone")
|
data[ivm_above] = node("fun_caves:glowing_fungal_stone")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -327,10 +337,10 @@ function fun_caves.generate(p_minp, p_maxp, seed)
|
||||||
elseif data[ivm_below] == node("fun_caves:stone_with_lichen") or data[ivm_above] == node("default:stone") then
|
elseif data[ivm_below] == node("fun_caves:stone_with_lichen") or data[ivm_above] == node("default:stone") then
|
||||||
data[ivm] = node("fun_caves:stalagmite")
|
data[ivm] = node("fun_caves:stalagmite")
|
||||||
end
|
end
|
||||||
elseif data[ivm_below] == node("fun_caves:stone_with_moss") and sr < 100 then
|
elseif data[ivm_below] == node("fun_caves:stone_with_moss") and sr < 90 then
|
||||||
data[ivm_below] = node("fun_caves:glowing_fungal_stone")
|
data[ivm_below] = node("fun_caves:glowing_fungal_stone")
|
||||||
-- vegetation
|
-- vegetation
|
||||||
elseif (data[ivm_below] == node("fun_caves:stone_with_lichen") or data[ivm_below] == node("fun_caves:stone_with_algae")) and biome_val >= -0.7 then
|
elseif (data[ivm_below] == node("fun_caves:stone_with_lichen") or data[ivm_below] == node("fun_caves:stone_with_algae")) and biome_val >= -0.5 then
|
||||||
if sr < 110 then
|
if sr < 110 then
|
||||||
data[ivm] = node("flowers:mushroom_red")
|
data[ivm] = node("flowers:mushroom_red")
|
||||||
elseif sr < 140 then
|
elseif sr < 140 then
|
||||||
|
@ -387,7 +397,7 @@ function fun_caves.respawn(player)
|
||||||
local biome_n = minetest.get_perlin(biome_noise):get3d({x=pos.x, y=pos.y, z=pos.z})
|
local biome_n = minetest.get_perlin(biome_noise):get3d({x=pos.x, y=pos.y, z=pos.z})
|
||||||
local biome = biome_n
|
local biome = biome_n
|
||||||
|
|
||||||
while biome < -0.3 or biome > 0.3 do
|
while biome < -0.2 or biome > 0.0 do
|
||||||
pos.x = pos.x + math.random(20) - 10
|
pos.x = pos.x + math.random(20) - 10
|
||||||
pos.z = pos.z + math.random(20) - 10
|
pos.z = pos.z + math.random(20) - 10
|
||||||
|
|
||||||
|
|
137
nodes.lua
137
nodes.lua
|
@ -141,16 +141,9 @@ minetest.register_node("fun_caves:moon_juice", {
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("fun_caves:moon_glass", {
|
local newnode = fun_caves.clone_node("default:glass")
|
||||||
description = "Moon Glass",
|
newnode.light_source = default.LIGHT_MAX
|
||||||
drawtype = "glasslike",
|
minetest.register_node("fun_caves:moon_glass", newnode)
|
||||||
tiles = {"default_glass.png",},
|
|
||||||
inventory_image = minetest.inventorycube("default_glass.png"),
|
|
||||||
is_ground_content = true,
|
|
||||||
light_source = default.LIGHT_MAX,
|
|
||||||
groups = {cracky=3},
|
|
||||||
sounds = default.node_sound_glass_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "fun_caves:moon_juice",
|
output = "fun_caves:moon_juice",
|
||||||
|
@ -236,46 +229,35 @@ minetest.register_craft({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("fun_caves:glowing_dirt", {
|
newnode = fun_caves.clone_node("default:dirt")
|
||||||
description = "Glowing Dirt",
|
newnode.description = "Glowing Dirt"
|
||||||
tiles = {"default_dirt.png"},
|
newnode.light_source = default.LIGHT_MAX
|
||||||
groups = {crumbly = 3, soil = 1},
|
newnode.soil = {
|
||||||
light_source = default.LIGHT_MAX,
|
base = "fun_caves:glowing_dirt",
|
||||||
sounds = default.node_sound_dirt_defaults(),
|
dry = "fun_caves:glowing_soil",
|
||||||
soil = {
|
wet = "fun_caves:glowing_soil_wet"
|
||||||
base = "fun_caves:glowing_dirt",
|
}
|
||||||
dry = "fun_caves:glowing_soil",
|
minetest.register_node("fun_caves:glowing_dirt", newnode)
|
||||||
wet = "fun_caves:glowing_soil_wet"
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("fun_caves:glowing_soil", {
|
newnode = fun_caves.clone_node("farming:soil")
|
||||||
description = "Glowing Soil",
|
newnode.description = "Glowing Soil"
|
||||||
tiles = {"default_dirt.png^farming_soil.png", "default_dirt.png"},
|
newnode.light_source = default.LIGHT_MAX
|
||||||
drop = "fun_caves:glowing_dirt",
|
newnode.soil = {
|
||||||
groups = {crumbly=3, not_in_creative_inventory=1, soil=2, grassland = 1, field = 1},
|
base = "fun_caves:glowing_dirt",
|
||||||
sounds = default.node_sound_dirt_defaults(),
|
dry = "fun_caves:glowing_soil",
|
||||||
light_source = default.LIGHT_MAX,
|
wet = "fun_caves:glowing_soil_wet"
|
||||||
soil = {
|
}
|
||||||
base = "fun_caves:glowing_dirt",
|
minetest.register_node("fun_caves:glowing_dirt", newnode)
|
||||||
dry = "fun_caves:glowing_soil",
|
|
||||||
wet = "fun_caves:glowing_soil_wet"
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("fun_caves:glowing_soil_wet", {
|
newnode = fun_caves.clone_node("farming:soil_wet")
|
||||||
description = "Wet Glowing Soil",
|
newnode.description = "Wet Glowing Soil"
|
||||||
tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt.png^farming_soil_wet_side.png"},
|
newnode.light_source = default.LIGHT_MAX
|
||||||
drop = "fun_caves:glowing_dirt",
|
newnode.soil = {
|
||||||
groups = {crumbly=3, not_in_creative_inventory=1, soil=3, wet = 1, grassland = 1, field = 1},
|
base = "fun_caves:glowing_dirt",
|
||||||
sounds = default.node_sound_dirt_defaults(),
|
dry = "fun_caves:glowing_soil",
|
||||||
light_source = default.LIGHT_MAX,
|
wet = "fun_caves:glowing_soil_wet"
|
||||||
soil = {
|
}
|
||||||
base = "fun_caves:glowing_dirt",
|
minetest.register_node("fun_caves:glowing_dirt", newnode)
|
||||||
dry = "fun_caves:glowing_soil",
|
|
||||||
wet = "fun_caves:glowing_soil_wet"
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "fun_caves:glowing_dirt",
|
output = "fun_caves:glowing_dirt",
|
||||||
|
@ -300,51 +282,50 @@ minetest.register_node("fun_caves:thin_ice", {
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("fun_caves:stone_with_moss", {
|
newnode = fun_caves.clone_node("default:stone")
|
||||||
description = "Cave Stone with Moss",
|
newnode.description = "Cave Stone With Moss"
|
||||||
tiles = {"default_stone.png^fun_caves_moss.png"},
|
newnode.tiles = {"default_stone.png^fun_caves_moss.png"}
|
||||||
is_ground_content = true,
|
newnode.groups = {stone=1, crumbly=3}
|
||||||
groups = {stone=1, crumbly=3},
|
newnode.sounds = default.node_sound_dirt_defaults({
|
||||||
drop = 'default:cobble',
|
footstep = {name="default_grass_footstep", gain=0.25},
|
||||||
sounds = default.node_sound_dirt_defaults({
|
|
||||||
footstep = {name="default_grass_footstep", gain=0.25},
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
|
minetest.register_node("fun_caves:stone_with_moss", newnode)
|
||||||
|
|
||||||
minetest.register_node("fun_caves:stone_with_lichen", {
|
newnode = fun_caves.clone_node("default:stone")
|
||||||
description = "Cave Stone with Lichen",
|
newnode.description = "Cave Stone With Lichen"
|
||||||
tiles = {"default_stone.png^fun_caves_lichen.png"},
|
newnode.tiles = {"default_stone.png^fun_caves_lichen.png"}
|
||||||
is_ground_content = true,
|
newnode.groups = {stone=1, crumbly=3}
|
||||||
groups = {stone=1, crumbly=3},
|
newnode.sounds = default.node_sound_dirt_defaults({
|
||||||
drop = 'default:cobble',
|
footstep = {name="default_grass_footstep", gain=0.25},
|
||||||
sounds = default.node_sound_dirt_defaults({
|
|
||||||
footstep = {name="default_grass_footstep", gain=0.25},
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
|
minetest.register_node("fun_caves:stone_with_lichen", newnode)
|
||||||
|
|
||||||
minetest.register_node("fun_caves:stone_with_algae", {
|
newnode = fun_caves.clone_node("default:stone")
|
||||||
description = "Cave Stone with Algae",
|
newnode.description = "Cave Stone With Algae"
|
||||||
tiles = {"default_stone.png^fun_caves_algae.png"},
|
newnode.tiles = {"default_stone.png^fun_caves_algae.png"}
|
||||||
is_ground_content = true,
|
newnode.groups = {stone=1, crumbly=3}
|
||||||
groups = {stone=1, crumbly=3},
|
newnode.sounds = default.node_sound_dirt_defaults({
|
||||||
drop = 'default:cobble',
|
footstep = {name="default_grass_footstep", gain=0.25},
|
||||||
sounds = default.node_sound_dirt_defaults({
|
|
||||||
footstep = {name="default_grass_footstep", gain=0.25},
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
|
minetest.register_node("fun_caves:stone_with_algae", newnode)
|
||||||
|
|
||||||
minetest.register_node("fun_caves:stone_with_salt", {
|
minetest.register_node("fun_caves:stone_with_salt", {
|
||||||
description = "Cave Stone with Salt",
|
description = "Cave Stone with Salt",
|
||||||
tiles = {"caverealms_salty2.png"},--{"caverealms_salty2.png^caverealms_salty.png", "caverealms_salty2.png", "caverealms_salty2.png^caverealms_salty_side.png"},
|
tiles = {"caverealms_salty2.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
use_texture_alpha = true,
|
use_texture_alpha = true,
|
||||||
drawtype = "glasslike",
|
drawtype = "glasslike",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = false,
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {stone=1, crumbly=3},
|
groups = {stone=1, crumbly=3},
|
||||||
--light_source = 1,
|
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
})
|
})
|
||||||
|
newnode = fun_caves.clone_node("fun_caves:stone_with_salt")
|
||||||
|
newnode.description = "Salt With Radioactive Ore"
|
||||||
|
newnode.tiles = {"caverealms_salty2.png^[colorize:#004000:250"}
|
||||||
|
newnode.light_source = 4
|
||||||
|
minetest.register_node("fun_caves:radioactive_ore", newnode)
|
||||||
|
|
||||||
|
|
||||||
--Glow Obsidian
|
--Glow Obsidian
|
||||||
minetest.register_node("fun_caves:glow_obsidian", {
|
minetest.register_node("fun_caves:glow_obsidian", {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue