 
task optionmove//オプションの動き方。powerによって場合分け。時間差（1F後)で自機に追従する。
{
let OpRadius=50;
let OpAnglePlus=0;
let dir=1;
let RightAngle=-10;
let LeftAngle=10;
let MoveY=5;
let AdY=0;

loop
{
		if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
			opX[0]=GetPlayerX+OpRadius*cos(OpAngle);
			opX[1]=GetPlayerX+OpRadius*cos(OpAngle+90);
			opX[2]=GetPlayerX+OpRadius*cos(OpAngle+180);
			opX[3]=GetPlayerX+OpRadius*cos(OpAngle+270);
			opX[4]=GetPlayerX+OpRadius*1.5;
			opX[5]=GetPlayerX-OpRadius*1.5;
			opY[0]=GetPlayerY+10*sin(OpAngle)+AdY;
			opY[1]=GetPlayerY+10*sin(OpAngle+90)+AdY;
			opY[2]=GetPlayerY+10*sin(OpAngle+180)+AdY;
			opY[3]=GetPlayerY+10*sin(OpAngle+270)+AdY;
			opY[4]=GetPlayerY+0;
			opY[5]=GetPlayerY+0;
			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(OpRadius>30)
			{
				OpRadius-=1;
			}
			if(AdY>-25)
			{
				AdY-=1;
			}		
		}
		else
		{
			opX[0]=GetPlayerX+OpRadius*cos(OpAngle);
			opX[1]=GetPlayerX+OpRadius*cos(OpAngle+90);
			opX[2]=GetPlayerX+OpRadius*cos(OpAngle+180);
			opX[3]=GetPlayerX+OpRadius*cos(OpAngle+270);
			opX[4]=GetPlayerX+OpRadius*1.5;
			opX[5]=GetPlayerX-OpRadius*1.5;
			opY[0]=GetPlayerY+10*sin(OpAngle)+AdY;
			opY[1]=GetPlayerY+10*sin(OpAngle+90)+AdY;
			opY[2]=GetPlayerY+10*sin(OpAngle+180)+AdY;
			opY[3]=GetPlayerY+10*sin(OpAngle+270)+AdY;
			opY[4]=GetPlayerY+0;
			opY[5]=GetPlayerY+0;
			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.2*dir;
			if(OpRadius<50)
			{
				OpRadius+=1;
			}
			if(AdY<0)
			{
				AdY+=1;
			}
		}
		if(OpAnglePlus>=6){OpAnglePlus=6;}
		if(OpAnglePlus<=-6){OpAnglePlus=-6;}
		MagicOpAnglePlus=OpAnglePlus;
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);
}