task BurstGaugeDisplay//バーストゲージを表示
{
BerD;
/*
loop
{
PowerBerDisplay;
PowerDisplayback;
wait(600);
}
*/
}

task BerD
{
loop
{
while(BurstMode==0){yield;}
PowerDisplay;
while(BurstMode==1){yield;}
}
}

task PowerDisplay//円形バーストゲージの表示
{
		let PowerLeft=0;
		let PowerAngle=0;
		let randvertex=0;
		let Vertex=48;
		let Radius=[40,46];
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj,imgBer);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj,Vertex);
		ascent(let i in 0..Vertex)
		{
			ObjEffect_SetVertexXY(obj, i, Radius[i%2]*cos(360/(Vertex-1)*i), Radius[i%2]*sin(360/(Vertex-1)*i));
		}
		ascent(let i in 0..Vertex)
		{	
			ObjEffect_SetVertexUV(obj, i,  512/(Vertex)*i,  27+6*(i%2));
		}

		ObjEffect_SetLayer(obj,3);

		ObjEffect_SetAngle(obj,0,0,180);
		let Alpha=100;

		while(BurstMode==1)
		{
			PowerLeft=Power/(1000/360);
			PowerAngle=PowerLeft/(Vertex-2);
			ascent(i in 0..Vertex)
			{
				alternative(i)
				case(0, 1){ObjEffect_SetVertexXY(obj,i,Radius[i%2]*sin(0),Radius[i%2]*cos(0)); }
				case(Vertex-2, Vertex-1){ObjEffect_SetVertexXY(obj,i,Radius[i%2]*sin(PowerLeft),Radius[i%2]*cos(PowerLeft)); }
				others{ObjEffect_SetVertexXY(obj,i,Radius[i%2]*sin(PowerAngle*i),Radius[i%2]*cos(PowerAngle*i));}			
				ObjEffect_SetVertexColor(obj, i,Alpha,ColorRed,ColorGreen,ColorBlue);
			}
/*
		if(Power<=1000)
		{
			ascent(let i in 0..VertexNum)
			{
				ObjEffect_SetVertexColor(obj, i,Alpha,ColorRed,ColorGreen,ColorBlue);
			}
			ascent(let i in 0..VertexNum-VertexNum*(Power/1000))
			{			
				ObjEffect_SetVertexColor(obj, i,0,255,255,255);
			}
		}
*/
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
		yield;
		}
		Obj_Delete(obj);
}

task PowerDisplay2//円形バーストゲージの表示
{
		let randvertex=0;
		let VertexNum=48;
		let Radius=[40,46];
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj,imgBer);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj,VertexNum);
		ascent(let i in 0..VertexNum)
		{
			ObjEffect_SetVertexXY(obj, i, Radius[i%2]*cos(360/(VertexNum-1)*i), Radius[i%2]*sin(360/(VertexNum-1)*i));
		}
		ascent(let i in 0..VertexNum)
		{	
			ObjEffect_SetVertexUV(obj, i,  512/(VertexNum)*i,  27+6*(i%2));
		}

		ObjEffect_SetLayer(obj,3);

		ObjEffect_SetAngle(obj,0,0,-90);
		let Alpha=100;

		while(BurstMode==1)
		{

		if(Power<=1000)
		{
			ascent(let i in 0..VertexNum)
			{
				ObjEffect_SetVertexColor(obj, i,Alpha,ColorRed,ColorGreen,ColorBlue);
			}
			ascent(let i in 0..VertexNum-VertexNum*(Power/1000))
			{			
				ObjEffect_SetVertexColor(obj, i,0,255,255,255);
			}
		}
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
		yield;
		}
		Obj_Delete(obj);
}

