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

script_enemy_main {
#include_function ".\Yuyukoinclude.txt";

	@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(45);
	SetInvincibility(260);
	SetDamageRate(125, 55);
	SetMovePosition03(GetCenterX, GetClipMinY + 120, 10, 2);
	LoadGraphic(SP);
	LoadGraphic(MC);
	attack1;
	MagicCircle(false);
	SetShotAutoDeleteClip(10, 10, 10, 10);
	SetEnemyMarker(true);
	SetCommonData("lastattack", false);
	}

task attack1 {
CreateEnemyFromScript("Youmu", GetX, GetY+100, 0, 0, 0);
let angle = 45/2;
let angle2 = 20;
let angle3 = 0;
let sine = 0;
let b = 20;
let a = -5;

wait(120);
SetAction(ACT_SHOT_B, 4480);
loop{

PlaySE(shot4);
loop(6){
CreateShot02(GetX, GetY, 6, angle, -0.3, 1.5, PURPLE22, 10);
CreateShot02(GetX, GetY, 6, -angle, -0.3, 1.5, PURPLE22, 10);
angle+=360/6;
}
angle+=11.554654;
wait(10);


}
}
}


script_enemy Youmu{
	
	
	
	#include_function ".\Youmuinclude.txt"


	@Initialize {
	InitializeAction;
	SetAction(ACT_MOVE, 120);
	SetX(GetCommonDataDefault("YoumuX", (GetCenterX+GetClipMinX)/2));
	SetY(GetCommonDataDefault("YoumuY", GetClipMinY+160));
	SetMovePosition02((GetCenterX+GetClipMinX)/2, GetClipMinY + 120, 60);
	LoadSE(shot);
	LoadSE(shot2);
	LoadSE(slash);
	LoadSE(shot3);
	LoadGraphic(imageFile);
	LoadGraphic(Cut);
	SetLife(150000);
	SetInvincibility(240);
	SetDamageRateEx(35, 25, 175, 10);
	attack1;
	}

	task attack1 {
	wait(140);
	loop{
	SetAction(ACT_CHARGE, 120);
	//PlaySE(charge);
	Concentration01(90);
	wait(120);
	
	SetMovePosition02((GetCenterX+GetClipMaxX)/2, GetClipMinY + 160+rand(-10, 50), 8);
	PlaySE(slash);
	loop(9){
	DeleteEnemyShotImmediatelyInCircle(ALL, GetX, GetY, 22);
	loop(15){
	ascent(i in 0..5){
	CreateShot01(GetX, GetY, 3-(i/3), GetAngleToPlayer+angle, BLUE21, 20);
	}
	angle+=360/15;
	}
	
	wait(1);
	}
	
	SetAction(ACT_SLASH_H, 120);
	wait(150);
	SetAction(ACT_CHARGE, 120);
	//PlaySE(charge);
	Concentration01(90);
	wait(120);
	
	SetMovePosition02((GetCenterX+GetClipMinX)/2, GetClipMinY + 160+rand(-10, 50), 8);
	PlaySE(slash);
	loop(9){
	DeleteEnemyShotImmediatelyInCircle(ALL, GetX, GetY, 22);
	loop(20){
	ascent(i in 0..6){
	CreateShot01(GetX, GetY, 3-(i/3), GetAngleToPlayer+angle+(360/20/2), RED21, 20);
	}
	angle+=360/15;
	}
	
	wait(1);
	}
	PlaySE(slash);
	SetAction(ACT_SLASH_H, 120);
	wait(150);
	}
}

	

}

