#TouhouDanmakufu
#Title[YuyukoN4_H]
#Text[YuyukoN4_H]
#Player[FREE]
#ScriptVersion[2]
#BGM[.\mu\bgm.mp3]

script_enemy_main {
#include_function ".\Yuyukoinclude.txt";
let angle2 = 0;
let i = 0;
	@Initialize{
	InitializeAction;
	LoadMusic(bgm);
	PlayMusic(bgm);
	LoadSE(shot3);
	LoadSE(time1);
	LoadSE(teleport);
	LoadGraphic(imageFile);
	LoadSE(time2);
	LoadSE(wtf);
	shotinit;
	LoadSE(charge);
	SetAction(ACT_MOVE, 120);
	LoadSE(shot);
	LoadSE(laser);
	LoadSE(familiarspawn);
	LoadGraphic(imglifebar); 
	SetLife(6000);
	LoadSE(shot2);
	SetTimer(53);
	SetInvincibility(360);
	SetDamageRate(300, 55);
	SetMovePosition03(GetCenterX, GetClipMinY + 120, 10, 2);
	LoadGraphic(SP);
	LoadGraphic(MC);
	attack1;
	attack2;
	MagicCircle(false);
	SetShotAutoDeleteClip(30, 30, 30, 30);
	SetEnemyMarker(true);
	SetCommonData("lastattack", false);
	}

task Movement{
SetAction(ACT_MOVE, 10000000);
loop{
SetMovePosition02(GetCenterX+135*cos(angle), GetClipMinY+120+30*sin(angle), 30);
wait(1);
angle++;
}
}


task attack1 {
wait(180);
Movement;
loop{
PlaySE(shot);
ascent(i in -7..7){
CreateShotA(1, GetX, GetY, 10);
SetShotDataA(1, 0, 0.25, 90+(i*23), 0, 0, 0, PURPLE21);
SetShotDataA(1, 120, NULL, NULL, 0, 0.02, 2.5, PURPLE21);
FireShot(1);
}
wait(8);


}
}


task attack2{
wait(420);
loop{
PlaySE(shot3);
loop(20){
CreateShot01(GetX, GetY, 1.5, GetAngleToPlayer+angle2, GREEN02, 10);
angle2+=360/20;
}

wait(45);


}
}



}