#e
#Title[חuAtFCu[U[-Easy-v]
#Text[G@͖]
#ScriptVersion[2]

script_enemy_main {
 let img = "script\img\ExRumia.png";
 let name = "חuAtFCu[U[-Easy-v";
 let power = 90;
 let uran = 90;

 @Initialize {
  CutIn(KOUMA, name, "", 0, 0, 0, 0);
  SetX(GetCenterX);
  SetY(GetCenterY);
  SetScore(1000000);
  SetLife(7000);

  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;
  THomig;
  TLaser;
 }

 task TShot {
  let point = 90;
  yield;

  loop {
   loop(7) { yield; }
   maru(1, GetX + offsetX(50, power), GetY + offsetY(50, uran), 0, point, RED11, 0);
   power += 15;
   uran += 15;
   point += 1;
  }
 }

 function maru(id, x, y, speed, angle, color, frame) {
  CreateShotA(id, x, y, 0);
  SetShotDataA(id, frame, speed, angle, 0, 0, speed, color);
  FireShot(id);
 }

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

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

 task THomig {
  let yui = 0;
  yield;

  loop {
   loop(10) { yield; }
   maru(2, GetX + offsetX(50, power), GetY + offsetY(50, uran), 1, yui, YELLOW11, 50);
   power += 15;
   uran += 15;
   yui += 1;
  }
 }

 task TLaser {
  yield;

  loop {
   loop(50) { yield; }
   CreateLaser01(GetX, GetY, 1, rand(0, 360), 100, 5, RED11, 0);
  }
 }

}