Clean up and adjust poison water.
This commit is contained in:
parent
3ddce086ca
commit
a6497392bd
6 changed files with 56 additions and 52 deletions
35
decogen.lua
35
decogen.lua
|
@ -153,9 +153,12 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local biome
|
||||||
|
--if underzone and y < (underzone.ceiling + underzone.floor) / 2 then
|
||||||
|
if underzone then
|
||||||
|
biome = underzone
|
||||||
|
else
|
||||||
local biome_val = biome_n[index3d]
|
local biome_val = biome_n[index3d]
|
||||||
local stone_type = "default:stone"
|
|
||||||
local stone_depth = 1
|
|
||||||
|
|
||||||
-- Compress biomes at the surface to avoid fluids.
|
-- Compress biomes at the surface to avoid fluids.
|
||||||
if y > fluid_compression then
|
if y > fluid_compression then
|
||||||
|
@ -164,16 +167,7 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi
|
||||||
-------------------
|
-------------------
|
||||||
--biome_val = -0.75
|
--biome_val = -0.75
|
||||||
-------------------
|
-------------------
|
||||||
local biome = nil
|
|
||||||
if underzone and y < (underzone.ceiling + underzone.floor) / 2 then
|
|
||||||
biome = underzone
|
|
||||||
stone_type = underzone.floor_node
|
|
||||||
stone_depth = 2
|
|
||||||
elseif underzone then
|
|
||||||
biome = underzone
|
|
||||||
stone_type = underzone.ceiling_node
|
|
||||||
stone_depth = 2
|
|
||||||
else
|
|
||||||
for _, bi in pairs(fun_caves.cave_biomes) do
|
for _, bi in pairs(fun_caves.cave_biomes) do
|
||||||
if biome_val >= bi.biome_val_low and biome_val < bi.biome_val_high then
|
if biome_val >= bi.biome_val_low and biome_val < bi.biome_val_high then
|
||||||
biome = bi
|
biome = bi
|
||||||
|
@ -187,9 +181,6 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi
|
||||||
if not biome or (y < undersea and not biome.underwater) then
|
if not biome or (y < undersea and not biome.underwater) then
|
||||||
biome = fun_caves.cave_biomes['algae']
|
biome = fun_caves.cave_biomes['algae']
|
||||||
end
|
end
|
||||||
|
|
||||||
stone_type = biome.stone_type
|
|
||||||
stone_depth = biome.stone_depth
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -213,7 +204,7 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi
|
||||||
end
|
end
|
||||||
|
|
||||||
local air_above = false
|
local air_above = false
|
||||||
for i = 1, stone_depth do
|
for i = 1, biome.stone_depth do
|
||||||
if data[ivm + area.ystride * i] == node["air"] or (y < undersea and data[ivm + area.ystride * i] == node["default:water_source"]) then
|
if data[ivm + area.ystride * i] == node["air"] or (y < undersea and data[ivm + area.ystride * i] == node["default:water_source"]) then
|
||||||
air_above = true
|
air_above = true
|
||||||
end
|
end
|
||||||
|
@ -225,20 +216,20 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi
|
||||||
write = true
|
write = true
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
data[ivm] = node[stone_type]
|
data[ivm] = node[biome.floor_node]
|
||||||
write = true
|
write = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local air_below = false
|
local air_below = false
|
||||||
for i = 1, stone_depth do
|
for i = 1, biome.stone_depth do
|
||||||
if data[ivm - area.ystride * i] == node["air"] then
|
if data[ivm - area.ystride * i] == node["air"] then
|
||||||
air_below = true
|
air_below = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not air_above and stone_type == "default:sand" then
|
if not air_above and biome.floor_node == "default:sand" then
|
||||||
data[ivm] = node["default:sandstone"]
|
data[ivm] = node["default:sandstone"]
|
||||||
write = true
|
write = true
|
||||||
break
|
break
|
||||||
|
@ -250,7 +241,7 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi
|
||||||
write = true
|
write = true
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
data[ivm] = node[stone_type]
|
data[ivm] = node[biome.ceiling_node]
|
||||||
write = true
|
write = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
@ -285,13 +276,13 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi
|
||||||
end
|
end
|
||||||
|
|
||||||
-- fluids
|
-- fluids
|
||||||
if y > minp.y and biome and biome.fluid and node_below == node[stone_type] and rand(biome.fluid_chance) == 1 then
|
if y > minp.y and biome and biome.fluid and node_below == node[biome.floor_node] and rand(biome.fluid_chance) == 1 then
|
||||||
data[ivm] = node[biome.fluid]
|
data[ivm] = node[biome.fluid]
|
||||||
write = true
|
write = true
|
||||||
break
|
break
|
||||||
|
|
||||||
-- standing up
|
-- standing up
|
||||||
elseif node_below == node[stone_type] and biome and biome.stalagmite and rand(biome.stalagmite_chance) == 1 then
|
elseif node_below == node[biome.floor_node] and biome and biome.stalagmite and rand(biome.stalagmite_chance) == 1 then
|
||||||
if type(biome.stalagmite) == 'table' then
|
if type(biome.stalagmite) == 'table' then
|
||||||
data[ivm] = node[biome.stalagmite[rand(#biome.stalagmite)]]
|
data[ivm] = node[biome.stalagmite[rand(#biome.stalagmite)]]
|
||||||
else
|
else
|
||||||
|
|
41
mapgen.lua
41
mapgen.lua
|
@ -87,6 +87,7 @@ fun_caves.underzones = {
|
||||||
regular_columns = false,
|
regular_columns = false,
|
||||||
stalactite = 'fun_caves:icicle_down',
|
stalactite = 'fun_caves:icicle_down',
|
||||||
stalactite_chance = 12,
|
stalactite_chance = 12,
|
||||||
|
stone_depth = 2,
|
||||||
upper_bound = -4832,
|
upper_bound = -4832,
|
||||||
vary = true,
|
vary = true,
|
||||||
},
|
},
|
||||||
|
@ -104,6 +105,7 @@ fun_caves.underzones = {
|
||||||
lake_level = 5,
|
lake_level = 5,
|
||||||
lower_bound = -10032,
|
lower_bound = -10032,
|
||||||
regular_columns = false,
|
regular_columns = false,
|
||||||
|
stone_depth = 1,
|
||||||
upper_bound = -9872,
|
upper_bound = -9872,
|
||||||
vary = true,
|
vary = true,
|
||||||
},
|
},
|
||||||
|
@ -112,11 +114,11 @@ fun_caves.underzones = {
|
||||||
ceiling = -14914,
|
ceiling = -14914,
|
||||||
ceiling_node = 'fun_caves:hot_brass',
|
ceiling_node = 'fun_caves:hot_brass',
|
||||||
column_node = 'default:steelblock',
|
column_node = 'default:steelblock',
|
||||||
column_node_rare = nil,
|
|
||||||
floor = -14982,
|
floor = -14982,
|
||||||
floor_node = 'fun_caves:hot_brass',
|
floor_node = 'fun_caves:hot_brass',
|
||||||
lower_bound = -14992,
|
lower_bound = -14992,
|
||||||
regular_columns = true,
|
regular_columns = true,
|
||||||
|
stone_depth = 1,
|
||||||
upper_bound = -14912,
|
upper_bound = -14912,
|
||||||
vary = false,
|
vary = false,
|
||||||
},
|
},
|
||||||
|
@ -134,6 +136,7 @@ fun_caves.underzones = {
|
||||||
lake_level = 10,
|
lake_level = 10,
|
||||||
lower_bound = -19952,
|
lower_bound = -19952,
|
||||||
regular_columns = false,
|
regular_columns = false,
|
||||||
|
stone_depth = 2,
|
||||||
upper_bound = -19792,
|
upper_bound = -19792,
|
||||||
vary = true,
|
vary = true,
|
||||||
},
|
},
|
||||||
|
@ -141,12 +144,11 @@ fun_caves.underzones = {
|
||||||
name = 'Styx',
|
name = 'Styx',
|
||||||
ceiling = -29812,
|
ceiling = -29812,
|
||||||
ceiling_node = 'default:dirt',
|
ceiling_node = 'default:dirt',
|
||||||
column_node = nil,
|
|
||||||
column_node_rare = nil,
|
|
||||||
floor = -30012,
|
floor = -30012,
|
||||||
floor_node = 'default:dirt',
|
floor_node = 'default:dirt',
|
||||||
lower_bound = -30032,
|
lower_bound = -30032,
|
||||||
regular_columns = false,
|
regular_columns = false,
|
||||||
|
stone_depth = 2,
|
||||||
sealevel = -29842,
|
sealevel = -29842,
|
||||||
upper_bound = -29792,
|
upper_bound = -29792,
|
||||||
vary = true,
|
vary = true,
|
||||||
|
@ -157,111 +159,120 @@ fun_caves.cave_biomes = {
|
||||||
algae = {
|
algae = {
|
||||||
biome_val_low = 0,
|
biome_val_low = 0,
|
||||||
biome_val_high = 0.2,
|
biome_val_high = 0.2,
|
||||||
|
ceiling_node = 'fun_caves:stone_with_algae',
|
||||||
dirt = 'default:dirt',
|
dirt = 'default:dirt',
|
||||||
dirt_chance = 10,
|
dirt_chance = 10,
|
||||||
|
floor_node = 'fun_caves:stone_with_algae',
|
||||||
fungi = true,
|
fungi = true,
|
||||||
stalactite = 'fun_caves:stalactite_slimy',
|
stalactite = 'fun_caves:stalactite_slimy',
|
||||||
stalactite_chance = 12,
|
stalactite_chance = 12,
|
||||||
stalagmite = 'fun_caves:stalagmite_slimy',
|
stalagmite = 'fun_caves:stalagmite_slimy',
|
||||||
stalagmite_chance = 12,
|
stalagmite_chance = 12,
|
||||||
stone_type = 'fun_caves:stone_with_algae',
|
|
||||||
stone_depth = 1,
|
stone_depth = 1,
|
||||||
underwater = true,
|
underwater = true,
|
||||||
},
|
},
|
||||||
coal = {
|
coal = {
|
||||||
biome_val_low = 0.5,
|
biome_val_low = 0.5,
|
||||||
biome_val_high = 0.6,
|
biome_val_high = 0.6,
|
||||||
|
ceiling_node = 'fun_caves:black_sand',
|
||||||
deco = 'default:coalblock',
|
deco = 'default:coalblock',
|
||||||
deco_chance = 100,
|
deco_chance = 100,
|
||||||
fungi = nil,
|
floor_node = 'fun_caves:black_sand',
|
||||||
stalagmite = 'fun_caves:constant_flame',
|
stalagmite = 'fun_caves:constant_flame',
|
||||||
stalagmite_chance = 50,
|
stalagmite_chance = 50,
|
||||||
stone_type = 'fun_caves:black_sand',
|
|
||||||
stone_depth = 2,
|
stone_depth = 2,
|
||||||
underwater = false,
|
underwater = false,
|
||||||
},
|
},
|
||||||
hot = {
|
hot = {
|
||||||
biome_val_low = 0.6,
|
biome_val_low = 0.6,
|
||||||
biome_val_high = 99,
|
biome_val_high = 99,
|
||||||
|
ceiling_node = 'fun_caves:hot_cobble',
|
||||||
|
floor_node = 'fun_caves:hot_cobble',
|
||||||
fluid = 'default:lava_source',
|
fluid = 'default:lava_source',
|
||||||
fluid_chance = 300,
|
fluid_chance = 300,
|
||||||
stalagmite = fun_caves.hot_spikes,
|
stalagmite = fun_caves.hot_spikes,
|
||||||
stalagmite_chance = 50,
|
stalagmite_chance = 50,
|
||||||
stone_type = 'fun_caves:hot_cobble',
|
|
||||||
stone_depth = 1,
|
stone_depth = 1,
|
||||||
underwater = false,
|
underwater = false,
|
||||||
},
|
},
|
||||||
ice = {
|
ice = {
|
||||||
biome_val_low = -99,
|
biome_val_low = -99,
|
||||||
biome_val_high = -0.6,
|
biome_val_high = -0.6,
|
||||||
|
ceiling_node = 'default:ice',
|
||||||
|
floor_node = 'default:ice',
|
||||||
stalactite = 'fun_caves:icicle_down',
|
stalactite = 'fun_caves:icicle_down',
|
||||||
stalactite_chance = 12,
|
stalactite_chance = 12,
|
||||||
stalagmite = 'fun_caves:icicle_up',
|
stalagmite = 'fun_caves:icicle_up',
|
||||||
stalagmite_chance = 12,
|
stalagmite_chance = 12,
|
||||||
stone_type = 'default:ice',
|
|
||||||
stone_depth = 2,
|
stone_depth = 2,
|
||||||
underwater = true,
|
underwater = true,
|
||||||
},
|
},
|
||||||
ice_thin = {
|
ice_thin = {
|
||||||
biome_val_low = -0.6,
|
biome_val_low = -0.6,
|
||||||
biome_val_high = -0.5,
|
biome_val_high = -0.5,
|
||||||
stone_type = 'fun_caves:thin_ice',
|
ceiling_node = 'fun_caves:thin_ice',
|
||||||
|
floor_node = 'fun_caves:thin_ice',
|
||||||
stone_depth = 2,
|
stone_depth = 2,
|
||||||
underwater = true,
|
underwater = true,
|
||||||
},
|
},
|
||||||
lichen = {
|
lichen = {
|
||||||
biome_val_low = -0.3,
|
biome_val_low = -0.3,
|
||||||
biome_val_high = 0,
|
biome_val_high = 0,
|
||||||
|
ceiling_node = 'fun_caves:stone_with_lichen',
|
||||||
dirt = 'default:dirt',
|
dirt = 'default:dirt',
|
||||||
dirt_chance = 10,
|
dirt_chance = 10,
|
||||||
|
floor_node = 'fun_caves:stone_with_lichen',
|
||||||
fungi = true,
|
fungi = true,
|
||||||
stalactite = 'fun_caves:stalactite',
|
stalactite = 'fun_caves:stalactite',
|
||||||
stalactite_chance = 12,
|
stalactite_chance = 12,
|
||||||
stalagmite = 'fun_caves:stalagmite',
|
stalagmite = 'fun_caves:stalagmite',
|
||||||
stalagmite_chance = 12,
|
stalagmite_chance = 12,
|
||||||
stone_type = 'fun_caves:stone_with_lichen',
|
|
||||||
stone_depth = 1,
|
stone_depth = 1,
|
||||||
underwater = true,
|
underwater = true,
|
||||||
},
|
},
|
||||||
lichen_dead = {
|
lichen_dead = {
|
||||||
biome_val_low = -0.6,
|
biome_val_low = -0.6,
|
||||||
biome_val_high = -0.5,
|
biome_val_high = -0.5,
|
||||||
|
ceiling_node = 'fun_caves:stone_with_lichen',
|
||||||
|
floor_node = 'fun_caves:stone_with_lichen',
|
||||||
stalactite = 'fun_caves:stalactite',
|
stalactite = 'fun_caves:stalactite',
|
||||||
stalactite_chance = 12,
|
stalactite_chance = 12,
|
||||||
stalagmite = 'fun_caves:stalagmite',
|
stalagmite = 'fun_caves:stalagmite',
|
||||||
stalagmite_chance = 12,
|
stalagmite_chance = 12,
|
||||||
stone_type = 'fun_caves:stone_with_lichen',
|
|
||||||
stone_depth = 1,
|
stone_depth = 1,
|
||||||
underwater = true,
|
underwater = true,
|
||||||
},
|
},
|
||||||
moss = {
|
moss = {
|
||||||
biome_val_low = -0.5,
|
biome_val_low = -0.5,
|
||||||
biome_val_high = -0.3,
|
biome_val_high = -0.3,
|
||||||
|
ceiling_node = 'fun_caves:stone_with_moss',
|
||||||
deco = 'fun_caves:glowing_fungal_stone',
|
deco = 'fun_caves:glowing_fungal_stone',
|
||||||
deco_chance = 50,
|
deco_chance = 50,
|
||||||
|
floor_node = 'fun_caves:stone_with_moss',
|
||||||
fluid = 'default:water_source',
|
fluid = 'default:water_source',
|
||||||
fluid_chance = 300,
|
fluid_chance = 300,
|
||||||
stalactite = 'fun_caves:stalactite_mossy',
|
stalactite = 'fun_caves:stalactite_mossy',
|
||||||
stalactite_chance = 12,
|
stalactite_chance = 12,
|
||||||
stalagmite = 'fun_caves:stalagmite_mossy',
|
stalagmite = 'fun_caves:stalagmite_mossy',
|
||||||
stalagmite_chance = 12,
|
stalagmite_chance = 12,
|
||||||
stone_type = 'fun_caves:stone_with_moss',
|
|
||||||
stone_depth = 1,
|
stone_depth = 1,
|
||||||
underwater = true,
|
underwater = true,
|
||||||
},
|
},
|
||||||
salt = {
|
salt = {
|
||||||
biome_val_low = 0.2,
|
biome_val_low = 0.2,
|
||||||
biome_val_high = 0.35,
|
biome_val_high = 0.35,
|
||||||
|
ceiling_node = 'fun_caves:stone_with_salt',
|
||||||
deco = 'fun_caves:radioactive_ore',
|
deco = 'fun_caves:radioactive_ore',
|
||||||
deco_chance = 500,
|
deco_chance = 500,
|
||||||
stone_type = 'fun_caves:stone_with_salt',
|
floor_node = 'fun_caves:stone_with_salt',
|
||||||
stone_depth = 2,
|
stone_depth = 2,
|
||||||
underwater = false,
|
underwater = false,
|
||||||
},
|
},
|
||||||
sand = {
|
sand = {
|
||||||
biome_val_low = 0.35,
|
biome_val_low = 0.35,
|
||||||
biome_val_high = 0.5,
|
biome_val_high = 0.5,
|
||||||
stone_type = 'default:sand',
|
ceiling_node = 'default:sand',
|
||||||
|
floor_node = 'default:sand',
|
||||||
stone_depth = 2,
|
stone_depth = 2,
|
||||||
underwater = true,
|
underwater = true,
|
||||||
},
|
},
|
||||||
|
@ -282,7 +293,7 @@ local function generate(p_minp, p_maxp, seed)
|
||||||
|
|
||||||
local write = false
|
local write = false
|
||||||
local write_p2 = false
|
local write_p2 = false
|
||||||
local underzone = nil
|
local underzone
|
||||||
for _, uz in pairs(fun_caves.underzones) do
|
for _, uz in pairs(fun_caves.underzones) do
|
||||||
local avg = (minp.y + maxp.y) / 2
|
local avg = (minp.y + maxp.y) / 2
|
||||||
if avg <= uz.upper_bound and avg >= uz.lower_bound then
|
if avg <= uz.upper_bound and avg >= uz.lower_bound then
|
||||||
|
|
18
nodes.lua
18
nodes.lua
|
@ -80,22 +80,24 @@ minetest.register_node("fun_caves:leaves_black", newnode)
|
||||||
|
|
||||||
newnode = fun_caves.clone_node("default:water_source")
|
newnode = fun_caves.clone_node("default:water_source")
|
||||||
newnode.description = "Poisonous Water"
|
newnode.description = "Poisonous Water"
|
||||||
newnode.tiles[1].name = "fun_caves_water_poison_source_animated.png"
|
newnode.groups.poison = 3
|
||||||
newnode.special_tiles[1].name = "fun_caves_water_poison_source_animated.png"
|
newnode.light_source = 6
|
||||||
newnode.liquid_alternative_flowing = "fun_caves:water_poison_flowing"
|
newnode.liquid_alternative_flowing = "fun_caves:water_poison_flowing"
|
||||||
newnode.liquid_alternative_source = "fun_caves:water_poison_source"
|
newnode.liquid_alternative_source = "fun_caves:water_poison_source"
|
||||||
newnode.light_source = 6
|
newnode.post_effect_color = {a = 103, r = 108, g = 128, b = 64}
|
||||||
newnode.groups.poison = 3
|
newnode.special_tiles[1].name = "fun_caves_water_poison_source_animated.png"
|
||||||
|
newnode.tiles[1].name = "fun_caves_water_poison_source_animated.png"
|
||||||
minetest.register_node("fun_caves:water_poison_source", newnode)
|
minetest.register_node("fun_caves:water_poison_source", newnode)
|
||||||
|
|
||||||
newnode = fun_caves.clone_node("default:water_flowing")
|
newnode = fun_caves.clone_node("default:water_flowing")
|
||||||
newnode.description = "Poisonous Water"
|
newnode.description = "Poisonous Water"
|
||||||
newnode.tiles[1] = "fun_caves_water_poison.png"
|
newnode.groups.poison = 3
|
||||||
newnode.special_tiles[1].name = "fun_caves_water_poison_flowing_animated.png"
|
newnode.light_source = 6
|
||||||
newnode.liquid_alternative_flowing = "fun_caves:water_poison_flowing"
|
newnode.liquid_alternative_flowing = "fun_caves:water_poison_flowing"
|
||||||
newnode.liquid_alternative_source = "fun_caves:water_poison_source"
|
newnode.liquid_alternative_source = "fun_caves:water_poison_source"
|
||||||
newnode.light_source = 6
|
newnode.post_effect_color = {a = 103, r = 108, g = 128, b = 64}
|
||||||
newnode.groups.poison = 3
|
newnode.special_tiles[1].name = "fun_caves_water_poison_flowing_animated.png"
|
||||||
|
newnode.tiles[1] = "fun_caves_water_poison.png"
|
||||||
minetest.register_node("fun_caves:water_poison_flowing", newnode)
|
minetest.register_node("fun_caves:water_poison_flowing", newnode)
|
||||||
|
|
||||||
--minetest.register_node("fun_caves:bright_air", {
|
--minetest.register_node("fun_caves:bright_air", {
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 618 B |
Binary file not shown.
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3.3 KiB |
Loading…
Add table
Add a link
Reference in a new issue