#e
#Title[֖uS󂵂̔v]
#Text[]
#Image[]
#BackGround[]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
#include_function ".\th[.txt"


	let name    = "֖uS󂵂̔v";

	//ʒu
	let xini    =GetCenterX;
	let yini    =GetCenterY;

	@Initialize{
	CutIn(YOUMU,name,"",0,0,0,0);
	SetX(xini);
	SetY(yini);
	SetLife(1);
	SetTimer(69);
	SetScore(500000);
	SetDamageRate(0,0);
	SetDurableSpellCard();

	LoadGraphic(imgboss);
	SetTexture(imgboss);
	SetGraphicRect(0,0,127,127);
	Shot();
	}

	@MainLoop{
	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	DeleteGraphic(imgboss);
	CreateItem(ITEM_BOMB,GetX,GetY);
	loop(30){
	let x = rand(GetX-32,GetX+32);
	let y = rand(GetY-32,GetY+32);
	CreateItem(ITEM_SCORE,x,y);}
	}


	task GateA(){
	let x;
	let x1 = GetClipMinX;
	let x2 = GetClipMaxX;
	let x3;
	let x4;
	let y = GetClipMinY;
	let angle = 90;
	loop(100){yield;}
	x3 = 179;
	loop{
	x4 = x3 + 90;
	x = x1;
	while(x < x3){
	CreateShot01(x,y,2,angle,BLUE31,10);
	x += 8;
	}
	x = x4;
	while(x < x2){
	CreateShot01(x,y,2,angle,BLUE31,10);
	x += 8;
	}
	loop(300){yield;}
	x3 -= 10;
	}
	}

	task GateB(){
	let x;
	let x1 = GetClipMinX;
	let x2 = GetClipMaxX;
	let x3;
	let x4;
	let y = GetClipMaxY;
	let angle = -90;
	loop(250){yield;}
	x3 = GetClipMaxX - 100;
	loop{
	x4 = x3 + 90;
	x = x1;
	while(x < x3){
	CreateShot01(x,y,2,angle,BLUE31,10);
	x += 8;
	}
	x = x4;
	while(x < x2){
	CreateShot01(x,y,2,angle,BLUE31,10);
	x += 8;
	}
	loop(300){yield;}
	x3 -= 10;
	}
	}

	task GateC(){
	let y;
	let y1 = GetClipMinY;
	let y2 = GetClipMaxY;
	let y3;
	let y4;
	let x = GetClipMinX;
	let angle = 0;
	loop(175){yield;}
	y3 = 280;
	loop{
	y4 = y3 + 90;
	y = y1;
	while(y < y3){
	CreateShot01(x,y,2,angle,BLUE31,10);
	y += 8;
	}
	y = y4;
	while(y < y2){
	CreateShot01(x,y,2,angle,BLUE31,10);
	y += 8;
	}
	loop(300){yield;}
	y3 -= 6.357;
	}
	}

	task GateD(){
	let y;
	let y1 = GetClipMinY;
	let y2 = GetClipMaxY;
	let y3;
	let y4;
	let x = GetClipMaxX;
	let angle = 180;
	loop(325){yield;}
	y3 = GetClipMinY + 104;
	loop{
	y4 = y3 + 90;
	y = y1;
	while(y < y3){
	CreateShot01(x,y,2,angle,BLUE31,10);
	y += 8;
	}
	y = y4;
	while(y < y2){
	CreateShot01(x,y,2,angle,BLUE31,10);
	y += 8;
	}
	loop(300){yield;}
	y3 += 12;
	}
	}

	task Shot(){
	let angle = 0;
	let angleA = 0;
	let time = GetTimer;
	GateA();
	GateB();
	GateC();
	GateD();
	loop(200){yield;}
	loop{
	Allshot(0.3,angle,16,RED21,10);
	loop(30){
	loop(20){time = GetTimer;
	yield;}
	if(time <= 60){CreateShot01(GetX+120,GetClipMinY,1,angleA,GREEN04,10);}
	if(time <= 50){CreateShot01(GetX-120,GetClipMaxY,1,180+angleA,GREEN04,10);}
	if(time <= 40){CreateShot01(GetClipMinX,GetY+120,1,-90+angleA,GREEN04,10);}
	if(time <= 30){CreateShot01(GetClipMaxX,GetY-120,1,90+angleA,GREEN04,10);}
	if(time <= 15){
	CreateShot01(GetX+120,GetClipMinY,1,-angleA,BLUE04,10);
	CreateShot01(GetX-120,GetClipMaxY,1,180-angleA,BLUE04,10);
	CreateShot01(GetClipMinX,GetY+120,1,-90-angleA,BLUE04,10);
	CreateShot01(GetClipMaxX,GetY-120,1,90-angleA,BLUE04,10);}
	angleA+= 18;
	}
	angleA = 0;
	angle += 5;
	}
	}
}