let point = 0;
let Remi = false;

task maple(type){
	if(type==2){
		PlaySound("Charge2",95,0);
		TCharge02(GetEnemyX,GetEnemyY,3,60,128,92,255);
		ascent(i in 0..20){
		loop(3){
		etama(50+i*10+rand(0,100),i,1);
		}
		yield;
		}
	}
	if(type==1){
		PlaySound("Charge1",95,0);
		TCharge02(GetEnemyX,GetEnemyY,3,120,128,92,255);
		ascent(i in 0..40){
		loop(4){
		etama(i*4+rand(0,100),i,1);
		}
		yield;
		}
	}
	if(type==3){
		PlaySound("Charge3",95,0);
		TCharge01(GetEnemyX,GetEnemyY,3,90,128,92,255);
		ascent(i in 0..40){
		loop(6){
		etama(i*4+rand(0,100),i,1);
		}
		yield;
		}
	}
	}

task etama(r,a,type){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/eff2.png";
	let dir = rand(0,359);
	let angle = rand(0,359);
	let size = 1.5+a/20;
	let s = size;
	let ra = r;
	let c = 0;
	let m = -10;
	let cp = rand(-7,7);
	let alpha = 0;
	let alphaplus = 255/ra;
	ObjPrim_SetTexture(obj,img);
	if(type==1){ObjSprite2D_SetSourceRect(obj,32,226,64,254);}
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetScaleXYZ(obj,size,size,size);
	ObjRender_SetBlendType(obj,BLEND_ALPHA);
	ObjRender_SetAlpha(obj,0);
	while(r>0){
	ObjRender_SetPosition(obj,GetEnemyX+r*cos(dir),GetEnemyY+r*sin(dir),0);
	ObjRender_SetAngleXYZ(obj,0,0,angle+c);
	ObjRender_SetScaleXYZ(obj,size,size,size);
	ObjRender_SetAlpha(obj,alpha*3);
	if(r>ra/2){alpha += alphaplus+1.5;}
	else{alpha -= alphaplus;}
	c+= cp;
	r -= (6-a/10)-m/10;
	size -= s/ra*3;
	yield;
	}
	Obj_Delete(obj);
	
}

task manageSprite{
		let f = 0;
		let px = 64;
		let py = 64;
		while(f<=36 && idle == true){
		if(f<8){ObjSprite2D_SetSourceRect(objBoss, 0, py, px, py*2);}
		if(f>=8 && f<16){ObjSprite2D_SetSourceRect(objBoss, px, py, px*2, py*2);}
		if(f>=16 && f<24){ObjSprite2D_SetSourceRect(objBoss, px*2, py, px*3, py*2);}
		if(f>=24 && f<32){ObjSprite2D_SetSourceRect(objBoss, px*3, py, px*4, py*2);}
		f++;
		yield;
		}
		while(ObjMove_GetSpeed(objBoss) > 1.5){
		yield;
		}
		while(f>=0  && idle == true){
		if(f<8){ObjSprite2D_SetSourceRect(objBoss, 0, py, px, py*2);}
		if(f>=8 && f<16){ObjSprite2D_SetSourceRect(objBoss, px, py, px*2, py*2);}
		if(f>=16 && f<24){ObjSprite2D_SetSourceRect(objBoss, px*2, py, px*3, py*2);}
		if(f>=24 && f<32){ObjSprite2D_SetSourceRect(objBoss, px*3, py, px*4, py*2);}
		f-= 1.5;
		yield;
		}
	}

task attack(time){
	let f = 0;
	idle = false;
	let px = 64;
	let py = 64;
	let by = 0;
	while(f<32){
	ObjRender_SetAngleY(objBoss,0);
	if(f<12){ObjSprite2D_SetSourceRect(objBoss, 0, py*2, px, py*3+32);}
	if(f>=12 && f<24){ObjSprite2D_SetSourceRect(objBoss, px, py*2, px*2, py*3+32);}
	if(f>=24 && f<32){ObjSprite2D_SetSourceRect(objBoss, px*2, py*2, px*3, py*3+32);}
	f+= 1;
	yield;
	}
	wait(time-32);
	while(f>0){
	ObjRender_SetAngleY(objBoss,0);
	if(f<12){ObjSprite2D_SetSourceRect(objBoss, 0, py*2,px, py*3+32);}
	if(f>=12 && f<24){ObjSprite2D_SetSourceRect(objBoss, px, py*2, px*2, py*3+32);}
	if(f>=24 && f<32){ObjSprite2D_SetSourceRect(objBoss, px*2, py*2, px*3, py*3+32);}
	f-= 1;
	yield;
	}
	idle = true;
	}
	
