let imgBIGCIRCLE = GetCurrentScriptDirectory~ "img\Circle_Hex.png";


sub boss_magic_circle
{
	effect_circle(imgBIGCIRCLE, 255, 255, 0, 0);
}

task effect_circle(graphic, c_alpha, c_red, c_green, c_blue)
{
	//初期設定
	let obj = Obj_Create(OBJ_EFFECT);
	ObjEffect_SetTexture(obj, graphic);
	ObjEffect_SetRenderState(obj, ADD);
	ObjEffect_SetLayer(obj, 2);
	ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
	ObjEffect_CreateVertex(obj, 4);
	ObjEffect_SetVertexUV(obj, 0,   0,   0);
	ObjEffect_SetVertexUV(obj, 1, 256,   0);
	ObjEffect_SetVertexUV(obj, 2, 256, 256);
	ObjEffect_SetVertexUV(obj, 3,   0, 256);
	ObjEffect_SetVertexXY(obj, 0,-75,-75);
	ObjEffect_SetVertexXY(obj, 1, 75,-75);
	ObjEffect_SetVertexXY(obj, 2, 75, 75);
	ObjEffect_SetVertexXY(obj, 3,-75, 75);
	ascent (let n in 0 .. 4)
	{
		ObjEffect_SetVertexColor(obj, n, c_alpha, c_red, c_green, c_blue);
	}

	
	//ずっとループのターン
	let t = 0;
	let angle = 0; let scale = 0;
	
	loop(20)
	{
		scale += 0.05;
		ObjEffect_SetScale(obj, scale, scale);
		Obj_SetPosition(obj, GetX, GetY);
		
		yield;
	}
	loop
	{
		ObjEffect_SetScale(obj, scale, scale);
		ObjEffect_SetAngle(obj, 0, 0, angle);
		Obj_SetPosition(obj, GetX, GetY);
		
		scale += sin(t)/60;
		angle -= 5;
		
		t+=3; angle %= 360;
		yield;
	}
	Obj_Delete(obj);
}

function wait(w){
		loop(w){ yield; }
	}

task watershot1(x,y,speed,speed2,angle,angle2,type,delay){
let obj1 = Obj_Create(OBJ_SHOT);
let i=0;
let j=0;
Obj_SetX(obj1, x);
Obj_SetY(obj1, y);
Obj_SetSpeed(obj1, speed);
Obj_SetAngle(obj1, angle);
Obj_SetAlpha(obj1, 255);
ObjShot_SetDelay(obj1, delay);
ObjShot_SetGraphic(obj1, type);
wait(10);
Obj_SetSpeed(obj1,0);
wait(60);
PlaySE(suzuSE);
Obj_SetAngle(obj1, angle2);
Obj_SetSpeed(obj1, speed2);
loop(90){
Obj_SetAngle(obj1, angle2+i);
i+=2;
wait(1);
}
i=0;
j=Obj_GetAngle(obj1);
loop(60){
Obj_SetAngle(obj1,j-i);
i+=1;
wait(1);
}
}

task watershot2(x,y,speed,speed2,angle,angle2,type,delay){
let obj6 = Obj_Create(OBJ_SHOT);
let i=0;
let j=0;
Obj_SetX(obj6, x);
Obj_SetY(obj6, y);
Obj_SetSpeed(obj6, speed);
Obj_SetAngle(obj6, angle);
Obj_SetAlpha(obj6, 255);
ObjShot_SetDelay(obj6, delay);
ObjShot_SetGraphic(obj6, type);
wait(10);
Obj_SetSpeed(obj6,0);
wait(60);
PlaySE(suzuSE);
Obj_SetAngle(obj6, angle2);
Obj_SetSpeed(obj6, speed2);
loop(90){
Obj_SetAngle(obj6, angle2-i);
i+=2;
wait(1);
}
i=0;
j=Obj_GetAngle(obj6);
loop(60){
Obj_SetAngle(obj6,j+i);
i+=1;
wait(1);
}
}

