#e
#Title[z剃R]
#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(15000);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	LoadGraphic(Back);
	Load;
	Expert;
        CutIn(YOUMU,"uyv", 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("PALUSY", 416, -20, 0, 0, 0);
	CreateEnemyFromScript("YAMAME", 0, -20, 0, 0, 0);
	CreateEnemyFromScript("KISUME", 224, -20, 0, 0, 0);
	CreateEnemyFromScript("SIZUHA", 64, -20, 0, 0, 0);
	CreateEnemyFromScript("MINORIKO", 384, -20, 0, 0, 0);
	wait(540);
	AddLife(-1);	
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


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

task Att{
	SetAction(ACT_SPELL, 300);
	loop(25){
	shot(100, 0);
	wait(5);
	shot(348, 0);
	wait(5);
	}
	SetAngle(180);
	SetSpeed(7);
	SetAction(ACT_MOVE_L, 360);
}

task shot(let x, let y){
	CreateShot01(x, y, 6, 90+rand(-7, 7), 4+164, 0);
	CreateShot01(x, y, 7, 90+rand(-7, 7), 4+24, 0);
	CreateShot01(x, y, 7, 90+rand(-7, 7), 4+24, 0);
	CreateShot01(x, y, 6, 90+rand(-7, 7), 4+24, 0);
	CreateShot01(x, y, 6, 90+rand(-7, 7), 4+24, 0);
	CreateShot01(x, y, 5, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 5, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 4, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 4, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 2, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 2, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 6, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 6, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 3, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 3, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 5, 90+rand(-7, 7), 4+24, 0);
	CreateShot01(x, y, 5, 90+rand(-7, 7), 4+24, 0);
	CreateShot01(x, y, 4, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 4, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 2, 90+rand(-7, 7), 4+8, 0);
	CreateShot01(x, y, 2, 90+rand(-7, 7), 4+8, 0);
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


script_enemy YAMAME{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_yamame.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{
	loop(4){
	let angle=GetAngleToPlayer;
	shot(angle);
	wait(30);
	}
	SetMovePosition03(224, -20, 10, 7);
	SetAction(ACT_MOVE, 60);
	wait(120);
	SetMovePosition03(GetPlayerX, 60, 10, 7);
	SetAction(ACT_MOVE, 60);
	wait(120);
	SetAngle(0);
	SetSpeed(7);
	SetAction(ACT_MOVE_R, 360);	
}

task shot(let A){
	loop(5){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 4, angle+A, 0.5, 0, 1, 14);
	SetShotDataA(1, 30, 1, NULL, 0.2, 0, 1, 11);
	FireShot(1);
	angle+=20;	
	}
	A+=4;
	wait(3);
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


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

task Move{
	loop{
	let angle=0;
	while(angle<360){
	SetGraphicAngle(0, 0, 30*sin(angle));
	wait(1);
	angle+=3;
	}
	yield;
	}
}

task Att{
	SetMovePosition03(GetPlayerX, 60, 10, 7);
	wait(80);
	SetAngle(90);
	SetSpeed(6);
	shot;
}

task shot{
	loop{
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 2, angle, 0.3, 0, 1, 9);
	FireShot(1);
	angle+=30;	
	}
	wait(30);
	yield;
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


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

task Att{
	SetAngle(90);
	SetSpeed(6);
	SetAction(ACT_MOVE_L, 360);
	shot;
}

task shot{
	loop{
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 2, angle, 0.3, 0, 1, 9);
	FireShot(1);
	angle+=10;	
	}
	wait(10);
	yield;
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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


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

task Att{
	SetAngle(90);
	SetSpeed(6);
	SetAction(ACT_MOVE_R, 360);
	shot;
}

task shot{
	loop{
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, 2, angle, -0.3, 0, 1, 11);
	FireShot(1);
	angle+=10;	
	}
	wait(10);
	yield;
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

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