turn underwater pillars/stalagmites in the Sunless Sea into cave coral

This commit is contained in:
FaceDeer 2019-08-01 23:07:15 -06:00
parent 161719eb4d
commit 5e113ec200
4 changed files with 19 additions and 8 deletions

View File

@ -9,6 +9,12 @@ local c_dry_flowstone = minetest.get_content_id("df_mapitems:dry_flowstone")
local c_lava = minetest.get_content_id("default:lava_source")
local c_obsidian = minetest.get_content_id("default:obsidian")
local c_coral_table = {
minetest.get_content_id("df_mapitems:cave_coral_1"),
minetest.get_content_id("df_mapitems:cave_coral_2"),
minetest.get_content_id("df_mapitems:cave_coral_3")
}
local mushroom_shrublist
local fungispore_shrublist
@ -357,15 +363,19 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d
-- columns
for _, vi in ipairs(node_arrays.column_nodes) do
local index2d = mapgen_helper.index2di(minp, maxp, area, vi)
local heat = heatmap[index2d]
if area:get_y(vi) > sea_level and heat > hot_zone_boundary and data[vi] == c_wet_flowstone then
data[vi] = c_dry_flowstone
if data[vi] == c_wet_flowstone then
if area:get_y(vi) > sea_level then
local index2d = mapgen_helper.index2di(minp, maxp, area, vi)
local heat = heatmap[index2d]
if heat > hot_zone_boundary then
data[vi] = c_dry_flowstone
end
else
data[vi] = c_coral_table[math.random(1,3)]
end
end
end
vm:set_param2_data(data_param2)
end

View File

@ -209,7 +209,7 @@ local get_pit = function(pos)
if region_mapblocks < 1 then return nil end
local corner_xz = get_corner(pos)
local next_seed = math.random(1, 2^31)
local next_seed = math.floor(math.random() * 2^31)
math.randomseed(corner_xz.x + corner_xz.z * 2 ^ 8 + mapgen_seed)
local location = scatter_2d(corner_xz, pit_region_size, radius_pit_max + radius_pit_variance)
local variance_multiplier = math.random()

View File

@ -42,6 +42,7 @@ local coral_names = {"df_mapitems:cave_coral_1", "df_mapitems:cave_coral_2", "df
minetest.register_abm{
label = "df_mapitems:shifting_coral",
nodenames = {"group:dfcaverns_cave_coral"},
neighbors = {"default:water_source"},
interval = 2,
chance = 10,
action = function(pos)

View File

@ -173,7 +173,7 @@ minetest.register_craft({
-- This ensures consistent random maximum to bloodthorn growth
local max_bloodthorn_height = function(pos)
local next_seed = math.random(1, 2^31)
local next_seed = math.floor(math.random() * 2^31)
math.randomseed(pos.x + pos.z * 2 ^ 8)
local output = math.random(3,6)
math.randomseed(next_seed)