task PowerBerDisplay//ライフバーの枠の設定
{
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgBer);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -71, -5);
		ObjEffect_SetVertexXY(obj, 1, 0,  -5);
		ObjEffect_SetVertexXY(obj, 2, 0, 5);
		ObjEffect_SetVertexXY(obj, 3,  -71,  5);
		
		ObjEffect_SetVertexUV(obj, 0,  6,  11);
		ObjEffect_SetVertexUV(obj, 1,  148, 11);
		ObjEffect_SetVertexUV(obj, 2, 148,  21);
		ObjEffect_SetVertexUV(obj, 3, 6, 21);
		ObjEffect_SetLayer(obj,3);
		ObjEffect_SetScale(obj, 1,0.6);
		Obj_SetPosition(obj,GetClipMinX+71,GetClipMaxY-32);

		loop(600)
		{
			if(GetPlayerY>GetClipMaxY-60)
			{
				ascent(i in 0..4)
				{
					ObjEffect_SetVertexColor(obj, i, 255+((GetClipMaxY-60)-GetPlayerY)*4, 255, 255, 255);
				}
			}
			else
			{
				ascent(i in 0..4)
				{
					ObjEffect_SetVertexColor(obj, i, 255+((GetClipMaxY-60)-GetPlayerY)*4, 255, 255, 255);
				}
			}
			yield
		}
		Obj_Delete(obj);
}

task PowerDisplayback//ライフバーのバー部分の設定
{
		let scale=2.5;

		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgBer);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, 0, -3);
		ObjEffect_SetVertexXY(obj, 1, 71,  -3);
		ObjEffect_SetVertexXY(obj, 2, 71, 3);
		ObjEffect_SetVertexXY(obj, 3,  0,  3);
		
		ObjEffect_SetVertexUV(obj, 0,  6,  27);
		ObjEffect_SetVertexUV(obj, 1,  148, 27);
		ObjEffect_SetVertexUV(obj, 2, 148,  33);
		ObjEffect_SetVertexUV(obj, 3, 6, 33);
		ObjEffect_SetLayer(obj,3);

		ascent(let i in 0..4)
		{
			ObjEffect_SetVertexColor(obj,i,150,255,255,255);
		}

		Obj_SetPosition(obj,GetClipMinX+35,GetClipMaxY-32);
		let Alpha;
		loop(600)
		{

			if(GetPlayerY>GetClipMaxY-60)
			{
				Alpha=255+((GetClipMaxY-60)-GetPlayerY)*4;
			}
			else
			{
				Alpha=255;
			}

			if(RushGauge>0)
			{
				ObjEffect_SetAngle(obj,0,0,0);
				scale=1.0*(absolute(RushGauge))/100/2;
				ascent(let i in 0..4)
				{
					ObjEffect_SetVertexColor(obj,i,Alpha,255,0,0);
				}
			}
			else
			{
				scale=1.0*(absolute(RushGauge))/100/2;
				ObjEffect_SetAngle(obj,0,0,180);
				ascent(let i in 0..4)
				{
					ObjEffect_SetVertexColor(obj,i,Alpha,0,0,255);
				}
			}
			ObjEffect_SetScale(obj, scale,0.6);
			yield;
		}
		Obj_Delete(obj);
}

task PowerChargeEffect
{
		let Scale=2;

  		let obj = Obj_Create(OBJ_EFFECT);
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
		ObjEffect_SetTexture(obj, imgMarisaShot);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -80, -80);
		ObjEffect_SetVertexXY(obj, 1,  80, -80);
		ObjEffect_SetVertexXY(obj, 2,  80,  80);
		ObjEffect_SetVertexXY(obj, 3, -80,  80);
		
		ObjEffect_SetVertexUV(obj, 0,  0,  0);
		ObjEffect_SetVertexUV(obj, 1,  128, 0);
		ObjEffect_SetVertexUV(obj, 2, 128,  128);
		ObjEffect_SetVertexUV(obj, 3, 0, 128);

		let Alpha=150;
		while(Alpha>0)
		{
			Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
			ObjEffect_SetScale(obj, Scale,Scale);
			ascent(let i in 0..4)
			{
				ObjEffect_SetVertexColor(obj,i,Alpha,ColorRed,ColorGreen,ColorBlue);
			}
			Alpha-=2.5;
			Scale-=0.07;
			yield;
		}
		Obj_Delete(obj);
}