task magiccircle(boss,size,type){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/eff.png";
	let spin = 0;
	let s = 0;
	//////////////////////////////////
	LoadTexture(img);
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,128,80,128*2,80+128);
	ObjSprite2D_SetDestCenter(obj);
	while(!Obj_IsDeleted(boss) && Remi == false){
	spin += 2;
	let timer = ObjEnemyBossScene_GetInfo(objScene, INFO_TIMERF);
	if(type==true){
	ObjRender_SetAngleXYZ(obj,0,0,-spin*2);
	ObjRender_SetPosition(obj,ObjMove_GetX(boss),ObjMove_GetY(boss),0);
	ObjRender_SetScaleXYZ(obj,size+0.15*sin(spin),size+0.15*sin(spin),0);
	ObjRender_SetColor(obj,232+32*sin(spin+180),232+32*sin(spin+180),232+32*sin(spin+180));
	}
	ObjMove_SetPosition(obj,GetEnemyX,GetEnemyY);
	yield;
	}
	descent(i in 0..60){
	ObjRender_SetColor(obj,i*4,i*4,i*4);
	yield;
	}
	Obj_Delete(obj);
	}


task magiccircle2(boss,size,type){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/Mg2.png";
	let spin = 0;
	let s = 0;
	//////////////////////////////////
	LoadTexture(img);
	ObjPrim_SetTexture(obj,img);
	//ObjSprite2D_SetSourceRect(obj,128,80,128*2,80+128);
	ObjSprite2D_SetSourceRect(obj,0,0,256,256);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	while(!Obj_IsDeleted(boss)){
	if(size>=1.75){size-= 0.1;}
	spin += 2;
	if(type==true){
	ObjRender_SetAngleXYZ(obj,0,0,-spin*2);
	ObjRender_SetPosition(obj,ObjMove_GetX(boss),ObjMove_GetY(boss),0);
	ObjRender_SetScaleXYZ(obj,size*0.75+0.1*sin(spin),size*0.75+0.1*sin(spin),0);
	ObjRender_SetColor(obj,192+64*sin(spin+180),192+64*sin(spin+180),192+64*sin(spin+180));
	}
	ObjMove_SetPosition(obj,GetEnemyX,GetEnemyY);
	yield;
	}
	Obj_Delete(obj);
	}

