task TShotSet1
{
	while(SELECT_PLAYER>=SELECT_REIMU&&SELECT_PLAYER<=SELECT_SEIJA)
	{
		if(SELECT_PLAYER==SELECT_REIMU)
		{
			TShotReimu;
			TShot2Reimu;
			while(SELECT_PLAYER==SELECT_REIMU){yield;}
		}
		if(SELECT_PLAYER==SELECT_MARISA)
		{
			TShotMarisa;
			TShot2Marisa;
			while(SELECT_PLAYER==SELECT_MARISA){yield;}
		}
		if(SELECT_PLAYER==SELECT_SAKUYA)
		{
			TShotSakuya;
			TShot2Sakuya;
			while(SELECT_PLAYER==SELECT_SAKUYA){yield;}
		}
		if(SELECT_PLAYER==SELECT_REISEN)
		{
			TShotReisen;
			TShot2Reisen;
			while(SELECT_PLAYER==SELECT_REISEN){yield;}
		}
		if(SELECT_PLAYER==SELECT_SANAE)
		{
			TShotSanae;
			TShot2Sanae;
			while(SELECT_PLAYER==SELECT_SANAE){yield;}
		}
		if(SELECT_PLAYER==SELECT_YOUMU)
		{
			TShotYoumu;
			TShot2Youmu;
			while(SELECT_PLAYER==SELECT_YOUMU){yield;}
		}
		if(SELECT_PLAYER==SELECT_AYA)
		{
			TShotAya;
			TShot2Aya;
			while(SELECT_PLAYER==SELECT_AYA){yield;}
		}
		if(SELECT_PLAYER==SELECT_ALICE)
		{
			TShotAlice;
			TShot2Alice;
			while(SELECT_PLAYER==SELECT_ALICE){yield;}
		}
		if(SELECT_PLAYER==SELECT_CIRNO)
		{
			TShotCirno;
			TShot2Cirno;
			while(SELECT_PLAYER==SELECT_CIRNO){yield;}
		}
		if(SELECT_PLAYER==SELECT_SEIJA)
		{
			TShotSeija;
			TShot2Seija;
			while(SELECT_PLAYER==SELECT_SEIJA){yield;}
		}
	}
}

task TShotReimu
{
	let pShot=false;
	ShotCheck;
	let Speed=22.5;
	let MainDamage=3.0*1.3;
	let DamageRate=1*1.3;
	while(SELECT_PLAYER==SELECT_REIMU)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.3;}
		else{DamageRate=1.0*1.3;}

		MainShot(GetPlayerX()+8, GetPlayerY(), Speed, 270, MainDamage/2, 1, 10);
		MainShot(GetPlayerX()-8, GetPlayerY(), Speed, 270, MainDamage/2, 1, 10);
		MainShot(GetPlayerX()+8, GetPlayerY(), Speed, 270+3, MainDamage/2, 1, 10);
		MainShot(GetPlayerX()-8, GetPlayerY(), Speed, 270-3, MainDamage/2, 1, 10);
		PlaySE(SE_SHOT);

		loop(3){yield;}
	}

	task ShotCheck
	{
		while(SELECT_PLAYER==SELECT_REIMU)
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_REIMU&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}

	task MainShot(x,y,speed,angle,damage,pene,id)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let OldX;
		let OldY;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);
	}

	task HitEffect(x,y,speed,angle)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,angle+90);

		ObjPrim_SetDestCenter(obj,3,209,14,224);

		ObjRender_SetPosition(obj,x,y,0);
		speed/=8;
		let Alpha=0.5;
		let R=255;
		let G=255;
		let B=255;
		loop(15)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.25/20;
			yield;
		}

		ObjPrim_SetDestCenter(obj,3,193,14,208);

		loop(5)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.25/20;
			yield;
		}
		Obj_Delete(obj);
	}
}
task TShot2Reimu
{
	let pShot=false;
	ShotCheck;
	let DamageRate=1*1.3;
	let ShotAngle_P4=[290,250,260,280];
	let ShotAngle=[ShotAngle_P4,ShotAngle_P4,ShotAngle_P4,ShotAngle_P4];
	while(SELECT_PLAYER==SELECT_REIMU)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.3;}
		else{DamageRate=1.0*1.3;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
			ascent(i in 0..PlayerPower_Int)
			{
				NeedleShot(OptionX[i]+6,OptionY[i],270,1.7*1.7);
				NeedleShot(OptionX[i]-6,OptionY[i],270,1.7*1.7);
			}
		}
		else
		{
			ascent(i in 0..PlayerPower_Int)
			{
				HomingShot_S(OptionX[i],OptionY[i],ShotAngle[PlayerPower_Int-1][i],2.9*1.3);
			}
		}
		loop(6){yield;}
	}

	task ShotCheck
	{
		while(SELECT_PLAYER==SELECT_REIMU)
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_REIMU&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}
	task NeedleShot(x,y,angle,damage)
	{
		let speed=22.5;
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,1,12);
		Obj_SetRenderPriorityI(obj,41);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let count=0;
		let OldX=x;
		let OldY=y;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		HitEffect3(OldX,OldY);
		Obj_Delete(obj);

		task HitEffect(x,y,speed,angle)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
		//	ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,0);

			ObjPrim_SetDestCenter(obj,32+16,192,48+16,256);

			ObjRender_SetPosition(obj,x,y,0);
			speed/=6;
			let ScaleX=1;
			let Alpha=0.4;
			let R=255;
			let G=255;
			let B=255;
			ObjRender_SetAngleZ(obj,rand(-20,20));
			ObjRender_SetAlpha(obj,255*Alpha);
			loop(10)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				yield;
			}

			loop(5)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			//	ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleX(obj,ScaleX);
				ObjRender_SetAlpha(obj,255*Alpha);
				ScaleX-=1/5;
				Alpha-=0.4/5;
				yield;
			}
			Obj_Delete(obj);
		}

		task HitEffect3(x,y)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SPLASH);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);

			ObjPrim_SetDestCenter(obj,0,0,64,16);

			ObjRender_SetPosition(obj,x,y+45,0);
			let Scale=2;
			let Alpha=0.5;
			let R=235;
			let G=136;
			let B=16;
			let Zangle=0;
			ObjRender_SetScaleXYZ(obj,Scale,Scale,Scale);
			ObjRender_SetAngleZ(obj,Zangle+90);
			let count=0;
			loop(8)
			{
				ObjPrim_SetDestCenter(obj,0,0+count*16,64,16+count*16);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=0.5/8;
				count+=1;
				yield;
			}
			Obj_Delete(obj);
		}
	}

	task HomingShot_S(x,y,angle,damage)
	{
		let speed=4;
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,1,11);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let count=0;
		let OldX=x;
		let OldY=y;
		loop(60)
		{
			if(Obj_IsDeleted(obj)){break;}
			let EnemyObjectArray=GetIntersectionRegistedEnemyID;
			let Dis=(count*5+120)^2;
			let nearObj=-1;
			if(length(EnemyObjectArray)!=0)
			{
			ascent(i in 0..length(EnemyObjectArray))
			{
			let dis=(ObjRender_GetY(EnemyObjectArray[i])-ObjRender_GetY(obj))^2+(ObjRender_GetX(EnemyObjectArray[i])-ObjRender_GetX(obj))^2;
			if(dis<Dis)
			{
				nearObj=EnemyObjectArray[i];
				Dis=dis;
			}
			}
			}

			if(nearObj!=-1)
			{
			let ToPlayerAngle=atan2(ObjRender_GetY(nearObj)-ObjRender_GetY(obj),ObjRender_GetX(nearObj)-ObjRender_GetX(obj));
			let judgangle=sin(ToPlayerAngle-angle);

			if(judgangle>0)
			{
				if(judgangle>0.05)
				{
				angle+=asin(judgangle)/4;
				}
				else
				{
				angle=ToPlayerAngle;
				}
			}
			else
			{
				if(judgangle<-0.05)
				{
				angle+=asin(judgangle)/4;
				}
				else
				{
				angle=ToPlayerAngle;
				}
			}
			ObjMove_SetAngle(obj,angle);
			}
			count++;
			if(count>30){count=30;}
			speed+=5/60;
			ObjMove_SetSpeed(obj,speed);
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			speed+=5/60;
			ObjMove_SetSpeed(obj,speed);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);

		task HitEffect(x,y,speed,angle)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,0);

			ObjPrim_SetDestCenter(obj,17,226,31,239);

			ObjRender_SetPosition(obj,x,y,0);
			speed/=4;
			let Alpha=0.5;
			let R=255;
			let G=255;
			let B=255;
			loop(8)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetAngleZ(obj,angle);
			//	Alpha-=1/15;
				yield;
			}

			ObjPrim_SetDestCenter(obj,17,193,31,208);

			loop(12)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetAngleZ(obj,angle);
				Alpha-=0.5/12;
				yield;
			}
			Obj_Delete(obj);
		}
	}
}

task TShotMarisa
{
	let pShot=false;
	ShotCheck;
	let Speed=22.5;
	let MainDamage=3.0;
	let DamageRate=1*2;
	while(SELECT_PLAYER==SELECT_MARISA)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*2;}
		else{DamageRate=1.0*2;}

		MainShot(GetPlayerX()+8, GetPlayerY(), Speed, 270, MainDamage, 1, 20);
		MainShot(GetPlayerX()-8, GetPlayerY(), Speed, 270, MainDamage, 1, 20);
		MainShot(GetPlayerX()  , GetPlayerY(), Speed, 270, MainDamage/2, 1, 20);
		PlaySE(SE_SHOT);

		loop(3){yield;}
	}

	task ShotCheck
	{
		while(SELECT_PLAYER==SELECT_MARISA)
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_MARISA&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}

	task MainShot(x,y,speed,angle,damage,pene,id)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		Obj_SetRenderPriorityI(obj,40);
		let OldX;
		let OldY;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);
	}

	task HitEffect(x,y,speed,angle)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,0);

		ObjPrim_SetDestCenter(obj,33,65,48,96);

		ObjRender_SetPosition(obj,x+1,y-18,0);
		speed/=8;
		let Alpha=0.75;
		let R=255;
		let G=255;
		let B=255;
		loop(15)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.25/15;
			yield;
		}

		ObjPrim_SetDestCenter(obj,32,33,48,64);

		loop(5)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.25/5;
			yield;
		}

		ObjPrim_SetDestCenter(obj,32,1,48,32);

		loop(5)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.25/5;
			yield;
		}
		Obj_Delete(obj);
	}

}
task TShot2Marisa
{//??
	let LaserPoint=[[0,0],[0,0],[0,0],[0,0]];
	let LaserImpactFlag=[0,0,0,0];
	let pShot=false;
	ShotCheck;
	let ShotDamage=10.0*0*2;
	let LaserDamage=0.6*2;
	let DamageRate=1*2;
	let ShotAngle_P4=[275,264,270,270];
	let ShotAngle=[ShotAngle_P4,ShotAngle_P4,ShotAngle_P4,ShotAngle_P4];
	LaserDraw(ShotAngle);
	let LaserLagCount=6;
	let ShotLagCount=0;
	while(SELECT_PLAYER==SELECT_MARISA)
	{
		while(!pShot){ShotLagCount=0;yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*2;}
		else{DamageRate=1.0*2;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
//			PlaySE(SE_MISSILE);
			if(ShotLagCount%2==0)
			{
			MissileShot(OptionX[0],OptionY[0],270,ShotDamage*2.5,0);
			MissileShot(OptionX[1],OptionY[1],270,ShotDamage*2.5,1);
	//		PlaySE(SE_MISSILE3);
			}
			else
			{
			MissileShot(OptionX[2],OptionY[2],270,ShotDamage*2.5,2);
			MissileShot(OptionX[3],OptionY[3],270,ShotDamage*2.5,3);
		//	PlaySE(SE_MISSILE3);

			}
			ShotLagCount+=1;
			loop(5){yield;}
			if(ShotLagCount%2==0){loop(3){yield;}}
		}
		else
		{
			ascent(i in 0..PlayerPower_Int)
			{
			if(i<=1)
			{
			if(LaserLagCount<=0)
			{
			LaserShot(OptionX[i],OptionY[i],ShotAngle[PlayerPower_Int-1][i],LaserDamage,i);
			}
			}
			else
			{
			LaserShot(OptionX[i],OptionY[i],ShotAngle[PlayerPower_Int-1][i],LaserDamage,i);
			}
			}
		}
		ascent(i in 0..4)
		{
		if(LaserImpactFlag[i]>0)
		{
		LaserImpactFlag[i]=LaserImpactFlag[i]-1;
		}
		}

		LaserLagCount--;
		loop(1){yield;}
	}

	task ShotCheck
	{
		while(SELECT_PLAYER==SELECT_MARISA)
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_MARISA&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}
	task MissileShot(x,y,angle,damage,Opnum)
	{
		let speed=3;
		let speedPlus=2;
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,1,21);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let count=2;
		let OldX=x;
		let OldY=y;
		let Alpha=255;
		GraChange;
		loop(6)
		{
			if(Obj_IsDeleted(obj)){break;}
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			count+=1;
			yield;
		}
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			speed+=1.5;
			ObjMove_SetSpeed(obj,speed);
			count+=1;
			yield;
		}
		ExplodeAttack(OldX,OldY);
		T_HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);

		task GraChange
		{
			while(!Obj_IsDeleted(obj))
			{	
				if(count%8<4){ObjShot_SetGraphic(obj,23);}
				else{ObjShot_SetGraphic(obj,24);}
				yield;
			}
		}

		task ExplodeAttack(x,y)
		{
			let objAK=CreatePlayerShotA1(x,y,0,0,1.57,65525,21);
			ObjRender_SetAlpha(objAK,0);
			if(y>0)
			{
			}
			loop(10)
			{
				ObjShot_SetIntersectionCircleA1(objAK,24);
				loop(2){yield;}
			}
			Obj_Delete(objAK);
		}

		task T_HitEffect(x,y,speed,angle)
		{
			if(y>0)
			{
	//		PlaySE(SE_MISSILE2);
			ascent(i in 0..10)
			{
				let ra=rand(0,360);
				HitEffect(x+4*i*cos(ra),y+4*i*sin(ra));
				y-=4;
				loop(2){yield;}
			}
			}
		}

		task HitEffect(x,y)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,0);

			ObjRender_SetPosition(obj,x,y,0);
			let Alpha=0.5;
			let Scale=0;
			let R=255;
			let G=255;
			let B=255;
			let bit2 = 2;
			ObjPrim_SetDestCenter(obj,96,97,128,128);
			loop(4)
			{
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Scale+=2/16*bit2;
				bit2-=2/16;
				ObjRender_SetScaleXYZ(obj,Scale,Scale,1);
				yield;
			}
			ObjPrim_SetDestCenter(obj,96,65,128,96);
			loop(4)
			{
				Scale+=2/16*bit2;
				bit2-=2/16;
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleXYZ(obj,Scale,Scale,1);
				yield;
			}
			Alpha=0.25;
			ObjPrim_SetDestCenter(obj,96,33,128,64);
			loop(4)
			{
				Scale+=2/16*bit2;
				bit2-=2/16;
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleXYZ(obj,Scale,Scale,1);
				yield;
			}
			ObjPrim_SetDestCenter(obj,96,1,128,32);
			loop(4)
			{
				Scale+=2/16*bit2;
				bit2-=2/16;
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleXYZ(obj,Scale,Scale,1);
				yield;
			}
			Obj_Delete(obj);
		}
	}


task LaserShot(x,y,angle,damage,Opnum)
{
	let speed=16.875;
	let obj=CreatePlayerShotA1(x,y,speed,angle,damage,1,21);
	Obj_SetRenderPriorityI(obj,20);
	let scale=1.0;
	ObjRender_SetScaleXYZ(obj,scale,scale,scale);
	ObjRender_SetAlpha(obj,0);
	let count=0;
	let OldX=x;
	let OldY=y;
	let dx=0;
	let dy=0;
	while(!Obj_IsDeleted(obj))
	{
		OldX=ObjMove_GetX(obj);
		OldY=ObjMove_GetY(obj);
		ObjMove_SetX(obj,OptionX[Opnum]+dx);
		ObjMove_SetY(obj,OptionY[Opnum]+dy);
		dx+=speed*cos(angle);
		dy+=speed*sin(angle);
		if(GetVirtualKeyState(VK_SHOT)==KEY_PULL){break;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH){break;}
		if(GetPlayerState!=STATE_NORMAL){break;}
		if(!IsPermitPlayerShot){break;}
		
		let TempLaserPoint=LaserPoint[Opnum];
		let LaserLeng=((OptionY[Opnum]-LaserPoint[Opnum][1])^2+(OptionX[Opnum]-LaserPoint[Opnum][0])^2)^0.5;
		let Leng=((OptionY[Opnum]-ObjMove_GetY(obj))^2+(OptionX[Opnum]-ObjMove_GetX(obj))^2)^0.5;
		if(LaserLeng<Leng)
		{
			let TempLaserPoint=LaserPoint[Opnum];
			TempLaserPoint[0]=OldX;
			TempLaserPoint[1]=OldY;
			LaserPoint[Opnum]=TempLaserPoint;
		}

		yield;
	}

	if(GetVirtualKeyState(VK_SHOT)!=KEY_PULL && GetVirtualKeyState(VK_SLOWMOVE)!=KEY_PUSH)
	{
		let TempLaserPoint=LaserPoint[Opnum];
		TempLaserPoint[0]=OldX;
		TempLaserPoint[1]=OldY;
		LaserPoint[Opnum]=TempLaserPoint;
		if(OldY>-16)
		{
			HitEffect(OptionX[Opnum],OptionY[Opnum],dx,dy,speed,angle,Opnum);
			LaserImpactFlag[Opnum]=2;
		}
	}
	else
	{

	}
	Obj_Delete(obj);

	task HitEffect(x,y,x2,y2,speed,angle,OP)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,0);

		ObjPrim_SetDestCenter(obj,64,34,80,61);

		ObjRender_SetPosition(obj,x,y,0);
		let am = 1;
		speed/=4;
		let Scale=1;
		let Alpha=1;
		let R=255;
		let G=100;
		let B=255;
		loop(12)
		{
			ObjRender_SetPosition(obj,(OptionX[Opnum]+x2+1)+(speed*am)*cos(angle+2),(OptionY[Opnum]+y2+9)+(speed*am)*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			ObjRender_SetScaleXYZ(obj,Scale,Scale,Scale);
			ObjRender_SetAngleZ(obj,angle+90);
			Alpha-=1/15;
			Scale-=1/15;
			am++;
			if(SELECT_PLAYER==SELECT_MARISA)
			{
				yield;
			}
		}
		Obj_Delete(obj);
	}
}

