#e
#Title[uXAoV-Nomal-v]
#Text[G@Ĺu`mv]
#ScriptVersion[2]
#PlayLevel[Easy]
#Player[FREE]

script_enemy_main {
 let img = "script\img\ExRumia.png";
 let name = "uXAoV-Nomal-v";

 @Initialize {
  CutIn(KOUMA, name, "", 0, 0, 0, 0);
  SetX(GetCenterX);
  SetY(GetClipMinY + 140);
  SetLife(5000);
  SetScore(1000000);
  SetDamageRate(5, 5);

  LoadGraphic(img);
  SetTexture(img);
  SetGraphicRect(0, 0, 64, 64);

  TMain;
 }

 @MainLoop {
  SetCollisionA(GetX, GetY, 24);
  SetCollisionB(GetX, GetY, 24);

  yield;
 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  DeleteGraphic(img);
 }

 task TMain {
  yield;

  TShot;
 }

 task TShot {
  let x = GetClipMinX;
  let y = 100;
  let way = 1;
  yield;

  loop {
   loop(way) { yield; }
   CreateShotA(1, x, GetClipMinY + y, 0);
   SetShotDataA(1, 0, 0, 90, 0, 0, 0, BLUE11);
   FireShot(1);
   x += 7;
   if(x > 418) {
    x = GetClipMinX;
    y -= 4;
    if(y == 0) {
     y = 100;
     way = 8;
     TShot2;
     TShot3;
     SetDamageRate(90, 100);
    }
   }
  }
 }

 task TShot2 {
  yield;

  loop {
   loop(5) { yield; }
   CreateShot01(rand(GetClipMinX, GetClipMaxX), rand(GetClipMinY, GetClipMinY + 100), rand(0.5, 1.5), rand(45, 135), BLUE11, 0);
  }
 }

 task TShot3 {
  yield;

  loop {
   loop(10) { yield; }
   CreateShot01(rand(GetClipMinX, GetClipMaxX), rand(GetClipMinY, GetClipMinY + 100), rand(0.3, 1.2), rand(45, 135), BLUE01, 0);
  }
 }

}