at least a bit history

This commit is contained in:
HybridDog
2015-02-18 18:34:03 +01:00
parent 4dba4e8cb1
commit 7c75dafcdb
136 changed files with 3573 additions and 861 deletions

View File

@ -5,19 +5,20 @@ end
local r_chs = {}
function nether_weird_noise(minp, fct, s, seed, range)
function nether_weird_noise(minp, fct, s, seed, range, scale)
if not r_chs[s] then
r_chs[s] = math.floor(s/3+0.5)
end
scale = scale or 15
local r_ch = r_chs[s]
local maxp = vector.add(minp, 16)
local maxp = vector.add(minp, scale)
local tab,n = {},1
local sm = range or (s+r_ch)*2
for z = -sm, 16+sm do
for z = -sm, scale+sm do
local pz = z+minp.z
if pz%s == 0 then
for x = -sm, 16+sm do
for x = -sm, scale+sm do
local px = x+minp.x
if px%s == 0 then
local pr = get_random(px, pz, seed)
@ -33,7 +34,6 @@ function nether_weird_noise(minp, fct, s, seed, range)
for x = minp.x, maxp.x do
local h = sm
for _,i in ipairs(tab) do
--local dist = vector.distance(i, {x=x, y=0, z=z})
h = math.min(h, fct(x, i.x, z, i.z))
end
tab2[n] = {x=x, y=maxp.y-h, z=z}
@ -45,10 +45,6 @@ end
--[[
local function dif(z1, z2)
if z1 < 0
and z2 < 0 then
z1,z2 = -z1,-z2
end
return math.abs(z1-z2)
end
@ -68,7 +64,7 @@ minetest.register_node("ac:wmg", {
description = "wmg",
tiles = {"ac_block.png"},
groups = {snappy=1,bendy=2,cracky=1},
sounds = default_stone_sounds,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local minp = vector.chunkcorner(pos)
for _,p in ipairs(weird_noise(minp, pymg, 20, 8, 4)) do