task LaserDraw(ShotAngle)
{
	while(SELECT_PLAYER==SELECT_MARISA)
	{
		while(GetPlayerState!=STATE_NORMAL || !IsPermitPlayerShot){yield;}
		while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH)
		{
			if(GetVirtualKeyState(VK_SHOT)==KEY_HOLD){break;}
			yield;
		}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_FREE&&SELECT_PLAYER==SELECT_MARISA)
		{
		LaserPoint=[[0,0],[0,0],[0,0],[0,0]];
		LaserEffect(2);
		LaserEffect(3);
		LaserEffect(0);
		LaserEffect(1);
		while( GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD&&SELECT_PLAYER==SELECT_MARISA)
		{
			if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PULL){break;}
			if(GetPlayerState!=STATE_NORMAL){break;}
			if(!IsPermitPlayerShot){break;}
			if(SELECT_PLAYER!=SELECT_MARISA){break;}
			
			yield;
		}
		}
		else{yield;}
	}
		task LaserEffect(num)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_LASER);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,0);

			ObjPrim_SetDestCenter(obj,80,0,96,256);
			let Alpha=1.0;
			let R=255;
			let G=255;
			let B=255;
		//	ObjRender_SetScaleXYZ(obj,5,5,5);
		//	ObjRender_SetAngleX(obj,180);
			ObjRender_SetAngleZ(obj,ShotAngle[PlayerPower_Int-1][num]-90);
			let LengMax=0;
			let ScaleX=0;
			let LagCount=6;
			LaserSourceEffect(num);
			let AnimeCount=0;
			while( (GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD )&&SELECT_PLAYER==SELECT_MARISA)
			{
				if(!OnSpell)
				{
					ObjRender_SetAlpha(obj,255);
				}
				else
				{
					ObjRender_SetAlpha(obj,0);
				}
				if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH){break;}
				if(GetPlayerState!=STATE_NORMAL){break;}
				if(!IsPermitPlayerShot){break;}
				
				if(LaserImpactFlag[num]>0)
				{
					R=100;G=100;B=255;
				}
				else
				{
					R=255;G=255;B=255;
				}

				ObjRender_SetPosition(obj,OptionX[num],OptionY[num],0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleXYZ(obj,ScaleX,1,1);

				let Leng=((OptionY[num]-LaserPoint[num][1])^2+(OptionX[num]-LaserPoint[num][0])^2)^0.5;
				LengMax+=16.875;
				if(LaserPoint[num][0]==0 && LaserPoint[num][1]==0)
				{
					if(num>=2)
					{
					Leng=LengMax;
					}
					else
					{
					if(LagCount>0){LengMax=0;Leng=LengMax;}
					}
				}
				if(Leng>LengMax){Leng=LengMax;}

				if(ScaleX<1){ScaleX+=0.5;}

				ObjPrim_SetVertexUVT(obj, 0, 64, AnimeCount);
				ObjPrim_SetVertexUVT(obj, 1, 80, AnimeCount);
				ObjPrim_SetVertexUVT(obj, 2, 80, Leng+AnimeCount);
				ObjPrim_SetVertexUVT(obj, 3, 64, Leng+AnimeCount);

				ObjPrim_SetVertexPosition(obj, 0, -8, 0, -0);
				ObjPrim_SetVertexPosition(obj, 1, 8, 0, -0);
				ObjPrim_SetVertexPosition(obj, 2, 8, Leng, 0);
				ObjPrim_SetVertexPosition(obj, 3, -8, Leng, 0);

				LagCount--;
				AnimeCount-=64/5;
				yield;
			}
			loop(3)
			{
				if(!OnSpell)
				{
					ObjRender_SetAlpha(obj,255);
				}
				else
				{
					ObjRender_SetAlpha(obj,0);
				}
				if(LaserImpactFlag[num]>0)
				{
					R=100;G=100;B=255;
				}
				else
				{
					R=255;G=255;B=255;
				}

				ObjRender_SetPosition(obj,OptionX[num],OptionY[num],0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleXYZ(obj,ScaleX,1,1);

				let Leng=((OptionY[num]-LaserPoint[num][1])^2+(OptionX[num]-LaserPoint[num][0])^2)^0.5;
				LengMax+=16.875;
				if(LaserPoint[num][0]==0 && LaserPoint[num][1]==0)
				{
					if(num>=2)
					{
					Leng=LengMax;
					}
					else
					{
					if(LagCount>0){LengMax=0;Leng=LengMax;}
					}
				}
				if(Leng>LengMax){Leng=LengMax;}

				ScaleX-=0.5;

				ObjPrim_SetVertexUVT(obj, 0, 64, AnimeCount);
				ObjPrim_SetVertexUVT(obj, 1, 80, AnimeCount);
				ObjPrim_SetVertexUVT(obj, 2, 80, Leng+AnimeCount);
				ObjPrim_SetVertexUVT(obj, 3, 64, Leng+AnimeCount);

				ObjPrim_SetVertexPosition(obj, 0, -8, 0, -0);
				ObjPrim_SetVertexPosition(obj, 1, 8, 0, -0);
				ObjPrim_SetVertexPosition(obj, 2, 8, Leng, 0);
				ObjPrim_SetVertexPosition(obj, 3, -8, Leng, 0);

				LagCount--;
				AnimeCount-=64/5;
				yield;
			}

			Obj_Delete(obj);

			task LaserSourceEffect(num)
			{
				let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
				ObjPrim_SetTexture(obj,IMG_SHOT);
				ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
				ObjPrim_SetVertexCount(obj, 4);
				ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
				Obj_SetRenderPriorityI(obj,43);
				ObjRender_SetAngleZ(obj,0);

				ObjPrim_SetDestCenter(obj,96,192,128,224);
				let Scale=1.25;
				let ScaleTheta=0;
				ObjRender_SetScaleXYZ(obj,Scale,Scale,Scale);
				let Xangle=-90;
				let Yangle=90;
				let Zangle=0;
				loop(3)
				{
					ObjRender_SetPosition(obj,OptionX[num],OptionY[num],0);
					ObjRender_SetAngleXYZ(obj,Xangle,Yangle,Zangle);
					Xangle+=30;
					Yangle-=30;
					Zangle+=30;
					yield;
				}
				while(GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD&&SELECT_PLAYER==SELECT_MARISA)
				{
					if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH){break;}
					if(GetPlayerState!=STATE_NORMAL){break;}
					if(!IsPermitPlayerShot){break;}
					
					ObjRender_SetPosition(obj,OptionX[num],OptionY[num],0);
					ObjRender_SetAngleXYZ(obj,Xangle,Yangle,Zangle);
					ObjRender_SetScaleXYZ(obj,Scale,Scale,Scale);
					Scale=1.00+0.25*cos(ScaleTheta);
					Zangle+=30;
					ScaleTheta+=45;
					yield;
				}
				loop(3)
				{
					ObjRender_SetPosition(obj,OptionX[num],OptionY[num],0);
					ObjRender_SetAngleXYZ(obj,Xangle,Yangle,Zangle);
					Xangle-=30;
					Yangle+=30;
					Zangle+=30;
					yield;
				}
				Obj_Delete(obj);
			}
		}
	}
}

task TShotSakuya
{
	let pShot=false;
	ShotCheck;
	let Speed=22.5;
	let MainDamage=3.0*1.1;
	let DamageRate=1*1.5;
	while(SELECT_PLAYER==SELECT_SAKUYA)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=1.0*1.5;}
		else{DamageRate=1.0*1.5;}
		if((GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD))
		{
			MainShot(GetPlayerX()+8, GetPlayerY(), Speed, 270, MainDamage, 1, 32);
			MainShot(GetPlayerX()-8, GetPlayerY(), Speed, 270, MainDamage, 1, 32);
		}
		else
		{
			MainShot(GetPlayerX(), GetPlayerY(), Speed, 270, MainDamage, 1, 30);
			MainShot(GetPlayerX(), GetPlayerY(), Speed, 270+3, MainDamage/5, 1, 30);
			MainShot(GetPlayerX(), GetPlayerY(), Speed, 270+6, MainDamage/5, 1, 30);
			MainShot(GetPlayerX(), GetPlayerY(), Speed, 270-3, MainDamage/5, 1, 30);
			MainShot(GetPlayerX(), GetPlayerY(), Speed, 270-6, MainDamage/5, 1, 30);
		}
		PlaySE(SE_SHOT);

		loop(3){yield;}
	}

	task ShotCheck
	{
		while(SELECT_PLAYER==SELECT_SAKUYA)
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_SAKUYA)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}

	task MainShot(x,y,speed,angle,damage,pene,id)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		Obj_SetRenderPriorityI(obj,40);
		let OldX;
		let OldY;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle,id);
		HitEffect2(OldX,OldY,speed,angle,id);
		if(id==32)
		{
		HitEffect3(OldX,OldY);
		}
		Obj_Delete(obj);
	}

	task HitEffect(x,y,speed,angle,id)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,angle+90);

		ObjPrim_SetDestCenter(obj,128,96,144,128);
		if(id==10){ObjPrim_SetDestCenter(obj,160,96,176,128);}
		ObjRender_SetPosition(obj,x+1,y-18,0);
		speed/=8;
		let Alpha=1.0;
		let R=255;
		let G=255;
		let B=255;
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			Alpha-=1.0/9;
			yield;
		}
		ObjPrim_SetDestCenter(obj,128,64,144,96);
		if(id==10){ObjPrim_SetDestCenter(obj,160,64,176,96);}
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			Alpha-=1.0/9;
			yield;
		}
		ObjPrim_SetDestCenter(obj,128,32,144,64);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			Alpha-=1.0/9;
			yield;
		}
		Obj_Delete(obj);
	}

	task HitEffect2(x,y,speed,angle,id)
	{
		angle+=180+rand(-90,90);
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);

		ObjPrim_SetDestCenter(obj,128,96,144,128);
		if(id==10){ObjPrim_SetDestCenter(obj,160,96,176,128);}

		ObjRender_SetPosition(obj,x,y,0);
		speed=rand(2.5,5);
		let Scale=1;
		let Alpha=0.5;
		let R=255;
		let G=255;
		let B=255;
		let Zangle=angle+90;
		let ZanglePlus=rand(10,20)*rand_dire;
		loop(10)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			Alpha-=0.5/15;
			ObjRender_SetAngleZ(obj,Zangle);
			Zangle+=ZanglePlus;
			yield;
		}
		ObjPrim_SetDestCenter(obj,128,64,144,96);
		if(id==10){ObjPrim_SetDestCenter(obj,160,64,176,96);}
		loop(5)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			Alpha-=0.5/15;
			ObjRender_SetAngleZ(obj,Zangle);
			Zangle+=ZanglePlus;
			yield;
		}
		Obj_Delete(obj);
	}

	task HitEffect3(x,y)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SPLASH);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);

		ObjPrim_SetDestCenter(obj,0,0,64,16);

		ObjRender_SetPosition(obj,x,y+45,0);
		let Scale=2;
		let Alpha=0;
		let R=100;
		let G=255;
		let B=100;
		let Zangle=0;
		ObjRender_SetScaleXYZ(obj,Scale,Scale,Scale);
		ObjRender_SetAngleZ(obj,Zangle+90);
		let count=0;
		loop(8)
		{
			ObjPrim_SetDestCenter(obj,0,0+count*16,64,16+count*16);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			Alpha+=0.5/8;
			count+=1;
			yield;
		}
		Obj_Delete(obj);
	}
}
task TShot2Sakuya
{//??
	TShot3;//????????2
	TShot4;//???
	let pShot=false;
	ShotCheck;
	let ShotDamage=2.4*1.5;
	let DamageRate=1*1.5;
	let ShotAngle_P4=[275,264,270,270];
	let ShotAngle=[ShotAngle_P4,ShotAngle_P4,ShotAngle_P4,ShotAngle_P4];
	let ShotLag=0;
	while(SELECT_PLAYER==SELECT_SAKUYA)
	{
		while(!pShot){ShotLag=0;yield;}
		if(IsPlayerSpellActive){DamageRate=1.0*1.5;}
		else{DamageRate=1.0*1.5;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{

		}
		else
		{
			ascent(i in 0..PlayerPower_Int)
			{
				if(i>=2)
				{
					KnifeShot(OptionX[i],OptionY[i],270,ShotDamage,i,31);
				}
			}
		}
		ShotLag+=1;
		loop(6-(ShotLag%3==2)*3){yield;}
	}

	task ShotCheck
	{
		while(SELECT_PLAYER==SELECT_SAKUYA)
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_SAKUYA)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}
	task TShot3
	{//??
		let pShot=false;
		ShotCheck;
		let ShotDamage=2.4*1.5;
		let DamageRate=1*1.5;
		let ShotAngle_P1=[270,0,0,0];
		let ShotAngle_P2=[250,290,0,0];
		let ShotAngle_P3=[290,250,270,0];
		let ShotAngle_P4=[290,250,260,280];
		let ShotAngle=[ShotAngle_P1,ShotAngle_P2,ShotAngle_P3,ShotAngle_P4];
		let ShotLag=0;
		while(SELECT_PLAYER==SELECT_SAKUYA)
		{
			while(!pShot){ShotLag=0;yield;}
			if(IsPlayerSpellActive){DamageRate=1.0*1.5;}
			else{DamageRate=1.0*1.5;}
			if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
			{

			}
			else
			{
				ascent(i in 0..PlayerPower_Int)
				{
					KnifeShot(OptionX[i],OptionY[i],ShotAngle[PlayerPower_Int-1][i],ShotDamage,i,31);
					if(i<2)
					{
						KnifeShot(OptionX[i],OptionY[i],270,ShotDamage,i,31);
					}
				}
			}
			ShotLag+=1;
			loop(3+ShotLag%2){yield;}
		}

		task ShotCheck
		{
			while(SELECT_PLAYER==SELECT_SAKUYA)
			{
				if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot && !IsPlayerSpellActive&&SELECT_PLAYER==SELECT_SAKUYA)
				{
				pShot=true;

				}
				else
				{
				pShot=false;

				}
				yield;
			}
		}
	}

	task TShot4
	{//??
		let pShot=false;
		ShotCheck;
		let ShotDamage=1.5*1.5;
		let DamageRate=1*1.5;
		let ShotAngle_P1=[270,0,0,0];
		let ShotAngle_P2=[250,290,0,0];
		let ShotAngle_P3=[290,250,270,0];
		let ShotAngle_P4=[250,290,290,250];
		let ShotAngle=[ShotAngle_P1,ShotAngle_P2,ShotAngle_P3,ShotAngle_P4];
		let ShotCount=0;

		while(SELECT_PLAYER==SELECT_SAKUYA)
		{
			while(!pShot){ShotCount=0;yield;}
			if(IsPlayerSpellActive){DamageRate=1.0*1.5;}
			else{DamageRate=1.0*1.5;}
			if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
			{
				ascent(i in 0..PlayerPower_Int)
				{
					KnifeShot(OptionX[i],OptionY[i],ShotAngle[PlayerPower_Int-1][i],ShotDamage,i,32);
				}
			}
			else
			{

			}
			loop(3){yield;}
		}

		task ShotCheck
		{
			loop
			{
				if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot && !IsPlayerSpellActive&&SELECT_PLAYER==SELECT_SAKUYA)
				{
				pShot=true;

				}
				else
				{
				pShot=false;

				}
				yield;
			}
		}
	}
	task KnifeShot(x,y,angle,damage,Opnum,id)
	{
		let speed=22.5;
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,1,id);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let count=0;
		let OldX=x;
		let OldY=y;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			count+=1;
			if(count==5 && id==32){
				let EnemyObjectArray=GetIntersectionRegistedEnemyID;
				angle = 270;
				let tmpAngle;
				if(length(EnemyObjectArray)!=0)
				{
					ascent(i in 0..length(EnemyObjectArray))
					{
						tmpAngle = atan2(ObjMove_GetY(EnemyObjectArray[i])-GetPlayerY(),ObjMove_GetX(EnemyObjectArray[i])-GetPlayerX());
						tmpAngle %= 360;
						if(tmpAngle > 240 && tmpAngle < 300){
							angle = tmpAngle;
							break;
						}
					}
				}
				ObjMove_SetAngle(obj,angle);
			}
			yield;
		}

		HitEffect(OldX,OldY,speed,angle);
		HitEffect2(OldX,OldY,speed,angle);
		Obj_Delete(obj);

		task HitEffect(x,y,speed,angle)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,angle+90);

			ObjPrim_SetDestCenter(obj,144,96,160,128);
			if(id==32){ObjPrim_SetDestCenter(obj,160,96,176,128);}

			ObjRender_SetPosition(obj,x,y,0);
			speed/=8;
			let Scale=1;
			let Alpha=1.0;
			let R=255;
			let G=255;
			let B=255;
			loop(3)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=1.0/9;
				yield;
			}
			ObjPrim_SetDestCenter(obj,144,64,160,96);
			if(id==32){ObjPrim_SetDestCenter(obj,160,64,176,96);}
			loop(3)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=1.0/9;
				yield;
			}
			ObjPrim_SetDestCenter(obj,144,32,160,64);
			if(id==10){ObjPrim_SetDestCenter(obj,160,32,176,64);}

			loop(3)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=1.0/9;
				yield;
			}
			Obj_Delete(obj);
		}

		task HitEffect2(x,y,speed,angle)
		{
			angle+=180+rand(-90,90);
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);

			ObjPrim_SetDestCenter(obj,144,96,160,128);
			if(id==32){ObjPrim_SetDestCenter(obj,160,96,176,128);}

			ObjRender_SetPosition(obj,x,y,0);
			speed=rand(2.5,5);
			let Scale=1;
			let Alpha=0.5;
			let R=255;
			let G=255;
			let B=255;
			let Zangle=angle+90;
			let ZanglePlus=rand(10,20)*rand_dire;
			loop(10)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=0.5/15;
				ObjRender_SetAngleZ(obj,Zangle);
				Zangle+=ZanglePlus;
				yield;
			}
			ObjPrim_SetDestCenter(obj,144,64,160,96);
			if(id==32){ObjPrim_SetDestCenter(obj,160,64,176,96);}

			loop(5)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=0.5/15;
				ObjRender_SetAngleZ(obj,Zangle);
				Zangle+=ZanglePlus;
				yield;
			}
			Obj_Delete(obj);
		}
	}
}

