--[[spark_particle = 
{
	animation = "DATA:Animations/marshmallow bud/effects/sweat.anim",
	life = 0.8,
	fade = "quadratic",

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

offsets = 
{
	Vector2(13, -8),
	--Vector2(5, -6),
	Vector2(8, -8),
	Vector2(7, -7),
	Vector2(-11, -5),
	Vector2(-7, -7),
	--Vector2(-10, -7)
}
	
scales = 
{
	Vector2( 1, 1 ),
	Vector2( 0.3, 0.3 ),
	Vector2( 0.8, 0.8 ),
	Vector2( 0.4, 0.4 ),
	Vector2( 0.5, 0.5 ),
	Vector2( 0.5, 0.5 ),
}

function UpdatePattern( pattern, time_elapsed, particles, root_position, root_object )
	
	for particle in particles:GetParticles() do
	
		particle:SetPosition( particle:GetPosition() + Vector2(0,0.5) )
	
	end
	
end

WAIT_TIME = 9
elapsed = WAIT_TIME

rotate = false

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

	if elapsed == WAIT_TIME then
		
		offset = World_GetDeterministicIntRange(1, table.getn(offsets))
		scale = World_GetDeterministicIntRange(1, table.getn(scales))
		
		local particle = spawner:SpawnParticle( "spark_particle", root_position + offsets[offset] )
		
		--particle:SetScale( Vector2(0.9,0.9) )
		if World_GetTimeOfDay() == 2 then
			particle:SetModulate( Colour(255,255,155,100) )
		else
			particle:SetModulate( Colour(255,255,155,210) )
		end
		
		particle:SetScale( scales[scale] )
	end
          
	elapsed = elapsed - 1
	if elapsed < 0 then elapsed = WAIT_TIME end
	
end

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

Effect = 
{
	FXType = "BudSweat",
	Data = 
	{
		-- 0 is infinity
		life = 0,
		
		BudSweat =
		{
			day = {255, 255, 155, 210},
			sunset = {255, 255, 155, 210},
			night = {255, 255, 155, 100},
			
			wait_time = 9,
			
			velocity = {0, 0.5},
			
			offsets =
			{
				{ 13, -8 },
				--{ 5, -6},
				{ 8, -8 },
				{ 7, -7 },
				{-11, -5 },
				{-7, -7 },
				--{-10, -}
			},
			
			scales =
			{
				{ 1, 1 },
				{ 0.3, 0.3 },
				{ 0.8, 0.8 },
				{ 0.4, 0.4 },
				{ 0.5, 0.5 },
				{ 0.5, 0.5 },
			},
		},
		
		Particles = 
		{
			animation = "DATA:Animations/marshmallow bud/effects/sweat.anim",
			life = 0.8,
			fade = "quadratic",
		
			--default to background particle
			particle_placement = FXParticle.FOREGROUND
		}

		--sound = "superpig_explode"
	}
}