task watershot3(x,y,speed,speed2,angle,angle2,type,delay){
let obj1 = Obj_Create(OBJ_SHOT);
let i=0;
let j=0;
Obj_SetX(obj1, x);
Obj_SetY(obj1, y);
Obj_SetSpeed(obj1, speed);
Obj_SetAngle(obj1, angle);
Obj_SetAlpha(obj1, 150);
ObjShot_SetDelay(obj1, delay);
ObjShot_SetGraphic(obj1, type);
wait(10);
Obj_SetSpeed(obj1,0);
wait(60);
PlaySE(suzuSE);
Obj_SetAngle(obj1, angle2);
Obj_SetSpeed(obj1, speed2);
loop(90){
Obj_SetAngle(obj1, angle2+i);
i+=2;
wait(1);
}
i=0;
j=Obj_GetAngle(obj1);
loop(60){
Obj_SetAngle(obj1,j-i);
i+=1;
wait(1);
}
}

task watershot4(x,y,speed,speed2,angle,angle2,type,delay){
let obj6 = Obj_Create(OBJ_SHOT);
let i=0;
let j=0;
Obj_SetX(obj6, x);
Obj_SetY(obj6, y);
Obj_SetSpeed(obj6, speed);
Obj_SetAngle(obj6, angle);
Obj_SetAlpha(obj6, 150);
ObjShot_SetDelay(obj6, delay);
ObjShot_SetGraphic(obj6, type);
wait(10);
Obj_SetSpeed(obj6,0);
wait(60);
PlaySE(suzuSE);
Obj_SetAngle(obj6, angle2);
Obj_SetSpeed(obj6, speed2);
loop(90){
Obj_SetAngle(obj6, angle2-i);
i+=2;
wait(1);
}
i=0;
j=Obj_GetAngle(obj6);
loop(60){
Obj_SetAngle(obj6,j+i);
i+=1;
wait(1);
}
}

task watershot5(x,y,speed,speed2,angle,angle2,type,delay){
let obj1 = Obj_Create(OBJ_SHOT);
let i=0;
let j=0;
Obj_SetX(obj1, x);
Obj_SetY(obj1, y);
Obj_SetSpeed(obj1, speed);
Obj_SetAngle(obj1, angle);
Obj_SetAlpha(obj1, 150);
ObjShot_SetDelay(obj1, delay);
ObjShot_SetGraphic(obj1, type);
wait(10);
Obj_SetSpeed(obj1,0);
wait(60);
PlaySE(suzuSE);
Obj_SetAngle(obj1, angle2);
Obj_SetSpeed(obj1, speed2);
loop(90){
Obj_SetAngle(obj1, angle2+i);
i+=2;
wait(1);
}
i=0;
j=Obj_GetAngle(obj1);
loop(120){
Obj_SetAngle(obj1,j-i);
i+=1;
wait(1);
}
}

task watershot6(x,y,speed,speed2,angle,angle2,type,delay){
let obj6 = Obj_Create(OBJ_SHOT);
let i=0;
let j=0;
Obj_SetX(obj6, x);
Obj_SetY(obj6, y);
Obj_SetSpeed(obj6, speed);
Obj_SetAngle(obj6, angle);
Obj_SetAlpha(obj6, 150);
ObjShot_SetDelay(obj6, delay);
ObjShot_SetGraphic(obj6, type);
wait(10);
Obj_SetSpeed(obj6,0);
wait(60);
PlaySE(suzuSE);
Obj_SetAngle(obj6, angle2);
Obj_SetSpeed(obj6, speed2);
loop(90){
Obj_SetAngle(obj6, angle2-i);
i+=2;
wait(1);
}
i=0;
j=Obj_GetAngle(obj6);
loop(120){
Obj_SetAngle(obj6,j+i);
i+=1;
wait(1);
}
}

