 
task optionmove//オプションの動き方。powerによって場合分け。時間差（1F後)で自機に追従する。
{
let OpAnglePlus=0;
let dir=1;
let RightAngle=-20;
let LeftAngle=20;
let MoveY=5;
let X1=[];
let Y1=[];
let X2=[];
let Y2=[];
let X3=[];
let Y3=[];
let X4=[];
let Y4=[];
let plus=0;
ascent(let k in 0..1)
{
 X1 = X1 ~ [k];
 Y1 = Y1 ~ [k];
 X2 = X2 ~ [k];
 Y2 = Y2 ~ [k];
 X3 = X3 ~ [k];
 Y3 = Y3 ~ [k];
 X4 = X4 ~ [k];
 Y4 = Y4 ~ [k];
}

	ascent(let i in 0..1)
	{
	if(Power>=1000 && Power<2000)
	{
	X1[i]=GetPlayerX;
	Y1[i]=GetPlayerY-30;
	}
	yield;
	}
loop
{

	ascent(let j in 0..1)
	{
	if(Power>=0)
	{
		if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
			X1[j]=GetPlayerX+30*cos(OpAngle);
			X2[j]=GetPlayerX+30*cos(OpAngle+90);
			X3[j]=GetPlayerX+30*cos(OpAngle+180);
			X4[j]=GetPlayerX+30*cos(OpAngle+270);
			Y1[j]=GetPlayerY-25+10*sin(OpAngle);
			Y2[j]=GetPlayerY-25+10*sin(OpAngle+90);
			Y3[j]=GetPlayerY-25+10*sin(OpAngle+180);
			Y4[j]=GetPlayerY-25+10*sin(OpAngle+270);
			OpAngle+=OpAnglePlus;
			if((GetKeyState(VK_LEFT)==KEY_PUSH || GetKeyState(VK_LEFT)==KEY_HOLD) && OpAnglePlus<6)
			{
				dir=1;
			}
			if((GetKeyState(VK_RIGHT)==KEY_PUSH || GetKeyState(VK_RIGHT)==KEY_HOLD) && OpAnglePlus>-6)
			{
				dir=-1;
			}
			OpAnglePlus+=0.3*dir;
			if(OpAnglePlus>=6){OpAnglePlus=6;}
			if(OpAnglePlus<=-6){OpAnglePlus=-6;}
		}
		else
		{
			X1[j]=GetPlayerX-35+15*cos(OpAngle)*cos(LeftAngle)-15*sin(OpAngle)*sin(LeftAngle);
			X2[j]=GetPlayerX-35+15*cos(OpAngle+180)*cos(LeftAngle)-15*sin(OpAngle+180)*sin(LeftAngle);
			X3[j]=GetPlayerX+35+15*cos(-OpAngle)*cos(RightAngle)-15*sin(-OpAngle)*sin(RightAngle);
			X4[j]=GetPlayerX+35+15*cos(-OpAngle+180)*cos(RightAngle)-15*sin(-OpAngle+180)*sin(RightAngle);
			Y1[j]=GetPlayerY+MoveY*sin(OpAngle)*cos(LeftAngle)-MoveY*cos(OpAngle)*sin(LeftAngle);
			Y2[j]=GetPlayerY+MoveY*sin(OpAngle+180)*cos(LeftAngle)-MoveY*cos(OpAngle+180)*sin(LeftAngle);
			Y3[j]=GetPlayerY+MoveY*sin(-OpAngle)*cos(RightAngle)-MoveY*cos(-OpAngle)*sin(RightAngle);
			Y4[j]=GetPlayerY+MoveY*sin(-OpAngle+180)*cos(RightAngle)-MoveY*cos(-OpAngle+180)*sin(RightAngle);;
			OpAngle+=6;
		}
		MagicOpAnglePlus=OpAnglePlus;
		opX[0]=X1[j];
		opY[0]=Y1[j];
		opX[1]=X2[j];
		opY[1]=Y2[j];
		opX[2]=X3[j];
		opY[2]=Y3[j];
		opX[3]=X4[j];
		opY[3]=Y4[j];
	}
	}
yield;
}
}


task OptionShot
{
loop
{
	ascent(let i in 0..4)
	{
		OptionAuraShot(i);
	}
	wait(600);
}
}

task OptionAuraShot(num)
{
	let obj= Obj_Create(OBJ_LASER);
	Obj_SetX(obj,opX[num]);
	Obj_SetY(obj,opY[num]+48);
	ObjShot_SetDamage(obj,0.2);
	ObjShot_SetPenetration(obj,65556);
	ObjShot_SetGraphic(obj,1);
	Obj_SetAngle(obj,270);
	ObjLaser_SetLength(obj,96);
	ObjLaser_SetWidth(obj,16);
	ObjLaser_SetSource(obj,false);
	Obj_SetAlpha(obj,0);

	loop(600)
	{
		if(BurstLevel==0)
		{
			ObjShot_SetDamage(obj,0.2);
		}
		if(BurstLevel==1)
		{
			ObjShot_SetDamage(obj,0.2*1.2);
		}
		if(BurstLevel==2)
		{
			ObjShot_SetDamage(obj,0.2*1.5);
		}
		if(BurstLevel==3)
		{
			ObjShot_SetDamage(obj,0.2*2);
		}
		if(GetKeyState(VK_SLOWMOVE)==KEY_FREE)
		{
			ObjShot_SetDamage(obj,0);
		}
	Obj_SetX(obj,opX[num]);
	Obj_SetY(obj,opY[num]+48);
	yield;
	}
	Obj_Delete(obj);
}