#TouhouDanmakufu
#Title[Boss War' NSC02]
#Text[Boss du stage 2, 2nde NSC]
#Image[]
#BGM[script\DanMUku\Stage2\War.mp3]
#Player[script\DanMUku\Joueur\KorA\KorHosik.txt, script\DanMUku\Joueur\KorB\KorB.txt, script\DanMUku\Joueur\KorC\KorC.txt]
#ScriptVersion[2]

script_enemy_main
{    
    let imgEnemy ="script\DanMUku\Stage2\Image\WaruigiD.png";
    let count=-120;
    let angle=0;
    let tir ="script\DanMUku\Stage1\Son\tir.wav";
    let z = 0;
    let w = 0.5;

   @Initialize
   {
            LoadUserShotData("script\DanMUku\MUtir\MUtir.txt");
            LoadGraphic(imgEnemy);
            SetLife(6000);
            SetTimer(40);
            SetInvincibility(100);
            SetEnemyMarker(true);
            SetMovePosition02(GetCenterX, GetCenterY, 120);        
   }
   
   @MainLoop
   {
          SetCollisionA(GetX, GetY, 16);
        SetCollisionB(GetX, GetY, 16);
if(count%300==0&&count>-1)
{
if(count%600==0)
{
loop(36)
{
PlaySE(tir);
CreateShotA(1, GetX, GetY, 10);
SetShotDataA(1, 0, 1, GetAngleToPlayer+angle, 0.45, 0, 0, 110);
FireShot(1);
angle+=10;
}
}
else
{
loop(36)
{
PlaySE(tir);
CreateShotA(1, GetX, GetY, 10);
SetShotDataA(1, 0, 1, GetAngleToPlayer+angle, -0.45, 0, 0, 116);
FireShot(1);
angle+=10;
}
}
}
if(count%300==0)
{
CreateShot01(GetX, GetY, 1, GetAngleToPlayer, WHITE03, 0);
}
yield;
count++;
   }
   @Finalize
   {
      DeleteGraphic(imgEnemy);
   }
   
   @DrawLoop
   {
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetAlpha(255);
            SetTexture(imgEnemy);
            SetGraphicRect(0, 0, 60, 38);
            DrawGraphic(GetX,GetY+z);
     if(z==10){w=-0.5;}
     if(z==-10){w=0.5;}
z+=w;
	DrawText("War'", GetClipMinX+10, GetClipMinY+15, 12, 255);
   }

}
