#e
#Title[Vgu\l̉Ηցv]
#Text[ւRԗւۂ̂ŁEEEB낢Ƃ܂ełAƂȂ肵܂B]

#BackGround[Default]
#BGM[.\BGM\thA07]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
	let count=210;
        let interbal=181;
        let flame=0;
	let cx=GetCenterX();//STGV[̒SxW擾;
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgback04_06=GetCurrentScriptDirectory~"img\back04_06.png";
        let speed=0;	
        let power0=GetCurrentScriptDirectory~"SE\power0.wave";
	let imgLittle=GetCurrentScriptDirectory~"img\RumiaCutIn.png";
        SetShotAutoDeleteClip(100,100,100,100);



        @Initialize
	{
		SetScore(30000);//XyJ[h{[iX30000ɐݒ
		SetLife(450);//Ct300ɐݒ
		SetDamageRate(10,3);//_[W10%ɐݒ
		SetTimer(60);//Ԑ60bɐݒ
                SetDurableSpellCard();//ϋvXyJɂ܂
		SetGraphicRect(1,1,64,64);//`挳`ݒ
		SetInvincibility(540);//G30t[Gɂ
		LoadGraphic(imgback04_06);		
		LoadGraphic(imgExRumia);//摜uimg\ExRumia.pngvǂ݂		

                LoadSE(power0);

		SetMovePosition02(GetCenterX,60,120);//W(cx,60)60t[Ĉړ
                Concentration02(150);
		CutIn(YOUMU,"Vgu\l̉Ηցv",imgLittle,1,1,350,525);//XyJ[h\


	}
	
	@MainLoop
	{       
          
          let radius =150;
          let angle =count-90;
          let x = GetPlayerX() + offsetX(radius, angle);
          let y = GetPlayerY() + offsetY(radius, angle);

          if(flame>179)
            {
             if(flame<540&&flame%30==1)
                {

                 CreateEnemyFromScript("Shito01",GetCenterX,GetClipMinY,0,0,0);

                 }

            }

          if(flame==60){ 
                          Concentration02(120);
                          PlaySE(power0);
                         }  

          if(flame==640){ 
                         PlaySE(power0);
                         Concentration02(80);
                         }

          if(flame==800)
               {
                CreateEnemyFromScript("bunnsinn01",GetX,GetY(),0,0,0);
                count=210;
                interbal=181;
               }

          if(flame>800)
            {


                SetMovePosition03(x,y,30,5);



                if(interbal==110){ 
                               PlaySE(power0);
                               }


                 if(interbal>440&&interbal%20==2)		
                         {
                         let ang=GetAngleToPlayer;
 
                
                             loop(4) {
                                      CreateShot02(GetX, GetY,0.5, ang,0.1, 10, PURPLE21, 0);
                                      ang += 90;
                                     }
                          
                         }

                if(interbal<181&&interbal%30==0)
		{
			let ang=GetAngleToPlayer();//G玩@ւ̊px擾
			let i=0;
                        while(i<360)
			{
				CreateShot02(GetX(),GetY(),7,ang+i,-0.4,1.5,PURPLE04,190);//e𔭎
				CreateShot02(GetX(),GetY(),6,ang+i,-0.5,1.2,PURPLE01,190);   
				i+=30;
			}

		}
		
           }
		if(count==360){count=0;};
                if(interbal==630){interbal=0;}
		SetCollisionA(GetX(),GetY(),32);//蔻(e)o^
		SetCollisionB(GetX(),GetY(),12);//蔻(̓)o^
		count++;
                interbal++;
                flame++;
	}
	
	@Finalize
	{//ǂ݂񂾃t@C폜
		DeleteGraphic(imgExRumia);	
		DeleteGraphic(imgback04_06);
		CreateItem(ITEM_1UP,GetX,GetY+60);
		loop(20)
		{
			CreateItem(ITEM_SCORE,GetX+rand(-100,100),GetY+rand(20,100));
		}
	}
	
	@DrawLoop
	{
		//Ex[~A`
		
                if(GetSpeedX()==0){SetGraphicRect(64,1,127,64);}
		else if(GetSpeedX()>0){SetGraphicRect(192,1,255,64);}
	        else if(GetSpeedX()<0){SetGraphicRect(128,1,191,64);}
                             
                              
                             
		SetAlpha(255);
		SetTexture(imgExRumia);
		DrawGraphic(GetX(),GetY());
	}

	@BackGround
	{
	//XyJ[h̔wi
	//Ă悢


		SetTexture(imgback04_06);
		SetGraphicRect(1,1,512,512);
		SetAlpha(100);
		SetGraphicAngle(0,0,0);
		DrawGraphic(GetCenterX,GetCenterY);
		
	}


    function offsetX(radius, angle) {
        return radius * cos(angle);
    }

    function offsetY(radius, angle) {
        return radius * sin(angle);
    }

}


