--[[spark_particle = 
{
	animation = "DATA:Animations/marshmallow bud/effects/sunshine.anim",
	life = 0,
	fade = "none",

	--default to background particle
	particle_placement = FXParticle.MIDGROUND
}

offset = Vector2(-1, -3)
offset2 = Vector2(3, -1)

scale = 0.9

WAIT_TIME = 10
elapsed = WAIT_TIME

rotate = false

function UpdatePattern( pattern, time_elapsed, particles, root_position, root_object )
	
	for particle in particles:GetParticles() do
	
		local theta = 0

		if elapsed == WAIT_TIME then

			rotate = not rotate
			if rotate then
				particle:SetFacing( Vector2(0,1) )
			else
				particle:SetFacing( Vector2(1,0) )
			end
			
		end

		local pos = root_position
		
		if rotate then
			root_position = root_position + offset2*scale
		else
			root_position = root_position + offset*scale
		end
		
		particle:SetPosition( root_position )
	
	end
	
	elapsed = elapsed - 1
	
	if elapsed < 0 then elapsed = WAIT_TIME end
	
end

function UpdateSpawn( spawner, time_elapsed, particles, root_position, root_object )

	if not spawned then
		spawned = true
		
		local particle = spawner:SpawnParticle( "spark_particle", root_position )
		
		if World_GetTimeOfDay() == 2 then
			particle:SetModulate( Colour(255,255,155,100) )
		else
			particle:SetModulate( Colour(255,255,155,210) )
		end
		
		particle:SetScale( Vector2(scale,scale) )
	end
          
end

Effect = 
{
	FXType = "Custom",
	Data = 
	{
		-- 0 is infinity
		life = 1000000,
		
--		sound = "bang",
		
--		volume = 10.0,
	}
}--]]

Effect = 
{
	FXType = "BudSunshine",
	Data = 
	{
		-- 0 is infinity
		life = 0,
		
		BudSunshine =
		{
			day = {255, 255, 155, 210},
			sunset = {255, 255, 155, 210},
			night = {255, 255, 155, 100},
			
			scale = 0.9,
			wait_time = 10,
			
			offset1 = {-1,-3},
			offset2 = {3,-1},
		},
		
		Particles = 
		{
			animation = "DATA:Animations/marshmallow bud/effects/sunshine.anim",
			life = 0,
			fade = "none",
		
			--default to background particle
			particle_placement = FXParticle.MIDGROUND
		}

		--sound = "superpig_explode"
	}
}