task Cutin(name,text,textwidth){
	let alpha=0;
	let scale=4;
	let yscale=1;
	let py = 0;
	let acc = 0;
	let acc2 = 0;
	let objTxt=ObjText_Create;
	ObjText_SetText(objTxt,text);
	ObjText_SetFontSize(objTxt,textwidth);
	ObjText_SetFontColorTop(objTxt,255,255,255);
	ObjText_SetFontColorBottom(objTxt,255,0,0);
	ObjText_SetFontBorderType(objTxt,BORDER_FULL);
	ObjText_SetFontBorderColor(objTxt,255,0,0);
	ObjText_SetFontBorderWidth(objTxt,1);
	ObjText_SetHorizontalAlignment(objTxt,ALIGNMENT_RIGHT);
	ObjText_SetMaxWidth(objTxt,380);
	Obj_SetRenderPriority(objTxt,0.8);
	ObjRender_SetPosition(objTxt,-300,300,0);
	ObjText_SetAutoTransCenter(objTxt,true);
	
	/*let scoreTxt=ObjText_Create;
	ObjText_SetText(scoreTxt,Bonus:);
	ObjText_SetFontSize(scoreTxt,100);
	ObjText_SetFontColorTop(scoreTxt,255,255,255);
	ObjText_SetFontColorBottom(scoreTxt,255,128,128);
	ObjText_SetFontBorderType(scoreTxt,BORDER_FULL);
	ObjText_SetFontBorderColor(scoreTxt,200,0,0);
	ObjText_SetFontBorderWidth(scoreTxt,1);
	ObjText_SetHorizontalAlignment(scoreTxt,ALIGNMENT_RIGHT);
	ObjText_SetMaxWidth(scoreTxt,380);
	Obj_SetRenderPriority(scoreTxt,0.8);
	ObjRender_SetPosition(scoreTxt,-10,300,0);
	ObjText_SetAutoTransCenter(scoreTxt,true);*/

	let path;
	if(name=="Medi"){path=GCSD~"img/cut.png";}
	let cut=ObjPrim_Create(OBJ_SPRITE_2D);
	ObjPrim_SetTexture(cut,path);
  	if(name=="Medi"){ObjSprite2D_SetSourceRect(cut,0,0,391,448);}
	ObjRender_SetScaleXYZ(cut,0.9,0.9,0.9);
  	ObjSprite2D_SetDestCenter(cut);
	ObjRender_SetPosition(cut,416,120,0);
	Obj_SetRenderPriority(cut,0.50);

	TScale;
	TCut;
	TScore;
	task TScore{
	}
		
	task TScale{
	ascent(i in 0..30){
	ObjRender_SetAlpha(objTxt,i*12);
	ObjRender_SetScaleXYZ(objTxt,scale,scale,1);
	ObjRender_SetPosition(objTxt,-310+i*10,300,0);
	scale -= 0.1;
	yield;
	}
	loop(57){
	ObjRender_SetPosition(objTxt,-20,300+py,0);
	py += acc;
	acc += 0.1;
	yield;
	}
	ObjRender_SetPosition(objTxt,0,-240,0);
	loop(40){
	ObjRender_SetPosition(objTxt,-20,-240+py,0);
	py += acc;
	acc -= 0.15;
	yield;
	}
	while(!Obj_IsDeleted(objBoss)){yield;}
		loop(20){
			alpha-=12.75;
			yscale+=0.05;
			ObjRender_SetAlpha(objTxt,alpha);
			ObjRender_SetScaleXYZ(objTxt,yscale,yscale,1);
			yield;
		}
		Obj_Delete(objTxt);
	}

	task TCut{
		
		let speed=1;
		ObjRender_SetAlpha(cut,0);
		descent(i in 10..60){
			ObjRender_SetX(cut,ObjRender_GetX(cut)-speed*5.5);
			ObjRender_SetY(cut,ObjRender_GetY(cut)+speed*3);
			ObjRender_SetAlpha(cut,255-i*255/70+60);
			speed=i/55;
			yield;
			}
		loop(60){
		ObjRender_SetX(cut,ObjRender_GetX(cut)-speed*5); 
		ObjRender_SetY(cut,ObjRender_GetY(cut)+speed*3); 
		speed = 10/65;
		yield;
		}
		ascent(i in 10..60){
			ObjRender_SetX(cut,ObjRender_GetX(cut)-speed*5);
			ObjRender_SetY(cut,ObjRender_GetY(cut)+speed*3);
			ObjRender_SetAlpha(cut,255-i*255/60);
			speed=i/55;
			yield;
			}
		Obj_Delete(cut);
		}
}

task White{
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/white.png";
	let c = 255;
	PlaySound("Stime",100,0);
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,0,0,480,480);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetPosition(obj,stgx,stgx,0);
	ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	ObjRender_SetScaleXYZ(obj,2,2,0);
	ObjRender_SetColor(obj,c,c,c);
	while(c>0){
	ObjRender_SetColor(obj,c,c,c);
	c-= 10;
	yield;
	}
	Obj_Delete(obj);
	}