task BurstStartEffect
{
	BurstEffect(1);
	BurstEffect(-1);
	wait(5);

	ascent(let i in 0..6)
	{
		BurstEffectStar(i*60,3,0,1);
		BurstEffectStar(i*60,3,0,-1);
	}
	wait(5);
	ascent(let i in 0..6)
	{
		BurstEffectStar(i*60,2,0,1);
		BurstEffectStar(i*60,2,0,-1);
	}
	wait(5);
	ascent(let i in 0..6)
	{
		BurstEffectStar(i*60,1,0,1);
		BurstEffectStar(i*60,1,0,-1);
	}

}

task BurstEffect(dir)
{
		let Scale=0;
		let Xangle=90;
		let Yangle=90;
		let Zangle=0;
  		let obj = Obj_Create(OBJ_EFFECT);
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
		ObjEffect_SetTexture(obj, imgKekkai);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -128, -128);
		ObjEffect_SetVertexXY(obj, 1,  128, -128);
		ObjEffect_SetVertexXY(obj, 2,  128,  128);
		ObjEffect_SetVertexXY(obj, 3, -128,  128);

		ObjEffect_SetVertexUV(obj, 0,  0,  0);
		ObjEffect_SetVertexUV(obj, 1,  64, 0);
		ObjEffect_SetVertexUV(obj, 2, 64,  64);
		ObjEffect_SetVertexUV(obj, 3, 0, 64);
	/*	
		ObjEffect_SetVertexUV(obj, 0,  0,  0);
		ObjEffect_SetVertexUV(obj, 1,  256, 0);
		ObjEffect_SetVertexUV(obj, 2, 256,  256);
		ObjEffect_SetVertexUV(obj, 3, 0, 256);

		ObjEffect_SetScale(obj, Scale,Scale);
*/
		let Alpha=150;
		while(Alpha>0)
		{
			Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
			ObjEffect_SetScale(obj, Scale,Scale);
			ObjEffect_SetAngle(obj, Xangle,Yangle,Zangle);
			ascent(let i in 0..4)
			{
				ObjEffect_SetVertexColor(obj,i,Alpha,255,255,255);
			}
			Alpha-=2.5;
			Scale+=0.035;
			Zangle+=2.25*dir;
			Xangle+=2.25*dir;
			Yangle+=2.25;
			yield;
		}
		Obj_Delete(obj);
}

task BurstEffectStar(angle,speed,rudius,dir)
{
		let Scale=0;

  		let obj = Obj_Create(OBJ_EFFECT);
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
		ObjEffect_SetTexture(obj, imgMarisaShot);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -64, -64);
		ObjEffect_SetVertexXY(obj, 1,  64, -64);
		ObjEffect_SetVertexXY(obj, 2,  64,  64);
		ObjEffect_SetVertexXY(obj, 3, -64,  64);
		
		ObjEffect_SetVertexUV(obj, 0,  0,  256);
		ObjEffect_SetVertexUV(obj, 1,  128, 256);
		ObjEffect_SetVertexUV(obj, 2, 128,  378);
		ObjEffect_SetVertexUV(obj, 3, 0, 378);


		let Alpha=255;

		while(Alpha>0)
		{
			Obj_SetPosition(obj,GetPlayerX+rudius*cos(angle),GetPlayerY+rudius*sin(angle));
			ObjEffect_SetScale(obj, Scale,Scale);
			ascent(let i in 0..4)
			{
				if(Power<1000)
				{
				ObjEffect_SetVertexColor(obj,i,Alpha,127,127,127);
				}
				if(Power>=1000 && Power<2000 || BurstLevel==1)
				{
				ObjEffect_SetVertexColor(obj,i,Alpha,127,127,255);
				}
				if(Power>=2000 && Power<3000 || BurstLevel==2)
				{
				ObjEffect_SetVertexColor(obj,i,Alpha,255,127,127);
				}
				if(Power>=3000 || BurstLevel==3)
				{
				ObjEffect_SetVertexColor(obj,i,Alpha,ColorRed,ColorGreen,ColorBlue);
				}
			}
			Alpha-=4;
			Scale+=0.01;
			rudius+=speed;
			angle+=3*dir;
			yield;
		}
		Obj_Delete(obj);
}

