
//=======================================================================
//　エフェクトを表示する関数集です。
//　このファイルをinclude_functionで取り込むか、
//　必要な部分をコピペして使用してください。
//=======================================================================

//=======================================================================
// ■ 画像へのパス 構成が違う場合は要変更
//-----------------------------------------------------------------------
let imgeff1 = GetCurrentScriptDirectory~"img/ChargeEffect_01.png";
let imgeff2 = GetCurrentScriptDirectory~"img/ChargeEffect_02.png";
//=======================================================================

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th06〜th14] [白妖気]
//-----------------------------------------------------------------------
task Concentration03(enemy,time,R,G,B) {

	loop(time-30) {
		Concentration(enemy,0,R,G,B);
		yield;
	}
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th06〜th14] [結晶]
//-----------------------------------------------------------------------
task Concentration04(enemy,time,R,G,B) {

	loop(time-30) {
		Concentration(enemy,1,R,G,B);
		yield;
	}
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th10〜th14] [葉]
//-----------------------------------------------------------------------
task Concentration05(enemy,time,R,G,B) {

	loop(time-30) {
		Concentration(enemy,2,R,G,B);
		yield;
	}
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th07〜th14] [花弁]
//-----------------------------------------------------------------------
task Concentration06(enemy,time,R,G,B) {

	loop(time-30) {
		Concentration(enemy,3,R,G,B);
		yield;
	}
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th07〜th08] [魔法陣]
//-----------------------------------------------------------------------
task Concentration07(enemy,time,R,G,B) {

	loop(time-30) {
		Concentration(enemy,4,R,G,B);
		yield;
	}
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th14] [葉]
//-----------------------------------------------------------------------
task Concentration08(enemy,time,R,G,B) {

	loop(time-30) {
		Concentration(enemy,5,R,G,B);
		yield;
	}
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th14] [黒妖気]
//-----------------------------------------------------------------------
task Concentration09(enemy,time,time2,angle1,angle2,R,G,B) {

	loop((time-30)/2) {
		Concentration_th14(enemy,time2,angle1,angle2,25,R,G,B);
		loop(2) { yield; }
	}
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th14] [黒妖気] [登場時]
//-----------------------------------------------------------------------
task Concentration10(enemy,time,time2,angle1,angle2,R,G,B) {

	loop((time-30)/2) {
		Concentration_th14(enemy,time2,angle1,angle2,40,R,G,B);
		loop(2) { yield; }
	}
}

//-----------------------------------------------------------------------
// ■ 拡散エフェクト [th08〜th14] [葉]
//-----------------------------------------------------------------------
task Diffusion01(x,y,nam,R,G,B) {

	loop(nam/10) {
		loop(10) { Diffusion(x,y,2,R,G,B); }
		loop(2) { yield; }
	}
}

//-----------------------------------------------------------------------
// ■ 拡散エフェクト [th07  th14] [花弁]
//-----------------------------------------------------------------------
task Diffusion02(x,y,nam,R,G,B) {

	loop(nam/10) {
		loop(10) { Diffusion(x,y,3,R,G,B); }
		loop(2) { yield; }
	}
}

//-----------------------------------------------------------------------
// ■ 拡散エフェクト [th14] [葉]
//-----------------------------------------------------------------------
task Diffusion03(x,y,nam,R,G,B) {

	loop(nam/10) {
		loop(10) { Diffusion(x,y,5,R,G,B); }
		loop(2) { yield; }
	}
}

//-----------------------------------------------------------------------
// ■ 拡散エフェクト [th07] [結晶]
//-----------------------------------------------------------------------
task Diffusion04(x,y,nam,R,G,B) {

	loop(nam/10) {
		loop(10) { Diffusion(x,y,1,R,G,B) }
		loop(2) { yield; }
	}
}