function TCharge01(x,y,size,frame,r,g,b){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/charge.png";
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,0,0,128,128);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetPosition(obj,x,y,0);
	ObjRender_SetAlpha(obj,0);
	ObjRender_SetScaleXYZ(obj,size,size,0);
	ObjRender_SetColor(obj,r,g,b);
	TAlpha;
	TShrink;
	return obj;
	task TAlpha{
		let l=10;
		let alpha=255/l;
		loop(l){
			ObjRender_SetAlpha(obj,alpha);
			alpha+=255/(l*2);
			yield;
			}
		}
	task TShrink{
		let l=frame;
		let a = size*2/l/l;
		ascent(i in 0..l){
			ObjRender_SetScaleXYZ(obj,size,size,0);
			ObjRender_SetPosition(obj,ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),0);
			size = size-i*a;
			yield;
			}
		Obj_Delete(obj);
		
	}
}

function TCharge02(x,y,size,frame,r,g,b){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/charge.png";
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,0,0,128,128);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetPosition(obj,x,y,0);
	ObjRender_SetAlpha(obj,0);
	ObjRender_SetScaleXYZ(obj,size,size,0);
	ObjRender_SetColor(obj,r,g,b);
	TAlpha;
	TShrink;
	return obj;
	task TAlpha{
		let l=10;
		let alpha=255/l;
		loop(l){
			ObjRender_SetAlpha(obj,alpha);
			alpha+=255/(l*2);
			yield;
			}
		}
	task TShrink{
			let a = size/frame;
			loop(frame){
			ObjRender_SetScaleXYZ(obj,size,size,0);
			ObjRender_SetPosition(obj,ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),0);
			size = size-a;
			yield;
			}
		Obj_Delete(obj);
		
	}
}

	task Aura(num){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/Aura.png";
	let color = [0,0,0];
	let value = 96;
	let dir = rand(0,359);
	let c = 0;
	let s = 2.5;
	if(num==0){color = [128,0,128];}
	if(num==1){color = [128,0,0];}
	ObjPrim_SetTexture(obj,img);
	ObjPrim_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjSprite2D_SetSourceRect(obj,48,0,96,64);
	ObjSprite2D_SetDestCenter(obj);
	ObjPrim_SetVertexCount(obj,4);
	ObjPrim_SetVertexPosition(obj,0,-24,-32,0);
	ObjPrim_SetVertexPosition(obj,1,-24,32,0);
	ObjPrim_SetVertexPosition(obj,2,24,-32 ,0);
	ObjPrim_SetVertexPosition(obj,3,24, 32,0);
	ObjPrim_SetVertexUVT(obj,0,0,0);
	ObjPrim_SetVertexUVT(obj,1,0,64);
	ObjPrim_SetVertexUVT(obj,2,48,0);
	ObjPrim_SetVertexUVT(obj,3,48,64);
	ObjRender_SetAngleXYZ(obj,0,0,dir);
	ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	ObjRender_SetColor(obj,color[0],color[1],color[2]);
	Obj_SetRenderPriority(obj,0.21);
	while(s>0 && !Obj_IsDeleted(objBoss)){
	ObjRender_SetPosition(obj,ObjMove_GetX(objBoss),ObjMove_GetY(objBoss)-10,0);
	ObjRender_SetScaleXYZ(obj,s,s,s);
	s -= 0.05;
	ObjRender_SetColor(obj,color[0]-c,color[1],color[2]+c);
	if(c==7){Aura((num+1)%2);}
	c++;
	yield;
	}
	Obj_Delete(obj);
	}
	
task effbreak(shot,type){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/effbreak.png";
	let s = rand(0.8,1.2);
	let color = [0,0,0];
	if(type=="RED"){color = [192,0,0];}
	if(type=="GREEN"){color = [0,192,0];}
	if(type=="BLUE"){color = [0,0,192];}
	if(type=="ORANGE"){color = [192,192,0];}
	if(type=="PURPLE"){color = [192,0,192];}
	if(type=="AQUA"){color = [0,192,192];}
	if(type=="GRAY"){color = [192,192,192];}
	let rect = [0,0,32,32];
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,rect[0],rect[1],rect[2],rect[3]);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetScaleXYZ(obj,s,s,0);
	ObjRender_SetAngleXYZ(obj,0,0,rand(0,359));
	ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	ObjRender_SetColor(obj,color[0],color[1],color[2]);
	Obj_SetRenderPriority(obj,0.21);
	let x = ObjMove_GetX(shot);
	let y = ObjMove_GetY(shot);
	ascent(i in 0..7){
	ObjRender_SetPosition(obj,x,y,0);
	ObjSprite2D_SetSourceRect(obj,rect[0],rect[1],rect[2],rect[3]);
	rect[0] = rect[0]+32;
	rect[2] = rect[2]+32;
	wait(3);
	}
	Obj_Delete(obj);
	}
	