task BurstEndEffect
{
	ascent(let i in 0..6)
	{
		BurstEffectStar(i*60,-3,64*3,1);
		BurstEffectStar(i*60,-3,64*3,-1);
	}
	wait(5);
	ascent(let i in 0..6)
	{
		BurstEffectStar(i*60,-2.5,64*2.5,1);
		BurstEffectStar(i*60,-2.5,64*2.5,-1);
	}
	wait(5);
	ascent(let i in 0..6)
	{
		BurstEffectStar(i*60,-2,64*2,1);
		BurstEffectStar(i*60,-2,64*2,-1);
	}
}


task StartStar
{
	OnCansellBomb=1;
	let X=GetPlayerX;
	let Y=GetPlayerY;
	let i=0;
	let r=120;
	let angle=rand(0,360);
	loop(30)
	{
		ascent(let k in 0..7)
		{
			StartStarEffect(X-((X-GetPlayerX)/30)*i,Y-((Y-GetPlayerY)/30)*i,r,angle+360/7*k,9+k);
		}
	yield;
	i+=1;
	if(r>0)
	{
	r-=120/30;
	}
	if(r<=0)
	{
	r-=60/30;
	}
	angle+=4.5;
	}
	wait(30);
	OnCansellBomb=0;
}

task StartStarEffect(X,Y,Radius,Angle,graphic)
{
		let R;let G;let B;
		if(graphic==9){R=255;G=0;B=0;}
		if(graphic==10){R=255;G=100;B=0;}
		if(graphic==11){R=255;G=255;B=0;}
		if(graphic==12){R=0;G=255;B=0;}
		if(graphic==13){R=0;G=255;B=255;}
		if(graphic==14){R=0;G=0;B=255;}
		if(graphic==15){R=160;G=32;B=240;}

		let Scale=0.6;

  		let obj = Obj_Create(OBJ_EFFECT);
		Obj_SetPosition(obj,X+Radius*cos(Angle),Y+Radius*sin(Angle));
		ObjEffect_SetTexture(obj, imgMarisaShot);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -64, -64);
		ObjEffect_SetVertexXY(obj, 1,  64, -64);
		ObjEffect_SetVertexXY(obj, 2,  64, 64);
		ObjEffect_SetVertexXY(obj, 3, -64,  64);
		
		ObjEffect_SetVertexUV(obj, 0,  0,  384);
		ObjEffect_SetVertexUV(obj, 1,  128, 384);
		ObjEffect_SetVertexUV(obj, 2, 128,  512);
		ObjEffect_SetVertexUV(obj, 3, 0, 512);

		ascent(let i in 0..4)
		{
		ObjEffect_SetVertexColor(obj,i,200,R,G,B);
		}
		if(GetCommonDataDefault("LightMode",0)==0)
		{
		loop(30)
		{
			ObjEffect_SetScale(obj,Scale,Scale);
			Scale-=0.02;
			yield;
		}
		}
		else
		{
		loop(10)
		{
			ObjEffect_SetScale(obj,Scale,Scale);
			Scale-=0.06;
			yield;
		}
		}
		Obj_Delete(obj);
}