//-----------------------------------------------------------------------
// ■ 拡散エフェクト [th08] [当たり判定]
//-----------------------------------------------------------------------
task Diffusion05(x,y,nam,R,G,B) {

	loop(nam/10) {
		loop(10) { Diffusion(x,y,4,R,G,B) }
		loop(2) { yield; }
	}
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th06〜th14] [共通]
//-----------------------------------------------------------------------
let CHARGE_maxscale	= [2.50, 2.50, 3.75, 3.00, 2.00, 3.25, 3.25];
let CHARGE_efftime	= [  36,   30,   36,   30,   33,   30,   30];
let CHARGE_rectU	= [ 128,  192,   64,    0,  192,  128,  192];
let CHARGE_rectV	= [  64,   64,    0,   64,  128,    0,    0];
//-----------------------------------------------------------------------
task Concentration(enemy,type,R,G,B) {

	let eff		= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let scale	= CHARGE_maxscale[type];
	let angle00	= rand(-180,180);
	let angle01	= rand(-180,180);
	let angle02	= 0;
	let radius01	= 0;
	let radius02	= 0;
	let alpha	= 0;
	let i1		= 1;
	let i2		= rand(-8,8);

	alternative(type)
	case(0)       { i1 = 1.25; i2 = 0; angle01 = angle00 }
	case(1,3,5,6) { i1 = 1.00; angle02 = rand(-60,60); }

	LoadTexture(imgeff1);

//	Obj_SetSpeed(eff,0);
//	Obj_SetAngle(eff,0);
	ObjPrim_SetTexture(eff,imgeff1);
	ObjRender_SetBlendType(eff,BLEND_ADD_RGB);
	ObjPrim_SetPrimitiveType(eff,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(eff,scale*i1,scale,1);
	Obj_SetRenderPriorityI(eff,30);
	ObjPrim_SetVertexCount(eff,4);
	ObjPrim_SetVertexPosition(eff,0,-32,-32,0);
	ObjPrim_SetVertexPosition(eff,1,-32, 32,0);
	ObjPrim_SetVertexPosition(eff,2, 32,-32,0);
	ObjPrim_SetVertexPosition(eff,3, 32, 32,0);
	ObjPrim_SetVertexUVT(eff,0,CHARGE_rectU[type]   ,CHARGE_rectV[type]);
	ObjPrim_SetVertexUVT(eff,1,CHARGE_rectU[type]   ,CHARGE_rectV[type]+64);
	ObjPrim_SetVertexUVT(eff,2,CHARGE_rectU[type]+64,CHARGE_rectV[type]);
	ObjPrim_SetVertexUVT(eff,3,CHARGE_rectU[type]+64,CHARGE_rectV[type]+64);

	while(alpha<255 && !Obj_IsDeleted(enemy)) {
		angle01  += i2;
		alpha    += 510.0/CHARGE_efftime[type];
		scale    -= 1.000/CHARGE_efftime[type];
		radius01 -= 90.00/CHARGE_efftime[type];
		radius02  = 260.0+244.0*sin(radius01);

		ObjRender_SetPosition(eff,ObjMove_GetX(enemy)+radius02*cos(angle00),ObjMove_GetY(enemy)+radius02*sin(angle00),0);
		ObjRender_SetScaleXYZ(eff,scale*i1,scale,1);
		ObjRender_SetAngleXYZ(eff,angle02,angle02,angle01);
		ObjPrim_SetVertexColor(eff,0,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,1,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,2,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,3,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexAlpha(eff,0,alpha);
		ObjPrim_SetVertexAlpha(eff,1,alpha);
		ObjPrim_SetVertexAlpha(eff,2,alpha);
		ObjPrim_SetVertexAlpha(eff,3,alpha);
		yield;
	}
	while(alpha>0 && !Obj_IsDeleted(enemy)) {
		angle01  += i2;
		alpha    -= 510.0/CHARGE_efftime[type];
		scale    -= 1.000/CHARGE_efftime[type];
		radius01 -= 90.00/CHARGE_efftime[type];
		radius02  = 260.0+244.0*sin(radius01);

		ObjRender_SetPosition(eff,ObjMove_GetX(enemy)+radius02*cos(angle00),ObjMove_GetY(enemy)+radius02*sin(angle00),0);
		ObjRender_SetScaleXYZ(eff,scale*i1,scale,1);
		ObjRender_SetAngleXYZ(eff,angle02,angle02,angle01);
		ObjPrim_SetVertexColor(eff,0,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,1,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,2,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,3,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexAlpha(eff,0,alpha);
		ObjPrim_SetVertexAlpha(eff,1,alpha);
		ObjPrim_SetVertexAlpha(eff,2,alpha);
		ObjPrim_SetVertexAlpha(eff,3,alpha);
		yield;
	}
	Obj_Delete(eff);
}

//-----------------------------------------------------------------------
// ■ 拡散エフェクト [th07〜th14] [共通]
//-----------------------------------------------------------------------
task Diffusion(x,y,type,R,G,B) {

	let eff		= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let scale	= CHARGE_maxscale[type]-0.50;
	let angle00	= rand(-180,180);
	let angle01	= rand(-180,180);
	let angle02	= rand(-180,180);
	let radius01	= 0;
	let radius02	= 0;
	let radius03	= rand(160,380);
	let alpha	= 0;
	let i1		= 1;
	let i2		= rand(-8,8);

	if(type==0) { i1 = 1.25; i2 = 0; }

	LoadTexture(imgeff1);

//	Obj_SetSpeed(eff,0);
//	Obj_SetAngle(eff,0);
	ObjPrim_SetTexture(eff,imgeff1);
	ObjRender_SetBlendType(eff,BLEND_ADD_RGB);
	ObjPrim_SetPrimitiveType(eff,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(eff,scale*i1,scale,1);
	Obj_SetRenderPriorityI(eff,30);
	ObjPrim_SetVertexCount(eff,4);
	ObjPrim_SetVertexPosition(eff,0,-32,-32,0);
	ObjPrim_SetVertexPosition(eff,1,-32, 32,0);
	ObjPrim_SetVertexPosition(eff,2, 32,-32,0);
	ObjPrim_SetVertexPosition(eff,3, 32, 32,0);
	ObjPrim_SetVertexUVT(eff,0,CHARGE_rectU[type]   ,CHARGE_rectV[type]);
	ObjPrim_SetVertexUVT(eff,1,CHARGE_rectU[type]   ,CHARGE_rectV[type]+64);
	ObjPrim_SetVertexUVT(eff,2,CHARGE_rectU[type]+64,CHARGE_rectV[type]);
	ObjPrim_SetVertexUVT(eff,3,CHARGE_rectU[type]+64,CHARGE_rectV[type]+64);

	while(alpha<255 ) {
		alpha    += 255.0/15;
		angle01  += i2;
		angle02  += 180.0/60;
		radius01 -= 90.00/60;
		radius02  = radius03*sin(radius01);

		ObjRender_SetPosition(eff,x+16+radius02*cos(angle00),y+16+radius02*sin(angle00),0);
		ObjRender_SetScaleXYZ(eff,scale*i1,scale,1);
		ObjRender_SetAngleXYZ(eff,angle02,angle02,angle01);
		ObjPrim_SetVertexColor(eff,0,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,1,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,2,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,3,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexAlpha(eff,0,alpha);
		ObjPrim_SetVertexAlpha(eff,1,alpha);
		ObjPrim_SetVertexAlpha(eff,2,alpha);
		ObjPrim_SetVertexAlpha(eff,3,alpha);
		yield;
	}
	while(alpha>0 ) {
		alpha    -= 255.0/45;
		angle01  += i2;
		angle02  += 180.0/60;
		radius01 -= 90.00/60;
		radius02  = radius03*sin(radius01);

		ObjRender_SetPosition(eff,x+16+radius02*cos(angle00),y+16+radius02*sin(angle00),0);
		ObjRender_SetScaleXYZ(eff,scale*i1,scale,1);
		ObjRender_SetAngleXYZ(eff,angle02,angle02,angle01);
		ObjPrim_SetVertexColor(eff,0,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,1,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,2,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,3,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexAlpha(eff,0,alpha);
		ObjPrim_SetVertexAlpha(eff,1,alpha);
		ObjPrim_SetVertexAlpha(eff,2,alpha);
		ObjPrim_SetVertexAlpha(eff,3,alpha);
		yield;
	}
	Obj_Delete(eff);
}

//-----------------------------------------------------------------------
// ■ 爆発エフェクト [th06〜th08]
//-----------------------------------------------------------------------
task Explosion02(X,Y,desalpha,R,G,B,addscale,time) {

	let eff		= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let scale	= 0;
	let alpha	= 255;
        let enemy = GetEnemyBossObjectID[0];

	LoadTexture(imgeff1);

        ObjRender_SetPosition(eff,X,Y,0);
	ObjPrim_SetTexture(eff,imgeff1);
	ObjRender_SetBlendType(eff,BLEND_ADD_RGB);
	ObjPrim_SetPrimitiveType(eff,PRIMITIVE_TRIANGLESTRIP);
        ObjRender_SetAngleXYZ(eff,0,0,0);
	ObjRender_SetScaleXYZ(eff,scale,scale,1);
	Obj_SetRenderPriorityI(eff,30);
	ObjPrim_SetVertexCount(eff,4);
	ObjPrim_SetVertexPosition(eff,0,-32,-32,0);
	ObjPrim_SetVertexPosition(eff,1,-32, 32,0);
	ObjPrim_SetVertexPosition(eff,2, 32,-32,0);
	ObjPrim_SetVertexPosition(eff,3, 32, 32,0);
	ObjPrim_SetVertexUVT(eff,0, 64,192);
	ObjPrim_SetVertexUVT(eff,1, 64,256);
	ObjPrim_SetVertexUVT(eff,2,128,192);
	ObjPrim_SetVertexUVT(eff,3,128,256);

	loop(time) {
                if(Obj_IsDeleted(enemy)){break;}
		alpha -= desalpha;
		scale += addscale;
		ObjRender_SetScaleXYZ(eff,scale,scale,1);
		ObjPrim_SetVertexColor(eff,0,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,1,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,2,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,3,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexAlpha(eff,0,alpha);
		ObjPrim_SetVertexAlpha(eff,1,alpha);
		ObjPrim_SetVertexAlpha(eff,2,alpha);
		ObjPrim_SetVertexAlpha(eff,3,alpha);
		yield;
	}
	Obj_Delete(eff);
}

//-----------------------------------------------------------------------
// ■ 爆発エフェクト [th12.8〜th14]
//-----------------------------------------------------------------------
task Explosion03(X,Y,desalpha,R,G,B,addscale,time) {

	let eff		= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let scale	= 0;
	let alpha	= 255;
        let enemy = GetEnemyBossObjectID[0];

	LoadTexture(imgeff1);

        ObjRender_SetPosition(eff,X,Y,0);
	ObjPrim_SetTexture(eff,imgeff1);
	ObjRender_SetBlendType(eff,BLEND_ADD_RGB);
	ObjPrim_SetPrimitiveType(eff,PRIMITIVE_TRIANGLESTRIP);
        ObjRender_SetAngleXYZ(eff,0,0,0);
	ObjRender_SetScaleXYZ(eff,scale,scale,1);
	Obj_SetRenderPriorityI(eff,30);
	ObjPrim_SetVertexCount(eff,4);
	ObjPrim_SetVertexPosition(eff,0,-32,-32,0);
	ObjPrim_SetVertexPosition(eff,1,-32, 32,0);
	ObjPrim_SetVertexPosition(eff,2, 32,-32,0);
	ObjPrim_SetVertexPosition(eff,3, 32, 32,0);
	ObjPrim_SetVertexUVT(eff,0, 0,192);
	ObjPrim_SetVertexUVT(eff,1, 0,256);
	ObjPrim_SetVertexUVT(eff,2,64,192);
	ObjPrim_SetVertexUVT(eff,3,64,256);

	loop(time) {
                if(Obj_IsDeleted(enemy)){break;}
		alpha -= desalpha;
		scale += addscale;
		ObjRender_SetScaleXYZ(eff,scale,scale,1);
		ObjPrim_SetVertexColor(eff,0,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,1,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,2,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,3,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexAlpha(eff,0,alpha);
		ObjPrim_SetVertexAlpha(eff,1,alpha);
		ObjPrim_SetVertexAlpha(eff,2,alpha);
		ObjPrim_SetVertexAlpha(eff,3,alpha);
		yield;
	}
	Obj_Delete(eff);
}

//-----------------------------------------------------------------------
// ■ 爆発エフェクト [th12.8〜th14]
//-----------------------------------------------------------------------
task Explosion04(X,Y,desalpha,R,G,B,addscale,time) {

	let eff		= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let scale	= 0;
	let alpha	= 255;
        let enemy = GetEnemyBossObjectID[0];

	LoadTexture(imgeff1);

        ObjRender_SetPosition(eff,X,Y,0);
	ObjPrim_SetTexture(eff,imgeff1);
	ObjRender_SetBlendType(eff,BLEND_ADD_RGB);
	ObjPrim_SetPrimitiveType(eff,PRIMITIVE_TRIANGLESTRIP);
        ObjRender_SetAngleXYZ(eff,0,0,0);
	ObjRender_SetScaleXYZ(eff,scale,scale,1);
	Obj_SetRenderPriorityI(eff,30);
	ObjPrim_SetVertexCount(eff,4);
	ObjPrim_SetVertexPosition(eff,0,-32,-32,0);
	ObjPrim_SetVertexPosition(eff,1,-32, 32,0);
	ObjPrim_SetVertexPosition(eff,2, 32,-32,0);
	ObjPrim_SetVertexPosition(eff,3, 32, 32,0);
	ObjPrim_SetVertexUVT(eff,0,128,192);
	ObjPrim_SetVertexUVT(eff,1,128,256);
	ObjPrim_SetVertexUVT(eff,2,192,192);
	ObjPrim_SetVertexUVT(eff,3,192,256);

	loop(time) {
                if(Obj_IsDeleted(enemy)){break;}
		alpha -= desalpha;
		scale += addscale;
		ObjRender_SetScaleXYZ(eff,scale,scale,1);
		ObjPrim_SetVertexColor(eff,0,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,1,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,2,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,3,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexAlpha(eff,0,alpha);
		ObjPrim_SetVertexAlpha(eff,1,alpha);
		ObjPrim_SetVertexAlpha(eff,2,alpha);
		ObjPrim_SetVertexAlpha(eff,3,alpha);
		yield;
	}
	Obj_Delete(eff);
}

//-----------------------------------------------------------------------
// ■ 爆発エフェクト [th09〜th14]
//-----------------------------------------------------------------------
task Explosion05(X,Y,desalpha,R,G,B,addscale,time) {

	let eff		= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let scale	= 0;
	let alpha	= 255;
        let enemy = GetEnemyBossObjectID[0];

	LoadTexture(imgeff1);

        ObjRender_SetPosition(eff,X,Y,0);
	ObjPrim_SetTexture(eff,imgeff1);
	ObjRender_SetBlendType(eff,BLEND_ADD_RGB);
	ObjPrim_SetPrimitiveType(eff,PRIMITIVE_TRIANGLESTRIP);
        ObjRender_SetAngleXYZ(eff,0,0,0);
	ObjRender_SetScaleXYZ(eff,scale,scale,1);
	Obj_SetRenderPriorityI(eff,30);
	ObjPrim_SetVertexCount(eff,4);
	ObjPrim_SetVertexPosition(eff,0,-32,-32,0);
	ObjPrim_SetVertexPosition(eff,1,-32, 32,0);
	ObjPrim_SetVertexPosition(eff,2, 32,-32,0);
	ObjPrim_SetVertexPosition(eff,3, 32, 32,0);
	ObjPrim_SetVertexUVT(eff,0,192,192);
	ObjPrim_SetVertexUVT(eff,1,192,256);
	ObjPrim_SetVertexUVT(eff,2,256,192);
	ObjPrim_SetVertexUVT(eff,3,256,256);

	loop(time) {
                if(Obj_IsDeleted(enemy)){break;}
		alpha -= desalpha;
		scale += addscale;
		ObjRender_SetScaleXYZ(eff,scale,scale,1);
		ObjPrim_SetVertexColor(eff,0,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,1,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,2,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,3,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexAlpha(eff,0,alpha);
		ObjPrim_SetVertexAlpha(eff,1,alpha);
		ObjPrim_SetVertexAlpha(eff,2,alpha);
		ObjPrim_SetVertexAlpha(eff,3,alpha);
		yield;
	}
	Obj_Delete(eff);
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th12〜th14]
//-----------------------------------------------------------------------
task WaveConcentration01(X,Y,R,G,B,maxscale,time) {

	let eff		= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let scale	= maxscale;
	let alpha	= 0;
        let enemy = GetEnemyBossObjectID[0];

	LoadTexture(imgeff1);

        ObjRender_SetPosition(eff,X,Y,0);
	ObjPrim_SetTexture(eff,imgeff1);
	ObjRender_SetBlendType(eff,BLEND_ADD_RGB);
	ObjPrim_SetPrimitiveType(eff,PRIMITIVE_TRIANGLESTRIP);
        ObjRender_SetAngleXYZ(eff,0,0,0);
	ObjRender_SetScaleXYZ(eff,scale,scale,1);
	Obj_SetRenderPriorityI(eff,30);
	ObjPrim_SetVertexCount(eff,4);
	ObjPrim_SetVertexPosition(eff,0,-32,-32,0);
	ObjPrim_SetVertexPosition(eff,1,-32, 32,0);
	ObjPrim_SetVertexPosition(eff,2, 32,-32,0);
	ObjPrim_SetVertexPosition(eff,3, 32, 32,0);
	ObjPrim_SetVertexUVT(eff,0, 0,192);
	ObjPrim_SetVertexUVT(eff,1, 0,256);
	ObjPrim_SetVertexUVT(eff,2,64,192);
	ObjPrim_SetVertexUVT(eff,3,64,256);

	loop(time) {
                if(Obj_IsDeleted(enemy)){break;}
		alpha += 255/time;
		scale -= maxscale/time;
		ObjRender_SetScaleXYZ(eff,scale,scale,1);
		ObjPrim_SetVertexColor(eff,0,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,1,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,2,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexColor(eff,3,R*alpha/255,G*alpha/255,B*alpha/255);
		ObjPrim_SetVertexAlpha(eff,0,alpha);
		ObjPrim_SetVertexAlpha(eff,1,alpha);
		ObjPrim_SetVertexAlpha(eff,2,alpha);
		ObjPrim_SetVertexAlpha(eff,3,alpha);
		yield;
	}
	Obj_Delete(eff);
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [th14]
//-----------------------------------------------------------------------
task Concentration_th14(enemy,time,angle1,angle2,layer,R,G,B) {

	let eff1	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let eff2	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let radius01	= 352.00+rand(-24,24);
	let radius02	= 352.00+rand(-24,24);
	let radius03	= 352.00+rand(-24,24);
	let angle01	= angle1+rand(-24,24);
	let angle02	= angle1+rand(-24,24);
	let angle03	= angle1+rand(-24,24);
	let scale01	= rand(0.25,1.50);
	let scale02	= rand(0.25,1.50);
	let scale03	= rand(0.25,1.50);
	let alpha	= 0;
	let alpha2	= 255;
	let i		= 0;

        R = 255 - R;
        G = 255 - G;
        B = 255 - B;

	LoadTexture(imgeff2);

	loop(3) {
	//	Obj_SetSpeed(eff1[i],0);
	//	Obj_SetAngle(eff1[i],0);
		ObjPrim_SetTexture(eff1[i],imgeff2);
		ObjRender_SetBlendType(eff1[i],BLEND_SUBTRACT);
		ObjPrim_SetPrimitiveType(eff1[i],PRIMITIVE_TRIANGLESTRIP);
		Obj_SetRenderPriorityI(eff1[i],layer);
		ObjPrim_SetVertexCount(eff1[i],4);
		ObjPrim_SetVertexPosition(eff1[i],0,-16,-16,0);
		ObjPrim_SetVertexPosition(eff1[i],1,-16, 16,0);
		ObjPrim_SetVertexPosition(eff1[i],2, 16,-16,0);
		ObjPrim_SetVertexPosition(eff1[i],3, 16, 16,0);
		ObjPrim_SetVertexUVT(eff1[i],0,  0,  0);
		ObjPrim_SetVertexUVT(eff1[i],1,  0, 32);
		ObjPrim_SetVertexUVT(eff1[i],2, 32,  0);
		ObjPrim_SetVertexUVT(eff1[i],3, 32, 32);

	//	Obj_SetSpeed(eff2[i],0);
	//	Obj_SetAngle(eff2[i],0);
		ObjPrim_SetTexture(eff2[i],imgeff2);
		ObjRender_SetBlendType(eff2[i],BLEND_SUBTRACT);
		ObjPrim_SetPrimitiveType(eff2[i],PRIMITIVE_TRIANGLESTRIP);
		Obj_SetRenderPriorityI(eff2[i],layer);
		ObjPrim_SetVertexCount(eff2[i],4);
		ObjPrim_SetVertexPosition(eff2[i],0,-16,-16,0);
		ObjPrim_SetVertexPosition(eff2[i],1,-16, 16,0);
		ObjPrim_SetVertexPosition(eff2[i],2, 16,-16,0);
		ObjPrim_SetVertexPosition(eff2[i],3, 16, 16,0);
		ObjPrim_SetVertexUVT(eff2[i],0, 32,  0);
		ObjPrim_SetVertexUVT(eff2[i],1, 32, 32);
		ObjPrim_SetVertexUVT(eff2[i],2, 64,  0);
		ObjPrim_SetVertexUVT(eff2[i],3, 64, 32);
		i++;
	}

	loop(time) {
                if(Obj_IsDeleted(enemy)){break;}
		i=0;
		alpha    += alpha2/time;
		angle01  += angle2/time;
		angle02  += angle2/time;
		angle03  += angle2/time;
		radius01 -= 352.00/time;
		radius02 -= 352.00/time;
		radius03 -= 352.00/time;
		scale01  += 0.7500/time;
		scale02  += 0.7500/time;
		scale03  += 0.7500/time;

		ObjRender_SetPosition(eff1[0],ObjMove_GetX(enemy)+radius01*cos(angle01),ObjMove_GetY(enemy)+radius01*sin(angle01),0);
		ObjRender_SetPosition(eff2[0],ObjMove_GetX(enemy)+radius01*cos(angle01),ObjMove_GetY(enemy)+radius01*sin(angle01),0);
		ObjRender_SetPosition(eff1[1],ObjMove_GetX(enemy)+radius02*cos(angle02),ObjMove_GetY(enemy)+radius02*sin(angle02),0);
		ObjRender_SetPosition(eff2[1],ObjMove_GetX(enemy)+radius02*cos(angle02),ObjMove_GetY(enemy)+radius02*sin(angle02),0);
		ObjRender_SetPosition(eff1[2],ObjMove_GetX(enemy)+radius03*cos(angle03),ObjMove_GetY(enemy)+radius03*sin(angle03),0);
		ObjRender_SetPosition(eff2[2],ObjMove_GetX(enemy)+radius03*cos(angle03),ObjMove_GetY(enemy)+radius03*sin(angle03),0);
		ObjRender_SetScaleXYZ(eff1[0],scale01,scale01,1);
		ObjRender_SetScaleXYZ(eff2[0],scale01,scale01,1);
		ObjRender_SetScaleXYZ(eff1[1],scale02,scale02,1);
		ObjRender_SetScaleXYZ(eff2[1],scale02,scale02,1);
		ObjRender_SetScaleXYZ(eff1[2],scale03,scale03,1);
		ObjRender_SetScaleXYZ(eff2[2],scale03,scale03,1);
		ObjRender_SetAngleXYZ(eff1[0],0,0,angle01);
		ObjRender_SetAngleXYZ(eff2[0],0,0,angle01);
		ObjRender_SetAngleXYZ(eff1[1],0,0,angle02);
		ObjRender_SetAngleXYZ(eff2[1],0,0,angle02);
		ObjRender_SetAngleXYZ(eff1[2],0,0,angle03);
		ObjRender_SetAngleXYZ(eff2[2],0,0,angle03);

		loop(3) {
			ObjPrim_SetVertexColor(eff1[i],0,R*alpha/255,G*alpha/255,B*alpha/255);
			ObjPrim_SetVertexColor(eff1[i],1,R*alpha/255,G*alpha/255,B*alpha/255);
			ObjPrim_SetVertexColor(eff1[i],2,R*alpha/255,G*alpha/255,B*alpha/255);
			ObjPrim_SetVertexColor(eff1[i],3,R*alpha/255,G*alpha/255,B*alpha/255);
			ObjPrim_SetVertexColor(eff2[i],0,255*alpha/255/2,255*alpha/255/2,255*alpha/255/2);
			ObjPrim_SetVertexColor(eff2[i],1,255*alpha/255/2,255*alpha/255/2,255*alpha/255/2);
			ObjPrim_SetVertexColor(eff2[i],2,255*alpha/255/2,255*alpha/255/2,255*alpha/255/2);
			ObjPrim_SetVertexColor(eff2[i],3,255*alpha/255/2,255*alpha/255/2,255*alpha/255/2);
			ObjPrim_SetVertexAlpha(eff1[i],0,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],1,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],2,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],3,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff2[i],0,alpha*0.50);
			ObjPrim_SetVertexAlpha(eff2[i],1,alpha*0.50);
			ObjPrim_SetVertexAlpha(eff2[i],2,alpha*0.50);
			ObjPrim_SetVertexAlpha(eff2[i],3,alpha*0.50);
			i++;
		}
		yield;
	}
	while(alpha>0 && !Obj_IsDeleted(enemy)) {
		i=0;
		alpha    -= alpha2/60;
		angle01  += angle2/time;
		angle02  += angle2/time;
		angle03  += angle2/time;

		ObjRender_SetPosition(eff1[0],ObjMove_GetX(enemy)+radius01*cos(angle01),ObjMove_GetY(enemy)+radius01*sin(angle01),0);
		ObjRender_SetPosition(eff2[0],ObjMove_GetX(enemy)+radius01*cos(angle01),ObjMove_GetY(enemy)+radius01*sin(angle01),0);
		ObjRender_SetPosition(eff1[1],ObjMove_GetX(enemy)+radius02*cos(angle02),ObjMove_GetY(enemy)+radius02*sin(angle02),0);
		ObjRender_SetPosition(eff2[1],ObjMove_GetX(enemy)+radius02*cos(angle02),ObjMove_GetY(enemy)+radius02*sin(angle02),0);
		ObjRender_SetPosition(eff1[2],ObjMove_GetX(enemy)+radius03*cos(angle03),ObjMove_GetY(enemy)+radius03*sin(angle03),0);
		ObjRender_SetPosition(eff2[2],ObjMove_GetX(enemy)+radius03*cos(angle03),ObjMove_GetY(enemy)+radius03*sin(angle03),0);
		ObjRender_SetScaleXYZ(eff1[0],scale01,scale01,1);
		ObjRender_SetScaleXYZ(eff2[0],scale01,scale01,1);
		ObjRender_SetScaleXYZ(eff1[1],scale02,scale02,1);
		ObjRender_SetScaleXYZ(eff2[1],scale02,scale02,1);
		ObjRender_SetScaleXYZ(eff1[2],scale03,scale03,1);
		ObjRender_SetScaleXYZ(eff2[2],scale03,scale03,1);
		ObjRender_SetAngleXYZ(eff1[0],0,0,angle01);
		ObjRender_SetAngleXYZ(eff2[0],0,0,angle01);
		ObjRender_SetAngleXYZ(eff1[1],0,0,angle02);
		ObjRender_SetAngleXYZ(eff2[1],0,0,angle02);
		ObjRender_SetAngleXYZ(eff1[2],0,0,angle03);
		ObjRender_SetAngleXYZ(eff2[2],0,0,angle03);

		loop(3) {
			ObjPrim_SetVertexColor(eff1[i],0,R*alpha/255,G*alpha/255,B*alpha/255);
			ObjPrim_SetVertexColor(eff1[i],1,R*alpha/255,G*alpha/255,B*alpha/255);
			ObjPrim_SetVertexColor(eff1[i],2,R*alpha/255,G*alpha/255,B*alpha/255);
			ObjPrim_SetVertexColor(eff1[i],3,R*alpha/255,G*alpha/255,B*alpha/255);
			ObjPrim_SetVertexColor(eff2[i],0,255*alpha/255/2,255*alpha/255/2,255*alpha/255/2);
			ObjPrim_SetVertexColor(eff2[i],1,255*alpha/255/2,255*alpha/255/2,255*alpha/255/2);
			ObjPrim_SetVertexColor(eff2[i],2,255*alpha/255/2,255*alpha/255/2,255*alpha/255/2);
			ObjPrim_SetVertexColor(eff2[i],3,255*alpha/255/2,255*alpha/255/2,255*alpha/255/2);
			ObjPrim_SetVertexAlpha(eff1[i],0,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],1,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],2,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],3,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff2[i],0,alpha*0.50);
			ObjPrim_SetVertexAlpha(eff2[i],1,alpha*0.50);
			ObjPrim_SetVertexAlpha(eff2[i],2,alpha*0.50);
			ObjPrim_SetVertexAlpha(eff2[i],3,alpha*0.50);
			i++;
		}
		yield;
	}
	i=0;
	loop(3) {
		Obj_Delete(eff1[i]);
		Obj_Delete(eff2[i]);
		i++;
	}
}

task Concentration001(Enemy,time,time2,angle1,angle2,R,G,B) {

	loop( ceil((time-30)/2) ) {
		Concentration_th14_add(Enemy,time2,angle1,angle2,10*trunc(rand(3.1,4.9)),R,G,B,30);
		loop(2) { yield; }
	}
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [オリジナル] [輝針城の加算] [角度設定可]
//-----------------------------------------------------------------------
task Concentration001_Ex(Enemy,time,time2,angle1,angle2,R,G,B,anglerange) {

	loop( ceil((time-30)/2) ) {
		Concentration_th14_add(Enemy,time2,angle1,angle2,10*trunc(rand(3.1,4.9)),R,G,B,anglerange);
		loop(2) { yield; }
	}
}

//-----------------------------------------------------------------------
// ■ 収束エフェクト [オリジナル] [輝針城の加算] [角度設定可]
//-----------------------------------------------------------------------
task Concentration_th14_add(Enemy,time,angle1,angle2,layer,R,G,B,anglerange) {

	let eff1	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let eff2	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let r01		= rand(-32,32);
	let r02		= rand(-32,32);
	let r03		= rand(-32,32);
	let radius_a	= 0;
	let radius_b	= 0;
	let radius01	= 0;
	let radius02	= 0;
	let radius03	= 0;
	let angle01	= angle1+rand(-anglerange,anglerange);
	let angle02	= angle1+rand(-anglerange,anglerange);
	let angle03	= angle1+rand(-anglerange,anglerange);
	let scale01	= rand(0.00,0.40);
	let scale02	= rand(0.00,0.40);
	let scale03	= rand(0.00,0.40);
	let alpha	= 0;
	let alpha2	= 255;
	let i		= 0;

	LoadTexture(imgeff2);

	loop(3) {
		ObjPrim_SetTexture(eff1[i],imgeff2);
		ObjRender_SetBlendType(eff1[i],BLEND_ADD_ARGB);
		ObjPrim_SetPrimitiveType(eff1[i],PRIMITIVE_TRIANGLESTRIP);
		Obj_SetRenderPriorityI(eff1[i],layer);
		ObjPrim_SetVertexCount(eff1[i],4);
		ObjPrim_SetVertexPosition(eff1[i],0,-16,-16,0);
		ObjPrim_SetVertexPosition(eff1[i],1,-16, 16,0);
		ObjPrim_SetVertexPosition(eff1[i],2, 16,-16,0);
		ObjPrim_SetVertexPosition(eff1[i],3, 16, 16,0);
		ObjPrim_SetVertexUVT(eff1[i],0,  0,  0);
		ObjPrim_SetVertexUVT(eff1[i],1,  0, 32);
		ObjPrim_SetVertexUVT(eff1[i],2, 32,  0);
		ObjPrim_SetVertexUVT(eff1[i],3, 32, 32);
		ObjPrim_SetVertexColor(eff1[i],0,R,G,B);
		ObjPrim_SetVertexColor(eff1[i],1,R,G,B);
		ObjPrim_SetVertexColor(eff1[i],2,R,G,B);
		ObjPrim_SetVertexColor(eff1[i],3,R,G,B);

		ObjPrim_SetTexture(eff2[i],imgeff2);
		ObjRender_SetBlendType(eff2[i],BLEND_ADD_ARGB);
		ObjPrim_SetPrimitiveType(eff2[i],PRIMITIVE_TRIANGLESTRIP);
		Obj_SetRenderPriorityI(eff2[i],layer);
		ObjPrim_SetVertexCount(eff2[i],4);
		ObjPrim_SetVertexPosition(eff2[i],0,-15,-15,0);
		ObjPrim_SetVertexPosition(eff2[i],1,-15, 15,0);
		ObjPrim_SetVertexPosition(eff2[i],2, 15,-15,0);
		ObjPrim_SetVertexPosition(eff2[i],3, 15, 15,0);
		ObjPrim_SetVertexUVT(eff2[i],0, 33,  1);
		ObjPrim_SetVertexUVT(eff2[i],1, 33, 31);
		ObjPrim_SetVertexUVT(eff2[i],2, 63,  1);
		ObjPrim_SetVertexUVT(eff2[i],3, 63, 31);
		ObjPrim_SetVertexColor(eff2[i],0,255,255,255);
		ObjPrim_SetVertexColor(eff2[i],1,255,255,255);
		ObjPrim_SetVertexColor(eff2[i],2,255,255,255);
		ObjPrim_SetVertexColor(eff2[i],3,255,255,255);
		i++;
	}

	loop(time) {
		i=0;
		alpha    += alpha2/time*1.5;
		angle01  += angle2/time;
		angle02  += angle2/time;
		angle03  += angle2/time;
		scale01  += 1.8000/time;
		scale02  += 1.8000/time;
		scale03  += 1.8000/time;
		radius_a += 90.000/time;
		radius_b  = 90.000*cos(radius_a);
		radius01  = 128.00*sin(radius_b)+r01;
		radius02  = 192.00*sin(radius_b)+r02;
		radius03  = 256.00*sin(radius_b)+r03;

		ObjRender_SetPosition(eff1[0],ObjMove_GetX(Enemy)+radius01*cos(angle01),ObjMove_GetY(Enemy)+radius01*sin(angle01),0);
		ObjRender_SetPosition(eff2[0],ObjMove_GetX(Enemy)+radius01*cos(angle01),ObjMove_GetY(Enemy)+radius01*sin(angle01),0);
		ObjRender_SetPosition(eff1[1],ObjMove_GetX(Enemy)+radius02*cos(angle02),ObjMove_GetY(Enemy)+radius02*sin(angle02),0);
		ObjRender_SetPosition(eff2[1],ObjMove_GetX(Enemy)+radius02*cos(angle02),ObjMove_GetY(Enemy)+radius02*sin(angle02),0);
		ObjRender_SetPosition(eff1[2],ObjMove_GetX(Enemy)+radius03*cos(angle03),ObjMove_GetY(Enemy)+radius03*sin(angle03),0);
		ObjRender_SetPosition(eff2[2],ObjMove_GetX(Enemy)+radius03*cos(angle03),ObjMove_GetY(Enemy)+radius03*sin(angle03),0);
		ObjRender_SetScaleXYZ(eff1[0],scale01,scale01,1.00);
		ObjRender_SetScaleXYZ(eff2[0],scale01,scale01,1.00);
		ObjRender_SetScaleXYZ(eff1[1],scale02,scale02,1.00);
		ObjRender_SetScaleXYZ(eff2[1],scale02,scale02,1.00);
		ObjRender_SetScaleXYZ(eff1[2],scale03,scale03,1.00);
		ObjRender_SetScaleXYZ(eff2[2],scale03,scale03,1.00);
		ObjRender_SetAngleXYZ(eff1[0],0,0,angle01);
		ObjRender_SetAngleXYZ(eff2[0],0,0,angle01);
		ObjRender_SetAngleXYZ(eff1[1],0,0,angle02);
		ObjRender_SetAngleXYZ(eff2[1],0,0,angle02);
		ObjRender_SetAngleXYZ(eff1[2],0,0,angle03);
		ObjRender_SetAngleXYZ(eff2[2],0,0,angle03);

		loop(3) {
			ObjPrim_SetVertexAlpha(eff1[i],0,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],1,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],2,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],3,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff2[i],0,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff2[i],1,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff2[i],2,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff2[i],3,alpha*1.00);
			i++;
		}
		if(Obj_IsDeleted(Enemy)) { break; }
		yield;
	}
	alpha = alpha2;
	while(alpha>0) {
		i=0;
		alpha    -= alpha2/60;
		angle01  += angle2/time;
		angle02  += angle2/time;
		angle03  += angle2/time;
		scale01  += 1.8000/time;
		scale02  += 1.8000/time;
		scale03  += 1.8000/time;

		ObjRender_SetPosition(eff1[0],ObjMove_GetX(Enemy)+radius01*cos(angle01),ObjMove_GetY(Enemy)+radius01*sin(angle01),0);
		ObjRender_SetPosition(eff2[0],ObjMove_GetX(Enemy)+radius01*cos(angle01),ObjMove_GetY(Enemy)+radius01*sin(angle01),0);
		ObjRender_SetPosition(eff1[1],ObjMove_GetX(Enemy)+radius02*cos(angle02),ObjMove_GetY(Enemy)+radius02*sin(angle02),0);
		ObjRender_SetPosition(eff2[1],ObjMove_GetX(Enemy)+radius02*cos(angle02),ObjMove_GetY(Enemy)+radius02*sin(angle02),0);
		ObjRender_SetPosition(eff1[2],ObjMove_GetX(Enemy)+radius03*cos(angle03),ObjMove_GetY(Enemy)+radius03*sin(angle03),0);
		ObjRender_SetPosition(eff2[2],ObjMove_GetX(Enemy)+radius03*cos(angle03),ObjMove_GetY(Enemy)+radius03*sin(angle03),0);
		ObjRender_SetScaleXYZ(eff1[0],scale01,scale01,1.00);
		ObjRender_SetScaleXYZ(eff2[0],scale01,scale01,1.00);
		ObjRender_SetScaleXYZ(eff1[1],scale02,scale02,1.00);
		ObjRender_SetScaleXYZ(eff2[1],scale02,scale02,1.00);
		ObjRender_SetScaleXYZ(eff1[2],scale03,scale03,1.00);
		ObjRender_SetScaleXYZ(eff2[2],scale03,scale03,1.00);

		loop(3) {
			ObjPrim_SetVertexAlpha(eff1[i],0,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],1,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],2,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff1[i],3,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff2[i],0,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff2[i],1,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff2[i],2,alpha*1.00);
			ObjPrim_SetVertexAlpha(eff2[i],3,alpha*1.00);
			i++;
		}
		if(Obj_IsDeleted(Enemy)) { break; }
		yield;
	}
	i=0;
	loop(3) {
		Obj_Delete(eff1[i]);
		Obj_Delete(eff2[i]);
		i++;
	}
}

