Revert "nerf asteroids"
This reverts commit 66323941c199bf6950aa49e363838261c5d65c21.
This commit is contained in:
parent
66323941c1
commit
c91e0d53ce
5
init.lua
5
init.lua
@ -2,12 +2,15 @@
|
||||
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
|
||||
debug = minetest.settings:get("planetoids.debug") or false,
|
||||
min_chance = 1,
|
||||
ores = {}
|
||||
}
|
||||
|
||||
|
||||
local MP = minetest.get_modpath("planetoids")
|
||||
|
||||
dofile(MP.."/ores.lua")
|
||||
dofile(MP.."/mapgen_oreplanet.lua")
|
||||
dofile(MP.."/mapgen.lua")
|
||||
|
||||
|
@ -56,6 +56,19 @@ 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
|
||||
@ -64,9 +77,7 @@ planetoids.mapgen_oreplanet = function(minp, maxp, vm, area)
|
||||
end --y
|
||||
end --z
|
||||
|
||||
minetest.generate_ores(vm, minp, maxp)
|
||||
|
||||
vm:set_data(data)
|
||||
vm:set_data(data)
|
||||
|
||||
if planetoids.debug then
|
||||
print("[Planetoids] count: " .. count .. " min: " .. min_perlin .. " max: " .. max_perlin)
|
||||
|
46
ores.lua
Normal file
46
ores.lua
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
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…
x
Reference in New Issue
Block a user