task SpecialEffect//ライフバーの枠の設定
{
	let gra=9;
	if(RushGauge>0)
	{
		gra=9;
	}
	if(RushGauge<0)
	{
		gra=14;
	}
	ascent(i in 0..4)
	{
	SpecialEffectLine(i*90,-1,gra);
	}
	ascent(i in 0..4)
	{
	SpecialEffectLine(i*90,1,gra);
	}
	yield;
	while(BurstMode!=0)
	{
	ascent(i in 0..6)
	{
		SpecialEffectStar(opX[i],opY[i],gra);
		yield;
	}
	//yield;
	}
/*
	ascent(i in 0..4)
	{
	SpecialEffectLine(i*90,-1);
	}
	ascent(i in 0..4)
	{
	SpecialEffectLine(i*90,1);
	}
*/
}
task SpecialEffectStar(x,y,graphic)//ライフバーの枠の設定
{
		let R;let G;let B;
		if(graphic==9){R=255;G=0;B=0;}
		if(graphic==10){R=255;G=100;B=0;}
		if(graphic==11){R=255;G=255;B=0;}
		if(graphic==12){R=0;G=255;B=0;}
		if(graphic==13){R=0;G=255;B=255;}
		if(graphic==14){R=0;G=0;B=255;}
		if(graphic==15){R=160;G=32;B=240;}

		let Scale=0.1;
		let X=GetPlayerX;
		let Y=GetPlayerY;
let Radius=0;
let Angle=rand(0,360);
  		let obj = Obj_Create(OBJ_EFFECT);
		Obj_SetPosition(obj,x,y);
		ObjEffect_SetTexture(obj, imgMarisaShot);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -64, -64);
		ObjEffect_SetVertexXY(obj, 1,  64, -64);
		ObjEffect_SetVertexXY(obj, 2,  64, 64);
		ObjEffect_SetVertexXY(obj, 3, -64,  64);
		
		ObjEffect_SetVertexUV(obj, 0,  0,  384);
		ObjEffect_SetVertexUV(obj, 1,  128, 384);
		ObjEffect_SetVertexUV(obj, 2, 128,  512);
		ObjEffect_SetVertexUV(obj, 3, 0, 512);

		Obj_SetSpeed(obj,2);
		Obj_SetAngle(obj,rand(60,120));
		ascent(let i in 0..4)
		{
		ObjEffect_SetVertexColor(obj,i,200,R,G,B);
		}
		if(GetCommonDataDefault("LightMode",0)==0)
		{
		loop(30)
		{
			ObjEffect_SetScale(obj,Scale,Scale);
			Scale-=0.02/6;
			yield;
		}
		}
		else
		{
		loop(10)
		{
			ObjEffect_SetScale(obj,Scale,Scale);
			Scale-=0.01;
			yield;
		}
		}
		Obj_Delete(obj);
}

task SpecialEffectLine(angle,dir,graphic)//ライフバーの枠の設定
{
		let R;let G;let B;
		if(graphic==9){R=255;G=0;B=0;}
		if(graphic==10){R=255;G=100;B=0;}
		if(graphic==11){R=255;G=255;B=0;}
		if(graphic==12){R=0;G=255;B=0;}
		if(graphic==13){R=0;G=255;B=255;}
		if(graphic==14){R=0;G=0;B=255;}
		if(graphic==15){R=160;G=32;B=240;}

		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgWhite);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, 0, -3);
		ObjEffect_SetVertexXY(obj, 1, 100,  -3);
		ObjEffect_SetVertexXY(obj, 2, 100, 3);
		ObjEffect_SetVertexXY(obj, 3,  0,  3);
		
		ObjEffect_SetVertexUV(obj, 0,  -10,  -10);
		ObjEffect_SetVertexUV(obj, 1,  10, -10);
		ObjEffect_SetVertexUV(obj, 2, 10, 10);
		ObjEffect_SetVertexUV(obj, 3, -10, 10);
		ObjEffect_SetLayer(obj,3);

		let X=GetPlayerX;
		let Y=GetPlayerY;
		Obj_SetPosition(obj,X,Y);

		let Leng=0;
		let Radius=0;
		let Scale=1;
		let Alpha=255;
		loop(120)
		{
			SpecialEffectLineBlur(GetPlayerX+Radius*cos(angle),GetPlayerY+Radius*sin(angle),Radius,Leng,angle,Alpha,graphic);
			Obj_SetPosition(obj,GetPlayerX+Radius*cos(angle),GetPlayerY+Radius*sin(angle));
			ObjEffect_SetVertexXY(obj, 0, 0, -2);
			ObjEffect_SetVertexXY(obj, 1, Leng,  -2);
			ObjEffect_SetVertexXY(obj, 2, Leng, 2);
			ObjEffect_SetVertexXY(obj, 3,  0,  2);
			ascent(i in 0..4)
			{
				ObjEffect_SetVertexColor(obj, i, Alpha, R, G, B);
			}
			ObjEffect_SetAngle(obj,0,0,angle+135);
			Radius+=5+dir;
			angle+=3*dir;
			Leng=Radius*2^0.5;
			Alpha-=255/120;
			//Scale+=8/120;
			yield;
		}
		Obj_Delete(obj);
}

