#東方弾幕風
#Title[チルノ通常弾３-Lunatic-]
#Text[仮]
#ScriptVersion[2]

script_enemy_main {
 let img = "script\img\ExRumia.png";

 @Initialize {
  SetX(GetCenterX);
  SetY(GetCenterY);
  SetLife(3000);
  boss_magic_circle;
  LoadGraphic(img);
  SetTexture(img);
  SetGraphicRect(64, 0, 128, 64);
  SetInvincibility(180);
  PlaySE(powerSE);
  Concentration01(180);
  TShot;
  TMove;
 }

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

  yield;
 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  DeleteGraphic(img);
 }

 task TShot {
  let speed = 1;
  let angle = -90;
  let speed2 = 1;
  let angle2 = 30;
  yield;
  wait(180);
  loop {
   loop(4) { yield; }
   PlaySE(shotSE);
   CreateShotA(1, GetX, GetY, 10);
   SetShotDataA(1, 0, speed, angle, 0, 0, speed, BLUE11);
   SetShotDataA(1, 120, speed2, angle2, 0, 0, speed2, BLUE11);
   FireShot(1);

   CreateShotA(1, GetX, GetY, 10);
   SetShotDataA(1, 0, speed, angle, 0, 0, speed, BLUE11);
   SetShotDataA(1, 120, speed2, angle2, 0, 0.15, 1.5, BLUE11);
   FireShot(1);

   CreateShotA(1, GetX, GetY, 10);
   SetShotDataA(1, 0, speed, angle, 0, 0, speed, BLUE11);
   SetShotDataA(1, 120, speed2, angle2, 0, 0.3, 2, BLUE11);
   FireShot(1);

   CreateShotA(1, GetX, GetY, 10);
   SetShotDataA(1, 0, speed, angle, 0, 0, speed, BLUE11);
   SetShotDataA(1, 120, speed2, angle2, 0, 0.4, 2.5, BLUE11);
   FireShot(1);

   speed = rand(0.5, 1);
   angle = rand(-135, -45);
   speed2 = rand(0.5, 1);
   angle2 = rand(30, 150);

   if(GetPlayerY < GetY) {
    CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMaxY, 3, -90, BLUE03, 0);
    CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMaxY, 3, -90, BLUE03, 0);
    CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMaxY, 3, -90, BLUE03, 0);
    CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMaxY, 3, -90, BLUE03, 0);
    CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMaxY, 3, -90, BLUE03, 0);
   }
  }
 }

 task TMove {
  yield;

  loop {
   loop(100) { yield; }
   SetMovePositionRandom01(rand(-300, 300), rand(-100, 100), 1, GetClipMinX + 30, GetCenterY - 120, GetClipMaxX - 30, GetCenterY);
  }
 }
#include_function ".\変数集.txt"
#include_function ".\functions.txt"
}