Light = 0.9
 
turnOn = function()
	Lighting.Ambient = Light
	if Light < 1.01 then
		Light = Light + 0.001
		Trigger.AfterDelay(8, function()
			turnOn()
		end)
	
	else
		Trigger.AfterDelay(8000, function()
			turnOff()
		end)
	end
end

turnOff = function()
	Lighting.Ambient = Light
	if Light > 0.6 then
		Light = Light - 0.001
		Trigger.AfterDelay(8, function()
			turnOff()
		end)	
	
	else
		Trigger.AfterDelay(3000, function()
			turnOn()
		end)
	end
end

PlaySound = function()
	Media.PlaySound("SilentNight.wav")
	Trigger.AfterDelay(DateTime.Seconds(175), PlaySound)
end


Thiscolor = HSLColor.New(115, 115, 143)

function WorldLoaded()
	Media.StopMusic()
	PlaySound()
	turnOn()
	Trigger.AfterDelay(DateTime.Seconds(5), function()
		Media.DisplayMessage("Toxic rules:\n...much faster build with more buildings\n...Unlimited superweapons", "Materia", Thiscolor)
	end)
	Trigger.AfterDelay(DateTime.Seconds(10), function()
		Media.DisplayMessage("No killbounties", "Materia", Thiscolor)
	end)
	Trigger.AfterDelay(DateTime.Seconds(15), function()
		Media.DisplayMessage("Merry X-mass and enjoy the map ;D", "Materia", Thiscolor)
	end)
end
