mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-01-24 01:00:18 +01:00
prevent chasms from breaching oil and magma seas, make veinstone actually do something
This commit is contained in:
parent
ed54ceec93
commit
a9dfec969b
@ -1,7 +1,7 @@
|
||||
local data = {}
|
||||
|
||||
local maxy = tonumber(minetest.settings:get("chasms_maxy")) or -50
|
||||
local miny = tonumber(minetest.settings:get("chasms_miny")) or -3000
|
||||
local miny = tonumber(minetest.settings:get("chasms_miny")) or -2500
|
||||
local falloff = tonumber(minetest.settings:get("chasms_falloff")) or 100
|
||||
|
||||
local chasms_threshold = tonumber(minetest.settings:get("chasms_threshold")) or 0.9
|
||||
@ -56,7 +56,7 @@ local get_intensity = function(y)
|
||||
return (y-miny)/falloff
|
||||
end
|
||||
-- if y > maxfalloff then
|
||||
return (maxy-y)/falloff
|
||||
return (maxy-y)/falloff
|
||||
-- end
|
||||
end
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
chasms_params (Noise params for chasms) noise_params_3d 0, 1, (50, 1000, 3000), 94586, 2, 0.63, 2.0
|
||||
chasms_threshold (Noise threshold for chasms) float 0.9
|
||||
chasms_maxy (Maximum Y) int -50
|
||||
chasms_miny (Minimum Y) int -3000
|
||||
chasms_miny (Minimum Y) int -2500
|
||||
chasms_falloff (Taper range when approaching max or min) int 100
|
@ -9,6 +9,57 @@ minetest.register_node("df_mapitems:veinstone", {
|
||||
_magma_conduits_heats_to = df_mapitems.node_name.cobble,
|
||||
is_ground_content = false,
|
||||
light_source = 2,
|
||||
drop = df_mapitems.node_name.cobble,
|
||||
drop = "df_mapitems:veinstone",
|
||||
sounds = df_mapitems.sounds.stone,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.swap_node(pos, {name="df_mapitems:veinstone_pulse"})
|
||||
minetest.get_node_timer(pos):start(2)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("df_mapitems:veinstone_pulse", {
|
||||
description = S("Veinstone"),
|
||||
_doc_items_longdesc = df_mapitems.doc.veinstone_desc,
|
||||
_doc_items_usagehelp = df_mapitems.doc.veinstone_usage,
|
||||
tiles = {df_mapitems.texture.stone .. "^dfcaverns_veins.png"},
|
||||
groups = {cracky = 3, stone = 1, lava_heatable = 1, not_in_creative_inventory = 1},
|
||||
_magma_conduits_heats_to = df_mapitems.node_name.cobble,
|
||||
is_ground_content = false,
|
||||
light_source = 8,
|
||||
drop = "df_mapitems:veinstone",
|
||||
sounds = df_mapitems.sounds.stone,
|
||||
on_timer = function(pos, elapsed)
|
||||
local positions, count = minetest.find_nodes_in_area(vector.add(pos,1), vector.subtract(pos,1), "df_mapitems:veinstone")
|
||||
if count["df_mapitems:veinstone"] == 0 then
|
||||
positions, count = minetest.find_nodes_in_area(vector.add(pos,2), vector.subtract(pos,2), "df_mapitems:veinstone")
|
||||
end
|
||||
if count["df_mapitems:veinstone"] == 0 then
|
||||
positions = {[1] = minetest.find_node_near(pos, 3, "df_mapitems:veinstone")}
|
||||
end
|
||||
if positions[1] == nil then
|
||||
positions = {[1] = minetest.find_node_near(pos, 4, "df_mapitems:veinstone")}
|
||||
end
|
||||
for _, neighbor_pos in pairs(positions) do
|
||||
minetest.swap_node(neighbor_pos, {name="df_mapitems:veinstone_pulse"})
|
||||
minetest.get_node_timer(neighbor_pos):start(2)
|
||||
end
|
||||
minetest.swap_node(pos, {name="df_mapitems:veinstone_refractory"})
|
||||
minetest.get_node_timer(pos):start(12)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("df_mapitems:veinstone_refractory", {
|
||||
description = S("Veinstone"),
|
||||
_doc_items_longdesc = df_mapitems.doc.veinstone_desc,
|
||||
_doc_items_usagehelp = df_mapitems.doc.veinstone_usage,
|
||||
tiles = {df_mapitems.texture.stone .. "^dfcaverns_veins.png"},
|
||||
groups = {cracky = 3, stone = 1, lava_heatable = 1, not_in_creative_inventory = 1},
|
||||
_magma_conduits_heats_to = df_mapitems.node_name.cobble,
|
||||
is_ground_content = false,
|
||||
light_source = 1,
|
||||
drop = "df_mapitems:veinstone",
|
||||
sounds = df_mapitems.sounds.stone,
|
||||
on_timer = function(pos, elapsed)
|
||||
minetest.swap_node(pos, {name="df_mapitems:veinstone"})
|
||||
end,
|
||||
})
|
Loading…
Reference in New Issue
Block a user