--[[spark_particle = 
{
	animation = "DATA:Animations/ginseng/effects/ginseng_front_halo.anim",
	life = 0.8,
	fade = "quadratic",

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

local elapsed = 0
local circles =
{
  --{ radius = 400, number = 10 },
  { radius = 80, number = 1 },
  { radius = 40, number = 1 },
}

function UpdatePattern( pattern, time_elapsed, particles, root_position, root_object )

    elapsed = elapsed + time_elapsed
	root_position = root_position + root_object:GetFacing():PerpDot()*5

	for i in particles:GetParticles() do
          
            local nowP = i:GetPosition()
            
            local diff = root_position - nowP
            diff.x = diff.x / 10
            diff.y = diff.y / 10
            i:Displace( diff )
			
			i:SetScale( i:GetScale()*0.92 )
                
	end

end

foo = 0
total = 0
function UpdateSpawn( spawner, time_elapsed, particles, root_position, root_object )

	total = total + 1
	if total >= 30*0.65 then
		return
	end
	
	if foo == 0 then
		foo = 3
	--if( not spawned ) then
		for i=1,table.getn( circles ) do
			for j=1,circles[i].number do
				local theta = math.random() * 2 * 3.14159
				local x = math.cos( theta ) * circles[i].radius
				local y = math.sin( theta ) * circles[i].radius
				
				local root_position = root_position + root_object:GetFacing():PerpDot()*80
				
				local pos = Vector2( root_position.x + x, root_position.y + y )
				local particle = spawner:SpawnParticle( "spark_particle", pos )
				particle:SetScale( Vector2(0.6,0.6) )
				particle:SetModulate( Colour(210,255,210,255) )
			end
		end
		--spawned = true
	end
          
	foo = foo - 1
	
end

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

Effect = 
{
	FXType = "GMInflate",
	Data = 
	{
		-- 0 is infinity
		life = 2.5,
		
		GMInflate =
		{
			spawn_time = 0.65,							--time in seconds for particle spawning
			spawn_delta = 3,								--wait 3 frames between spawning particles
			initial_scale = { 0.6, 0.6 },				--initial scaling of particles
			scaling_factor = 0.92,						--scaling factor for particles per frame
			modulate = { 210, 255, 210, 255 },		--particle modulate
			
			circles =
			{
				--{ radius = 400, number = 10 },
				{ radius = 80, number = 1 },
				{ radius = 40, number = 1 },
			},
		},
		
		Particles = 
		{
			animation = "DATA:Animations/ginseng/effects/ginseng_front_halo.anim",
			life = 0.8,
			fade = "quadratic",
			--default to background particle
			particle_placement = FXParticle.FOREGROUND
		}
	}
}