task TShotReisen
{
	let pShot=false;
	ShotCheck;
	let Speed=22.5;
	let MainDamage=3.0*1.5;
//	let DamageRate=1*1.5;
	while(SELECT_PLAYER==SELECT_REISEN)
	{
		while(!pShot){yield;}
//		if(IsPlayerSpellActive){DamageRate=2.0*1.5;}
//		else{DamageRate=1.0*1.5;}

		if(OnSpell)
		{
			MainDamage = 3.2*1.5;
		}
		else
		{
			MainDamage = 3.0*1.5;
		}
		MainShot(GetPlayerX()+8, GetPlayerY(), Speed, 270, MainDamage, 1, 104);
		MainShot(GetPlayerX()-8, GetPlayerY(), Speed, 270, MainDamage, 1, 104);
		PlaySE(SE_SHOT);

		loop(3){yield;}
	}

	task ShotCheck
	{
		while(SELECT_PLAYER==SELECT_REISEN)
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_REISEN)
			{
				pShot=true;
			}
			else
			{
				pShot=false;
			}
			yield;
		}
	}

	task MainShot(x,y,speed,angle,damage,pene,id)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		Obj_SetRenderPriorityI(obj,40);
		let OldX;
		let OldY;
		MOVE(obj,angle);
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		//HitEffect2(OldX,OldY,speed,angle);
		Obj_Delete(obj);
	}
	task MOVE(obj,angle)
	{
		loop(rand(5,15)){yield;}
		angle=270+rand(7,-7);
		ObjMove_SetAngle(obj,angle);
	}

	task HitEffect(x,y,speed,angle)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,200);
		Obj_SetRenderPriorityI(obj,40);

		ObjPrim_SetDestCenter(obj,263,188,271,201);

		ObjRender_SetPosition(obj,x+1,y-18,0);
		speed/=8;
		let Alpha=1.0;
		let R=255;
		let G=255;
		let B=255;
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			//ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			Alpha-=1.0/9;
			yield;
		}
		ObjPrim_SetDestCenter(obj,263,155,271,163);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			Alpha-=1.0/9;
			yield;
		}
		ObjPrim_SetDestCenter(obj,263,122,271,126);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			//ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			Alpha-=1.0/9;
			yield;
		}
		Obj_Delete(obj);
	}
}
task TShot2Reisen
{//??
	TShot3;
	let pShot=false;
	ShotCheck;
	let ShotDamage=2.0*1.5;
//	let DamageRate=1*1.5;
	let ShotAngle_P1=[rand(270-35,270+35),0,0,0];
	let ShotAngle_P2=[rand(270-35,270+35),rand(270-35,270+35),0,0];
	let ShotAngle_P3=[rand(270-35,270+35),rand(270-35,270+35),rand(270-35,270+35),0];
	let ShotAngle_P4=[rand(270-35,270+35),rand(270-35,270+35),rand(270-35,270+35),rand(270-35,270+35)];
	let ShotAngle=[ShotAngle_P1,ShotAngle_P2,ShotAngle_P3,ShotAngle_P4];
	let ShotLag=0;
	let RANDANG = rand(0,360);
	while(SELECT_PLAYER==SELECT_REISEN)
	{
		while(!pShot){ShotLag=0;yield;}
//		if(IsPlayerSpellActive){DamageRate=1.0*1.5;}
//		else{DamageRate=1.0*1.5;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{

		}
		else
		{
			
			ascent(i in 0..PlayerPower_Int)
			{
				ReiBul(OptionX[i],OptionY[i],rand(270-35,270+35),ShotDamage,i);
			}
					
		}
		ShotLag+=1;	
		loop(3){yield;}
		
	}

	task ShotCheck
	{
		while(SELECT_PLAYER==SELECT_REISEN)
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot && !IsPlayerSpellActive&&SELECT_PLAYER==SELECT_REISEN)
			{
				pShot=true;
			}
			else
			{
				pShot=false;
			}
			yield;
		}
	}
	task TShot3
	{//??
		let pShot=false;
		ShotCheck;
		let ShotDamage=0*1.5;
	//	let DamageRate=1*1.5;
		let ShotAngle_P1=[270,0,0,0];
		let ShotAngle_P2=[250,290,0,0];
		let ShotAngle_P3=[290,250,270,0];
		let ShotAngle_P4=[290,250,260,280];
		let ShotAngle=[ShotAngle_P1,ShotAngle_P2,ShotAngle_P3,ShotAngle_P4];
		let ShotCount=0;
		let FLORX=GetPlayerX-(GetStgFrameWidth/30)*10;
		let FLORY=GetStgFrameHeight+30;
		while(SELECT_PLAYER==SELECT_REISEN)
		{
			while(!pShot){ShotCount=0;yield;}
	//		if(IsPlayerSpellActive){DamageRate=1.0*1.5;}
	//		else{DamageRate=1.0*1.5;}
			if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
			{
				ascent(i in 0..PlayerPower_Int)
				{
					Wave(OptionX[i],OptionY[i],270,ShotDamage,0);

				}
				ShotCount+=1;
			}
			else
			{

			}
			loop(2)
			{
				yield;
			}
		}

		task ShotCheck
		{
			while(SELECT_PLAYER==SELECT_REISEN)
			{
				if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot && !IsPlayerSpellActive&&SELECT_PLAYER==SELECT_REISEN)
				{
					pShot=true;
				}
				else
				{
					pShot=false;
				}
				yield;
			}
		}
	}

	task APPEAR(obj,amount)
	{
		let amounter = 0;
		loop(25)
		{
			ObjRender_SetAlpha(obj,amounter);
			amounter+=amount/25;
			yield;
		}
	}
	task APPEAR2(obj,amount)
	{
		let amounter = 0;
		loop(10)
		{	
			ObjRender_SetAlpha(obj,amounter);
			amounter+=amount/10;
			yield;
		}
	}
	task Wave(x,y,angle,damage,Opnum)
	{
		let scale=1.0;
		
		let speed=3;
		let obj=CreatePlayerShotA1(x,y-10,20,angle,0.4,999,107);

		
		Obj_SetRenderPriorityI(obj,40);

		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let count=0;
		let OldX=x;
		let OldY=y;
		let Alpha=255;
		//ObjShot_SetIntersectionEnable(obj,false);

		ObjRender_SetAlpha(obj,192);
		while(!Obj_IsDeleted(obj))
		{
			if(ObjShot_GetPenetration(obj)<999)
			{
				ObjRender_SetColor(obj,255,32,255);
			}
			yield;
		}

	}


	task ReiBul(x,y,angle,damage,Opnum)
	{
		let speed=17;
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage/2,1,106);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		ObjRender_SetAlpha(obj,0);

		ObjRender_SetColor(obj,255,160,255);
		APPEAR2(obj,200);
		let OldX=x;
		let OldY=y;
		while(!Obj_IsDeleted(obj))
		{
			angle=ObjMove_GetAngle(obj);
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}

		HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);

		task HitEffect(x,y,speed,angle)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetAngleZ(obj,angle+90);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			ObjRender_SetAlpha(obj,200);
			ObjRender_SetColor(obj,255,160,255);
			ObjPrim_SetDestCenter(obj,300,131,317,158);

			ObjRender_SetPosition(obj,x,y,0);
			speed/=8;
			let Scale=1;
			let Alpha=1.0;
			let R=255;
			let G=160;
			let B=255;
			loop(3)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				//ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=1.0/9;
				yield;
			}
			ObjPrim_SetDestCenter(obj,300-7,67-7,317+7,83+7);
			loop(3)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=1.0/9;
				yield;
			}
			ObjPrim_SetDestCenter(obj,300-7,3-7,317+7,12+7);
			loop(3)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				//ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=1.0/9;
				yield;
			}

			Obj_Delete(obj);
		}

		task HitEffect2(x,y,speed,angle)
		{
			angle+=180+rand(-90,90);
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);

			ObjPrim_SetDestCenter(obj,144,96,160,128);

			ObjRender_SetPosition(obj,x,y,0);
			speed=rand(2.5,5);
			let Scale=1;
			let Alpha=0.5;
			let R=255;
			let G=255;
			let B=255;
			let Zangle=angle+90;
			let ZanglePlus=rand(10,20)*rand_dire;
			loop(10)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=0.5/15;
				ObjRender_SetAngleZ(obj,Zangle);
				Zangle+=ZanglePlus;
				yield;
			}
			ObjPrim_SetDestCenter(obj,144,64,160,96);
			loop(5)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=0.5/15;
				ObjRender_SetAngleZ(obj,Zangle);
				Zangle+=ZanglePlus;
				yield;
			}
			Obj_Delete(obj);
		}
	}
}

task TShotSanae
{
	let pShot=false;
	ShotCheck;
	let Speed=22.5;
	let MainDamage=3.0;
	let DamageRate=1*2;
	while(SELECT_PLAYER==SELECT_SANAE)
	{
		while(!pShot){yield;}
		MainShot(GetPlayerX()+8, GetPlayerY(), Speed, 270, MainDamage, 1, 109,1);
		MainShot(GetPlayerX()-8, GetPlayerY(), Speed, 270, MainDamage, 1, 109,-1);
		PlaySE(SE_SHOT);
		loop(3){yield;}
	}

	task ShotCheck
	{
		while(SELECT_PLAYER==SELECT_SANAE)
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_SANAE&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}

	task MainShot(x,y,speed,angle,damage,pene,id,turner)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		Obj_SetRenderPriorityI(obj,40);
		let OldX;
		let OldY;
		MOVE(obj,turner);
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			angle=ObjMove_GetAngle(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);
	}
	task MOVE(obj,turner)
	{
		let c = 0;
		while(!Obj_IsDeleted(obj))
		{
			ObjMove_SetAngle(obj,-90+(17*cos(c))*turner);
			c+=60;
			yield;
		}
	}
	task HitEffect(x,y,speed,angle)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,0);

		ObjPrim_SetDestCenter(obj,411,49,426,63);

		ObjRender_SetPosition(obj,x+1,y-18,0);
		speed/=8;
		let Alpha=0.75;
		let R=255;
		let G=255;
		let B=255;
		loop(15)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.25/15;
			yield;
		}

		ObjPrim_SetDestCenter(obj,411,33,426,47);

		loop(5)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.25/5;
			yield;
		}

		ObjPrim_SetDestCenter(obj,411,17,426,31);

		loop(5)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.25/5;
			yield;
		}
		ObjPrim_SetDestCenter(obj,411,1,426,15);

		loop(5)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.25/5;
			yield;
		}
		Obj_Delete(obj);
	}

}
task TShot2Sanae
{//??
	let pShot=false;
	ShotCheck;
	let ShotDamage=10.0*0*2;
	let LaserDamage=0.6*2;
	let DamageRate=1*2;
	let ShotAngle_P1=[250,0,0,0];
	let ShotAngle_P2=[270,270,0,0];
	let ShotAngle_P3=[225,270+20,315,0];
	let ShotAngle_P4=[270,270-35,270,270+35];
	let ShotAngle=[ShotAngle_P1,ShotAngle_P2,ShotAngle_P3,ShotAngle_P4];
	
	let ShotAngle2_P1=[290,0,0,0];
	let ShotAngle2_P2=[250,290,0,0];
	let ShotAngle2_P3=[315,270-20,225,0];
	let ShotAngle2_P4=[270+15,270-45,270-15,270+45];
	let ShotAngle2=[ShotAngle2_P1,ShotAngle2_P2,ShotAngle2_P3,ShotAngle2_P4];
	
	let LaserLagCount=6;
	let ShotLagCount=0;
	while(SELECT_PLAYER==SELECT_SANAE)
	{
		while(!pShot){ShotLagCount=0;yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*2;}
		else{DamageRate=1.0*2;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
			ascent(i in 0..PlayerPower_Int)
			{	
				SnakeShot(OptionX[i]+4,OptionY[i],270,ShotDamage,0);
				SnakeShot(OptionX[i]-4,OptionY[i],270,ShotDamage,0);
			}
			ShotLagCount+=1;
			loop(8){yield;}
			if(ShotLagCount%2==0){loop(3){yield;}}
		}
		else
		{
//			PlaySE(SE_MISSILE);

			ascent(i in 0..PlayerPower_Int)
			{
				FrogShot(OptionX[i],OptionY[i],ShotAngle[PlayerPower_Int-1][i],ShotDamage*3,0);
				FrogShot(OptionX[i],OptionY[i],ShotAngle2[PlayerPower_Int-1][i],ShotDamage*3,1);
			}
			
			ShotLagCount+=1;
			loop(3){yield;}
			if(ShotLagCount%1==0)
			{
				loop(30)
				{	
					if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH ||GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
					{
					}
					else
					{
						yield;
					}
				}
			}
		}

		loop(1){yield;}
	}

	task ShotCheck
	{
		while(SELECT_PLAYER==SELECT_SANAE)
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_SANAE&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}
	task FrogShot(x,y,angle,damage,Opnum)
	{
		let speed=8;
		let speedPlus=2;
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,1,99);
		ObjMove_SetAcceleration(obj,-0.2);
		ObjMove_SetMaxSpeed(obj,4);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let count=2;
		let OldX=x;
		let OldY=y;
		let Alpha=255;
		GraChange;
		loop(6)
		{
			if(Obj_IsDeleted(obj)){break;}
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			count+=1;
			yield;
		}
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			speed = ObjMove_GetSpeed(obj);
			count+=1;
			yield;
		}
		ExplodeAttack(OldX,OldY);
		T_HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);

		task GraChange
		{
			while(!Obj_IsDeleted(obj))
			{	
				//if(count%8<4){ObjShot_SetGraphic(obj,23);}
			//	else{ObjShot_SetGraphic(obj,24);}
				yield;
			}
		}

		task ExplodeAttack(x,y)
		{
			if(y>0&&GetPlayerState==STATE_NORMAL && IsPermitPlayerShot){
			let objAK=CreatePlayerShotA1(x,y,0,0,2,65525,21);

			
			ObjRender_SetAlpha(objAK,0);
			loop(10)
			{
				ObjShot_SetIntersectionCircleA1(objAK,24);
				loop(2){yield;}
			}
			Obj_Delete(objAK);
			}
			
		}

		task T_HitEffect(x,y,speed,angle)
		{
			if(y>0)
			{
	//		PlaySE(SE_MISSILE2);
			HitEffect(x,y,3);
			ascent(i in 0..10)
			{
				let ra=rand(0,360);
				HitEffect(x+4*i*cos(ra),y+4*i*sin(ra),1);
				y-=4;
				loop(2){yield;}
			}
			}
		}

		task HitEffect(x,y,Scaleadd)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,0);

			ObjRender_SetPosition(obj,x,y,0);
			let Alpha=0.5;
			let Scale=0;
			let R=255;
			let G=255;
			let B=255;

			ObjPrim_SetDestCenter(obj,96,97,128,128);
			loop(4)
			{
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Scale+=Scaleadd/4;
				ObjRender_SetScaleXYZ(obj,Scale,Scale,1);
				yield;
			}
			ObjPrim_SetDestCenter(obj,96,65,128,96);
			loop(4)
			{
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleXYZ(obj,Scale,Scale,1);
				yield;
			}
			Alpha=0.25;
			ObjPrim_SetDestCenter(obj,96,33,128,64);
			loop(4)
			{
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleXYZ(obj,Scale,Scale,1);
				yield;
			}
			ObjPrim_SetDestCenter(obj,96,1,128,32);
			loop(4)
			{
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleXYZ(obj,Scale,Scale,1);
				yield;
			}
			Obj_Delete(obj);
		}
	}

	task SnakeShot(x,y,angle,damage,Opnum)
	{
		let scale=1.0;
		
		let speed=3;
		let obj=CreatePlayerShotA1(x,y-10,10,angle,5,1,108);

		
		Obj_SetRenderPriorityI(obj,40);

		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let count=0;
		let OldX=x;
		let OldY=y;
		let Alpha=255;
		ObjShot_SetIntersectionEnable(obj,true);
		let ANG = ObjMove_GetAngle(obj);
		ObjRender_SetAlpha(obj,192);
		
		let swatch = 1;
		let swatch2 = 1;
		while(!Obj_IsDeleted(obj))
		{
			speed = ObjMove_GetSpeed(obj);
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			ANG = ObjMove_GetAngle(obj);
				let EnemyObjectArray=GetIntersectionRegistedEnemyID;
				if(swatch==1&&swatch2==1){
				//angle = 270;
				}
				let tmpAngle;
				if(swatch==1){
				if(length(EnemyObjectArray)!=0 )
				{
					ascent(i in 0..length(EnemyObjectArray))
					{
						if(ObjMove_GetY(obj)<ObjMove_GetY(EnemyObjectArray[i])+10&&ObjMove_GetY(obj)>ObjMove_GetY(EnemyObjectArray[i])-10)
						{
							
						tmpAngle = atan2(ObjMove_GetY(EnemyObjectArray[i])-ObjMove_GetY(obj),ObjMove_GetX(EnemyObjectArray[i])-ObjMove_GetX(obj));
						tmpAngle %= 360;
						swatch=0;
						swatch2=0;
						if(tmpAngle > 180 && tmpAngle < 270){
							angle = 180;
							break;
						}
						else if(tmpAngle > 270 && tmpAngle < 360){
							angle = 0;
							break;
						}
						}
					}
				}
				}
				if(swatch==0){
				ObjMove_SetSpeed(obj,20);
				ObjMove_SetAngle(obj,angle);
				}
			yield;
			
		}
		HitEffect(OldX,OldY,angle,speed);
		
		task HitEffect(x,y,angleT,speed)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			//ObjRender_SetAngleZ(obj,0);
			ObjRender_SetAngleZ(obj,angleT+90);
			ObjRender_SetPosition(obj,x,y,0);
			let Alpha2=192;
			let Scale=1;
			let R=255;
			let G=255;
			let B=255;
			
			ObjPrim_SetDestCenter(obj,381,193,391,252);
			loop(20)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed/6*cos(angleT),ObjRender_GetY(obj)+speed/6*sin(angleT),0);
				Scale+=1/20;
				ObjRender_SetScaleXYZ(obj,Scale,Scale,1);
				ObjRender_SetAlpha(obj,Alpha2);
				Alpha2-=192/20;
				yield;
			}
			Obj_Delete(obj);
		}
	}
}

task TShotYoumu
{
	let pShot=false;
	ShotCheck;
	let Speed=22.5;
	let MainDamage=3.0*1.3;
	let DamageRate=1*1.3;
	while(SELECT_PLAYER==SELECT_YOUMU)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.3;}
		else{DamageRate=1.0*1.3;}

		MainShot(GetPlayerX()+8, GetPlayerY(), Speed, 270-1, MainDamage, 1, 36);
		MainShot(GetPlayerX()-8, GetPlayerY(), Speed, 270+1, MainDamage, 1, 36);
		
		MainShot(GetPlayerX()+32, GetPlayerY()+20, Speed, 270-4, MainDamage, 1, 36);
		MainShot(GetPlayerX()-32, GetPlayerY()+20, Speed, 270+4, MainDamage, 1, 36);
		PlaySE(SE_SHOT);

		loop(3){yield;}
	}

	task ShotCheck
	{
		loop
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_YOUMU&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}

	task MainShot(x,y,speed,angle,damage,pene,id)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let OldX;
		let OldY;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);
	}

	task HitEffect(x,y,speed,angle)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,angle+90);

		ObjPrim_SetDestCenter(obj,882,476,898,490);

		ObjRender_SetPosition(obj,x,y,0);
		speed/=8;
		let Alpha=0.75;
		let R=255;
		let G=255;
		let B=255;
		loop(5)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.375/15;
			yield;
		}

		ObjPrim_SetDestCenter(obj,882,460,898,475);

		loop(5)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.375/5;
			yield;
		}
		
		ObjPrim_SetDestCenter(obj,882,445,898,453);

		loop(5)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=0.375/5;
			yield;
		}
		Obj_Delete(obj);
	}
}
task TShot2Youmu
{//??
	let pShot=false;
	ShotCheck;
	let DamageRate=1*1.3;
	let ang = -90;
	let ang2 = -90;
	let c = 0;
	while(SELECT_PLAYER==SELECT_YOUMU)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.3;}
		else{DamageRate=1.0*1.3;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
			
		}
		else
		{
			if((GetVirtualKeyState(VK_LEFT)==KEY_PUSH || GetVirtualKeyState(VK_LEFT)==KEY_HOLD))
			{
				ang2 = -0;
				ang = ang * 0.96 + ang2 * 0.04;
			}
			if((GetVirtualKeyState(VK_RIGHT)==KEY_PUSH || GetVirtualKeyState(VK_RIGHT)==KEY_HOLD))
			{
				ang2 = -180;
				ang = ang * 0.96 + ang2 * 0.04;
			}
			if((GetVirtualKeyState(VK_DOWN)==KEY_PUSH || GetVirtualKeyState(VK_DOWN)==KEY_HOLD))
			{
				ang2 = -90;
				ang = ang * 0.93 + ang2 * 0.07;
			}
			if((GetVirtualKeyState(VK_UP)==KEY_PUSH || GetVirtualKeyState(VK_UP)==KEY_HOLD))
			{
				ang2 = -90;
				ang = ang * 0.93 + ang2 * 0.07;
			}			
		}
		
		ascent(i in 0..1)
		{
			Slash(OptionX[i],OptionY[i],ang,1.7*1.7);
			Slash(OptionX[i],OptionY[i],ang+2,1.7*1.7);
			Slash(OptionX[i],OptionY[i],ang-2,1.7*1.7);			
		}
		if(c == 2)
		{
			Slash(OptionX[0],OptionY[0],ang+180+5,1.7*1.7);
			Slash(OptionX[0],OptionY[0],ang+180-5,1.7*1.7);
			c = 0;
		}
		c++;
		loop(3){yield;}
	}

	task ShotCheck
	{
		loop
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_YOUMU&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}
	task Slash(x,y,angle,damage)
	{
		let speed=22.5;
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,1,36);
		Obj_SetRenderPriorityI(obj,41);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,scale,scale*4,scale);
		let count=0;
		let OldX=x;
		let OldY=y;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);

		task HitEffect(x,y,speed,angle)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,angle+90);
			ObjRender_SetScaleY(obj,4);
			ObjPrim_SetDestCenter(obj,882,476,898,490);

			ObjRender_SetPosition(obj,x,y,0);
			speed/=8;
			let Alpha=0.75;
			let R=255;
			let G=255;
			let B=255;
			loop(5)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			//	ObjRender_SetAngleZ(obj,angle);
				Alpha-=0.375/15;
				yield;
			}

			ObjPrim_SetDestCenter(obj,882,460,898,475);

			loop(5)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			//	ObjRender_SetAngleZ(obj,angle);
				Alpha-=0.375/5;
				yield;
			}
			
			ObjPrim_SetDestCenter(obj,882,445,898,453);

			loop(5)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			//	ObjRender_SetAngleZ(obj,angle);
				Alpha-=0.375/5;
				yield;
			}
			Obj_Delete(obj);
		}
	}
}

