#東方弾幕風
#Title[雪星「リリィスタークリスマス-Hard-」]
#Text[敵機推奨キャラ「チルノ」]
#ScriptVersion[2]
#PlayLevel[Hard]
#Player[FREE]

script_enemy_main {
 let name = "雪星「リリィスタークリスマス」";

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

  boss_magic_circle;

  LoadGraphic(Cirno);
  SetTexture(Cirno);
  SetGraphicRect(270, 50, 325, 125);

  boss_magic_circle;

  PlaySE(spellSE);

  LoadUserShotData(GetCurrentScriptDirectory~"shot_All.txt");

  SetInvincibility(180);

  PlaySE(powerSE);
  Concentration01(180);

  TMain;
 }

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

  yield;
 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  DeleteGraphic(Cirno);
  loop(20) {
   CreateItem(ITEM_SCORE, rand(GetX - 50, GetX + 50), rand(GetY - 50, GetY + 50));
  }
 }

 task TMain {
  yield;
  wait(180);
  TStar;
  TMove;
  TSstar
 }

 task TStar {
  yield;

  loop {
   loop(6) { yield; }
   CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMinY, 1, rand(45, 135), 123, 0);
  }
 }

 task TMove {
  yield;

  loop {
   loop(10) { yield; }
   moveX(rand(-100, 100), 120);
   loop(120) { yield; }
  }
 }

 task TSstar {
  let y = rand(GetClipMinY, GetCenterY);
  let angle = 45;
  let angle2 = 90;
  let angle3 = rand(135, 160);
  yield;

  loop {
   loop(150) { yield; }
   CreateShot01(GetX, GetY, 1.5, angle, BLUE03, 0);
   CreateShot01(GetX, GetY, 1.5, angle, BLUE03, 15);
   CreateShot01(GetX, GetY, 1.5, angle + 1.5, BLUE03, 0);
   CreateShot01(GetX, GetY, 1.5, angle - 1.5, BLUE03, 0);
   angle = rand(45, 85);
   CreateShot01(GetX, GetY, 1.5, angle2, BLUE03, 0);
   CreateShot01(GetX, GetY, 1.5, angle2, BLUE03, 15);
   CreateShot01(GetX, GetY, 1.5, angle2 + 1.5, BLUE03, 0);
   CreateShot01(GetX, GetY, 1.5, angle2 - 1.5, BLUE03, 0);
   angle2 = rand(95, 135);
   loop(45) { yield; }
   PlaySE(laserSE);
   CreateLaser01(GetClipMaxX, y, 3, angle3, 200, 10, WHITE11, 0);
   CreateShot01(GetClipMaxX, y, 3, angle3, 131, 0);
   angle3 = rand(135, 160);
   y = rand(GetClipMinY, GetCenterY);
  }
 }

 function moveX(xMove, frame) {
  let x;

  x = GetX + xMove;
  if(x < GetClipMinX + 20) {
   x = GetClipMinX + 40;
  }
  else if(x > GetClipMaxX - 20) {
   x = GetClipMaxX - 40;
  }

  SetMovePosition02(x, GetY, frame);
 }
#include_function ".\変数集.txt"
#include_function ".\functions.txt"
}