Change pyramid spawns to center on caskets.

This commit is contained in:
Duane 2016-07-03 02:49:09 -05:00
parent 70c39c6c0e
commit 6286a4e829
3 changed files with 26 additions and 2 deletions

View file

@ -298,6 +298,29 @@ minetest.register_abm({
end end
}) })
minetest.register_abm({
nodenames = {"fun_caves:casket"},
interval = 2,
chance = 10,
action = function(pos, node)
local objs = minetest.get_objects_inside_radius(pos, 7)
for i = 1, #objs do
if objs[i]:is_player() then
local p1 = vector.subtract(pos, 3)
local p2 = vector.add(pos, 3)
local nodes = minetest.find_nodes_in_area_under_air(p1, p2, {'fun_caves:pyramid_1'})
if nodes and #nodes > 0 then
if math.random(3) == 1 then
minetest.add_entity(nodes[math.random(#nodes)], 'mobs_monster:stone_monster')
else
minetest.add_entity(nodes[math.random(#nodes)], 'fun_caves:sand_monster')
end
end
end
end
end
})
local no_tree_grow = {'fun_caves:bark', 'fun_caves:leaves'} local no_tree_grow = {'fun_caves:bark', 'fun_caves:leaves'}
local wood_nodes = {{name = 'fun_caves:diamondwood'}, {name = 'fun_caves:ironwood'}, {name = 'fun_caves:sap'}, {name = 'fun_caves:tree'}} local wood_nodes = {{name = 'fun_caves:diamondwood'}, {name = 'fun_caves:ironwood'}, {name = 'fun_caves:sap'}, {name = 'fun_caves:tree'}}
minetest.register_abm({ minetest.register_abm({

View file

@ -637,7 +637,6 @@ if minetest.registered_entities["mobs_monster:sand_monster"] then
mobs.spawning_mobs["fun_caves:sand_monster"] = true mobs.spawning_mobs["fun_caves:sand_monster"] = true
mobs:register_spawn("fun_caves:sand_monster", {"default:sand"}, 20, 0, 4000, 3, -50) mobs:register_spawn("fun_caves:sand_monster", {"default:sand"}, 20, 0, 4000, 3, -50)
mobs:register_spawn("fun_caves:sand_monster", {"fun_caves:pyramid_1"}, default.LIGHT_MAX - 1, 0, 200, 5, 31000)
mobs:register_egg("fun_caves:sand_monster", "Deep Sand Monster", "default_sand.png", 1) mobs:register_egg("fun_caves:sand_monster", "Deep Sand Monster", "default_sand.png", 1)
end end

View file

@ -127,8 +127,10 @@ fun_caves.pyramid = function(minp, maxp, data, p2data, area, biomemap, biome_ids
else else
data[ivm] = node['air'] data[ivm] = node['air']
end end
elseif dy >= base_height and dy <= base_height + 40 - math.max(math.abs(dx - 40), math.abs(dz - 40)) then elseif dy >= base_height + 3 and dy <= base_height + 37 - math.max(math.abs(dx - 40), math.abs(dz - 40)) then
data[ivm] = node['fun_caves:pyramid_1'] data[ivm] = node['fun_caves:pyramid_1']
elseif dy >= base_height and dy <= base_height + 40 - math.max(math.abs(dx - 40), math.abs(dz - 40)) then
data[ivm] = node['default:sandstone_block']
end end
ivm = ivm + area.ystride ivm = ivm + area.ystride