Make raid end firework last a bit longer

This commit is contained in:
cora 2022-11-18 15:15:58 +01:00
parent c6fc388597
commit 87d5cdc439

@ -245,10 +245,12 @@ local function start_firework_rocket(pos)
o:set_acceleration(vector.new(math.random(0,2),math.random(30,50),math.random(0,2))) o:set_acceleration(vector.new(math.random(0,2),math.random(30,50),math.random(0,2)))
end end
local function make_firework(pos) local function make_firework(pos,stime)
if os.time() - stime > 60 then return end
for i=1,math.random(25) do for i=1,math.random(25) do
minetest.after(math.random(i),start_firework_rocket,pos) minetest.after(math.random(i),start_firework_rocket,pos)
end end
minetest.after(10,make_firework,pos,stime)
end end
mcl_events.register_event("raid",{ mcl_events.register_event("raid",{
@ -315,7 +317,7 @@ mcl_events.register_event("raid",{
on_complete = function(self) on_complete = function(self)
awards.unlock(self.player,"mcl:hero_of_the_village") awards.unlock(self.player,"mcl:hero_of_the_village")
mcl_potions.player_clear_effect(minetest.get_player_by_name(self.player),"bad_omen") mcl_potions.player_clear_effect(minetest.get_player_by_name(self.player),"bad_omen")
make_firework(self.pos) make_firework(self.pos,os.time())
end, end,
}) })