   script_shot shot1{
      let out=false;
      let gr=GetArgument;
      let lv=0;
      @Initialize{
         SetDefault(gr+lv*20);
      }
      @MainLoop {
         if(GetX<20||GetX>428||GetY<20||GetY>460){
            out=true;
            End;
         }
         if(GetCommonData("kakusei")>0){
            lv=1;
            if(GetPoint==0){lv=2;SetSpeed(GetSpeed+0.04)}
         }
         else{lv=0}
         SetDefault(gr+lv*20);
         if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<=4){SetCommonData("gekitui",1);}
      }
      @DrawLoop {
         DrawGraphicDefault();
      }
      @Finalize{
         if(out==false&&OnBomb==false){
            if(GetCommonData("kakusei")>0){
               CreateShotFromScript( "kinka",GetX(), GetY(), 0, 270, 0, 0);
            }
            if(OnBomb==false&&GetCommonData("kakusei")==0){
               CreateShotFromScript( "isi",GetX(), GetY(), 0, 270, 0, 0);
            }
         }
      }
   }    

  script_shot shot2{//重力加速弾
      let out=false;
      let gr=GetArgument;
      let lv=0;
      let kasoku=0;
      let speed=GetSpeed;
      let angle=GetAngle;
      let ex = GetCommonData("ex");
      @Initialize{
         SetDefault(gr+lv*20);
      }
      @MainLoop {
         if(GetX<20||GetX>428||GetY<20||GetY>460){
            out=true;
            End;
         }
         if(GetCommonData("kakusei")>0){
            lv=1;
            if(GetPoint==0){lv=2;SetSpeed(GetSpeed+0.04);kasoku+=0.025;}
         }
         else{lv=0}
         SetDefault(gr+lv*20);
         if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<=4){SetCommonData("gekitui",1);}
         SetX(GetX+cos(angle)*speed);
         SetY(GetY+sin(angle)*speed+kasoku);
         kasoku+=0.03+ex*0.01;
      }
      @DrawLoop {
         DrawGraphicDefault();
      }
      @Finalize{
         if(out==false&&OnBomb==false){
            if(GetCommonData("kakusei")>0){
               CreateShotFromScript( "kinka",GetX(), GetY(), 0, 270, 0, 0);
            }
            if(OnBomb==false&&GetCommonData("kakusei")==0){
               CreateShotFromScript( "isi",GetX(), GetY(), 0, 270, 0, 0);
            }
         }
      }
   }
  script_shot shot3{//加速弾
      let out=false;
      let gr=GetArgument;
      let lv=0;
      let kasoku=GetSpeed;
      let angle=GetAngle;
      @Initialize{
         SetDefault(gr+lv*20);
      }
      @MainLoop {
         if(GetX<20||GetX>428||GetY<20||GetY>460){
            out=true;
            End;
         }
         if(GetCommonData("kakusei")>0){
            lv=1;
            if(GetPoint==0){lv=2;SetSpeed(GetSpeed+0.04)}
         }
         else{lv=0}
         SetDefault(gr+lv*20);
         if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<=4){SetCommonData("gekitui",1);}
         SetSpeed(GetSpeed+kasoku);
      }
      @DrawLoop {
         DrawGraphicDefault();
      }
      @Finalize{
         if(out==false&&OnBomb==false){
            if(GetCommonData("kakusei")>0){
               CreateShotFromScript( "kinka",GetX(), GetY(), 0, 270, 0, 0);
            }
            if(OnBomb==false&&GetCommonData("kakusei")==0){
               CreateShotFromScript( "isi",GetX(), GetY(), 0, 270, 0, 0);
            }
         }
      }
   }
  script_shot shot4{//減速から自機狙い
      let out=false;
      let gr=GetArgument;
      let lv=0;
      let kasoku=GetSpeed;
      let phase=2;
      @Initialize{
         SetDefault(gr+lv*20);
      }
      @MainLoop {
         if(GetX<20||GetX>428||GetY<20||GetY>460){
            out=true;
            End;
         }
         if(GetCommonData("kakusei")>0){
            lv=1;
            if(GetPoint==0){lv=2;SetSpeed(GetSpeed+0.04)}
         }
         else{lv=0}
         if(phase==2){
            SetSpeed(GetSpeed-0.1);
            if(GetSpeed<0.5){
               let p=GetAngleToPlayer;
               SetAngle(p);
               SetSpeed(kasoku);
               phase=1;
            }
         }
         SetDefault(gr+lv*20);
         if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<=4){SetCommonData("gekitui",1);}
      }
      @DrawLoop {
         DrawGraphicDefault();
      }
      @Finalize{
         if(out==false&&OnBomb==false){
            if(GetCommonData("kakusei")>0){
               CreateShotFromScript( "kinka",GetX(), GetY(), 0, 270, 0, 0);
            }
            if(OnBomb==false&&GetCommonData("kakusei")==0){
               CreateShotFromScript( "isi",GetX(), GetY(), 0, 270, 0, 0);
            }
         }
      }
   }
  script_shot shot5{//弾を撃つ弾直進
      let out=false;
      let gr=01;
      let arg=GetArgument;
      let pl=GetAngleToPlayer;
      let ex = GetCommonData("ex");
      let lv=0;
      let time=0;
      @Initialize{
         SetDefault(gr+lv*20);
      }
      @MainLoop {
		if(GetX<20||GetX>428||GetY<20||GetY>460){
			out=true;
			End;
		}
		if(GetCommonData("kakusei")>0){
			lv=1;
			if(GetPoint==0){lv=2;SetSpeed(GetSpeed+0.04);}
		}
		else{lv=0}
		SetDefault(gr+lv*20);
		if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<=4){SetCommonData("gekitui",1);}
		if(arg==1&&time%6==0){//跡が残る
			CreateShotFromScript( "shot1",GetX(), GetY(), 2+ex, GetAngle, 0, 13);
		}
		else if(arg==2&&time<30&&time%2==0){//２中ボス
			CreateShotFromScript( "shot1",GetX(), GetY(), 3.5+ex, GetAngle+80, 0, 06);
			CreateShotFromScript( "shot1",GetX(), GetY(), 3.5+ex, GetAngle-80, 0, 06);
			CreateShotFromScript( "shot1",GetX(), GetY(), 3.5+ex, GetAngle+30, 0, 06);
			CreateShotFromScript( "shot1",GetX(), GetY(), 3.5+ex, GetAngle-30, 0, 06);
		}
		else if((|arg|)==3&&time%4==0){//３中ボス
			CreateShotFromScript( "shot1",GetX(), GetY(), 2.6+ex*1.2, GetAngle-16*arg/3, 0, 12);
		}
		else if(arg==4&&time%6==0){//跡が残る２
			CreateShotFromScript( "shot1",GetX(), GetY(), 2.8+ex, GetAngle, 0, 13);
		}
		else if(arg==5&&time%5==0){//３ボス12
			CreateShotFromScript( "shot3",GetX(), GetY(), 0.03+ex*0.02, GetAngle+time*3.7, 0, 05);
			CreateShotFromScript( "shot3",GetX(), GetY(), 0.03+ex*0.02, GetAngle-time*3.7, 0, 05);
		}
		else if(arg==6){//３ボス13
			if(time>15&&time%3==0){
				let p=GetAngleToPlayer;
				let a=0;
				CreateShotFromScript( "shot1",GetX(), GetY(), 2+(time-15)/8+ex, p-(pl-GetAngle)*0.5+rand(1,-1), 0, 02);
				if(ex==1){
					CreateShotFromScript( "shot1",GetX(), GetY(), 2+(time-15)/8+ex, p-(pl-GetAngle)*0.5+rand(1,-1)+30, 0, 02);
					CreateShotFromScript( "shot1",GetX(), GetY(), 2+(time-15)/8+ex, p-(pl-GetAngle)*0.5+rand(1,-1)-30, 0, 02);
				}
			}
			if(time>40){out=true;End;}
		}
		else if((|arg|)==7&&time%8==0){//３ボス22
			CreateShotFromScript( "shot3",GetX(), GetY(), 0.04+ex*0.04, GetAngle-(160-time*1)*arg/7, 0, 11);
		}
		else if((|arg|)==8&&time%8==0){//４ボス23
			CreateShotFromScript( "shot3",GetX(), GetY(), 0.007, GetAngle+180+time*arg, 0, 06);
		}
		else if(arg==9&&time<30&&time%2==0){//５中ボス2
			CreateShotFromScript( "shot1",GetX(), GetY(), 3.5+ex, GetAngle+105, 0, 06);
			CreateShotFromScript( "shot1",GetX(), GetY(), 3.5+ex, GetAngle-105, 0, 06);
			CreateShotFromScript( "shot1",GetX(), GetY(), 3.5+ex, GetAngle+60, 0, 06);
			CreateShotFromScript( "shot1",GetX(), GetY(), 3.5+ex, GetAngle-60, 0, 06);
			CreateShotFromScript( "shot1",GetX(), GetY(), 3.5+ex, GetAngle+15, 0, 06);
			CreateShotFromScript( "shot1",GetX(), GetY(), 3.5+ex, GetAngle-15, 0, 06);
		}
		else if(arg==10&&time%12==0){//５ボス27
			CreateShotFromScript( "shot3",GetX(), GetY(), 0.03-ex*0.01, GetAngle+90, 0, 13);
			CreateShotFromScript( "shot3",GetX(), GetY(), 0.03-ex*0.01, GetAngle-90, 0, 13);
			if(ex==1){
			CreateShotFromScript( "shot3",GetX(), GetY(), 0.05, GetAngle+90, 0, 13);
			CreateShotFromScript( "shot3",GetX(), GetY(), 0.05, GetAngle-90, 0, 13);
			}
		}
		else if((|arg|)==11&&time%8==0){//５ボス31
			CreateShotFromScript( "shot3",GetX(), GetY(), 0.02+ex*0.01, GetAngle+(-20+time*2.5)*arg/11, 0, 13);
		}
		time++;
      }
      @DrawLoop {
         DrawGraphicDefault();
      }
      @Finalize{
         if(out==false&&OnBomb==false){
            if(GetCommonData("kakusei")>0){
               CreateShotFromScript( "kinka",GetX(), GetY(), 0, 270, 0, 0);
            }
            if(OnBomb==false&&GetCommonData("kakusei")==0){
               CreateShotFromScript( "isi",GetX(), GetY(), 0, 270, 0, 0);
            }
         }
      }
   }    

   script_shot shot6{//減速から加速自機狙い
      let out=false;
      let gr=GetArgument;
      let lv=0;
      let kasoku=GetSpeed;
      let phase=2;
      @Initialize{
         SetDefault(gr+lv*20);
      }
      @MainLoop {
         if(GetX<20||GetX>428||GetY<20||GetY>460){
            out=true;
            End;
         }
         if(GetCommonData("kakusei")>0){
            lv=1;
            if(GetPoint==0){lv=2;SetSpeed(GetSpeed+0.04)}
         }
         else{lv=0}
         if(phase==2){
            SetSpeed(GetSpeed-0.1);
            if(GetSpeed<0.5){
               SetAngle(GetAngleToPlayer);
               phase=1;
            }
         }
         if(phase==1){
            SetSpeed(GetSpeed+0.07);
         }
         SetDefault(gr+lv*20);
         if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<=4){SetCommonData("gekitui",1);}
      }
      @DrawLoop {
         DrawGraphicDefault();
      }
      @Finalize{
         if(out==false&&OnBomb==false){
            if(GetCommonData("kakusei")>0){
               CreateShotFromScript( "kinka",GetX(), GetY(), 0, 270, 0, 0);
            }
            if(OnBomb==false&&GetCommonData("kakusei")==0){
               CreateShotFromScript( "isi",GetX(), GetY(), 0, 270, 0, 0);
            }
         }
      }
    }

   script_shot kinka{
      let time=4;
      let score=0;
      let arg=0;
      let zessi=GetCommonData("zessi");
      let ex=GetCommonData("ex");
      @Initialize{
         SetDefault(93);
         SetBombResist();
         SetSpeed(4);
         arg=GetCommonData("kinkaiten");

         score=arg*100+500+GetCommonData("kinkai");
         if(GetCommonData("zessi")==1){
            DeleteEnemyShotImmediatelyInCircle(SHOT, GetX, GetY, 30);
         }
         SetCommonData("kinkai",GetCommonData("kinkai")+trunc(arg/2)+1);
         if(GetCommonData("kinkai")>5000+25000*GetCommonData("zessi")){
            SetCommonData("kinkai",5000+25000*GetCommonData("zessi"));
         }
      }
      @MainLoop {
         if(time>=3+ex&&GetCommonData("kakusei")>0){
            DeleteEnemyShotImmediatelyInCircle(SHOT, GetX, GetY, 30);
         }
         SetSpeed(GetSpeed+1);
         SetAngle(GetAngleToPlayer);
         if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<30^2&&time<0){End;}
         if(time<=-30){
            End;
         }
         if(GetCommonData("zessi")==1&&time==-2&&GetEnemyShotCount<1500){
            CreateShotFromScript( "zessi",GetX(), GetY(), 2, GetAngleToPlayer, 20, 12);
            End;
         }
         if(time==-2){SetDefault(98-trunc(arg/10));}
         time-=1;
      }
      @DrawLoop {
         DrawGraphicDefault();
      }
      @Finalize{
         SetCommonData("score",GetCommonData("score")+score);
         if(zessi==0){
            SetCommonData("ruikei",GetCommonData("ruikei")+1);
            if(GetCommonData("ruikei")>1000){
               SetCommonData("ruikei",1000);
            }
         }
         let se1 = GetCurrentScriptDirectory~"wav\se1.wav";
         PlaySE(se1);
      }
   }

   script_shot isi{
      let time=3;
      @Initialize{
         SetDefault(99);
         SetBombResist();
         SetSpeed(10);
      }
      @MainLoop {
         SetAngle(GetAngleToPlayer);
         if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<30^2){End;}
         if(time<=-30){
            End;
         }
         time-=1;
      }
      @DrawLoop {
         DrawGraphicDefault();
      }
      @Finalize{
         if(GetPoint<500){AddPoint(1);}
      }
   }
   script_shot zessi{
      let out=false;
      let gr=GetArgument;
      let lv=0;
      let time=-20;
      @Initialize{
         SetDefault(gr+lv*20);
      }
      @MainLoop {
         if(GetX<20||GetX>428||GetY<20||GetY>460){
            out=true;
            End;
         }
         if(GetCommonData("kakusei")>0){
            lv=1;
            if(GetPoint==0){lv=2;SetSpeed(GetSpeed+0.04)}
         }
         else{lv=0}
         SetDefault(gr+lv*20);
         if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<=4&&time>0){
            SetCommonData("gekitui",1);
         }
         /*if(time==0){SetBombResist(false);}*/
         time++;
      }
      @DrawLoop {
         DrawGraphicDefault();
      }
      @Finalize{
         if(out==false&&OnBomb==false){
            if(GetCommonData("kakusei")>0){
               let a=(200+GetCommonData("kinkaiten")*100);
               CreateShotFromScript( "kinka",GetX(), GetY(), a, 270, 0, 99-GetCommonData("kinkaiten")/20);
            }
            if(OnBomb==false&&GetCommonData("kakusei")==0){
               CreateShotFromScript( "isi",GetX(), GetY(), 0, 270, 0, 0);
            }
         }
      }
   }    
   script_shot utikaesi{
      let out=false;
      let gr=GetArgument;
      let lv=0;
      @Initialize{
         SetDefault(gr+lv*20);
         if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<130^2){out=true;End;}
      }
      @MainLoop {
         if(GetX<20||GetX>428||GetY<20||GetY>460){
            out=true;
            End;
         }
         if(GetCommonData("kakusei")>0){
            lv=1;
            if(GetPoint==0){lv=2;SetSpeed(GetSpeed+0.04)}
         }
         else{lv=0}
         SetDefault(gr+lv*20);
         if((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2<=4){SetCommonData("gekitui",1);}
      }
      @DrawLoop {
         DrawGraphicDefault();
      }
      @Finalize{
         if(out==false&&OnBomb==false){
            if(GetCommonData("kakusei")>0){
               let se1 = GetCurrentScriptDirectory~"wav\se1.wav";
               PlaySE(se1);
               let a=GetGraze*(5+GetCommonData("kinkaiten")/2);
               CreateShotFromScript( "kinka",GetX(), GetY(), a, 270, 0, 99-GetCommonData("kinkaiten")/20);
            }
            if(OnBomb==false&&GetGraze==0){
            }
         }
      }
   }    

