#東方弾幕風
#Title[禁弾「カタディオブクライシス」]
#Text[]
#Image[]
#BackGround[]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
#include_function ".\フランドール.txt"

	let name    = "禁弾「カタディオブクライシス」";

	//初期位置
	let xini    =GetCenterX;
	let yini    =GetCenterY;

	@Initialize{
	CutIn(YOUMU,name,"",0,0,0,0);
	SetX(GetCenterX);
	SetY(GetClipMinY + 120);
	SetLife(1000);
	SetTimer(100);
	SetScore(5000000);
	SetDamageRate(25,0);
	SetInvincibility(100);

	LoadGraphic(imgboss);
	SetTexture(imgboss);
	SetGraphicRect(0,0,127,127);
	CatadyOfTrickShot(100,3,130,70,5,600);
	CatadyOfTrickShot(200,3,270,0,1,600);
	CatadyOfTrickShot(300,3,270,0,1,600);
	CatadyOfTrickShot(400,3,270,0,1,600);
	CatadyOfTrickShot(500,3,270,0,1,600);
	Shot(12);
	Move();
	}

	@MainLoop{
	if(OnBomb() == false){
	SetCollisionA(GetX,GetY,24);
	SetCollisionB(GetX,GetY,24);}
	//EX風ボムバリア
	if(OnBomb() == true){SetInvincibility(1);}
	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	DeleteGraphic(imgboss);
	}

	task Move(){
	loop{
	loop(150){yield;}
	SetMovePosition02(GetClipMinX,GetClipMinY + 120,30);
	loop(50){yield;}
	SetMovePosition02(GetClipMaxX,GetClipMinY + 120,300);
	loop(300){yield;}
	SetMovePosition02(GetCenterX,GetClipMinY + 120,50);
	loop(100){yield;}
	}
	}

	task Shot(way){
	let x = GetX;
	let ay = GetY + 50;
	let by = GetY - 50;
	let angle = 90;
	let addangle;
	loop{
	loop(100){yield;}
	loop(5){
	addangle = 360 / way;
	x = GetX;
	ay = GetY + 50;
	by = GetY - 50;
	loop(way){
	CreateShot01(x,ay,2,angle,BLUE31,0);
	CreateShot01(x,by,2,angle,BLUE31,0);
	angle += addangle;
	}
	angle += 3;
	}
	loop(75){yield;}
	angle = 90;
	}
	}
}