task option{
      optiondeta(-10,-40,-25,-30);
      optiondeta( 10, 40, 25,-30);
}

task optiondeta(ShotAngle,normalX,slowX,slowY){
       let obj=Obj_Create(OBJ_EFFECT);
       let X=normalX;
       let Y=0;
       let angle=0;
       let frame=0;
       let ShotN=3;
       let NUN=3;
       Obj_SetAutoDelete(obj,false);
       ObjEffect_SetTexture(obj,imgPlayer);
       ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
       ObjEffect_CreateVertex(obj,4);
       ObjEffect_SetVertexXY(obj,0,-10,-10);
       ObjEffect_SetVertexXY(obj,1, 10,-10);
       ObjEffect_SetVertexXY(obj,2,-10, 10);
       ObjEffect_SetVertexXY(obj,3, 10, 10);
       ObjEffect_SetVertexColor(obj,0,255,255,255,255);
       ObjEffect_SetVertexColor(obj,1,255,255,255,255);
       ObjEffect_SetVertexColor(obj,2,255,255,255,255);
       ObjEffect_SetVertexColor(obj,3,255,255,255,255);
       ObjEffect_SetVertexUV(obj,0, 0,159);
       ObjEffect_SetVertexUV(obj,1,20,159);
       ObjEffect_SetVertexUV(obj,2, 0,179);
       ObjEffect_SetVertexUV(obj,3,20,179);
       loop{
	if(GetCommonData("ResultTime") == 1){break;}
	  let Power=truncate(GetCommonData("Power")/100);
          Obj_SetPosition(obj,GetPlayerX+X,GetPlayerY+Y);
          if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD){//低速移動時
		if(frame!=5){
			X-=slowX/5;
			Y+=slowY/5;
			frame++;
		}
	  	if(GetKeyState(VK_SHOT)==KEY_PUSH || GetKeyState(VK_SHOT)==KEY_HOLD){
			if(shotCount%4 == 0){
				let Sangle=-90+4+(ShotN-3)*2;
				loop(ShotN){
					if(ShotN<=NUN){CreatePlayerShot01(Obj_GetX(obj),Obj_GetY(obj),14,Sangle, 2.0, 1, 2);}
					Sangle-=4;
				}
				ShotN++;
			}
		}
	  }
	  else{//高速移動時
		if(frame!=0){
			X+=slowX/5;
			Y-=slowY/5;
			frame--;
		}
	  	if(GetKeyState(VK_SHOT)==KEY_PUSH || GetKeyState(VK_SHOT)==KEY_HOLD){
			if(shotCount%4 == 0){
				let Sangle=-90+6+(ShotN-3)*3+ShotAngle;
				loop(ShotN){
					if(ShotN<=NUN){CreatePlayerShot01(Obj_GetX(obj),Obj_GetY(obj),14,Sangle, 2.0, 1, 2);}
					Sangle-=6;
				}
				ShotN++;
			}
		}
	  }
          ObjEffect_SetAngle(obj,0,0,angle);
          angle+=3;
	  if(ShotN==NUN+3){ShotN=3;}
	  if(Power>=1){NUN=4;}
	  if(Power>=3){NUN=5;}
	  if(Power>=5){NUN=6;}
          yield;
       }

       

}