task TShotAya
{
	let pShot=false;
	ShotCheck;
	let Speed=22.5;
	let MainDamage=2.5*1.5;
	let DamageRate=1*1.5;
	let A1 = 0;
	let CurveCount = 0;
	while(SELECT_PLAYER==SELECT_AYA)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.5;}
		else{DamageRate=1.0*1.5;}

		MainShot(GetPlayerX()-8, GetPlayerY(), 27, 270, MainDamage, 1, 135,8);
		MainShot(GetPlayerX()+8, GetPlayerY(), 27, 270, MainDamage, 1, 135,-8);
		CurveCount+=2;
		PlaySE(SE_SHOT);

		loop(3){yield;}
	}

	task ShotCheck
	{
		loop
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot && !IsPlayerSpellActive && !OnSpell&&SELECT_PLAYER==SELECT_AYA)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}

	task MainShot(x,y,speed,angle,damage,pene,id,amount)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		ObjRender_SetAlpha(obj,255);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let OldX;
		let OldY;
		while(!Obj_IsDeleted(obj))
		{
			ObjMove_SetX(obj,GetPlayerX+amount);
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			angle=ObjMove_GetAngle(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);
	}

	task HitEffect(x,y,speed,angle)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		//ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,angle+90);

		ObjPrim_SetDestCenter(obj,743,64,760,93);
		ObjRender_SetPosition(obj,x,y,0);
		speed/=3;
		let Alpha=155;
		let R=255;
		let G=255;
		let B=255;
		let yel = 1;
		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=255/20;
			yield;
		}

		ObjPrim_SetDestCenter(obj,743,31,760,60);

		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=255/20;
			yield;
		}
		ObjPrim_SetDestCenter(obj,743,0,760,29);

		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=255/20;
			yield;
		}

		Obj_Delete(obj);
	}

}
task TShot2Aya
{//??
	let pShot=false;
	ShotCheck;
	let DamageRate=1*1.3;
	let angleT = 0;
	let c = 0;
	while(SELECT_PLAYER==SELECT_AYA)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.3;}
		else{DamageRate=1.0*1.3;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
			Fan(GetPlayerX,GetPlayerY-30,-90,1.7*1.7,999,255,64,64,1.2,1);	
		}
		else
		{
			angleT = 0;
			if((GetVirtualKeyState(VK_LEFT)==KEY_PUSH || GetVirtualKeyState(VK_LEFT)==KEY_HOLD)&&(GetVirtualKeyState(VK_UP)==KEY_PUSH || GetVirtualKeyState(VK_UP)==KEY_HOLD))
			{
				angleT = -45
			}
			else if((GetVirtualKeyState(VK_RIGHT)==KEY_PUSH || GetVirtualKeyState(VK_RIGHT)==KEY_HOLD)&&(GetVirtualKeyState(VK_UP)==KEY_PUSH || GetVirtualKeyState(VK_UP)==KEY_HOLD))
			{
				angleT = 45;
			}
			else if((GetVirtualKeyState(VK_LEFT)==KEY_PUSH || GetVirtualKeyState(VK_LEFT)==KEY_HOLD)&&(GetVirtualKeyState(VK_DOWN)==KEY_PUSH || GetVirtualKeyState(VK_DOWN)==KEY_HOLD))
			{
				angleT = -45
			}
			else if((GetVirtualKeyState(VK_RIGHT)==KEY_PUSH || GetVirtualKeyState(VK_RIGHT)==KEY_HOLD)&&(GetVirtualKeyState(VK_DOWN)==KEY_PUSH || GetVirtualKeyState(VK_DOWN)==KEY_HOLD))
			{
				angleT = 45;
			}
			else if((GetVirtualKeyState(VK_LEFT)==KEY_PUSH || GetVirtualKeyState(VK_LEFT)==KEY_HOLD))
			{
				angleT = -90
			}					
			else if((GetVirtualKeyState(VK_RIGHT)==KEY_PUSH || GetVirtualKeyState(VK_RIGHT)==KEY_HOLD))
			{
				angleT = 90;
			}
			else if((GetVirtualKeyState(VK_UP)==KEY_PUSH || GetVirtualKeyState(VK_UP)==KEY_HOLD))
			{
				angleT = 0;
			}				
			else if((GetVirtualKeyState(VK_DOWN)==KEY_PUSH || GetVirtualKeyState(VK_DOWN)==KEY_HOLD))
			{
				angleT = 0;
			}	
			Fan(OptionX[0],OptionY[0],angleT+90,1.7*1.7,1,255,225,128,1/2.5,1);	
			Fan(OptionX[1],OptionY[1],angleT-90,1.7*1.7,1,255,225,128,1/2.5,1);	
			Fan(OptionX[2],OptionY[2],angleT-90,1.7*1.7,1,255,225,128,1/2.5,1);	
			Fan(OptionX[3],OptionY[3],angleT+90,1.7*1.7,1,255,225,128,1/2.5,1);	
			
			Fan(OptionX[0],OptionY[0],angleT+90+rand(20,-20),1.3,1,255,255,255,1/2.5,0.5);	
			Fan(OptionX[1],OptionY[1],angleT-90+rand(20,-20),1.3,1,255,255,255,1/2.5,0.5);	
			Fan(OptionX[2],OptionY[2],angleT-90+rand(20,-20),1.3,1,255,255,255,1/2.5,0.5);	
			Fan(OptionX[3],OptionY[3],angleT+90+rand(20,-20),1.3,1,255,255,255,1/2.5,0.5);	
		}
		loop(3){yield;}
	}

	task ShotCheck
	{
		loop
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&!OnSpell&&SELECT_PLAYER==SELECT_AYA)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}
	task Fan(x,y,angle,damage,pene,r,g,b,sx,sy)
	{
		let speed=22.5;
		let obj=CreatePlayerShotA1(x,y,0,angle,damage,pene,137);
		ObjMove_SetAcceleration(obj,speed/20);
		ObjMove_SetMaxSpeed(obj,speed);
		Obj_SetRenderPriorityI(obj,41);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,sx,sy,scale);
		ObjRender_SetColor(obj,r,g,b);
		ObjRender_SetAlpha(obj,128);
		let count=0;
		let OldX=x;
		let OldY=y;
		while(!Obj_IsDeleted(obj))
		{
			if(ObjShot_GetPenetration(obj)<999&&ObjShot_GetPenetration(obj)!=1)
			{
				ObjRender_SetColor(obj,128,0,0);
			}
			ObjShot_SetIntersectionCircleA1(obj,30*sx);
			speed = ObjMove_GetSpeed(obj);
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);

		task HitEffect(x,y,speed,angle)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,angle+90);
			let scale = 1;
			ObjRender_SetScaleXYZ(obj,sx,sy,1);
			ObjPrim_SetDestCenter(obj,787,130,832,189);
			ObjRender_SetColor(obj,r,g,b);
			ObjRender_SetPosition(obj,x,y,0);
			ObjRender_SetAlpha(obj,128);
			speed/=4;
			let Alpha=0.5;
			let R=r;
			let G=g;
			let B=b;
			loop(4)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetAngleZ(obj,angle+90);
				Alpha-=0.5/12;
				yield;
			}

			ObjPrim_SetDestCenter(obj,787,65,832,124);

			loop(4)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetAngleZ(obj,angle+90);
				Alpha-=0.5/12;
				yield;
			}
			ObjPrim_SetDestCenter(obj,787,1,832,60);

			loop(4)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetAngleZ(obj,angle+90);
				Alpha-=0.5/12;
				yield;
			}
			Obj_Delete(obj);
		}
	}
}

task TShotAlice
{
	let LaserPoint=[[0,0],[0,0],[0,0],[0,0]];
	let LaserImpactFlag=[0,0,0,0];
	let pShot=false;
	ShotCheck;
	let Speed=22.5;
	let MainDamage=3.0*1.5;
	let DamageRate=1*1.5;
	let SHOT = 114;
	let angle=270;
	LaserDraw(-90);
	SHOTS;
	while(SELECT_PLAYER==SELECT_ALICE)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.5;}
		else{DamageRate=1.0*1.5;}

		MainShot(GetPlayerX(), GetPlayerY(), 22.5, 270, MainDamage, 1, 161);

		PlaySE(SE_SHOT);
		angle+=10;
		loop(3){yield;}
	}
	task SHOTS
	{
		loop
		{
			while(!pShot){yield;}
			LaserShot(GetPlayerX(),GetPlayerY(),-90,(3.0*1.5)/3,0);
			yield;
		}
	}
	task ShotCheck
	{
		loop
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&!OnSpell&&SELECT_PLAYER==SELECT_ALICE&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}

	task MainShot(x,y,speed,angle,damage,pene,id)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let OldX;
		let OldY;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle);
		Obj_Delete(obj);
	}

	task HitEffect(x,y,speed,angle)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,0);

		ObjPrim_SetDestCenter(obj,278,408,294,462);

		ObjRender_SetPosition(obj,x,y,0);
		speed/=8;
		let Alpha=128;
		let R=255;
		let G=255;
		let B=255;
		let yel = 1;
		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=128/20;
			yield;
		}



		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=128/20;
			yield;
		}
		

		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
		//	ObjRender_SetAngleZ(obj,angle);
			Alpha-=128/20;
			yield;
		}
		

		Obj_Delete(obj);
	}
	task LaserShot(x,y,angle,damage,Opnum)
	{
		let speed=16.875*2;
		let obj=CreatePlayerShotA1(x,y-40,speed,angle,0,1,21);
		let obj2=CreatePlayerShotA1(x,y-40,speed,angle,damage/6,999,21);
		
		Obj_SetRenderPriorityI(obj,20);
		Obj_SetRenderPriorityI(obj2,20);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		ObjRender_SetAlpha(obj,0);
		ObjRender_SetAlpha(obj2,0);
		let count=0;
		let OldX=x;
		let OldY=y;
		let dx=0;
		let dy=0;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			ObjMove_SetX(obj,GetPlayerX+dx);
			ObjMove_SetY(obj,GetPlayerY+dy);
			
			ObjMove_SetX(obj2,GetPlayerX+dx);
			ObjMove_SetY(obj2,GetPlayerY+dy);
			dx+=speed*cos(angle);
			dy+=speed*sin(angle);
			if(GetVirtualKeyState(VK_SHOT)==KEY_PULL){break;}
			if(GetPlayerState!=STATE_NORMAL){break;}
			if(!IsPermitPlayerShot){break;}
			if(SELECT_PLAYER!=SELECT_ALICE){break;}
			let TempLaserPoint=LaserPoint[Opnum];
			let LaserLeng=((GetPlayerY-LaserPoint[Opnum][1])^2+(GetPlayerX-LaserPoint[Opnum][0])^2)^0.5;
			let Leng=((GetPlayerY-ObjMove_GetY(obj))^2+(GetPlayerX-ObjMove_GetX(obj))^2)^0.5;
			if(LaserLeng<Leng)
			{
				let TempLaserPoint=LaserPoint[Opnum];
				TempLaserPoint[0]=OldX;
				TempLaserPoint[1]=OldY;
				LaserPoint[Opnum]=TempLaserPoint;
			}

			yield;
		}

		if(GetVirtualKeyState(VK_SHOT)!=KEY_PULL )
		{
			let TempLaserPoint=LaserPoint[Opnum];
			TempLaserPoint[0]=OldX;
			TempLaserPoint[1]=OldY;
			LaserPoint[Opnum]=TempLaserPoint;
			if(OldY>-16)
			{
				//HitEffect(OldX,OldY,speed,angle);
				LaserImpactFlag[Opnum]=2;
			}
		}
		else
		{

		}
		Obj_Delete(obj);

		task HitEffect(x,y,speed,angle)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,0);

			ObjPrim_SetDestCenter(obj,64,34,80,61);

			ObjRender_SetPosition(obj,x,y,0);
			speed/=4;
			let Scale=1;
			let Alpha=0.5;
			let R=255;
			let G=100;
			let B=255;
			loop(12)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleXYZ(obj,Scale,Scale,Scale);
				ObjRender_SetAngleZ(obj,angle+90);
				Alpha-=0.5/15;
				Scale-=1/15;
				yield;
			}
			Obj_Delete(obj);
		}
	}

