#東方弾幕風
#Title[西行寺幽々子 冥符「黄泉平坂行路」]
#Text[]
#ScriptVersion[2]

script_enemy_main {
    let name        = "冥符「黄泉平坂行路」";
    let imgBoss   = "script\img\dot_yuyuko.png";
    let frame     =  0;
    let angleBase = 90;
    let bgm       = "script\bgm\mkei_yuuga02.mp3";
    let shot1se   = "script\se\Shot00.wav";
    let shot2se   = "script\se\Shot02.wav";
    let laserse   = "script\se\Laser.wav";
    PlayMusic(bgm);
    @Initialize {
        CutIn(YOUMU, name, "script\img\Yuyuko.png", 0, 0, 190, 320);
        SetX(GetCenterX);
        SetY(GetClipMinY + 120);
        SetLife(4000);
	SetTimer(66);
        SetScore(4000000);

        LoadGraphic(imgBoss);
        SetTexture(imgBoss);
        SetGraphicRect(0, 0, 128, 128);
    }

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

        frame++;
        if(frame == 20) {
		loop(5){
		CreateShotSK2otama(rand(400,0), 500, 4, 3, -0.1, rand(345,215), 0.5);PlaySE(shot2se);
		CreateShotSK2otama(rand(400,0), 500, 4, 3, -0.1, rand(GetAngleToPlayer+10,GetAngleToPlayer-10), 0.5);PlaySE(shot2se);
      	  	frame = 0;
		}	
	}
    }

    @DrawLoop {
        DrawGraphic(GetX, GetY);
    }

    @Finalize {
        DeleteGraphic(imgBoss);
    }

#include_function "script\lily\function_bullet.txt"

  //おたまじゃくし弾を撃つ関数（弾種類固定、ディレイなし）
  //X, Y, しっぽの数, 基準速度（あたまの速度）, 速度変化量, 角度, しっぽのゆらぎ
  function CreateShotSK2otama(_X, _Y, _TailNum, _BaseSpeed, _ChangeSpeed, _BaseDir, _ShakeDir)
  {
    CreateShot01(_X, _Y, _BaseSpeed, _BaseDir, AQUA02, 100);
    
    let _count = 1; //カウンタ
    
    loop(_TailNum)
    {
      let _speed = _BaseSpeed + _ChangeSpeed*_count;
      let _dir = _BaseDir + rand(-_ShakeDir, _ShakeDir);
      
      CreateShot01(_X, _Y, _speed, _dir, GREEN12, 100);
      
      _count ++;
    }
  }
}