#e
#Title[z剃X]
#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(55000);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	LoadGraphic(Back);
	Load;
	Expert;
        CutIn(YOUMU,"uI[iCgtB[o[v", 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);
	SetGraphicScale(1,1);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(224, 240);
	}

    task Main {
	yield;
	Att;
}

task Att{
	CreateEnemyFromScript("TENSHI", 246, -20, 0, 0, 0);
	CreateEnemyFromScript("IKU", 0, 120, 0, 0, 0);
	CreateEnemyFromScript("EIKI", 84, -20, 0, 0, 0);
	CreateEnemyFromScript("KOMACHI", 364, 500, 0, 0, 0);
	CreateEnemyFromScript("SUIKA", 0, 0, 0, 0, 0);
	CreateEnemyFromScript("YUUGI", 448, 0, 0, 0, 0);
	wait(550);
	AddLife(-1);	
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


script_enemy TENSHI{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_tenshi.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, 60, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	SetAction(ACT_SHOT_A, 120);
	shotA;
	shotB;
	shotC;
	shotD;
	shotE;
	wait(120);
	SetAngle(0);
	SetSpeed(7);
	SetAction(ACT_MOVE_R, 600);
}

task shotA{
	let A=0;
	loop(2){
	let angle=0;
	while(angle<360){
	CreateLaser01(GetX, GetY, 5, angle, 180, 10, RED01, 0);
	angle+=20;
	wait(3);
	}
	A+=5;
	}	
}

task shotB{
	let A=0;
	loop(1){
	let angle=0;
	while(angle<360){
	CreateLaser01(GetX, GetY, 5, -angle-A, 180, 10, GREEN01, 0);
	angle+=10;
	wait(3);
	}
	A+=2;
	}	
}

task shotC{
	let A=5;
	loop(3){
	let angle=0;
	while(angle<360){
	CreateLaser01(GetX, GetY, 5, angle+A, 180, 10, BLUE01, 0);
	angle+=40;
	wait(4);
	}
	A+=10;
	}	
}

task shotD{
	let A=0;
	loop(2){
	let angle=0;
	while(angle<360){
	CreateLaser01(GetX, GetY, 5, angle+A, 180, 10, AQUA01, 0);
	angle+=30;
	wait(5);
	}
	A+=8;
	}	
}

task shotE{
	let A=0;
	loop(6){
	let angle=0;
	while(angle<360){
	CreateLaser01(GetX, GetY, 5, angle+A, 180, 10, YELLOW01, 0);
	angle+=72;
	wait(4);
	}
	A+=10;
	}	
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


script_enemy IKU{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_iku.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(60);
	Att;	
}

task Att{
	SetAngle(0);
	SetSpeed(3);
	SetAction(ACT_MOVE_R, 600);
	shot;
}

task shot{
	let A=0;
	loop{
	let angle=0;
	while(angle<360){
	CreateLaser01(GetX, GetY, 4, angle, 180, 10, PURPLE01, 0);
	angle+=20;
	}
	A+=5;
	wait(20);
	yield;
	}	
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


script_enemy EIKI{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_eiki.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(120);
	standBy;
	Att;	
}
	sub standBy{
		SetMovePosition03(84, 240, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	SetAction(ACT_SHOT_A, 120);
	wait(30);
	shot;
	wait(120);
	SetAngle(-45);
	SetSpeed(7);
	SetAction(ACT_MOVE_R, 600);
}

task shot{
	loop(12){
	let A=GetAngleToPlayer;
	let angle=0;
	while(angle<360){
	CreateShot01(GetX, GetY, 4, angle+A, 164, 0);
	FireShot(1);
	angle+=72;
	}
	wait(10);
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


script_enemy KOMACHI{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_komachi.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(150);
	standBy;
	Att;	
}
	sub standBy{
		SetMovePosition03(364, 240, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	SetAction(ACT_SHOT_A, 120);
	shotA;
	shotB;
	wait(120);
	SetAngle(-135);
	SetSpeed(7);
	SetAction(ACT_MOVE_L, 600);
}

task shotA{
	let A=0;
	loop(12){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 3, angle, 0.7, 0, 3, 97);
	FireShot(1);
	angle+=30;
	}
	A+=10;
	wait(10);
	}
}

task shotB{
	let A=0;
	loop(12){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 3, angle, -0.7, 0, 3, 102);
	FireShot(1);
	angle+=30;
	}
	A+=10;
	wait(10);
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


script_enemy SUIKA{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_suika.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(300);
	standBy;
	Att;	
}

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

task Att{
	SetAction(ACT_SHOT_A, 120);
	shotA;
	shotB;
	wait(120);
	SetAngle(0);
	SetSpeed(7);
	SetAction(ACT_MOVE_R, 600);
}

task shotA{
	wait(10);
	let A=0;
	loop(6){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 4, angle+A, -1, 0, 3, 168);
	FireShot(1);
	angle+=45;
	}
	A+=5;
	wait(20);
	}
}

task shotB{
	let A=0;
	loop(12){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 4, angle+A, 0.8, 0, 3, 47);
	FireShot(1);
	angle+=15;
	}
	A+=2;
	wait(10);
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


script_enemy YUUGI{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_yuugi.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(300);
	standBy;
	Att;	
}

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

task Att{
	SetAction(ACT_SPELL, 120);
	shotA;
	shotB;
	wait(120);
	SetAngle(180);
	SetSpeed(7);
	SetAction(ACT_MOVE_L, 600);
}

task shotA{
	let A=0;
	loop(6){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 4, angle+A, 0.8, 0, 3, 170);
	FireShot(1);
	angle+=45;
	}
	A+=5;
	wait(20);
	}
}

task shotB{
	let A=0;
	loop(12){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 4, angle+A, -1, 0, 3, 42);
	FireShot(1);
	angle+=15;
	}
	A+=2;
	wait(10);
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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