task SpecialEffectLineBlur(X,Y,Radius,Leng,angle,Alpha,graphic)//ライフバーの枠の設定
{
		let R;let G;let B;
		if(graphic==9){R=255;G=0;B=0;}
		if(graphic==10){R=255;G=100;B=0;}
		if(graphic==11){R=255;G=255;B=0;}
		if(graphic==12){R=0;G=255;B=0;}
		if(graphic==13){R=0;G=255;B=255;}
		if(graphic==14){R=0;G=0;B=255;}
		if(graphic==15){R=160;G=32;B=240;}

		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgWhite);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, 0, -3);
		ObjEffect_SetVertexXY(obj, 1, 100,  -3);
		ObjEffect_SetVertexXY(obj, 2, 100, 3);
		ObjEffect_SetVertexXY(obj, 3,  0,  3);
		
		ObjEffect_SetVertexUV(obj, 0,  -10,  -10);
		ObjEffect_SetVertexUV(obj, 1,  10, -10);
		ObjEffect_SetVertexUV(obj, 2, 10, 10);
		ObjEffect_SetVertexUV(obj, 3, -10, 10);
		ObjEffect_SetLayer(obj,3);

		let Scale=1;
		let BasicAlpha=Alpha;
		Obj_SetPosition(obj,X,Y);

		loop(5)
		{
			ObjEffect_SetVertexXY(obj, 0, 0, -2);
			ObjEffect_SetVertexXY(obj, 1, Leng,  -2);
			ObjEffect_SetVertexXY(obj, 2, Leng, 2);
			ObjEffect_SetVertexXY(obj, 3,  0,  2);
			ascent(i in 0..4)
			{
				ObjEffect_SetVertexColor(obj, i, Alpha, R, G, B);
			}
			ObjEffect_SetAngle(obj,0,0,angle+135);
			Alpha-=BasicAlpha/5;
			yield;
		}
		Obj_Delete(obj);
}

task RushChargeEffect
{
	let angle=rand(0,360);
	ascent(i in 0..4)
	{
	RushChargeLine(angle+i*90,1,9);
	RushChargeLine(angle+45+i*90,-1,9);
	}
}

task RushChargeLine(angle,dir,graphic)//ライフバーの枠の設定
{
		let R;let G;let B;
		if(graphic==9){R=255;G=0;B=0;}
		if(graphic==10){R=255;G=100;B=0;}
		if(graphic==11){R=255;G=255;B=0;}
		if(graphic==12){R=0;G=255;B=0;}
		if(graphic==13){R=0;G=255;B=255;}
		if(graphic==14){R=0;G=0;B=255;}
		if(graphic==15){R=160;G=32;B=240;}

		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgWhite);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, 0, -3);
		ObjEffect_SetVertexXY(obj, 1, 100,  -3);
		ObjEffect_SetVertexXY(obj, 2, 100, 3);
		ObjEffect_SetVertexXY(obj, 3,  0,  3);
		
		ObjEffect_SetVertexUV(obj, 0,  -10,  -10);
		ObjEffect_SetVertexUV(obj, 1,  10, -10);
		ObjEffect_SetVertexUV(obj, 2, 10, 10);
		ObjEffect_SetVertexUV(obj, 3, -10, 10);
		ObjEffect_SetLayer(obj,3);

		let X=GetPlayerX;
		let Y=GetPlayerY;
		Obj_SetPosition(obj,X,Y);

		let Leng=0;
		let Radius=210;
		let Scale=1;
		let Alpha=0;
		loop(30)
		{
			RushChargeLineBlur(GetPlayerX+Radius*cos(angle),GetPlayerY+Radius*sin(angle),Radius,Leng,angle,Alpha,graphic);
			Obj_SetPosition(obj,GetPlayerX+Radius*cos(angle),GetPlayerY+Radius*sin(angle));
			ObjEffect_SetVertexXY(obj, 0, 0, -2);
			ObjEffect_SetVertexXY(obj, 1, Leng,  -2);
			ObjEffect_SetVertexXY(obj, 2, Leng, 2);
			ObjEffect_SetVertexXY(obj, 3,  0,  2);
			ascent(i in 0..4)
			{
				ObjEffect_SetVertexColor(obj, i, Alpha, R, G, B);
			}
			ObjEffect_SetAngle(obj,0,0,angle+135);
			Radius-=5;
			angle+=4.5*dir;
			Leng=Radius*2^0.5;
			Alpha+=150/30;
			yield;
		}
		loop(60)
		{
			RushChargeLineBlur(GetPlayerX+Radius*cos(angle),GetPlayerY+Radius*sin(angle),Radius,Leng,angle,Alpha,graphic);
			Obj_SetPosition(obj,GetPlayerX+Radius*cos(angle),GetPlayerY+Radius*sin(angle));
			ObjEffect_SetVertexXY(obj, 0, 0, -2);
			ObjEffect_SetVertexXY(obj, 1, Leng,  -2);
			ObjEffect_SetVertexXY(obj, 2, Leng, 2);
			ObjEffect_SetVertexXY(obj, 3,  0,  2);
			ascent(i in 0..4)
			{
				ObjEffect_SetVertexColor(obj, i, Alpha, R, G, B);
			}
			ObjEffect_SetAngle(obj,0,0,angle+135);
		//	Radius-=5+dir;
			angle+=4.5*dir;
		//	Leng=Radius*2^0.5;
			Alpha-=150/60;
			yield;
		}
		Obj_Delete(obj);
}

