1
0
mirror of git://repo.or.cz/rocks.git synced 2024-11-16 07:20:40 +01:00
rocks/sed.lua

68 lines
2.3 KiB
Lua
Raw Normal View History

2015-04-01 21:46:30 +02:00
--
-- Sedimentary Layer
--
local sed={
top={
offset = 20, scale = 0,
spread = {x=80, y=80, z=80},
octaves = 0, persist = 0 },
bot={
2015-04-02 20:17:56 +02:00
offset = -16, scale = 10, seed=rocksl.GetNextSeed(),
2015-04-01 21:46:30 +02:00
spread = {x=80, y=80, z=80},
octaves = 2, persist = 0.7 },
primary={ name="rocks:mudstone" },
localized={},
2015-04-02 20:17:56 +02:00
stats={ count=0, total=0, node={}, totalnodes=0 },
debugging=nil
2015-04-01 21:46:30 +02:00
}
-- Mudstone Sed soft Ocean, beach, river, glaciers
minetest.register_node( "rocks:mudstone", {
description = S("Mudstone"),
tiles = { "rocks_Mudstone.png" },
2015-04-02 20:17:56 +02:00
groups = {cracky=1, crumbly=3},
2015-04-01 21:46:30 +02:00
is_ground_content = true, sounds = default.node_sound_dirt_defaults(),
})
-- more rock defs
minetest.register_node( "rocks:limestone", {
description = S("Limestone"),
tiles = { "rocks_Limestone.png" },
is_ground_content = true, sounds = default.node_sound_stone_defaults(),
2015-04-02 00:28:16 +02:00
groups = {cracky=2},
2015-04-01 21:46:30 +02:00
})
local reg=function(name,param)
2015-04-02 20:17:56 +02:00
rocksl.register_blob(sed,name,param)
2015-04-01 21:46:30 +02:00
end
2015-04-02 20:17:56 +02:00
2015-04-01 21:46:30 +02:00
rocks.register_sedimentary=reg
-- Sedimentary rock hardness and distribution
-- Rock Hard Distribution
--Breccia Weak Localized continental, folded
-->Claystone Weak Localized continental, folded, oceanic
--Conglomerate Weak Localized continental, folded
-->Limestone Medium Localized continental, folded; primary oceanic, hills
-->Coal - Large beds, twice as common in swamps
2015-04-02 20:17:56 +02:00
reg("rocks:limestone", { spread=64, height=32, treshold=0.36 })
2015-04-02 00:28:16 +02:00
--reg("rocks:breccia", { spread=64, height=32, treshold=0.6 })
--reg("rocks:conglomerate", { spread=64, height=32, treshold=0.6 })
2015-04-02 20:17:56 +02:00
reg("default:stone_with_coal", { spread=48, height=14, treshold=0.40 })
reg("default:clay",{ spread=48, height=14, treshold=0.50 })
2015-04-01 21:46:30 +02:00
minetest.register_on_generated(function(minp, maxp, seed)
2015-04-02 20:17:56 +02:00
rocksl.layergen(sed,minp,maxp,seed)
2015-04-01 21:46:30 +02:00
end)
minetest.register_on_shutdown(function()
2015-04-03 15:48:49 +02:00
if (sed.stats.count==0) then rocksl.print("[rocks](sed) stats not available, no chunks generated") return end
rocksl.print("[rocks](sed) generated total "..sed.stats.count.." chunks in "..sed.stats.total.." seconds ("..(sed.stats.total/sed.stats.count).." seconds per "..sed.stats.side.."^3 chunk)")
2015-04-02 00:28:16 +02:00
for name,total in pairs(sed.stats.node) do
2015-04-03 15:48:49 +02:00
rocksl.print("[rocks](sed) "..name..": "..total.." nodes placed ("..(total*100)/(sed.stats.totalnodes).." %)")
2015-04-02 00:28:16 +02:00
end
2015-04-01 21:46:30 +02:00
end)
-- ~ Tomas Brod