for k,v in pairs({"disableAfkDeath","disableAutoTimeLeft","disableAutoShaman","disableAutoNewGame","disableMortCommand","disableDebugCommand"}) do
tfm.exec[v]()
end
tfm.exec.newGame('')
tfm.exec.snow(10000)
ui.setMapName("Joyeux Noël Papaneige !")
A={{12,90},{18,70},{24,50},{30,30},{40,10},{50,30},{56,50},{62,70},{68,90},{40,50}}
P={{20,90},{20,70},{20,50},{20,30},{20,10},{38,48},{38,12},{55,44},{55,16},{65,30}}
N={{15,90},{15,70},{15,50},{15,30},{15,10},{65,90},{65,70},{65,50},{65,30},{65,10},{25,24},{33,37},{40,50},{47,63},{55,76}}
E={{15,90},{15,70},{15,50},{15,30},{15,10},{30,90},{45,90},{60,90},{30,10},{45,10},{60,10},{30,50},{45,50}}
G={{60,15},{47,14},{34,18},{23,26},{16,39},{15,53},{15,67},{20,80},{32,88},{46,90},{60,90},{60,75},{60,60},{46,60}}
I={{40,90},{40,75},{40,60},{40,45},{40,30},{40,15}}
pseudo={P,A,P,A,N,E,I,G,E}
particles={1,9,0,4,2,11,13}
t1,t2,currPart,yi=5,-1,4,350
function resetParameters()
currPart=particles[math.random(#particles)]
vy=math.random()
if math.random(1,3)<=2 then
t1=1+math.random(2,4)
else
t2=10+math.random(2,4)
end
end
function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
end
function launchFirework(j)
for i=1,#pseudo[j] do
xi=25+150*math.random(0,5)
xf=pseudo[j][i][1]+(j-1)*90
yf=pseudo[j][i][2]+30
tfm.exec.displayParticle(currPart, xi, yi, (xf-xi)*5/145, (yf-yi)*5/145, 0, 0, nil)
end
end
function displayFirework(j)
for k=1,3 do
for i=1,#pseudo[j] do
tfm.exec.displayParticle(currPart, pseudo[j][i][1]+(j-1)*90, pseudo[j][i][2]+30, 0, vy, 0, 0, nil)
end
end
end
function eventLoop()
t=not t
if t then return end
if t1>=0 then
if t1==2 then
for i=1,9 do
launchFirework(i)
end
elseif t1==1 then
for i=1,9 do
displayFirework(i)
end
end
t1=t1-1
elseif t2>=0 then
if t2>=1 and t2<=10 then
if t2~=1 then launchFirework(11-t2) end
if t2~=10 then displayFirework(10-t2) end
end
t2=t2-1
end
if t1==0 or t2==0 then
resetParameters()
end
end