task LaserDraw(ShotAngle)
{
	let AnimeCount=0;
	while(SELECT_PLAYER==SELECT_ALICE)
	{
		while(GetPlayerState!=STATE_NORMAL || !IsPermitPlayerShot&&!OnSpell){yield;}
		while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH)
		{
			if(GetVirtualKeyState(VK_SHOT)==KEY_HOLD){break;}
			yield;
		}

		LaserPoint=[[0,0],[0,0],[0,0],[0,0]];

		while( GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD)
		{
			LaserEffect(0,AnimeCount);
			AnimeCount-=64/10;
			//if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PULL){break;}
			if(GetPlayerState!=STATE_NORMAL){break;}
			if(!IsPermitPlayerShot){break;}
			if(SELECT_PLAYER!=SELECT_ALICE){break;}
			yield;
		}
		
		yield;
	}
		task LaserEffect(num,AnimeCount)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_LASER);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,0);
			
			ObjPrim_SetDestCenter(obj,975,0,988,255);
			let Alpha1=0.0;
			let Alpha2=0.1;
			let R=255;
			let G=255;
			let B=255;
		//	ObjRender_SetScaleXYZ(obj,5,5,5);
		//	ObjRender_SetAngleX(obj,180);
			ObjRender_SetAngleZ(obj,-180);
			let LengMax=0;
			let ScaleX=0;
			let LagCount=6;
			ObjPrim_SetVertexAlpha(obj,0,0);
			ObjPrim_SetVertexAlpha(obj,1,0);
			loop(10)
			{
				//if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_FREE){break;}
				if(SELECT_PLAYER!=SELECT_ALICE){break;}
				if(GetPlayerState!=STATE_NORMAL){break;}
				if(!IsPermitPlayerShot){break;}
				if(OnSpell){break;}
				if(LaserImpactFlag[num]>0)
				{
					R=100;G=100;B=255;
				}
				else
				{
					R=255;G=255;B=255;
				}

				ObjRender_SetPosition(obj,GetPlayerX,GetPlayerY-40,0);
				ObjRender_SetColor(obj,255*Alpha1,255*Alpha1,255*Alpha1);
				ObjRender_SetScaleXYZ(obj,ScaleX,1,2);

				let Leng=((GetPlayerY)^2+(GetPlayerX)^2)^0.5;
				LengMax+=16.875*9;
				Alpha1+=0.1/10;
				if(LaserPoint[num][0]==0 && LaserPoint[num][1]==0)
				{
					if(num>=2)
					{
					Leng=GetStgFrameHeight+90;
					}
					else
					{
					if(LagCount>0){LengMax=0;Leng=LengMax;}
					}
				}
				if(Leng>LengMax){Leng=LengMax;}

				if(ScaleX<1){ScaleX+=0.5;}

				ObjPrim_SetVertexUVT(obj, 0, 1024, AnimeCount);
				ObjPrim_SetVertexUVT(obj, 1, 1062, AnimeCount);
				ObjPrim_SetVertexUVT(obj, 2, 1062, Leng+AnimeCount);
				ObjPrim_SetVertexUVT(obj, 3, 1024, Leng+AnimeCount);

				ObjPrim_SetVertexPosition(obj, 0, -35/2, 0, -0);
				ObjPrim_SetVertexPosition(obj, 1, 35/2, 0, -0);
				ObjPrim_SetVertexPosition(obj, 2, 35/2, Leng, 0);
				ObjPrim_SetVertexPosition(obj, 3, -35/2, Leng, 0);

				LagCount--;
				
				yield;
			}
			loop(20)
			{
				if(LaserImpactFlag[num]>0)
				{
					R=100;G=100;B=255;
				}
				else
				{
					R=255;G=255;B=255;
				}

				//ObjRender_SetPosition(obj,GetPlayerX,GetPlayerY,0);
				ObjRender_SetColor(obj,255*Alpha2,255*Alpha2,255*Alpha2);
				ObjRender_SetScaleXYZ(obj,ScaleX,1,1);
				Alpha2-=0.1/20;
				let Leng=((GetPlayerY-LaserPoint[num][1])^2+(GetPlayerX-LaserPoint[num][0])^2)^0.5;
				LengMax+=16.875;
				if(LaserPoint[num][0]==0 && LaserPoint[num][1]==0)
				{
					if(num>=2)
					{
					Leng=GetStgFrameHeight+90;;
					}
					else
					{
					if(LagCount>0){LengMax=0;Leng=LengMax;}
					}
				}
				if(Leng>LengMax){Leng=LengMax;}

				//ScaleX-=0.5;

				ObjPrim_SetVertexUVT(obj, 0, 1024, AnimeCount);
				ObjPrim_SetVertexUVT(obj, 1, 1062, AnimeCount);
				ObjPrim_SetVertexUVT(obj, 2, 1062, Leng+AnimeCount);
				ObjPrim_SetVertexUVT(obj, 3, 1024, Leng+AnimeCount);

				ObjPrim_SetVertexPosition(obj, 0, -35/2, 0, -0);
				ObjPrim_SetVertexPosition(obj, 1, 35/2, 0, -0);
				ObjPrim_SetVertexPosition(obj, 2, 35/2, 999, 0);
				ObjPrim_SetVertexPosition(obj, 3, -35/2, 999, 0);

				LagCount--;
				AnimeCount-=64/5;
				yield;
			}

			Obj_Delete(obj);

			
		}
	}
}
task TShot2Alice
{//??
	let pShot=false;
	ShotCheck;
	let ShotLagCount=0;
	let HomingDamage=2.4*1;
	let DamageRate=1*1.5;
	let LaserDamage=0.6*2;
	let LaserPoint=[[0,0],[0,0],[0,0],[0,0]];
	let LaserImpactFlag=[0,0,0,0];

	let ShotAngle_P4=[-90-20,-90-10,-90+10,-90+20];
	
	let ShotAngle2_P4=[-90-40,-90-30,-90+30,-90+40];

	let ShotAngleL_P4=[-90+27,-90+17,-90-17,-90-27];
	
	let bit = 5;
	let bit2 = 5;
	let bit4 = 1;
	let darm = 1;

	let ShotAngle=[ShotAngle_P4,ShotAngle_P4,ShotAngle_P4,ShotAngle_P4];
	let ShotAngle2=[ShotAngle2_P4,ShotAngle2_P4,ShotAngle2_P4,ShotAngle2_P4];
	let ShotAngleL=[ShotAngleL_P4,ShotAngleL_P4,ShotAngleL_P4,ShotAngleL_P4];
	
	LaserDraw2(ShotAngleL);
	let LaserLagCount=6;
	let am = 0;
	while(SELECT_PLAYER==SELECT_ALICE)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.5;}
		else{DamageRate=1.0*1.5;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
			ascent(i in 0..PlayerPower_Int)
			{
				LaserShot2(OptionX[i],OptionY[i],ShotAngleL[PlayerPower_Int-1][i],LaserDamage,i);
			}

		ascent(i in 0..4)
		{
			if(LaserImpactFlag[i]>0)
			{
				LaserImpactFlag[i]=LaserImpactFlag[i]-1;
			}
		}

		LaserLagCount--;

		loop(1){yield;}
		}
		else
		{

			ascent(i in 0..PlayerPower_Int)
			{
				RainbowDollShot(OptionX[i],OptionY[i],-90,2.1,am);
				RainbowDollShot(OptionX[i],OptionY[i],ShotAngle[PlayerPower_Int-1][i],2.1,am);
				
				//SHOTUN(OptionX[i],OptionY[i],ShotAngle2[PlayerPower_Int-1][i],1);
			}
			ShotLagCount+=1;
			//if(ShotLagCount%4==0){loop(7){yield;}}
			loop(2){yield;}
		}		
	}

	task ShotCheck
	{
		loop
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&!OnSpell&&SELECT_PLAYER==SELECT_ALICE&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}
	task RainbowDollShot(x,y,angle,damage,tp)
	{
		let R;
		let G;
		let B;
		let speed=9;
		let obj=CreatePlayerShotA1(x,y,13*2,angle,damage-1,1,162);
		ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
		ObjRender_SetScaleXYZ(obj,1,2,1);
		Rainbow(obj);
		let scale=1.0;
		let count=0;
		let OldX=x;
		let OldY=y;

		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			speed+=5/60;
			
			yield;
		}
		HitEffect2(OldX,OldY,speed,angle);
		Obj_Delete(obj);
		
		task Rainbow(obj)
		{
			let Color = RainbowArray;
			let t=0+tp;
			while(!Obj_IsDeleted(obj))
			{
				CHANGE(Color[t%7]);
				t++;
				yield;
			}
			task CHANGE(Color)
			{
				R=Color[0];
				G=Color[1];
				B=Color[2];
				ObjRender_SetColor(obj,R*1,G*1,B*1);
			}
		}
		task HitEffect2(x,y,speed,angle)
		{
			angle+=180+rand(-90,90);
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			
			ObjPrim_SetDestCenter(obj,298,430,307,463);
			ObjRender_SetScaleXYZ(obj,0.3,2,1);
			ObjRender_SetPosition(obj,x,y,0);
			speed=rand(2.5,5);
			let Scale=1;
			let Alpha=0.5;
			let Zangle=angle+90;
			let ZanglePlus=rand(10,20)*rand_dire;
			ObjRender_SetColor(obj,R*1,G*1,B*1);
			loop(10)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=0.5/15;
				ObjRender_SetAngleZ(obj,Zangle);
				Zangle+=ZanglePlus;
				yield;
			}

			loop(5)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				Alpha-=0.5/15;
				ObjRender_SetAngleZ(obj,Zangle);
				Zangle+=ZanglePlus;
				yield;
			}
			Obj_Delete(obj);
		}
	}
	task LaserDraw2(ShotAngle)
	{
	while(SELECT_PLAYER==SELECT_ALICE)
	{		
		while(GetPlayerState!=STATE_NORMAL || !IsPermitPlayerShot||OnSpell&&SELECT_PLAYER!=SELECT_ALICE){yield;}
		while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH)
		{
			if(GetVirtualKeyState(VK_SHOT)==KEY_HOLD){break;}
			yield;
		}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD||GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH&&SELECT_PLAYER==SELECT_ALICE)
		{
		LaserPoint=[[0,0],[0,0],[0,0],[0,0]];
		LaserEffect(2);
		LaserEffect(3);
		LaserEffect(0);
		LaserEffect(1);
		while( GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD)
		{
			if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PULL){break;}
			if(GetPlayerState!=STATE_NORMAL){break;}
			if(!IsPermitPlayerShot){break;}
			if(SELECT_PLAYER!=SELECT_ALICE){break;}
			
			yield;
		}
		}
		else{yield;}
	}
	task LaserEffect(num)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_LASER);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,0);
		
		ObjPrim_SetDestCenter(obj,80,0,96,256);
		let Alpha=1.0;
		let R=255;
		let G=255;
		let B=255;
	//	ObjRender_SetScaleXYZ(obj,5,5,5);
	//	ObjRender_SetAngleX(obj,180);
		ObjRender_SetAngleZ(obj,ShotAngle[PlayerPower_Int-1][num]-90);
		let LengMax=0;
		let ScaleX=0;
		let LagCount=6;
		LaserSourceEffect(num);
		let AnimeCount=0;
		Rainbow;
		task Rainbow
		{
			let Color = RainbowArray;
			let t=0;
			while((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD ))
			{
				CHANGE(Color[t%7]);
				t++;
				yield;
			}
			task CHANGE(Color)
			{
				R=Color[0];
				G=Color[1];
				B=Color[2];
			}
		}
		while( (GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD ))
		{
			if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_FREE){break;}
			if(GetPlayerState!=STATE_NORMAL){break;}
			if(!IsPermitPlayerShot){break;}
			if(OnSpell){break;}
			if(SELECT_PLAYER!=SELECT_ALICE){break;}
			if(LaserImpactFlag[num]>0)
			{
				R=100;G=100;B=255;
			}
			else
			{
				//R=255;G=255;B=255;
			}

			ObjRender_SetPosition(obj,OptionX[num],OptionY[num],0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			ObjRender_SetScaleXYZ(obj,ScaleX,1,2);

			let Leng=((OptionY[num])^2+(OptionX[num])^2)^0.5;
			LengMax+=16.875;
			if(LaserPoint[num][0]==0 && LaserPoint[num][1]==0)
			{
				if(num>=4)
				{
				Leng=LengMax;
				}
				else
				{
				if(LagCount>0){LengMax=0;Leng=LengMax;}
				}
			}
			if(Leng>LengMax){Leng=LengMax;}

			if(ScaleX<1){ScaleX+=0.5;}

			ObjPrim_SetVertexUVT(obj, 0, 64, AnimeCount);
			ObjPrim_SetVertexUVT(obj, 1, 80, AnimeCount);
			ObjPrim_SetVertexUVT(obj, 2, 80, Leng+AnimeCount);
			ObjPrim_SetVertexUVT(obj, 3, 64, Leng+AnimeCount);

			ObjPrim_SetVertexPosition(obj, 0, -8, 0, -0);
			ObjPrim_SetVertexPosition(obj, 1, 8, 0, -0);
			ObjPrim_SetVertexPosition(obj, 2, 8, Leng*3, 0);
			ObjPrim_SetVertexPosition(obj, 3, -8, Leng*3, 0);

			LagCount--;
			AnimeCount-=64/10;
			yield;
		}
		loop(3)
		{
			if(LaserImpactFlag[num]>0)
			{
				R=100;G=100;B=255;
			}
			else
			{
				R=255;G=255;B=255;
			}

			ObjRender_SetPosition(obj,OptionX[num],OptionY[num],0);
			ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
			ObjRender_SetScaleXYZ(obj,ScaleX,1,1);

			let Leng=((OptionY[num]-LaserPoint[num][1])^2+(OptionX[num]-LaserPoint[num][0])^2)^0.5;
			LengMax+=16.875;
			if(LaserPoint[num][0]==0 && LaserPoint[num][1]==0)
			{
				if(num>=2)
				{
				Leng=LengMax;
				}
				else
				{
				if(LagCount>0){LengMax=0;Leng=LengMax;}
				}
			}
			if(Leng>LengMax){Leng=LengMax;}

			ScaleX-=0.5;

			ObjPrim_SetVertexUVT(obj, 0, 64, AnimeCount);
			ObjPrim_SetVertexUVT(obj, 1, 80, AnimeCount);
			ObjPrim_SetVertexUVT(obj, 2, 80, Leng+AnimeCount);
			ObjPrim_SetVertexUVT(obj, 3, 64, Leng+AnimeCount);

			ObjPrim_SetVertexPosition(obj, 0, -8, 0, -0);
			ObjPrim_SetVertexPosition(obj, 1, 8, 0, -0);
			ObjPrim_SetVertexPosition(obj, 2, 8, Leng, 0);
			ObjPrim_SetVertexPosition(obj, 3, -8, Leng, 0);

			LagCount--;
			AnimeCount-=64/10;
			yield;
		}

		Obj_Delete(obj);

		task LaserSourceEffect(num)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,43);
			ObjRender_SetAngleZ(obj,0);

			ObjPrim_SetDestCenter(obj,96,192,128,224);
			let Scale=1.25;
			let ScaleTheta=0;
			ObjRender_SetScaleXYZ(obj,Scale,Scale,Scale);
			let Xangle=-90;
			let Yangle=90;
			let Zangle=0;
			loop(3)
			{
				ObjRender_SetPosition(obj,OptionX[num],OptionY[num],0);
				ObjRender_SetAngleXYZ(obj,Xangle,Yangle,Zangle);
				Xangle+=30;
				Yangle-=30;
				Zangle+=30;
				yield;
			}
			while(GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD)
			{
				if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_FREE){break;}
				if(GetPlayerState!=STATE_NORMAL){break;}
				if(!IsPermitPlayerShot){break;}
				if(SELECT_PLAYER!=SELECT_ALICE){break;}
				if(OnSpell){break;}
				ObjRender_SetPosition(obj,OptionX[num],OptionY[num],0);
				ObjRender_SetAngleXYZ(obj,Xangle,Yangle,Zangle);
				ObjRender_SetScaleXYZ(obj,Scale,Scale,Scale);
				Scale=1.00+0.25*cos(ScaleTheta);
				Zangle+=30;
				ScaleTheta+=45;
				yield;
			}
			loop(3)
			{
				ObjRender_SetPosition(obj,OptionX[num],OptionY[num],0);
				ObjRender_SetAngleXYZ(obj,Xangle,Yangle,Zangle);
				Xangle-=30;
				Yangle+=30;
				Zangle+=30;
				yield;
			}
			Obj_Delete(obj);
		}
	}
}


	task LaserShot2(x,y,angle,damage,Opnum)
	{
		let speed=16.875;
		let obj=CreatePlayerShotA1(x,y,speed,angle,0,1,21);
		let obj2=CreatePlayerShotA1(x,y,speed,angle,damage/4,999,21);
		
		Obj_SetRenderPriorityI(obj,20);
		Obj_SetRenderPriorityI(obj2,20);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		ObjRender_SetAlpha(obj,0);
		ObjRender_SetAlpha(obj2,0);
		let count=0;
		let OldX=x;
		let OldY=y;
		let dx=0;
		let dy=0;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			ObjMove_SetX(obj,OptionX[Opnum]+dx);
			ObjMove_SetY(obj,OptionY[Opnum]+dy);
			
			ObjMove_SetX(obj2,OptionX[Opnum]+dx);
			ObjMove_SetY(obj2,OptionY[Opnum]+dy);
			dx+=speed*cos(angle);
			dy+=speed*sin(angle);
			if(GetVirtualKeyState(VK_SHOT)==KEY_PULL){break;}
			if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH){break;}
			if(GetPlayerState!=STATE_NORMAL){break;}
			if(!IsPermitPlayerShot){break;}
			if(SELECT_PLAYER!=SELECT_ALICE){break;}
			let TempLaserPoint=LaserPoint[Opnum];
			let LaserLeng=((OptionY[Opnum]-LaserPoint[Opnum][1])^2+(OptionX[Opnum]-LaserPoint[Opnum][0])^2)^0.5;
			let Leng=((OptionY[Opnum]-ObjMove_GetY(obj))^2+(OptionX[Opnum]-ObjMove_GetX(obj))^2)^0.5;
			if(LaserLeng<Leng)
			{
				let TempLaserPoint=LaserPoint[Opnum];
				TempLaserPoint[0]=OldX;
				TempLaserPoint[1]=OldY;
				LaserPoint[Opnum]=TempLaserPoint;
			}

			yield;
		}

		if(GetVirtualKeyState(VK_SHOT)!=KEY_PULL && GetVirtualKeyState(VK_SLOWMOVE)!=KEY_PUSH)
		{
			let TempLaserPoint=LaserPoint[Opnum];
			TempLaserPoint[0]=OldX;
			TempLaserPoint[1]=OldY;
			LaserPoint[Opnum]=TempLaserPoint;
			if(OldY>-16)
			{
				//HitEffect(OldX,OldY,speed,angle);
				LaserImpactFlag[Opnum]=2;
			}
		}
		else
		{

		}
		//Obj_Delete(obj);

		task HitEffect(x,y,speed,angle)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,0);

			ObjPrim_SetDestCenter(obj,64,34,80,61);

			ObjRender_SetPosition(obj,x,y,0);
			speed/=4;
			let Scale=1;
			let Alpha=0.5;
			let R=255;
			let G=100;
			let B=255;
			loop(12)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetColor(obj,R*Alpha,G*Alpha,B*Alpha);
				ObjRender_SetScaleXYZ(obj,Scale,Scale,Scale);
				ObjRender_SetAngleZ(obj,angle+90);
				Alpha-=0.5/15;
				Scale-=1/15;
				yield;
			}
			Obj_Delete(obj);
		}
	}
	
}

task TShotCirno
{
	let pShot=false;
	ShotCheck;
	let Speed=22.5;
	let MainDamage=3.0*1.5;
	let DamageRate=1*1.5;
	let SHOT = 148;
	while(SELECT_PLAYER==SELECT_CIRNO)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.5;}
		else{DamageRate=1.0*1.5;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
			MainShot(GetPlayerX()+8, GetPlayerY(), 22.5, 270+1, MainDamage, 1, SHOT);
			MainShot(GetPlayerX()-8, GetPlayerY(), 22.5, 270-1, MainDamage, 1, SHOT);
		}
		else
		{
			MainShot(GetPlayerX()+8, GetPlayerY(), 22.5, 270+3, MainDamage/2, 1, SHOT);
			MainShot(GetPlayerX()-8, GetPlayerY(), 22.5, 270-3, MainDamage/2, 1, SHOT);
			MainShot(GetPlayerX()+12, GetPlayerY()+22.5, 22.5, 270+5, MainDamage/2, 1, SHOT);
			MainShot(GetPlayerX()-12, GetPlayerY()+22.5, 22.5, 270-5, MainDamage/2, 1, SHOT);
		}
		PlaySE(SE_SHOT);

		loop(3){yield;}
	}

	task ShotCheck
	{
		loop
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_CIRNO)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}
	task MainShot(x,y,speed,angle,damage,pene,id)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let OldX;
		let OldY;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			angle=ObjMove_GetAngle(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle,id);
		Obj_Delete(obj);
	}

	task HitEffect(x,y,speed,angle,id)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		//ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,angle+90);
		let ADDER = 0;
		if(id==149){ADDER=25;}
		if(id==150){ADDER=-25;}
		ObjPrim_SetDestCenter(obj,25+ADDER,382,43+ADDER,437);

		ObjRender_SetPosition(obj,x+1,y-18,0);
		speed/=8;
		let Alpha=155;
		ObjRender_SetAlpha(obj,Alpha);
		let R=255;
		let G=255;
		let B=255;
		let yel = 1;
		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=155/15;
			yield;
		}

		ObjPrim_SetDestCenter(obj,25+ADDER,320,43+ADDER,375);

		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=155/15;
			yield;
		}
		
		ObjPrim_SetDestCenter(obj,25+ADDER,376,43+ADDER,310);
		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=155/15;
			yield;
		}
		

		Obj_Delete(obj);
	}
}
task TShot2Cirno
{//??
	let pShot=false;
	ShotCheck;
	let ShotLagCount=0;
	let HomingDamage=2.4*1;
	let DamageRate=1*1.5;
	let LaserDamage=0.6*2;

	let Plusangle = -30;
	let Plusangle2 = 30;
	let bit = 30;
	let darm = 1;
	let TURN = 1;


	while(SELECT_PLAYER==SELECT_CIRNO)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.5;}
		else{DamageRate=1.0*1.5;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{

			let MainDamage = 2.7;
			darm=1;
			
			GFW(GetPlayerX()+15, GetPlayerY(), 22.5, 270+6, MainDamage/2, 1, 149,-1,1);
			GFW(GetPlayerX()-15, GetPlayerY(), 22.5, 270-6, MainDamage/2, 1, 149,1,1);
			
			GFW(GetPlayerX()+18, GetPlayerY()+22.5, 22.5, 270+3, MainDamage/2, 1, 149,-1,1);
			GFW(GetPlayerX()-18, GetPlayerY()+22.5, 22.5, 270-3, MainDamage/2, 1, 149,1,1);
			
		
			GFW(GetPlayerX()+16.5, GetPlayerY()+22.5, 22.5, 270+1, MainDamage/2, 1, 149,-1,1);
			GFW(GetPlayerX()-16.5, GetPlayerY()+22.5, 22.5, 270-1, MainDamage/2, 1, 149,1,1);
		
			GFW(GetPlayerX()+1, GetPlayerY()+22.5, 22.5, 270, MainDamage/2, 1, 149,-1,1);
			GFW(GetPlayerX()-1, GetPlayerY()+22.5, 22.5, 270, MainDamage/2, 1, 149,1,1);
				
			
			loop(3){yield;}
		}
		else
		{
			let MainDamage = 2.7;
			ascent(i in 0..4)
			{
				GFW(OptionX[i],OptionY[i], 10, 270+rand(45,-45), MainDamage, 1, 149,1,0.5);
				GFW(OptionX[i],OptionY[i], 10, 270+rand(45,-45), MainDamage, 1, 149,1,0.5);
			}
			loop(6)
			{
				yield;
			}
		}

		
	}

	task ShotCheck
	{
		loop
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_CIRNO)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}
	task GFW(x,y,speed,angle,damage,pene,id,sx,sy)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,sx,sy,1);
		ObjRender_SetAlpha(obj,128);
		let OldX;
		let OldY;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			angle=ObjMove_GetAngle(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed,angle,id,sx,sy);
		Obj_Delete(obj);
	}

	task HitEffect(x,y,speed,angle,id,sx,sy)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		//ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,angle+90);
		let ADDER = 0;
		if(id==149){ADDER=25;}
		if(id==150){ADDER=-25;}
		ObjRender_SetScaleXYZ(obj,sx,sy,1);
		ObjPrim_SetDestCenter(obj,25+ADDER,382,43+ADDER,437);

		ObjRender_SetPosition(obj,x+1,y-18,0);
		speed/=8;
		let Alpha=155;
		ObjRender_SetAlpha(obj,Alpha);
		let R=255;
		let G=255;
		let B=255;
		let yel = 1;
		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=155/15;
			yield;
		}

		ObjPrim_SetDestCenter(obj,25+ADDER,320,43+ADDER,375);

		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=155/15;
			yield;
		}
		
		ObjPrim_SetDestCenter(obj,25+ADDER,376,43+ADDER,310);
		loop(5*yel)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=155/15;
			yield;
		}
		

		Obj_Delete(obj);
	}
}

