#e
#Title[z剃S]
#Text[]
#BackGround[User(.\img\Sky.png,0,0)]
#BGM[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
	let csd		=GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss	=csd ~ "img\Boss\.png";
	let Back	=csd ~ "img\Sky.png";

	@Initialize {
        SetLife(1);
	SetScore(20000);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	LoadGraphic(Back);
	Load;
	Expert;
        CutIn(YOUMU,"uvYo[tv", NULL, 0, 0, 0, 0);
        Main;
	}

    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
        yield;
    }

	@DrawLoop {
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

	@BackGround {
	SetTexture(Back);
	SetGraphicRect(0, 0, 384, 457);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(224, 240);
	}

    task Main {
	yield;
	Att;
}

task Att{
	CreateEnemyFromScript("LYRICA", 224, -20, 0, 0, 0);
	CreateEnemyFromScript("LUNASA", 0, 100, 0, 0, 0);
	CreateEnemyFromScript("MERLIN", 448, 100, 0, 0, 0);
	CreateEnemyFromScript("LILY", -20, 160, 0, 0, 0);
	CreateEnemyFromScript("MEDICINE", 448, 60, 0, 0, 0);
	CreateEnemyFromScript("MOMIJI", 448, 0, 0, 0, 0);
	wait(620);
	AddLife(-1);	
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Sakuya.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy LYRICA{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_lyrica.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	standBy;
	Att;	
}

	sub standBy{
		SetMovePosition03(224, 120, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	shot;
	wait(420);
	SetAngle(270);
	SetSpeed(6);
	SetAction(ACT_MOVE_L, 240);
}

task shot{
	loop(15){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 3, angle, 0, 0, 0, 225);
	FireShot(1);
	angle+=15;	
	}
	wait(20);
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Sangetusei.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy LUNASA{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_lunasa.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	standBy;
	Att;	
}

	sub standBy{
		SetMovePosition03(184, 100, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	shot;
	wait(420);
	SetAngle(180);
	SetSpeed(6);
	SetAction(ACT_MOVE_L, 240);
}

task shot{
	let A=0;
	loop(15){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 3, angle+A, -0.3, 0, 1, 227);
	FireShot(1);
	angle+=30;	
	}
	A+=2;
	wait(20);
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Sangetusei.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy MERLIN{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_merlin.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	standBy;
	Att;	
}

	sub standBy{
		SetMovePosition03(264, 100, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	shot;
	wait(420);
	SetAngle(0);
	SetSpeed(6);
	SetAction(ACT_MOVE_R, 240);
}

task shot{
	let A=0;
	loop(15){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 3, angle+A, 0.3, 0, 1, 230);
	FireShot(1);
	angle+=30;
	}
	A+=2;
	wait(20);
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Sangetusei.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy LILY{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_lily.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task Main{
	yield;
	wait(280);
	Att;	
}

task Att{
	SetAngle(0);
	SetSpeed(2);
	SetAction(ACT_SHOT_A, 320);
	shotA;
	shotB;
}

task shotA{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX+60*sin(time), GetY+60*cos(time), 0);
	SetShotDataA(1, 0, 2, angle+time, -0.3, 0, 1, 241);
	FireShot(1);
	angle+=180;
	}
	time+=10;
	wait(4);
	}
	yield;
	}	
}

task shotB{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX+60*sin(time+180), GetY+60*cos(time+180), 0);
	SetShotDataA(1, 0, 2, angle-time, 0.3, 0, 1, 244);
	FireShot(1);
	angle+=180;
	}
	time+=10;
	wait(4);
	}
	yield;
	}	
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Lily.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy MEDICINE{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_medicine.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	wait(340);
	Att;	
}

task Att{
	SetAngle(180);
	SetSpeed(4);
	SetAction(ACT_MOVE_L, 240);
	shotA;
	shotB;
	shotC;
}

task shotA{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShot01(GetX+60*sin(time), GetY+60*cos(time), 3, angle+time, 12, 0);
	angle+=180;
	}
	time+=10;
	wait(4);
	}
	yield;
	}	
}

task shotB{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShot01(GetX+60*sin(time+120), GetY+60*cos(time+120), 2, angle-time, 14, 0);
	angle+=180;
	}
	time+=10;
	wait(4);
	}
	yield;
	}	
}

task shotC{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShot01(GetX+60*sin(time+240), GetY+60*cos(time+240), 1, -angle-time, 15, 0);
	angle+=60;
	}
	time+=10;
	wait(4);
	}
	yield;
	}	
}


	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Medicine.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy MOMIJI{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_momiji.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	wait(460);
	Att;	
}

task Att{
	SetAngle(150);
	SetSpeed(6);
	SetAction(ACT_MOVE_L, 240);
	shot;
}

task shot{
	loop(20){
	let angle=GetAngleToPlayer;
	CreateShot01(GetX, GetY, 8, angle, 30, 0);
	wait(5);
	}	
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Sangetusei.txt"
	#include_function ".\lib_Functions.txt"
}