task RushChargeLineBlur(X,Y,Radius,Leng,angle,Alpha,graphic)//ライフバーの枠の設定
{
		let R;let G;let B;
		if(graphic==9){R=255;G=0;B=0;}
		if(graphic==10){R=255;G=100;B=0;}
		if(graphic==11){R=255;G=255;B=0;}
		if(graphic==12){R=0;G=255;B=0;}
		if(graphic==13){R=0;G=255;B=255;}
		if(graphic==14){R=0;G=0;B=255;}
		if(graphic==15){R=160;G=32;B=240;}

		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgWhite);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, 0, -3);
		ObjEffect_SetVertexXY(obj, 1, 100,  -3);
		ObjEffect_SetVertexXY(obj, 2, 100, 3);
		ObjEffect_SetVertexXY(obj, 3,  0,  3);
		
		ObjEffect_SetVertexUV(obj, 0,  -10,  -10);
		ObjEffect_SetVertexUV(obj, 1,  10, -10);
		ObjEffect_SetVertexUV(obj, 2, 10, 10);
		ObjEffect_SetVertexUV(obj, 3, -10, 10);
		ObjEffect_SetLayer(obj,3);

		let Scale=1;
		let BasicAlpha=Alpha;
		Obj_SetPosition(obj,X,Y);

		loop(5)
		{
			ObjEffect_SetVertexXY(obj, 0, 0, -2);
			ObjEffect_SetVertexXY(obj, 1, Leng,  -2);
			ObjEffect_SetVertexXY(obj, 2, Leng, 2);
			ObjEffect_SetVertexXY(obj, 3,  0,  2);
			ascent(i in 0..4)
			{
				ObjEffect_SetVertexColor(obj, i, Alpha, R, G, B);
			}
			ObjEffect_SetAngle(obj,0,0,angle+135);
			Alpha-=BasicAlpha/5;
			yield;
		}
		Obj_Delete(obj);
}

/*
task SpecialEffect//ライフバーの枠の設定
{
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgWhite);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -100, -100);
		ObjEffect_SetVertexXY(obj, 1, 100,  -100);
		ObjEffect_SetVertexXY(obj, 2, 100, 100);
		ObjEffect_SetVertexXY(obj, 3,  -100,  100);
		
		ObjEffect_SetVertexUV(obj, 0,  -10,  -10);
		ObjEffect_SetVertexUV(obj, 1,  10, -10);
		ObjEffect_SetVertexUV(obj, 2, 10, 10);
		ObjEffect_SetVertexUV(obj, 3, -10, 10);
		ObjEffect_SetLayer(obj,3);
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);

		let Scale=0;
		let Alpha=255;
		let R=255;let G=0;let B=0;
		loop(120)
		{
			ObjEffect_SetScale(obj, Scale,Scale);
			ascent(i in 0..4)
			{
				ObjEffect_SetVertexColor(obj, i, Alpha, R, G, B);
			}

			Alpha-=255/120;
			Scale+=8/120;
			yield;
		}
		Obj_Delete(obj);
}
*/