task TShotSeija
{
	let pShot=false;
	ShotCheck;
	let Speed=22.5;
	let MainDamage=3.0*1.5;
	let DamageRate=1*1.5;
	let SHOT = 132;
	while(SELECT_PLAYER==SELECT_SEIJA)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.5;}
		else{DamageRate=1.0*1.5;}

		MainShot(GetPlayerX()+8, GetPlayerY()+13.5, 22.5, 270, MainDamage/2, 1, SHOT);
		MainShot(GetPlayerX()-8, GetPlayerY()+13.5, 22.5, 270, MainDamage/2, 1, SHOT);
		MainShot(GetPlayerX()+13, GetPlayerY()+13.5, 22.5, 270+6, MainDamage/4, 1, SHOT);
		MainShot(GetPlayerX()-13, GetPlayerY()+13.5, 22.5, 270-6, MainDamage/4, 1, SHOT);
		MainShot(GetPlayerX()+15, GetPlayerY()+13.5, 22.5, 270+9, MainDamage/4, 1, SHOT);
		MainShot(GetPlayerX()-15, GetPlayerY()+13.5, 22.5, 270-9, MainDamage/4, 1, SHOT);
		PlaySE(SE_SHOT);

		loop(3){yield;}
	}

	task ShotCheck
	{
		loop
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot&&SELECT_PLAYER==SELECT_SEIJA&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}

	task MainShot(x,y,speed,angle,damage,pene,id)
	{
		let obj=CreatePlayerShotA1(x,y,speed,angle,damage,pene,id);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAlpha(obj,128);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let OldX;
		let OldY;
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			angle=ObjMove_GetAngle(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed+3,angle);
		Obj_Delete(obj);
	}

	task HitEffect(x,y,speed,angle)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,angle+90);

		ObjPrim_SetDestCenter(obj,706,117,717,150);
		ObjRender_SetScaleXYZ(obj,1.3,1.3,1.3);
		ObjRender_SetPosition(obj,x+1,y-18,0);
		speed/=8;
		let Alpha=128;
		let R=255;
		let G=255;
		let B=255;
		let yel = 1;
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}

		ObjPrim_SetDestCenter(obj,706,150,717,177);

		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}	
		ObjPrim_SetDestCenter(obj,706,181,717,203);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}
		ObjPrim_SetDestCenter(obj,705,205,718,224);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}		
		ObjPrim_SetDestCenter(obj,705,229,718,243);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}	
		ObjPrim_SetDestCenter(obj,704,245,719,255);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}
		Obj_Delete(obj);
	}

}
task TShot2Seija
{//??
	let pShot=false;
	ShotCheck;
	let ShotLagCount=0;
	let HomingDamage=2.4*1;
	let DamageRate=1*1.5;
	let LaserDamage=0.6*2;
	let ShotAngle_P4=[2,-2,5,-5];
	let Plusangle = -30;
	let Plusangle2 = 30;
	let bit = 5;
	let bit2 = 5;
	let bit4 = 1;
	let darm = 1;
	let ShotAngle=[ShotAngle_P4,ShotAngle_P4,ShotAngle_P4,ShotAngle_P4];
	while(SELECT_PLAYER==SELECT_SEIJA)
	{
		while(!pShot){yield;}
		if(IsPlayerSpellActive){DamageRate=0.5*1.5;}
		else{DamageRate=1.0*1.5;}
		if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
			ascent(i in 0..PlayerPower_Int)
			{
				Fire(OptionX[i],OptionY[i],-90,3,ShotAngle[PlayerPower_Int-1][i]+rand(2,-2));
			}
			loop(7){yield;}
		}
		else
		{
			ascent(i in 0..PlayerPower_Int)
			{
				Dreambow(OptionX[i],OptionY[i],90,7);
			}
			ShotLagCount+=1;
			loop(3){yield;}
		}

	}

	task ShotCheck
	{
		loop
		{
			if((GetVirtualKeyState(VK_SHOT)==KEY_PUSH || GetVirtualKeyState(VK_SHOT)==KEY_HOLD) && GetPlayerState==STATE_NORMAL && IsPermitPlayerShot &&SELECT_PLAYER==SELECT_SEIJA&&!OnSpell)
			{
			pShot=true;

			}
			else
			{
			pShot=false;

			}
			yield;
		}
	}
	task Dreambow(x,y,angle,damage)
	{
		let obj=CreatePlayerShotA1(x,y,30,angle,3,1,133);
		Obj_SetRenderPriorityI(obj,40);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale,2,scale);
		ObjRender_SetAlpha(obj,100);
		let OldX;
		let OldY;
		let speed  = 17;
		YCHANGE(obj,angle);
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			angle=ObjMove_GetAngle(obj);
			speed=ObjMove_GetSpeed(obj);
			yield;
		}
		HitEffect(OldX,OldY,speed+3,angle);
		Obj_Delete(obj);
	}
	task YCHANGE(obj,angle)
	{
		ObjShot_SetAutoDelete(obj,false);
		while(ObjMove_GetY(obj)<GetScreenWidth)
		{
			yield;
		}
		ObjRender_SetAlpha(obj,50);
		ObjMove_SetSpeed(obj,19);
		ObjMove_SetY(obj,0);
		ObjMove_SetAngle(obj,90+rand(-15,15));
		ObjShot_SetAutoDelete(obj,true);
	}
	task HitEffect(x,y,speed,angle)
	{
		let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
		ObjPrim_SetTexture(obj,IMG_SHOT);
		ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjPrim_SetVertexCount(obj, 4);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetAngleZ(obj,angle+90);
		ObjRender_SetScaleXYZ(obj,1,2,1);
		ObjPrim_SetDestCenter(obj,706+17,117,717+17,150);
		ObjRender_SetScaleXYZ(obj,1.3,1.3,1.3);
		ObjRender_SetPosition(obj,x+1,y-18,0);
		speed/=8;
		let Alpha=128;
		let R=255;
		let G=255;
		let B=255;
		let yel = 1;
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}

		ObjPrim_SetDestCenter(obj,706+17,150,717+17,177);

		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}	
		ObjPrim_SetDestCenter(obj,706+17,181,717+17,203);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}
		ObjPrim_SetDestCenter(obj,705+17,205,718+17,224);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}		
		ObjPrim_SetDestCenter(obj,705+17,229,718+17,243);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}	
		ObjPrim_SetDestCenter(obj,704+17,245,719+17,255);
		loop(3)
		{
			ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
			ObjRender_SetAlpha(obj,Alpha);
			Alpha-=128/18;
			yield;
		}
		Obj_Delete(obj);
	}

	task Fire(x,y,angle,damage,Plusangle)
	{
		let speed=9;
		let obj=CreatePlayerShotA1(x,y,1,angle,7,1,134);
		Obj_SetRenderPriorityI(obj,40);
		ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
		ObjRender_SetAngleZ(obj,90);
		ObjRender_SetAlpha(obj,100);
		let scale=1.0;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		let count=0;
		let OldX=x;
		let OldY=y;
		ObjMove_SetMaxSpeed(obj,5);
		ObjMove_SetAcceleration(obj,0.4);
		loop(1)
		{
			if(Obj_IsDeleted(obj)){break;}
			let EnemyObjectArray=GetIntersectionRegistedEnemyID;
			let Dis=(count*5+120)^4;
			let nearObj=-1;
			if(length(EnemyObjectArray)!=0)
			{
			ascent(i in 0..length(EnemyObjectArray))
			{
			let dis=(ObjRender_GetY(EnemyObjectArray[i])-ObjRender_GetY(obj))^2+(ObjRender_GetX(EnemyObjectArray[i])-ObjRender_GetX(obj))^2;
			if(dis<Dis)
			{
				nearObj=EnemyObjectArray[i];
				Dis=dis;
			}
			}
			}

			if(nearObj!=-1)
			{
			let ToPlayerAngle=atan2(ObjRender_GetY(nearObj)-ObjRender_GetY(obj),ObjRender_GetX(nearObj)-ObjRender_GetX(obj));
			let judgangle=sin(ToPlayerAngle-angle);

			if(judgangle>0)
			{
				if(judgangle>0.05)
				{
				angle+=asin(judgangle)/1;
				}
				else
				{
				angle=ToPlayerAngle;
				}
			}
			else
			{
				if(judgangle<-0.05)
				{
				angle+=asin(judgangle)/1;
				}
				else
				{
				angle=ToPlayerAngle;
				}
			}
			ObjMove_SetAngle(obj,angle+Plusangle*2);
			}
			count++;
			if(count>30){count=30;}
			speed+=5/60;
			//ObjMove_SetSpeed(obj,speeder);
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			yield;
		}
		while(!Obj_IsDeleted(obj))
		{
			OldX=ObjMove_GetX(obj);
			OldY=ObjMove_GetY(obj);
			speed=ObjMove_GetSpeed(obj);
			angle=ObjMove_GetAngle(obj);
			yield;
		}
		HitEffect(OldX,OldY,5,angle);
		Obj_Delete(obj);

		task HitEffect(x,y,speed,angle)
		{
			let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
			ObjPrim_SetTexture(obj,IMG_SHOT);
			ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
			ObjPrim_SetVertexCount(obj, 4);
			Obj_SetRenderPriorityI(obj,40);
			ObjRender_SetAngleZ(obj,90);
			ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
			ObjPrim_SetDestCenter(obj,744,224,775,255);
			ObjRender_SetPosition(obj,x,y,0);	
			ObjRender_SetAngleZ(obj,angle+180);
			speed/=8;
			let Alpha=100;
			let R=255;
			let G=255;
			let B=255;
			let yel = 1;
			let scales = 1;
			loop(18)
			{
				ObjRender_SetPosition(obj,ObjRender_GetX(obj)+speed*cos(angle),ObjRender_GetY(obj)+speed*sin(angle),0);
				ObjRender_SetAlpha(obj,Alpha);
				ObjRender_SetScaleXYZ(obj,scale,scales,scale);
				scale+=0.1;
				Alpha-=100/18;
				yield;
			}

			Obj_Delete(obj);
		}
	}
	
	
}

task OptionSet1
{
	while(SELECT_PLAYER>=SELECT_REIMU&&SELECT_PLAYER<=SELECT_SEIJA)
	{
		if(SELECT_PLAYER==SELECT_REIMU)
		{
			OptionMoveReimu;
			TRenderOptionReimu;
			while(SELECT_PLAYER==SELECT_REIMU){yield;}
		}
		if(SELECT_PLAYER==SELECT_MARISA)
		{
			OptionMoveMarisa;
			TRenderOptionMarisa;
			while(SELECT_PLAYER==SELECT_MARISA){yield;}
		}
		if(SELECT_PLAYER==SELECT_SAKUYA)
		{
			OptionMoveSakuya;
			TRenderOptionSakuya;
			while(SELECT_PLAYER==SELECT_SAKUYA){yield;}
		}
		if(SELECT_PLAYER==SELECT_REISEN)
		{
			OptionMoveReisen;
			TRenderOptionReisen;
			while(SELECT_PLAYER==SELECT_REISEN){yield;}
		}
		if(SELECT_PLAYER==SELECT_SANAE)
		{
			OptionMoveSanae;
			TRenderOptionSanae;
			while(SELECT_PLAYER==SELECT_SANAE){yield;}
		}
		if(SELECT_PLAYER==SELECT_YOUMU)
		{
			OptionMoveYoumu;
			TRenderOptionYoumu;
			while(SELECT_PLAYER==SELECT_YOUMU){yield;}
		}
		if(SELECT_PLAYER==SELECT_AYA)
		{
			OptionMoveAya;
			TRenderOptionAya;
			while(SELECT_PLAYER==SELECT_AYA){yield;}
		}
		if(SELECT_PLAYER==SELECT_ALICE)
		{
			DollAlice;
			OptionMoveAlice;
			TRenderOptionAlice;
			while(SELECT_PLAYER==SELECT_ALICE){yield;}
		}
		if(SELECT_PLAYER==SELECT_CIRNO)
		{
			OptionMoveCirno;
			TRenderOptionCirno;
			while(SELECT_PLAYER==SELECT_CIRNO){yield;}
		}
		if(SELECT_PLAYER==SELECT_SEIJA)
		{
			OptionMoveSeija;
			TRenderOptionSeija;
			while(SELECT_PLAYER==SELECT_SEIJA){yield;}
		}
	}
}

task OptionMoveReimu
{
	let HiOpX_P4=[36,-36,-16,16];
	let HiOpY_P4=[15,15,30,30];
	let LowOpX_P4=[24,-24,-8,8];
	let LowOpY_P4=[-20,-20,-30,-30];

	let HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
	let HiOpY=[ HiOpY_P4, HiOpY_P4, HiOpY_P4, HiOpY_P4];
	let LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
	let LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];

	let LowCount=0;
	let D_OptionX=[0,0,0,0];
	let D_OptionY=[0,0,0,0];
	while(SELECT_PLAYER==SELECT_REIMU)
	{
		ascent(i in 0..4)
		{
			if(SELECT_PLAYER==SELECT_REIMU)
			{
				if(GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD)
				{
					D_OptionX[i]=GetPlayerX+LowOpX[3][i];
					D_OptionY[i]=GetPlayerY+LowOpY[PlayerPower_Int-1][i];
				}
				else
				{
					D_OptionX[i]=GetPlayerX+HiOpX[3][i];
					D_OptionY[i]=GetPlayerY+HiOpY[3][i];
				}
				OptionX[i]=OptionX[i]*0.70+D_OptionX[i]*0.30;
				OptionY[i]=OptionY[i]*0.70+D_OptionY[i]*0.30;
			}
		}
		yield;
	}
}
task TRenderOptionReimu
{
	let CurrentPower;
	

	CurrentPower=PlayerPower_Int;
	DrawOption(0);
	DrawOption(1);
	DrawOption(2);
	DrawOption(3);
	while(SELECT_PLAYER==SELECT_REIMU){yield;}

	

	task DrawOption(num)
	{
		let path =GetCurrentScriptDirectory() ~ "./optionimg/reimu.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		objOption=objOption~[obj];
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,43);
		let Zangle=0;
		DrawOptionBlur(objOption,num,Zangle);
		ObjSprite2D_SetSourceRect(obj, 0, 0, 128, 128);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0.15;
		ObjRender_SetBlendType(obj, BLEND_ALPHA);
		let DownCount=0;
		while(SELECT_PLAYER==SELECT_REIMU)
		{
			ObjRender_SetScaleXYZ(obj,scale,scale,1);
			ObjRender_SetAngleZ(obj,Zangle);
			Zangle+=360/54;
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			if(SELECT_PLAYER==SELECT_REIMU)
			{
				ObjRender_SetAlpha(obj,255);
			}
			else
			{
				ObjRender_SetAlpha(obj,0);
			}
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			DownCount-=1;
			yield;
		}
		Obj_Delete(obj);
	}

	task DrawOptionBlur(objOption,num,Zangle)
	{//???4???????????
		let path = GetCurrentScriptDirectory() ~ "./optionimg/reimu.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,42);
		ObjSprite2D_SetSourceRect(obj, 0, 0, 128, 128);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0.20;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,150);
		let DownCount=0;
		while(SELECT_PLAYER==SELECT_REIMU)
		{
			ObjRender_SetAngleZ(obj,Zangle);
			Zangle+=360/54;
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
			else
			{
				ObjRender_SetAlpha(obj,150);
			}

 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			DownCount-=1;
			yield;
		}
		Obj_Delete(obj);
	}
}
//--------------
task OptionMoveMarisa
{


let HiOpX_P4=[30,-30,-16,16];
let HiOpY_P4=[0,0,-30,-30];
let LowOpX_P4=[18,-18,-6,6];
let LowOpY_P4=[-20,-20,-30,-30];

let HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
let HiOpY=[ HiOpY_P4, HiOpY_P4, HiOpY_P4, HiOpY_P4];
let LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
let LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];

