nerf asteroids
parent
72e6db6538
commit
66323941c1
5
init.lua
5
init.lua
|
@ -2,15 +2,12 @@
|
|||
planetoids = {
|
||||
miny = tonumber(minetest.settings:get("planetoids.miny")) or 6000,
|
||||
maxy = tonumber(minetest.settings:get("planetoids.maxy")) or 10000,
|
||||
debug = minetest.settings:get("planetoids.debug") or false,
|
||||
min_chance = 1,
|
||||
ores = {}
|
||||
debug = minetest.settings:get("planetoids.debug") or false
|
||||
}
|
||||
|
||||
|
||||
local MP = minetest.get_modpath("planetoids")
|
||||
|
||||
dofile(MP.."/ores.lua")
|
||||
dofile(MP.."/mapgen_oreplanet.lua")
|
||||
dofile(MP.."/mapgen.lua")
|
||||
|
||||
|
|
|
@ -56,19 +56,6 @@ planetoids.mapgen_oreplanet = function(minp, maxp, vm, area)
|
|||
|
||||
if planet_n > max_perlin then max_perlin = planet_n end
|
||||
if planet_n < min_perlin then min_perlin = planet_n end
|
||||
|
||||
if planet_n > planetoids.min_chance then
|
||||
|
||||
-- planet
|
||||
data[index] = c_base
|
||||
for _,ore in pairs(planetoids.ores) do
|
||||
if planet_n > ore.chance then
|
||||
data[index] = ore.id
|
||||
count = count + 1
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
i = i + 1
|
||||
|
@ -77,7 +64,9 @@ planetoids.mapgen_oreplanet = function(minp, maxp, vm, area)
|
|||
end --y
|
||||
end --z
|
||||
|
||||
vm:set_data(data)
|
||||
minetest.generate_ores(vm, minp, maxp)
|
||||
|
||||
vm:set_data(data)
|
||||
|
||||
if planetoids.debug then
|
||||
print("[Planetoids] count: " .. count .. " min: " .. min_perlin .. " max: " .. max_perlin)
|
||||
|
|
46
ores.lua
46
ores.lua
|
@ -1,46 +0,0 @@
|
|||
|
||||
local register_ore = function(def)
|
||||
table.insert(planetoids.ores, def)
|
||||
planetoids.min_chance = math.min(def.chance, planetoids.min_chance)
|
||||
end
|
||||
|
||||
register_ore({
|
||||
id = minetest.get_content_id("default:lava_source"),
|
||||
chance = 1.16
|
||||
})
|
||||
|
||||
register_ore({
|
||||
id = minetest.get_content_id("default:stone_with_mese"),
|
||||
chance = 1.1
|
||||
})
|
||||
|
||||
register_ore({
|
||||
id = minetest.get_content_id("default:stone_with_iron"),
|
||||
chance = 1.0
|
||||
})
|
||||
|
||||
register_ore({
|
||||
id = minetest.get_content_id("default:stone_with_gold"),
|
||||
chance = 0.99
|
||||
})
|
||||
|
||||
register_ore({
|
||||
id = minetest.get_content_id("default:stone_with_copper"),
|
||||
chance = 0.98
|
||||
})
|
||||
|
||||
register_ore({
|
||||
id = minetest.get_content_id("default:ice"),
|
||||
chance = 0.9
|
||||
})
|
||||
|
||||
register_ore({
|
||||
id = minetest.get_content_id("default:stone"),
|
||||
chance = 0.85
|
||||
})
|
||||
|
||||
|
||||
-- sort ores
|
||||
table.sort(planetoids.ores, function(a,b)
|
||||
return b.chance < a.chance
|
||||
end)
|
Loading…
Reference in New Issue