task watershot7(x,y,speed,speed2,angle,angle2,type,delay){
let obj1 = Obj_Create(OBJ_SHOT);
let i=0;
let j=0;
Obj_SetX(obj1, x);
Obj_SetY(obj1, y);
Obj_SetSpeed(obj1, speed);
Obj_SetAngle(obj1, angle);
Obj_SetAlpha(obj1, 100);
ObjShot_SetDelay(obj1, delay);
ObjShot_SetGraphic(obj1, type);
wait(10);
Obj_SetSpeed(obj1,0);
wait(60);
PlaySE(suzuSE);
Obj_SetAngle(obj1, angle2);
Obj_SetSpeed(obj1, speed2);
loop(90){
Obj_SetAngle(obj1, angle2+i);
i+=2;
wait(1);
}
i=0;
j=Obj_GetAngle(obj1);
loop(120){
Obj_SetAngle(obj1,j-i);
i+=1;
wait(1);
}
}

task watershot8(x,y,speed,speed2,angle,angle2,type,delay){
let obj6 = Obj_Create(OBJ_SHOT);
let i=0;
let j=0;
Obj_SetX(obj6, x);
Obj_SetY(obj6, y);
Obj_SetSpeed(obj6, speed);
Obj_SetAngle(obj6, angle);
Obj_SetAlpha(obj6, 100);
ObjShot_SetDelay(obj6, delay);
ObjShot_SetGraphic(obj6, type);
wait(10);
Obj_SetSpeed(obj6,0);
wait(60);
PlaySE(suzuSE);
Obj_SetAngle(obj6, angle2);
Obj_SetSpeed(obj6, speed2);
loop(90){
Obj_SetAngle(obj6, angle2-i);
i+=2;
wait(1);
}
i=0;
j=Obj_GetAngle(obj6);
loop(120){
Obj_SetAngle(obj6,j+i);
i+=1;
wait(1);
}
}

task watershot9(x,y,speed,speed2,angle,angle2,type,delay){
let obj1 = Obj_Create(OBJ_SHOT);
let i=0;
let j=0;
Obj_SetX(obj1, x);
Obj_SetY(obj1, y);
Obj_SetSpeed(obj1, speed);
Obj_SetAngle(obj1, angle);
Obj_SetAlpha(obj1, 100);
ObjShot_SetDelay(obj1, delay);
ObjShot_SetGraphic(obj1, type);
wait(10);
Obj_SetSpeed(obj1,0);
wait(30);
PlaySE(suzuSE);
Obj_SetAngle(obj1, angle2);
Obj_SetSpeed(obj1, speed2);
loop(120){
Obj_SetAngle(obj1, angle2+i);
i+=2;
wait(1);
}
i=0;
j=Obj_GetAngle(obj1);
loop(150){
Obj_SetAngle(obj1,j-i);
i+=1;
wait(1);
}
}

task watershot10(x,y,speed,speed2,angle,angle2,type,delay){
let obj1 = Obj_Create(OBJ_SHOT);
let i=0;
let j=0;
Obj_SetX(obj1, x);
Obj_SetY(obj1, y);
Obj_SetSpeed(obj1, speed);
Obj_SetAngle(obj1, angle);
Obj_SetAlpha(obj1, 100);
ObjShot_SetDelay(obj1, delay);
ObjShot_SetGraphic(obj1, type);
wait(10);
Obj_SetSpeed(obj1,0);
wait(30);
PlaySE(suzuSE);
Obj_SetAngle(obj1, angle2);
Obj_SetSpeed(obj1, speed2);
loop(120){
Obj_SetAngle(obj1, angle2-i);
i+=2;
wait(1);
}
i=0;
j=Obj_GetAngle(obj1);
loop(150){
Obj_SetAngle(obj1,j+i);
i+=1;
wait(1);
}
}
#include_function ".\変数集.txt"