let LowCount=0;
let D_OptionX=[0,0,0,0];
let D_OptionY=[0,0,0,0];
while(SELECT_PLAYER==SELECT_MARISA)
{
	ascent(i in 0..4)
	{
		if(SELECT_PLAYER==SELECT_MARISA)
		{
			if(GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD)
			{
				D_OptionX[i]=GetPlayerX+LowOpX[PlayerPower_Int-1][i];
				D_OptionY[i]=GetPlayerY+LowOpY[PlayerPower_Int-1][i];
			}
			else
			{
				D_OptionX[i]=GetPlayerX+HiOpX[PlayerPower_Int-1][i];
				D_OptionY[i]=GetPlayerY+HiOpY[PlayerPower_Int-1][i];
			}
			OptionX[i]=OptionX[i]*0.70+D_OptionX[i]*0.30;
			OptionY[i]=OptionY[i]*0.70+D_OptionY[i]*0.30;
		}
	}
	yield;
}
}
task TRenderOptionMarisa
{
	let CurrentPower;
	

	CurrentPower=PlayerPower_Int;
	DrawOption(0);
	DrawOption(1);
	DrawOption(2);
	DrawOption(3);
	while(SELECT_PLAYER==SELECT_MARISA){yield;}
	

	task DrawOption(num)
	{
		let path =GetCurrentScriptDirectory() ~ "./optionimg/marisa.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		objOption=objOption~[obj];
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,43);
		let Zangle=0;
		ObjSprite2D_SetSourceRect(obj, 0, 0, 256, 256);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0;

		DrawOptionBlur(obj,num,Zangle);
		ObjRender_SetBlendType(obj, BLEND_ALPHA);
		let DownCount=0;
		let ScaleTheta=0;
		scale=0.065+0.010*sin(ScaleTheta);
		while(SELECT_PLAYER==SELECT_MARISA)
		{
			ObjRender_SetScaleXYZ(obj,scale,scale,scale);
			scale=0.065+0.010*sin(ScaleTheta);
			ScaleTheta+=12;
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			if(SELECT_PLAYER==SELECT_MARISA)
			{
				ObjRender_SetAlpha(obj,255);
			}
			else
			{
				ObjRender_SetAlpha(obj,0);
			}
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			DownCount-=1;
			yield;
		}
		Obj_Delete(obj);
	}

	task DrawOptionBlur(objOption,num,Zangle)
	{//???4???????????
		let path = GetCurrentScriptDirectory() ~ "./optionimg/marisa.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,42);
		ObjSprite2D_SetSourceRect(obj, 0, 0, 256, 256);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0.20/2;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,150);
		let DownCount=0;
		while(SELECT_PLAYER==SELECT_MARISA)
		{
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
			else
			{
				ObjRender_SetAlpha(obj,150);
			}

 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			DownCount-=1;
			yield;
		}
		Obj_Delete(obj);
	}
}
//--------------
task OptionMoveSakuya
{
	let HiOpX_P4=[40,-40,-24,24];
	let HiOpY_P4=[10,10,0,0];
	let LowOpX_P4=[40,-40,-18,18];
	let LowOpY_P4=[-56,-56,-40,-40];

	let HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
	let HiOpY=[ HiOpY_P4, HiOpY_P4, HiOpY_P4, HiOpY_P4];
	let LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
	let LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];

	let LowCount=0;
	let D_OptionX=[0,0,0,0];
	let D_OptionY=[0,0,0,0];
	while(SELECT_PLAYER==SELECT_SAKUYA)
	{
		ascent(i in 0..4)
		{
			if(SELECT_PLAYER==SELECT_SAKUYA)
			{
				if(GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD)
				{
				D_OptionX[i]=GetPlayerX+LowOpX[PlayerPower_Int-1][i];
				D_OptionY[i]=GetPlayerY+LowOpY[PlayerPower_Int-1][i];
				}
				else
				{
				D_OptionX[i]=GetPlayerX+HiOpX[PlayerPower_Int-1][i];
				D_OptionY[i]=GetPlayerY+HiOpY[PlayerPower_Int-1][i];
				}
				OptionX[i]=OptionX[i]*0.70+D_OptionX[i]*0.30;
				OptionY[i]=OptionY[i]*0.70+D_OptionY[i]*0.30;
			}
		}
		yield;
	}
}
task TRenderOptionSakuya
{
	let CurrentPower;
	

	CurrentPower=PlayerPower_Int;
	DrawOption(0);
	DrawOption(1);
	DrawOption(2);
	DrawOption(3);
	while(SELECT_PLAYER==SELECT_SAKUYA){yield;}
	

	task DrawOption(num)
	{
		let path = GetCurrentScriptDirectory() ~ "./optionimg/sakuya.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		objOption=objOption~[obj];
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,43);
		let Zangle=0;
		ObjSprite2D_SetSourceRect(obj, 0, 1, 32, 32);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0.6;
		let FrameCount=0;
		ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
		
		DrawOptionBlur(obj,num,Zangle);
		
		ObjRender_SetBlendType(obj, BLEND_ALPHA);
		let DownCount=0;
		let ScaleTheta=0;
		while(SELECT_PLAYER==SELECT_SAKUYA)
		{
			ObjRender_SetScaleXYZ(obj,scale,scale,1);
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			ObjSprite2D_SetSourceRect(obj, 0+32*floor((FrameCount%32)/2), 1, 32+32*floor((FrameCount%32)/2), 32);
			if(SELECT_PLAYER==SELECT_SAKUYA)
			{
				ObjRender_SetAlpha(obj,255);
			}
			else
			{
				ObjRender_SetAlpha(obj,0);
			}
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			FrameCount+=1;
			DownCount-=1;
			yield;
		}
		Obj_Delete(obj);
	}

	task DrawOptionBlur(objOption,num,Zangle)
	{//???4???????????
		let path = GetCurrentScriptDirectory() ~ "./optionimg/sakuya.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,42);
		ObjSprite2D_SetSourceRect(obj, 0, 1, 32, 32);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0.2*8/2;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,150);
		let DownCount=0;
		let FrameCount=0;
		while(SELECT_PLAYER==SELECT_SAKUYA)
		{
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			ObjSprite2D_SetSourceRect(obj, 0+32*floor((FrameCount%32)/2), 1, 32+32*floor((FrameCount%32)/2), 32);	
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
			else
			{
				ObjRender_SetAlpha(obj,150);
			}

 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			FrameCount+=1;
			DownCount-=1;
			yield;
		}
		Obj_Delete(obj);
	}
}
//--------------
task OptionMoveReisen
{

	let HiOpX_P4=[50,-50,-0,0];
	let HiOpY_P4=[0,0,50,-50];
	let LowOpX_P4=[-40,-15,15,40];
	let LowOpY_P4=[-20,-35,-35,-20];

	let HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
	let HiOpY=[ HiOpY_P4, HiOpY_P4, HiOpY_P4, HiOpY_P4];
	let LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
	let LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];

	let LowCount=0;
	let D_OptionX=[0,0,0,0];
	let D_OptionY=[0,0,0,0];
	while(SELECT_PLAYER==SELECT_REISEN)
	{
		ascent(i in 0..4)
		{
			if(SELECT_PLAYER==SELECT_REISEN)
			{
				if(GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD)
				{
					D_OptionX[i]=GetPlayerX+LowOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+LowOpY[PlayerPower_Int-1][i];
				}
				else
				{
					D_OptionX[i]=GetPlayerX+HiOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+HiOpY[PlayerPower_Int-1][i];
				}
				OptionX[i]=OptionX[i]*0.70+D_OptionX[i]*0.30;
				OptionY[i]=OptionY[i]*0.70+D_OptionY[i]*0.30;
			}
		}
		yield;
	}
}
task TRenderOptionReisen
{
	let CurrentPower;
	
	
	CurrentPower=PlayerPower_Int;
	DrawOption(0);
	DrawOption(1);
	DrawOption(2);
	DrawOption(3);
	while(SELECT_PLAYER==SELECT_REISEN){yield;}
	

	task DrawOption(num)
	{
		let path = GetCurrentScriptDirectory() ~ "./optionimg/reisen.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		objOption=objOption~[obj];
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,43);
		let Zangle=0;
		ObjSprite2D_SetSourceRect(obj, 65, 164, 80, 172);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0;
		let FrameCount=0;
		ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
		
		DrawOptionBlur(obj,num,Zangle);
		
		scale=0.6;
		ObjRender_SetBlendType(obj, BLEND_ALPHA);
		let DownCount=0;
		let ScaleTheta=0;
		while(SELECT_PLAYER==SELECT_REISEN)
		{
			FrameCount=0;
			loop(16)
			{
				ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
				ObjSprite2D_SetSourceRect(obj, 65+16*floor((FrameCount%16)/2), 163, 80+16*floor((FrameCount%16)/2), 172); //WORK ON THIS FIRST
				if(SELECT_PLAYER==SELECT_REISEN)
				{
					ObjRender_SetAlpha(obj,192);
				}
				else
				{
					ObjRender_SetAlpha(obj,0);
				}
				if(GetPlayerState==STATE_DOWN)
				{
					ObjRender_SetAlpha(obj,0);
					DownCount=50;
				}
				if(DownCount>0)
				{
					ObjRender_SetAlpha(obj,0);
				}
				FrameCount+=1;
				DownCount-=1;
				if(SELECT_PLAYER==SELECT_REISEN)
				{
					yield;
				}
				if(SELECT_PLAYER==SELECT_REISEN)
				{
					yield;
				}
			}
			loop(32)
			{
				ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
				ObjSprite2D_SetSourceRect(obj, 65, 163, 80, 172); //WORK ON THIS FIRST
				if(SELECT_PLAYER==SELECT_REISEN)
				{
					ObjRender_SetAlpha(obj,192);
				}
				else
				{
					ObjRender_SetAlpha(obj,0);
				}
				if(GetPlayerState==STATE_DOWN)
				{
					ObjRender_SetAlpha(obj,0);
					DownCount=50;
				}
				if(DownCount>0)
				{
					ObjRender_SetAlpha(obj,0);
				}
				
				DownCount-=1;
				if(SELECT_PLAYER==SELECT_REISEN)
				{
					yield;
				}
			}

		}
		Obj_Delete(obj);
	}

	task DrawOptionBlur(objOption,num,Zangle)
	{//???4???????????
		let path = GetCurrentScriptDirectory() ~ "./optionimg/reisen.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,42);
		ObjSprite2D_SetSourceRect(obj, 65, 163, 80, 172);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0.2*8/2;
		ObjRender_SetScaleXYZ(obj,scale*2,scale*2,scale*3);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,150);
		let DownCount=0;
		let FrameCount=10;
		let ALPHAFRAME = 0;
		let BIT=1;
		while(SELECT_PLAYER==SELECT_REISEN)
		{
			FrameCount=0;
		
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			ObjSprite2D_SetSourceRect(obj, 65, 163, 81, 172);
			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
			
				DownCount=50;
			}
			else
			{	
				ObjRender_SetAlpha(obj,128+128*cos(ALPHAFRAME));
				
			}

			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			FrameCount+=0.5;
			DownCount-=1;
			if(SELECT_PLAYER==SELECT_REISEN)
			{
				yield;
			}
			ALPHAFRAME+=2;
			
		}
		Obj_Delete(obj);
	}
}
//--------------
task OptionMoveSanae
{
	let HiOpX_P4=[34,34,-34,-34];
	let HiOpY_P4=[7,-7,7,-7];
	let LowOpX_P4=[-28,-17,17,28];
	let LowOpY_P4=[7,34,34,7];

	let HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
	let HiOpY=[ HiOpY_P4, HiOpY_P4, HiOpY_P4, HiOpY_P4];
	let LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
	let LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];

	let LowCount=0;
	let D_OptionX=[0,0,0,0];
	let D_OptionY=[0,0,0,0];
	while(SELECT_PLAYER==SELECT_SANAE)
	{
		ascent(i in 0..4)
		{
			if(SELECT_PLAYER==SELECT_SANAE)
			{
				if(GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD)
				{
					D_OptionX[i]=GetPlayerX+LowOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+LowOpY[PlayerPower_Int-1][i];
				}
				else
				{
					D_OptionX[i]=GetPlayerX+HiOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+HiOpY[PlayerPower_Int-1][i];
				}
				OptionX[i]=OptionX[i]*0.70+D_OptionX[i]*0.30;
				OptionY[i]=OptionY[i]*0.70+D_OptionY[i]*0.30;
			}
		}
		yield;
	}
}
task TRenderOptionSanae
{
	let CurrentPower;
	

	CurrentPower=PlayerPower_Int;
	DrawOption(0);
	DrawOption(1);
	DrawOption(2);
	DrawOption(3);
	while(SELECT_PLAYER==SELECT_SANAE){yield;}

	task DrawOption(num)
	{
		let path = GetCurrentScriptDirectory() ~ "./optionimg/sanae.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		objOption=objOption~[obj];
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,43);
		let Zangle=0;
		ObjSprite2D_SetSourceRect(obj, 0, 0, 256, 256);
		ObjSprite2D_SetDestCenter(obj);
		DrawOptionBlur(obj,num,Zangle);
		let DownCount=0;
		let ScaleTheta=0;
		let scale=0.065+0.010*sin(ScaleTheta);
		while(SELECT_PLAYER==SELECT_SANAE)
		{
			ObjRender_SetScaleXYZ(obj,scale,scale,scale);
			scale=0.065+0.010*sin(ScaleTheta);
			//ScaleTheta+=1;
			ObjRender_SetAngleZ(obj,ObjRender_GetAngleZ(obj)+1);
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			if(SELECT_PLAYER==SELECT_SANAE)
			{
				ObjRender_SetAlpha(obj,255);
			}
			else
			{
				ObjRender_SetAlpha(obj,0);
			}
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			DownCount-=1;
			yield;
		}
		Obj_Delete(obj);
	}

	task DrawOptionBlur(objOption,num,Zangle)
	{//???4???????????
		let path = GetCurrentScriptDirectory() ~ "./optionimg/sanae.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,42);
		ObjSprite2D_SetSourceRect(obj, 0, 0, 256, 256);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0.20/2;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,150);
		let DownCount=0;
		while(SELECT_PLAYER==SELECT_SANAE)
		{
			ObjRender_SetAngleZ(obj,ObjRender_GetAngleZ(obj)-1);
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
			else
			{
				ObjRender_SetAlpha(obj,150);
			}

 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			DownCount-=1;
			yield;
		}
		Obj_Delete(obj);
	}
}
//--------------
task OptionMoveYoumu
{
	let angleT = 90;
	let angleT2 = 90;

	let LowOpX_P4=[0,-0,0,-0];
	let LowOpY_P4=[-0,-0,-0,-0];
	let HiOpX_P4=[30,80,-30,-80];
	let HiOpY_P4=[20,20,20,20];

	let LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
	let LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];
	let HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
	let HiOpY=[HiOpY_P4,HiOpY_P4,HiOpY_P4,HiOpY_P4];
	let objcount=0;
	let LowCount=0;
	let D_OptionX=[0,0,0,0];
	let D_OptionY=[0,0,0,0];
	let ARHG = (GetScreenWidth/2)-32;
	let URHG = (GetScreenHeight/2)-32;
	let XXX;
	let YYY;
	while(SELECT_PLAYER==SELECT_YOUMU)
	{
		ascent(i in 0..4)
		{
			if(SELECT_PLAYER==SELECT_YOUMU)
			{
				if(GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD)
				{
					D_OptionX[i]=GetPlayerX+LowOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+LowOpY[PlayerPower_Int-1][i];
				}
				else
				{
				
					D_OptionX[i]=GetPlayerX+HiOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+HiOpY[PlayerPower_Int-1][i];
				}
				OptionX[i]=OptionX[i]*0.97+D_OptionX[i]*0.03;
				OptionY[i]=OptionY[i]*0.97+D_OptionY[i]*0.03;
			}
		}
		HiOpX_P4=[40*cos(angleT/2),0,0,0];
		HiOpY_P4=[10*sin(angleT)+30*cos(angleT2),0,0,0];
		HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
		HiOpY=[HiOpY_P4,HiOpY_P4,HiOpY_P4,HiOpY_P4];
		
		LowOpX_P4=[20*cos(angleT/2),0,0,0];
		LowOpY_P4=[10*sin(angleT)+30*cos(angleT2),0,0,0];
		LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
		LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];
		
		angleT+=2;
		angleT2+=2;

		yield;
	}
}
task TRenderOptionYoumu
{
	let CurrentPower;
	let tt= 2;

	CurrentPower=PlayerPower_Int;
	DrawOption(0);
	while(SELECT_PLAYER==SELECT_YOUMU){yield;}
	

task DrawOption(num)
{
		let path = GetCurrentScriptDirectory() ~ "./optionimg/youmu.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		objOption=objOption~[obj];
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,43);
		let Zangle=0;
		ObjSprite2D_SetSourceRect(obj, 32*0, 32*0, 32*1, 32*1);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0;
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		let DownCount=0;
		let t = 1;
		while(SELECT_PLAYER==SELECT_YOUMU)
		{
			if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
			{
				ObjRender_SetColor(obj,255,128,128);
			}
			else
			{
				ObjRender_SetColor(obj,255,255,255);
			}
			GhostlyTrail(obj);
			if(t>8*4){t=1;}
			Anim;
			t++;
			ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
			ObjRender_SetAngleZ(obj,-90);
			Zangle+=360/54;
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			if(SELECT_PLAYER==SELECT_YOUMU)
			{
				ObjRender_SetAlpha(obj,255);
			}
			else
			{
				ObjRender_SetAlpha(obj,0);
			}
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			DownCount-=1;
			yield;
			task Anim
			{
			
				if(t>=1&&t<=4)
				{
					ObjSprite2D_SetSourceRect(obj, 32*0, 32*(tt), 32*1, 32*(tt+1));
				}
				if(t>4&&t<=8)
				{
					ObjSprite2D_SetSourceRect(obj, 32*1, 32*(tt), 32*2, 32*(tt+1));
				}
				if(t>8&&t<=12)
				{
					ObjSprite2D_SetSourceRect(obj, 32*2, 32*(tt), 32*3, 32*(tt+1));
				}
				if(t>12&&t<=16)
				{
					ObjSprite2D_SetSourceRect(obj, 32*3, 32*(tt), 32*4, 32*(tt+1));
				}
				if(t>16&&t<=20)
				{
					ObjSprite2D_SetSourceRect(obj, 32*4, 32*(tt), 32*5, 32*(tt+1));
				}
				if(t>20&&t<=24)
				{
					ObjSprite2D_SetSourceRect(obj, 32*5, 32*(tt), 32*6, 32*(tt+1));
				}
				if(t>24&&t<=28)
				{
					ObjSprite2D_SetSourceRect(obj, 32*6, 32*(tt), 32*7, 32*(tt+1));
				}
				if(t>28&&t<=32)
				{
					ObjSprite2D_SetSourceRect(obj, 32*7, 32*(tt), 32*8, 32*(tt+1));
				}
				if(t>32&&t<=36)
				{
					ObjSprite2D_SetSourceRect(obj, 32*8, 32*(tt), 32*9, 32*(tt+1));
				}
			}
			task GhostlyTrail(obj)
			{
				let xx=OptionX[num]+rand(-3,3)*cos(rand(0,360)); 
				let yy=OptionY[num]+rand(-3,3)*sin(rand(0,360));
				let trail=ObjPrim_Create(OBJ_SPRITE_2D);
				ObjPrim_SetTexture(trail, GetCurrentScriptDirectory() ~ "./optionimg/youmu.png");
				ObjRender_SetBlendType(trail, BLEND_ADD_ARGB);
				ObjRender_SetAlpha(trail,128);
				let s=1.0; 
				let st=1; 
				let m=32;
				let t=0;
				loop(20)
				{
					if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD)
					{
						ObjRender_SetColor(trail,255,64,64);
					}
					else
					{
						ObjRender_SetColor(trail,255,255,255);
					}
					ObjRender_SetAlpha(trail,128*s);
					t+=st; if (t>6){st*=-2;}
					s-=(1.0)/20;
					ObjSprite2D_SetSourceRect(trail, t*m, tt*m, (t+1)*m, (tt+1)*m);
					ObjSprite2D_SetDestCenter(trail);
					yy-=1;
					ObjRender_SetScaleXYZ(trail, s, s, 0);
					ObjRender_SetPosition(trail, xx, yy, 0);
					if(SELECT_PLAYER==SELECT_YOUMU)
					{
						yield;
					}
				}
				Obj_Delete(trail);
			}
	
		}
		Obj_Delete(obj);
	}
}
//--------------
task OptionMoveAya
{

	let HiOpX_P4=[50,-50,-0,0];
	let HiOpY_P4=[0,0,50,-50];
	let LowOpX_P4=[-15,-6,6,15];
	let LowOpY_P4=[-25,-30,-30,-25];

	let HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
	let HiOpY=[ HiOpY_P4, HiOpY_P4, HiOpY_P4, HiOpY_P4];
	let LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
	let LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];
	
	let LowCount=0;
	let D_OptionX=[0,0,0,0];
	let D_OptionY=[0,0,0,0];
	let angleT = 0;
	while(SELECT_PLAYER==SELECT_AYA)
	{
		ascent(i in 0..4)
		{
			if(SELECT_PLAYER==SELECT_AYA)
			{
				angleT = 0;
				if((GetVirtualKeyState(VK_LEFT)==KEY_PUSH || GetVirtualKeyState(VK_LEFT)==KEY_HOLD)&&(GetVirtualKeyState(VK_UP)==KEY_PUSH || GetVirtualKeyState(VK_UP)==KEY_HOLD))
				{
					angleT = -45
				}
				else if((GetVirtualKeyState(VK_RIGHT)==KEY_PUSH || GetVirtualKeyState(VK_RIGHT)==KEY_HOLD)&&(GetVirtualKeyState(VK_UP)==KEY_PUSH || GetVirtualKeyState(VK_UP)==KEY_HOLD))
				{
					angleT = 45;
				}
				else if((GetVirtualKeyState(VK_LEFT)==KEY_PUSH || GetVirtualKeyState(VK_LEFT)==KEY_HOLD)&&(GetVirtualKeyState(VK_DOWN)==KEY_PUSH || GetVirtualKeyState(VK_DOWN)==KEY_HOLD))
				{
					angleT = -45
				}
				else if((GetVirtualKeyState(VK_RIGHT)==KEY_PUSH || GetVirtualKeyState(VK_RIGHT)==KEY_HOLD)&&(GetVirtualKeyState(VK_DOWN)==KEY_PUSH || GetVirtualKeyState(VK_DOWN)==KEY_HOLD))
				{
					angleT = 45;
				}
				else if((GetVirtualKeyState(VK_LEFT)==KEY_PUSH || GetVirtualKeyState(VK_LEFT)==KEY_HOLD))
				{
					angleT = -90
				}					
				else if((GetVirtualKeyState(VK_RIGHT)==KEY_PUSH || GetVirtualKeyState(VK_RIGHT)==KEY_HOLD))
				{
					angleT = 90;
				}
				else if((GetVirtualKeyState(VK_UP)==KEY_PUSH || GetVirtualKeyState(VK_UP)==KEY_HOLD))
				{
					angleT = 0;
				}				
				else if((GetVirtualKeyState(VK_DOWN)==KEY_PUSH || GetVirtualKeyState(VK_DOWN)==KEY_HOLD))
				{
					angleT = 0;
				}
				
				HiOpX_P4=[40*cos(angleT+90-15),40*cos(angleT-90-15),40*cos(angleT-90+15),40*cos(angleT+90+15)];
				HiOpY_P4=[40*sin(angleT+90-15),40*sin(angleT-90-15),40*sin(angleT-90+15),40*sin(angleT+90+15)];
				HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
				HiOpY=[ HiOpY_P4, HiOpY_P4, HiOpY_P4, HiOpY_P4];
				if(GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD)
				{
					D_OptionX[i]=GetPlayerX+LowOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+LowOpY[PlayerPower_Int-1][i];
				}
				else
				{
					D_OptionX[i]=GetPlayerX+HiOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+HiOpY[PlayerPower_Int-1][i];
				}
				
				OptionX[i]=OptionX[i]*0.70+D_OptionX[i]*0.30;
				OptionY[i]=OptionY[i]*0.70+D_OptionY[i]*0.30;
			}
		}
		yield;
	}
}
task TRenderOptionAya
{
	let CurrentPower;
	

	CurrentPower=PlayerPower_Int;
	DrawOption(0);
	DrawOption(1);
	DrawOption(2);
	DrawOption(3);
	while(SELECT_PLAYER==SELECT_AYA){yield;}
	

	task DrawOption(num)
	{
		let path = GetCurrentScriptDirectory() ~ "./optionimg/aya.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		objOption=objOption~[obj];
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,43);
		let Zangle=0;
		ObjSprite2D_SetSourceRect(obj, 0, 0, 16, 16);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0;
		let FrameCount=0;
		ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
		
		DrawOptionBlur(obj,num,Zangle);
		
		scale=0.6;
		ObjRender_SetBlendType(obj, BLEND_ALPHA);
		let DownCount=0;
		let ScaleTheta=0;
		while(SELECT_PLAYER==SELECT_AYA)
		{
			if(num>1)
			{
				ObjRender_SetAngleY(obj,180);
			}
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			ObjSprite2D_SetSourceRect(obj, 0+16*floor((FrameCount%8)/2), 0, 16+16*floor((FrameCount%8)/2), 16); 
			if(SELECT_PLAYER==SELECT_AYA&&!OnSpell)
			{
				ObjRender_SetAlpha(obj,255);
			}
			else
			{
				ObjRender_SetAlpha(obj,0);
			}
			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			FrameCount+=1/6;
			DownCount-=1;	
			yield;
		}
		Obj_Delete(obj);
	}

	task DrawOptionBlur(objOption,num,Zangle)
	{//???4???????????
		let path = GetCurrentScriptDirectory() ~ "./optionimg/aya.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,42);
		ObjSprite2D_SetSourceRect(obj, 65, 163, 80, 172);
		ObjSprite2D_SetDestCenter(obj);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,scale*2,scale*2,scale*3);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,150);
		let DownCount=0;
		let FrameCount=0;
		let ALPHAFRAME = 0;
		let BIT=1;
		while(SELECT_PLAYER==SELECT_AYA)
		{
			if(num>1&&!OnSpell)
			{
				ObjRender_SetAngleY(obj,180);
			}
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			ObjSprite2D_SetSourceRect(obj, 0+16*floor((FrameCount%8)/2), 0, 16+16*floor((FrameCount%8)/2), 16); 
			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
			
				DownCount=50;
			}
			else
			{	
				ObjRender_SetAlpha(obj,128);
				
			}
			if(OnSpell)
			{
				ObjRender_SetAlpha(obj,0);
			}
			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			FrameCount+=1/6;
			DownCount-=1;			
			yield;
		}
		Obj_Delete(obj);
	}
}
//--------------
task DollAlice
{
	
	let path = GetCurrentScriptDirectory() ~ "./optionimg/alice.png";
	let objF = ObjPrim_Create(OBJ_SPRITE_2D);
	ObjPrim_SetTexture(objF, path);	
	Obj_SetRenderPriorityI(objF,44);
	ObjSprite2D_SetSourceRect(objF, 194, 145, 220, 174);
	ObjSprite2D_SetDestCenter(objF);
	ObjRender_SetAlpha(objF,255);
	ObjRender_SetScaleXYZ(objF,0.8,0.8,0.8);
	let ALPHA =0;
	let Turnamount=0;
	while(SELECT_PLAYER==SELECT_ALICE)
	{
		if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH||GetVirtualKeyState(VK_LEFT) == KEY_HOLD)
		{
			ObjRender_SetAngleZ(objF,0-Turnamount);
			if(Turnamount<13){Turnamount++;}
		}
		else if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH||GetVirtualKeyState(VK_RIGHT) == KEY_HOLD)
		{
			ObjRender_SetAngleZ(objF,0+Turnamount);
			if(Turnamount<13){Turnamount++;}
		}
		else
		{
			ObjRender_SetAngleZ(objF,0);
			if(Turnamount>0){Turnamount--;}
		}
		ObjRender_SetPosition(objF, GetPlayerX,GetPlayerY-40, 0);
		if(OnSpell==true)
		{
			let XX = GetPlayerX;
			let YY = GetPlayerY-40;
			ObjDoll_SetDestAtFrame(objF,XX,YY,GetStgFrameWidth/2,GetStgFrameHeight/2,20);
			loop(120){yield;}
			ALPHA=0;
			ObjRender_SetAlpha(objF,ALPHA);
			loop(480-121-50){yield;}
		}
		ObjRender_SetAlpha(objF,ALPHA);
		if(ALPHA<255)
		{
			ALPHA+=255/15;
		}
		yield;
	}
	Obj_Delete(objF);

	task ObjDoll_SetDestAtFrame(objF,OX,OY,px,py,frame)
	{
		let originalposition = [OX,OY];
		let distance = [  px-OX ,py-OY ];
		ascent(i in 0..frame)
		{
			ObjRender_SetPosition(objF,originalposition[0]+distance[0]*i/frame,originalposition[1]+distance[1]*i/frame,0);
			yield;
		}
		ObjRender_SetPosition(objF,px,py,0);
		yield;
	}
}
task OptionMoveAlice
{
let angleT = 0;

let LowOpX_P4=[60*cos(angleT+180),60*cos(angleT+120),60*cos(angleT+60),60*cos(angleT+0)];
let LowOpY_P4=[-30*sin(angleT+0),-30*sin(angleT+60),-30*sin(angleT+120),-30*sin(angleT+180)];
let HiOpX_P4=[30*cos(angleT+0),30*cos(angleT+60),30*cos(angleT+120),30*cos(angleT+180)];
let HiOpY_P4=[60*sin(angleT+0),60*sin(angleT+60),60*sin(angleT+120),60*sin(angleT+180)];

let LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
let LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];
let HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
let HiOpY=[HiOpY_P4,HiOpY_P4,HiOpY_P4,HiOpY_P4];
let objcount=0;
let LowCount=0;
let D_OptionX=[0,0,0,0];
let D_OptionY=[0,0,0,0];
let ARHG = (GetScreenWidth/2)-32;
let URHG = (GetScreenHeight/2)-32;
let XXX;
let YYY;
while(SELECT_PLAYER==SELECT_ALICE)
{
	ascent(i in 0..4)
	{
		if(SELECT_PLAYER==SELECT_ALICE)
		{
			if(GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD)
			{	
				D_OptionX[i]=GetPlayerX+LowOpX[PlayerPower_Int-1][i];
				D_OptionY[i]=GetPlayerY+LowOpY[PlayerPower_Int-1][i];
			}
			else
			{
				D_OptionX[i]=GetPlayerX+HiOpX[PlayerPower_Int-1][i];
				D_OptionY[i]=GetPlayerY+HiOpY[PlayerPower_Int-1][i];		
			}
			OptionX[i]=OptionX[i]*0.70+D_OptionX[i]*0.30;
			OptionY[i]=OptionY[i]*0.70+D_OptionY[i]*0.30;
		}
	}
//	LowOpX_P4=[50*cos(angleT+90),50*cos(angleT+180),50*cos(angleT+270),50*cos(angleT+0)];
//	LowOpY_P4=[0*sin(angleT+90),0*sin(angleT+180),0*sin(angleT+270),0*sin(angleT+0)];
//	LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
//	LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];
	angleT+=10*cos(objcount);
	objcount+=0.5;
	yield;
}
}
task TRenderOptionAlice
{
	let CurrentPower;
	let tt = 2;
	
	CurrentPower=PlayerPower_Int;
	DrawOption(0);
	DrawOption(1);
	DrawOption(2);
	DrawOption(3);
	while(SELECT_PLAYER==SELECT_ALICE){yield;}


	task DrawOption(num)
	{
		let path = GetCurrentScriptDirectory() ~ "./optionimg/alice.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		objOption=objOption~[obj];
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,43);
		let Zangle=0;
		ObjSprite2D_SetSourceRect(obj, 128, 143, 143, 160);
		ObjSprite2D_SetDestCenter(obj);
		
		//DrawOptionBlur(obj,num);

		ObjRender_SetBlendType(obj, BLEND_ALPHA);
		let DownCount=0;
		let t = 1;
		let Turnamount=0;
		while(SELECT_PLAYER==SELECT_ALICE)
		{
			if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH||GetVirtualKeyState(VK_LEFT) == KEY_HOLD)
			{
				ObjRender_SetAngleZ(obj,0-Turnamount);
				if(Turnamount<13){Turnamount++;}
			}
			else if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH||GetVirtualKeyState(VK_RIGHT) == KEY_HOLD)
			{
				ObjRender_SetAngleZ(obj,0+Turnamount);
				if(Turnamount<13){Turnamount++;}
			}
			else
			{
				ObjRender_SetAngleZ(obj,0);
				if(Turnamount>0){Turnamount--;}
			}
			t+=2;
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			if(SELECT_PLAYER==SELECT_ALICE)
			{
				ObjRender_SetAlpha(obj,255);
			}
			else
			{
				ObjRender_SetAlpha(obj,0);
			}
			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			DownCount-=1;
			yield;
			

		}
		Obj_Delete(obj);
	}

	task DrawOptionBlur(objOption,num)
	{//???4???????????
		let t = 1;
		let path = GetCurrentScriptDirectory() ~ "./optionimg/alice.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,42);
		ObjSprite2D_SetSourceRect(obj, 128, 143, 143, 160);
		ObjRender_SetAngleX(obj,180);
		ObjSprite2D_SetDestCenter(obj);
		let scale=1.5;
		ObjRender_SetScaleXYZ(obj,scale,scale,scale);
		//ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,150);
		let DownCount=0;
		while(SELECT_PLAYER==SELECT_ALICE)
		{
			t+=2;
	
			ObjRender_SetAngleZ(obj,0);
			
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
			else
			{
				ObjRender_SetAlpha(obj,150);
			}

 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			DownCount-=1;
			yield;
		}
		Obj_Delete(obj);
	}
}
//--------------
task OptionMoveCirno
{
	let HiOpX_P4=[-30,-50,50,30];
	let HiOpY_P4=[0,-20,-20,0];
	let LowOpX_P4=[-0,-0,0,0];
	let LowOpY_P4=[-0,-0,-0,-0];

	let HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
	let HiOpY=[ HiOpY_P4, HiOpY_P4, HiOpY_P4, HiOpY_P4];
	let LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
	let LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];
	
	let LowCount=0;
	let D_OptionX=[0,0,0,0];
	let D_OptionY=[0,0,0,0];
	let angleT = 0;
	while(SELECT_PLAYER==SELECT_CIRNO)
	{
		ascent(i in 0..4)
		{
			if(SELECT_PLAYER==SELECT_CIRNO)
			{				
				if(GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD)
				{
					D_OptionX[i]=GetPlayerX+LowOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+LowOpY[PlayerPower_Int-1][i];
				}
				else
				{
					D_OptionX[i]=GetPlayerX+HiOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+HiOpY[PlayerPower_Int-1][i];
				}
				
				OptionX[i]=OptionX[i]*0.70+D_OptionX[i]*0.30;
				OptionY[i]=OptionY[i]*0.70+D_OptionY[i]*0.30;
			}
		}
		yield;
	}
}
task TRenderOptionCirno
{
	let CurrentPower;
	
	
	CurrentPower=PlayerPower_Int;
	DrawOption(0);
	DrawOption(1);
	DrawOption(2);
	DrawOption(3);
	while(SELECT_PLAYER==SELECT_CIRNO){yield;}
	

	task DrawOption(num)
	{
		let path = GetCurrentScriptDirectory() ~ "./optionimg/cirno.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		objOption=objOption~[obj];
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,43);
		let Zangle=0;
		ObjSprite2D_SetSourceRect(obj, 0, 0, 16, 16);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0;
		let FrameCount=0;
		ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
		
		DrawOptionBlur(obj,num,Zangle);
		
		scale=0.6;
		ObjRender_SetBlendType(obj, BLEND_ALPHA);
		let DownCount=0;
		let ScaleTheta=0;
		while(SELECT_PLAYER==SELECT_CIRNO)
		{
			if(num>1)
			{
				ObjRender_SetAngleY(obj,180);
			}
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			ObjSprite2D_SetSourceRect(obj, 0+16*floor((FrameCount%8)/2), 0, 16+16*floor((FrameCount%8)/2), 16); 
			if(SELECT_PLAYER==SELECT_CIRNO)
			{
				ObjRender_SetAlpha(obj,255);
			}
			else
			{
				ObjRender_SetAlpha(obj,0);
			}
			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			FrameCount+=1/3;
			DownCount-=1;	
			yield;
		}
		Obj_Delete(obj);
	}

	task DrawOptionBlur(objOption,num,Zangle)
	{//???4???????????
		let path = GetCurrentScriptDirectory() ~ "./optionimg/cirno.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,42);
		ObjSprite2D_SetSourceRect(obj, 0, 0, 16, 16);
		ObjSprite2D_SetDestCenter(obj);
		let scale=1;
		ObjRender_SetScaleXYZ(obj,1.5,1.5,scale*3);
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		ObjRender_SetAlpha(obj,150);
		let DownCount=0;
		let FrameCount=0;
		let ALPHAFRAME = 0;
		let BIT=1;
		while(SELECT_PLAYER==SELECT_CIRNO)
		{
			if(num>1)
			{
				ObjRender_SetAngleY(obj,180);
			}
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			ObjSprite2D_SetSourceRect(obj, 0+16*floor((FrameCount%8)/2), 0, 16+16*floor((FrameCount%8)/2), 16); 
			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
			
				DownCount=50;
			}
			else
			{	
				ObjRender_SetAlpha(obj,128);
				
			}

			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			FrameCount+=1/3;
			DownCount-=1;			
			yield;
		}
		Obj_Delete(obj);
	}
}
//--------------
task OptionMoveSeija
{
	let angleT = 0;

	let LowOpX_P4=[0,-0,0,-0];
	let LowOpY_P4=[30,30,30+15,30-15];
	let HiOpX_P4=[15,40,-15,-40];
	let HiOpY_P4=[20,20,20,20];

	let LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
	let LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];
	let HiOpX=[HiOpX_P4,HiOpX_P4,HiOpX_P4,HiOpX_P4];
	let HiOpY=[HiOpY_P4,HiOpY_P4,HiOpY_P4,HiOpY_P4];
	let objcount=0;
	let LowCount=0;
	let D_OptionX=[0,0,0,0];
	let D_OptionY=[0,0,0,0];
	let ARHG = (GetScreenWidth/2)-32;
	let URHG = (GetScreenHeight/2)-32;
	let XXX;
	let YYY;
	while(SELECT_PLAYER==SELECT_SEIJA)
	{
		ascent(i in 0..4)
		{
			if(SELECT_PLAYER==SELECT_SEIJA)
			{
				if(GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD)
				{
					D_OptionX[i]=GetPlayerX+LowOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+LowOpY[PlayerPower_Int-1][i];
				}
				else
				{
				
					D_OptionX[i]=GetPlayerX+HiOpX[PlayerPower_Int-1][i];
					D_OptionY[i]=GetPlayerY+HiOpY[PlayerPower_Int-1][i];
				
				}
				OptionX[i]=OptionX[i]*0.70+D_OptionX[i]*0.30;
				OptionY[i]=OptionY[i]*0.70+D_OptionY[i]*0.30;
			}
		}
		LowOpX_P4=[70*cos(angleT+15),70*cos(angleT-15),70*cos(angleT),70*cos(angleT)];
		LowOpX=[LowOpX_P4,LowOpX_P4,LowOpX_P4,LowOpX_P4];
		LowOpY=[LowOpY_P4,LowOpY_P4,LowOpY_P4,LowOpY_P4];
		angleT+=3;
		objcount+=0.5;
		yield;
	}
}
task TRenderOptionSeija
{
	let CurrentPower;
	
	CurrentPower=PlayerPower_Int;
	DrawOption(0);
	DrawOption(1);
	DrawOption(2);
	DrawOption(3);
	while(SELECT_PLAYER==SELECT_SEIJA){yield;}


	task DrawOption(num)
	{
		let path = GetCurrentScriptDirectory() ~ "./optionimg/seija.png";
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		objOption=objOption~[obj];
		ObjPrim_SetTexture(obj, path);	
		Obj_SetRenderPriorityI(obj,43);
		let Zangle=0;
		ObjSprite2D_SetSourceRect(obj, 0, 0, 128, 128);
		ObjSprite2D_SetDestCenter(obj);
		let scale=0;
		ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
		ObjRender_SetScaleXYZ(obj,0.2,0.2,0.2);
		let DownCount=0;
		while(SELECT_PLAYER==SELECT_SEIJA)
		{
			ObjRender_SetAngleZ(obj,Zangle);
			Zangle+=360/54;
			ObjRender_SetPosition(obj, OptionX[num],OptionY[num], 0);
			if(SELECT_PLAYER==SELECT_SEIJA)
			{
				ObjRender_SetAlpha(obj,255);
			}
			else
			{
				ObjRender_SetAlpha(obj,0);
			}
 			if(GetPlayerState==STATE_DOWN)
			{
				ObjRender_SetAlpha(obj,0);
				DownCount=50;
			}
 			if(DownCount>0)
			{
				ObjRender_SetAlpha(obj,0);
			}
			DownCount-=1;
			yield;
		}
		Obj_Delete(obj);
	}
}
//--------------