task TWaveCircle() // from sample script
{
	//レンダリングターゲットに使用するテクスチャ
	let renderTexture = GetReservedRenderTargetName(0);

	let frame = 0; //フレーム
	let baseEffectRadius = 144; //基準エフェクト半径
	let outerFluct = 16; //エフェクト半径の最大変化量
	let effectRadius = 0; //エフェクト半径
	let circleVertexCount = 16; //円をあらわすのに使用する頂点の数
	let innerCircleCount = 4;

	let priEffectMin = 20; //エフェクトをかける最小優先度
	let priEffectMax = 28; //エフェクトをかける最大優先度

	//背景のみエフェクトの対象とする
	//エフェクトの描画でまかなえるため、
	//優先度20〜28の通常描画を無効にする。
	SetInvalidRenderPriorityA1(priEffectMin, priEffectMax);


	let frameWidth = GetStgFrameWidth();
	let frameHeight = GetStgFrameHeight();
	let frameLeft = GetStgFrameLeft();
	let frameRight = frameLeft + frameWidth;
	let frameTop = GetStgFrameTop();
	let frameBottom = frameTop + frameHeight;

	//--------------------------------
	//円形の影
	let path = GetCurrentScriptDirectory() ~ "Effect02.png";
	let objShadow = ObjPrim_Create(OBJ_SPRITE_2D); //2Dスプライトオブジェクト生成
	Obj_SetRenderPriorityI(objShadow, 25); //描画優先度を設定
	ObjPrim_SetTexture(objShadow, path); //テクスチャを設定
	ObjRender_SetBlendType(objShadow, BLEND_MULTIPLY);
	ObjSprite2D_SetSourceRect(objShadow, 1, 1, 255, 255); //描画元設定(44, 54)-(71,105)
	ObjSprite2D_SetDestCenter(objShadow);
	ObjRender_SetScaleXYZ(objShadow, 1.2, 1.2, 0);


	//--------------------------------
	//円内
	let objInnerC = ObjPrim_Create(OBJ_PRIMITIVE_2D);
	Obj_SetRenderPriorityI(objInnerC, priEffectMax + 1);
	ObjPrim_SetTexture(objInnerC, renderTexture);
	ObjPrim_SetVertexCount(objInnerC, 6 * circleVertexCount * innerCircleCount);

	//円外〜エフェクト枠
	let objOuterC = ObjPrim_Create(OBJ_PRIMITIVE_2D);
	Obj_SetRenderPriorityI(objOuterC, priEffectMax + 1);
	ObjPrim_SetTexture(objOuterC, renderTexture); //テクスチャを設定
	ObjPrim_SetVertexCount(objOuterC, 3 * circleVertexCount);

	//エフェクト枠外オブジェクト
	let objOuterE = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
	Obj_SetRenderPriorityI(objOuterE, priEffectMax + 1);
	ObjPrim_SetTexture(objOuterE, renderTexture); //テクスチャを設定


	//ボスのライフが0になるまでエフェクトをかける。
	let objEnemy = GetEnemyBossObjectID[0];
	while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0)
	{
		//エフェクト半径
		effectRadius = baseEffectRadius + outerFluct * sin(frame*4);

		let enemyX = ObjMove_GetX(objEnemy); //敵座標X
		let enemyY = ObjMove_GetY(objEnemy); //敵座標Y
		let circleLeft = enemyX - effectRadius + frameLeft; //エフェクト円の左端
		let circleRight = enemyX + effectRadius + frameLeft; //エフェクト円の右端
		let circleTop = enemyY - effectRadius + frameTop; //エフェクト円の上端
		let circleBottom = enemyY + effectRadius + frameTop; //エフェクト円の下端

		//--------------------------------
		//優先度20〜28(背景)をエフェクト用のテクスチャに描画
		RenderToTextureA1(renderTexture, priEffectMin, priEffectMax, true);

		//--------------------------------
		//影
		ObjRender_SetPosition(objShadow, enemyX, enemyY, 0);

		//--------------------------------
		//円内
		//エフェクト内円を描画
		//ゆらいでいる部分
		ObjRender_SetPosition(objInnerC, -frameLeft, -frameTop, 0);
		ascent(let iPosI in 0 .. circleVertexCount) 
		{
			let xyOldRadius = 0;
			ascent(let iCircle in 0 .. innerCircleCount) 
			{
				let vertexIndex = (iPosI * innerCircleCount + iCircle) * 6;
				let angle1 =  iPosI * (360 / circleVertexCount);
				let angle2 =  (iPosI + 1) * (360 / circleVertexCount);

				//テクスチャのUV座標
				let uvRadius1 = iCircle * effectRadius / innerCircleCount;
				let uvRadius2 = (iCircle + 1) * effectRadius / innerCircleCount;

				//テクスチャのUV座標と描画先のXY座標を変化させることでゆらぎを表現する
				let xyRadius1t = iCircle * effectRadius / innerCircleCount;
				let xyRadius2t = (iCircle + 1) * effectRadius / innerCircleCount;
				let xyRadius1 = xyOldRadius;
				let xyBias = (xyRadius2t - xyRadius1t) / 2 + (xyRadius2t - xyRadius1t) * sin(frame*16 + (iCircle * 360 / innerCircleCount)) / 4;
				let xyRadius2 = xyRadius2t + xyBias / ((innerCircleCount - iCircle + 1) / 2);

				xyOldRadius = xyRadius2;
				if(iCircle == innerCircleCount - 1)
				{
					xyRadius2 = uvRadius2;
				}

				//上記の頂点座標を設定
				let leftBias = enemyX + frameLeft;
				let topBias = enemyY + frameTop;
				ObjPrim_SetVertexPosition(objInnerC, vertexIndex  , leftBias + xyRadius1 * cos(angle1), topBias + xyRadius1 * sin(angle1), 0);
				ObjPrim_SetVertexPosition(objInnerC, vertexIndex+1, leftBias + xyRadius2 * cos(angle1), topBias + xyRadius2 * sin(angle1), 0);
				ObjPrim_SetVertexPosition(objInnerC, vertexIndex+2, leftBias + xyRadius1 * cos(angle2), topBias + xyRadius1 * sin(angle2), 0);
			
				ObjPrim_SetVertexPosition(objInnerC, vertexIndex+3, leftBias + xyRadius1 * cos(angle2), topBias + xyRadius1 * sin(angle2), 0);
				ObjPrim_SetVertexPosition(objInnerC, vertexIndex+4, leftBias + xyRadius2 * cos(angle1), topBias + xyRadius2 * sin(angle1), 0);
				ObjPrim_SetVertexPosition(objInnerC, vertexIndex+5, leftBias + xyRadius2 * cos(angle2), topBias + xyRadius2 * sin(angle2), 0);

				ObjPrim_SetVertexUVT(objInnerC, vertexIndex  , leftBias + uvRadius1 * cos(angle1), topBias + uvRadius1 * sin(angle1));
				ObjPrim_SetVertexUVT(objInnerC, vertexIndex+1, leftBias + uvRadius2 * cos(angle1), topBias + uvRadius2 * sin(angle1));
				ObjPrim_SetVertexUVT(objInnerC, vertexIndex+2, leftBias + uvRadius1 * cos(angle2), topBias + uvRadius1 * sin(angle2));
			
				ObjPrim_SetVertexUVT(objInnerC, vertexIndex+3, leftBias + uvRadius1 * cos(angle2), topBias + uvRadius1 * sin(angle2));
				ObjPrim_SetVertexUVT(objInnerC, vertexIndex+4, leftBias + uvRadius2 * cos(angle1), topBias + uvRadius2 * sin(angle1));
				ObjPrim_SetVertexUVT(objInnerC, vertexIndex+5, leftBias + uvRadius2 * cos(angle2), topBias + uvRadius2 * sin(angle2));

			}
		}


		//--------------------------------
		//円外〜エフェクト枠
		//揺らいでいる円の外側から矩形までを埋める
		ObjRender_SetPosition(objOuterC, -frameLeft, -frameTop, 0);
		ascent(let iPosO in 0 .. circleVertexCount) 
		{
			let angle1 = iPosO * (360 / circleVertexCount);
			let angle2 = (iPosO + 1) * (360 / circleVertexCount);
			let rectX = 0;
			let rectY = 0;
			if(angle1 >= 0 && angle1 < 90)
			{
				rectX = circleRight;
				rectY = circleBottom;
			}
			else if(angle1 >= 90 && angle1 < 180)
			{
				rectX = circleLeft;
				rectY = circleBottom;
			}
			else if(angle1 >= 180 && angle1 < 270)
			{
				rectX = circleLeft;
				rectY = circleTop;
			}
			else if(angle1 >= 270 && angle1 < 360)
			{
				rectX = circleRight;
				rectY = circleTop;
			}
			let vertexIndex = iPosO * 3;
			ObjPrim_SetVertexPosition(objOuterC, vertexIndex, enemyX + effectRadius * cos(angle1) + frameLeft, enemyY + effectRadius * sin(angle1) + frameTop, 0);
			ObjPrim_SetVertexPosition(objOuterC, vertexIndex+1, rectX, rectY, 0);
			ObjPrim_SetVertexPosition(objOuterC, vertexIndex+2, enemyX + effectRadius * cos(angle2) + frameLeft, enemyY + effectRadius * sin(angle2) + frameTop, 0);

			ObjPrim_SetVertexUVT(objOuterC, vertexIndex, enemyX + effectRadius * cos(angle1) + frameLeft, enemyY + effectRadius * sin(angle1) + frameTop);
			ObjPrim_SetVertexUVT(objOuterC, vertexIndex+1, rectX, rectY);
			ObjPrim_SetVertexUVT(objOuterC, vertexIndex+2, enemyX + effectRadius * cos(angle2) + frameLeft, enemyY + effectRadius * sin(angle2) + frameTop);
			
		}
		

		//--------------------------------
		//エフェクト枠外
		//エフェクト枠外の背景を描画する
		ObjSpriteList2D_ClearVertexCount(objOuterE);
		ObjRender_SetPosition(objOuterE, -frameLeft, -frameTop, 0);
		ObjSpriteList2D_SetSourceRect(objOuterE, frameLeft, frameTop, frameRight, circleTop + 1);
		ObjSpriteList2D_SetDestRect(objOuterE, frameLeft, frameTop, frameRight, circleTop + 1);
		ObjSpriteList2D_AddVertex(objOuterE);

		ObjSpriteList2D_SetSourceRect(objOuterE, frameLeft, circleTop, circleLeft + 1, circleBottom);
		ObjSpriteList2D_SetDestRect(objOuterE, frameLeft, circleTop, circleLeft + 1, circleBottom);
		ObjSpriteList2D_AddVertex(objOuterE);

		ObjSpriteList2D_SetSourceRect(objOuterE, circleRight, circleTop, frameRight, circleBottom);
		ObjSpriteList2D_SetDestRect(objOuterE, circleRight, circleTop, frameRight, circleBottom);
		ObjSpriteList2D_AddVertex(objOuterE);

		ObjSpriteList2D_SetSourceRect(objOuterE, frameLeft, circleBottom, frameRight, frameBottom);
		ObjSpriteList2D_SetDestRect(objOuterE, frameLeft, circleBottom, frameRight, frameBottom);
		ObjSpriteList2D_AddVertex(objOuterE);

		frame++;
		yield;
	}

	//エフェクト用オブジェクト削除
	Obj_Delete(objInnerC);
	Obj_Delete(objOuterC);
	Obj_Delete(objOuterE);
	Obj_Delete(objShadow);
	ClearInvalidRenderPriority();
}