--------------------------------------------------------------------
-- e_put_red.lua
-- チップ配置時演出（赤）
--
-- author IZUMI STUDIO
-- date 2009-08-20 新規作成
--------------------------------------------------------------------
require(".\\scripts\\common")


function createElement_Ring_In( delay )
	local mover = Effect.CreateAnimator_Still(
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0 )
	
	local rotator = Effect.CreateAnimator_Still(
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0 )
	
	Effect.CreateElement_Ring(
		0,0,0,0,
		0,0,0,0,
		255,0,0,0,
		255,255,255,255,
		0,0,0,0,
		0,0,0,0,
		INTERPOLATION_EASE_IN,
		4.0, 0.0,
		INTERPOLATION_EASE_IN,
		0.2, 0.2,
		INTERPOLATION_EASE_IN,
		30,
		255,
		0.5,
		EFFECT_BLEND_ADD,
		EFFECT_BILLBOARD_NORMAL,
		delay, 10, 1,
		mover, rotator )
end

function createElement_Particle3( delay, alpha )
	local vX = math.random()*0.04 -0.02
	local vZ = math.random()*0.04 -0.02
	local arY = math.random()*0.0036 + 0.0004
	local endFrame = 5+math.random()*5.0
	
	local mover = Effect.CreateAnimator_Spiral(
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0,
		math.random()*1.0+2.0, 0.0, 0.0, 0.0,
		INTERPOLATION_EASE_IN2,
		endFrame,
		0.0, 0.0, 0.0,
		3.1415*2.0, 3.1415*2.0, 3.1415*2.0,
		0.0, 0.0, 0.0,
		3.1415*8.0/180.0, 3.1415*8.0/180.0, 3.1415*8.0/180.0,
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0 )
	
	local rotator = Effect.CreateAnimator_Still(
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0 )
	
	w = math.random() * 0.04 + 0.03
	w = w * 3.0
	
	Effect.CreateElement_Circle(
		255,0,0,0,
		255,255,255,255,
		255,0,0,0,
		255,0,0,0,
		w, w,
		INTERPOLATION_EASE_OUT,
		EFFECT_BLEND_ADD,
		EFFECT_BILLBOARD_NORMAL,
		delay, endFrame, 1,
		mover, rotator )
end


function createElement_Ring3( delay )
	local mover = Effect.CreateAnimator_Still(
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0 )
	
	local rotator = Effect.CreateAnimator_Still(
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0 )
	
	Effect.CreateElement_Ring(
		0,0,0,0,
		0,0,0,0,
		255,255,255,255,
		0,255,255,255,
		0,0,0,0,
		0,0,0,0,
		INTERPOLATION_EASE_OUT4,
		0.0, 4.0,
		INTERPOLATION_EASE_OUT4,
		0.2, 0.2,
		INTERPOLATION_EASE_OUT4,
		30,
		255,
		0.5,
		EFFECT_BLEND_ADD,
		EFFECT_BILLBOARD_NORMAL,
		delay, 30, 1,
		mover, rotator )
end

function createElement_Particle2( delay, alpha )
	local vX = math.random()*0.04 -0.02
	local vZ = math.random()*0.04 -0.02
	local arY = math.random()*0.01 + 0.0004
	
	local mover = Effect.CreateAnimator_Dynamics(
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0,
		vX*6.0, 0.0, vZ*6.0,
		0.0, 0.2, 0.0,
		-vX*0.12, arY, -vZ*0.12,
		0.0, 0.0, 0.0 )
	
	local rotator = Effect.CreateAnimator_Still(
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0 )
	
	w = math.random() * 0.04 + 0.03
	w = w * 4.0
	
	Effect.CreateElement_Circle(
		255,alpha,alpha,alpha,
		255,0,0,0,
		255,0,0,0,
		255,0,0,0,
		w, w,
		INTERPOLATION_LINEAR,
		EFFECT_BLEND_ADD,
		EFFECT_BILLBOARD_NORMAL,
		delay, 10+math.random()*20.0, 1,
		mover, rotator )
end


createElement_Ring_In(0)
for idx = 1, 20 do
	createElement_Particle3( 0, 255*(16.0-idx/2.0)/16.0 )
end

createElement_Ring3(10)
for idx = 1, 10 do
	createElement_Particle2( 10, 255*(16.0-idx/2.0)/16.0 )
end