script_enemy bunnsinn01
{//g`
	let count=210;
        let interbal=181;
        let flame=0;
	let ExRumiabunnsinn01=GetCurrentScriptDirectory~"img\ExRumiabunnsinn01.png";




        @Initialize
	{

		SetLife(300);//Ct300ɐݒ

		SetDamageRateEx(10,3,100,0);


		SetGraphicRect(1,1,64,64);//`挳`ݒ
		SetInvincibility(100);//G30t[Gɂ
		
		LoadGraphic(ExRumiabunnsinn01);//摜uimg\ExRumiabunnsinn01.pngvǂ݂		
		




	}
	
	@MainLoop
	{       

               let radius =150;
               let angle =count+90;
               let x = GetPlayerX() + offsetX(radius, angle);
               let y = GetPlayerY() + offsetY(radius, angle);

                SetMovePosition03(x,y,30,5);
                
                


                if(count==120){ 
                               Concentration02(120);
                               }  



                 if(interbal>440&&interbal%20==2)		
                         {
                         let ang=GetAngleToPlayer;
 
                
                             loop(4) {
                                      CreateShot02(GetX, GetY,0.5, ang,0.1, 10, BLUE21, 0);
                                      ang += 90;
                                     }
                          
                         }

                if(interbal<181&&interbal%30==0)
		{
			let ang=GetAngleToPlayer();//G玩@ւ̊px擾
			let i=0;
                        while(i<360)
			{
				CreateShot02(GetX(),GetY(),7,ang+i,-0.4,1.5,BLUE04,190);//e𔭎
				CreateShot02(GetX(),GetY(),6,ang+i,-0.5,1.2,BLUE01,190); 
				i+=30;
			}

		}
		

		if(count==360){count=0;};
                if(interbal==630){interbal=0;}
		SetCollisionA(GetX(),GetY(),32);//蔻(e)o^
		SetCollisionB(GetX(),GetY(),12);//蔻(̓)o^
		count++;
                interbal++;
                flame++;
	}
	
	@Finalize
	{//ǂ݂񂾃t@C폜
		DeleteGraphic(ExRumiabunnsinn01);	

		loop(20)
		{
			CreateItem(ITEM_SCORE,GetX+rand(-100,100),GetY+rand(20,100));
		}
	}
	
	@DrawLoop
	{
		//Ex[~A`
		
                if(GetSpeedX()==0){SetGraphicRect(64,1,127,64);}
		else if(GetSpeedX()>0){SetGraphicRect(192,1,255,64);}
	        else if(GetSpeedX()<0){SetGraphicRect(128,1,191,64);}
                             
                              
                             
		SetAlpha(255);
		SetTexture(ExRumiabunnsinn01);
		DrawGraphic(GetX(),GetY());
	}

    function offsetX(radius, angle) {
        return radius * cos(angle);
    }

    function offsetY(radius, angle) {
        return radius * sin(angle);
    }


}

script_enemy Shito01
{//Ήւ`

	let count=0;
        let interbal=0;
        let flame=0;

        @Initialize
	{

		SetLife(300);//Ct300ɐݒ
		SetDamageRate(10,10);//_[W10%ɐݒ
		SetDamageRateEx(10,3,20,0);

		SetInvincibility(100);//G30t[Gɂ

	}
	
	@MainLoop
        {
          let radius =220;
          let angle =count-90;
          let x = GetCenterX() + offsetX(radius, angle);
          let y = GetCenterY() + offsetY(radius, angle);

          SetMovePosition03(x,y,30,5);

          if(count<360&&count%6==1)
             {
		CreateShot01(GetX(),GetY(),2,GetAngle-150,RED11,40);

             }
         	 if(count==360){count=0}
          	SetCollisionB(GetX(),GetY(),24);
          	count++;
		SetCollisionA(GetX(),GetY(),24);//蔻(e)o^
        }

	@Finalize
	{

		loop(5)
		{
			CreateItem(ITEM_SCORE,GetX+rand(-100,100),GetY+rand(20,100));
		}
	}
	
	@DrawLoop
	{

	}



    function offsetX(radius, angle) {
        return radius * cos(angle);
    }

    function offsetY(radius, angle) {
        return radius * sin(angle);
    }
		
}