#e
#Title[cuƍׂ̋Ev]
#Text[G@Lu_v
Q̎Ƃ݂Ă]
#ScriptVersion[2]
#Player[FREE]

script_enemy_main {
 let img = "script\img\ExRumia.png";
 let name = "cuƍׂ̋Ev";
 let pet = 0;

 @Initialize {
  CutIn(KOUMA, name, "", 0, 0, 0, 0);
  SetX(GetCenterX);
  SetY(GetCenterY - 120);
  SetLife(10000);
  SetScore(2000000);

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

  TMain;
 }

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

  pet += 1;
  if(pet == 960) {
   CreateShot01(GetX, GetY, 0.25, 45, WHITE11, 0);
   CreateShot01(GetX, GetY, 0.25, 60, WHITE11, 0);
   CreateShot01(GetX, GetY, 0.25, 120, WHITE11, 0);
   CreateShot01(GetX, GetY, 0.25, 135, WHITE11, 0);
   CreateShot01(GetX, GetY, 0.25, 75, WHITE11, 0);
   CreateShot01(GetX, GetY, 0.25, 105, WHITE11, 0);
   CreateShot01(GetX, GetY, 0.25, 82.5, WHITE11, 0);
   CreateShot01(GetX, GetY, 0.25, 97.5, WHITE11, 0);
   CreateShot01(GetX, GetY, 0.25, 90, WHITE11, 0);
   pet = 840;
  }

  yield;
 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  DeleteGraphic(img);
 }

 task TMain {
  yield;

  TShot;
 }

 task TShot {
  let x = 0;
  let y = 0;
  yield;

  loop {
   loop(1) { yield; }
   SetShotColor(1, 1, 1);
   CreateShot01(GetX + offsetX(100, x), GetY + offsetY(100, y), 0.3, atan2(GetY - (GetY + offsetY(100, y)) + 6, GetX - (GetX + offsetX(100, x))), WHITE11, 0);
   x += 5;
   y += 5;
  }
 }

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

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

}