Protect translocators. Fix mobs requirement error in villages.

The translocator protection DOES NOT WORK against mobs explosions.
This is not a fun_caves issue.
This commit is contained in:
Duane 2016-07-03 23:20:53 -05:00
parent 26622dd1dd
commit 0fd901dcca
7 changed files with 108 additions and 70 deletions

View file

@ -60,6 +60,34 @@ local gravity_off = {gravity = 0.1}
local gravity_on = {gravity = 1}
local fortress_floor = {x = 30, y = 2, z = 30}
local fortress_group = {'group:fortress'}
local firework_active = false
local function firework()
local t = minetest.get_timeofday()
if not firework_active and (t < 0.25 or t > 0.75) then
firework_active = true
local ps = {}
local players = minetest.get_connected_players()
for i = 1, #players do
local pp = players[i]:getpos()
if pp and pp.y > 0 then
local sky = {}
sky.bgcolor, sky.type, sky.textures = players[i]:get_sky()
ps[#ps+1] = { p = players[i], sky = sky }
--players[i]:set_sky(0xffffff, "plain", {})
players[i]:set_sky('#000000', 'skybox', {'fun_caves_firework_'..math.random(2)..'.png', 'fun_caves_blank.png', 'fun_caves_blank.png', 'fun_caves_blank.png', 'fun_caves_blank.png', 'fun_caves_blank.png'})
end
end
minetest.sound_play("fireworks", {gain = 1, pos = pp, max_hear_distance = 2})
minetest.after(4, function()
for i = 1, #ps do
ps[i].p:set_sky(ps[i].sky.bgcolor, ps[i].sky.type, ps[i].sky.textures)
end
firework_active = false
end)
end
end
minetest.register_globalstep(function(dtime)
local time = minetest.get_gametime()
@ -74,6 +102,10 @@ minetest.register_globalstep(function(dtime)
out:close()
end
if fun_caves.date and fun_caves.date[2] == 7 and fun_caves.date[3] == 3 and math.random(30) == 1 then
firework()
end
-- Promote mobs based on spawn position
local is_fortress = fun_caves.is_fortress
for _, mob in pairs(minetest.luaentities) do