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

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

//-----------------------------------------------------------------------
// ■ カットイン系関数の準備
//-----------------------------------------------------------------------
function InitializeCutin {
	CreateCommonDataArea("spelldata");
}

//-----------------------------------------------------------------------
// ■ キャラ立ち絵表示 [th06〜th14]
//-----------------------------------------------------------------------
task Cutin01(type,X,Y,texture,rect01,rect02,rect03,rect04) {

	let Enemy	= GetEnemyBossObjectID[0];
	let cutin	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let alpha	= 0;
	let scale	= 0.5;
	let move01	= 0;
	let move02	= 0;
	let move03	= 0;
	let move04	= 0;
	let rectX	= (rect01+rect03)/2.0;
	let rectY	= (rect02+rect04)/2.0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 32;
	let MinY	= 16;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;

	let layer	= 30;

	LoadTexture(texture);
	LoadTexture(imgspelleffect);

	/*****************************************************************
		type 0：紅魔郷
		type 1：妖々夢　永夜抄
		type 2：風神録
		type 3：地霊殿　星蓮船　妖精大戦争　神霊廟　輝針城
		type 4：聖 白蓮
		type 5：霊烏路 空
		type 6：オリジナル（type 0 の逆）
		type 7：オリジナル（type 1 の逆）
		type 8：オリジナル（type 3 の逆）
		type 9：オリジナル（type 4 の逆）
	*****************************************************************/

	ObjPrim_SetTexture(cutin,texture);
	ObjRender_SetBlendType(cutin,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(cutin,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(cutin,scale,scale,1.00);
	Obj_SetRenderPriorityI(cutin,layer);
	ObjPrim_SetVertexCount(cutin,4);
	ObjPrim_SetVertexPosition(cutin,0,-(rectX-rect01),-(rectY-rect02),0);
	ObjPrim_SetVertexPosition(cutin,1,-(rectX-rect01), (rect04-rectY),0);
	ObjPrim_SetVertexPosition(cutin,2, (rect03-rectX),-(rectY-rect02),0);
	ObjPrim_SetVertexPosition(cutin,3, (rect03-rectX), (rect04-rectY),0);
	ObjPrim_SetVertexUVT(cutin,0, rect01, rect02);
	ObjPrim_SetVertexUVT(cutin,1, rect01, rect04);
	ObjPrim_SetVertexUVT(cutin,2, rect03, rect02);
	ObjPrim_SetVertexUVT(cutin,3, rect03, rect04);

	alternative(type)
	case(0) {
		loop(30) {
			alpha  += 255/30;
			move01 += 90/60;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(30) {
			move01 += 90/60;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY+Y,0);
			yield;
		}
		loop(30) { yield; move01 = 0; }
		loop(60) {
			move01 += 90/60;
			alpha  -= 255/30;
			scale   = 1.0+2.0*sin(move01);

			ObjRender_SetScaleXYZ(cutin,scale,scale,1.00);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
	}

	case(1) {
		loop(30) {
			alpha  += 255/30;
			move01 += 200/150;

			ObjRender_SetPosition(cutin,CenX+X,CenY-200+move01+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(60) {
			move01 += 200/150;

			ObjRender_SetPosition(cutin,CenX+X,CenY-200+move01+Y,0);
			yield;
		}
		loop(60) {
			alpha  -= 255/60;
			move01 += 200/150;

			ObjRender_SetPosition(cutin,CenX+X,CenY-200+move01+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
	}

	case(2) {
		move03 = -45;
		loop(60) {
			alpha  += 255/60;
			move01 += 90/60;
			move02  = 200*sin(move01);
			move03 -= 135/150;
			move04  = 200*sin(move03);

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY-100-move04+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(60) {
			move03 -= 135/150;
			move04  = 200*sin(move03);

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY-100-move04+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(60) {
			alpha  -= 255/60;
			move03 -= 135/150;
			move04  = 200*sin(move03);

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY-100-move04+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
	}

	case(3) {
		loop(30) {
			alpha  += 255/30;
			move01 += 60/30;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY-200+move02+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(90) {
			move01 += 30/90;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY-200+move02+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(30) {
			alpha  -= 255/30;
			move02 += 10.0;

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY-200+move02+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
	}

	case(4) {
		loop(30) {
			alpha  += 255/30;
			move01 += 60/30;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX-200+move02+X,CenY+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(90) {
			move01 += 30/90;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX-200+move02+X,CenY+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(30) {
			alpha  -= 255/30;
			move02 += 10.0;

			ObjRender_SetPosition(cutin,CenX-200+move02+X,CenY+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
	}

	case(5) {
		loop(30) {
			alpha  += 255/30;
			move01 += 60/30;
			move02  = 500*sin(move01);

			ObjRender_SetPosition(cutin,CenX+X,CenY+400-move02+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(90) {
			move01 += 30/90;
			move02  = 500*sin(move01);

			ObjRender_SetPosition(cutin,CenX+X,CenY+400-move02+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(60) {
			move03 += 90/60;
			alpha -= 255/60;
			scale -= 0.1*sin(-move03);

			ObjRender_SetScaleXYZ(cutin,scale,scale,1.00);
			ObjRender_SetPosition(cutin,CenX+X,CenY+400-move02+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
	}

	case(6) {
		loop(30) {
			alpha  += 255/30;
			move01 += 90/60;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX-200+move02+X,CenY+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(30) {
			move01 += 90/60;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX-200+move02+X,CenY+Y,0);
			yield;
		}
		loop(30) { yield; move01 = 0; }
		loop(60) {
			move01 += 90/60;
			alpha  -= 255/30;
			scale   = 1.0+2.0*sin(move01);

			ObjRender_SetScaleXYZ(cutin,scale,scale,1.00);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
	}

	case(7) {
		loop(30) {
			alpha  += 255/30;
			move01 += 200/150;

			ObjRender_SetPosition(cutin,CenX+X,CenY+200-move01+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(60) {
			move01 += 200/150;

			ObjRender_SetPosition(cutin,CenX+X,CenY+200-move01+Y,0);
			yield;
		}
		loop(60) {
			alpha  -= 255/60;
			move01 += 200/150;

			ObjRender_SetPosition(cutin,CenX+X,CenY+200-move01+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
	}

	case(8) {
		loop(30) {
			alpha  += 255/30;
			move01 += 60/30;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX-200+move02+X,CenY-200+move02+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(90) {
			move01 += 30/90;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX-200+move02+X,CenY-200+move02+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(30) {
			alpha  -= 255/30;
			move02 += 10.0;

			ObjRender_SetPosition(cutin,CenX-200+move02+X,CenY-200+move02+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
	}

	case(9) {
		loop(30) {
			alpha  += 255/30;
			move01 += 60/30;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(90) {
			move01 += 30/90;
			move02  = 200*sin(move01);

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
		loop(30) {
			alpha  -= 255/30;
			move02 += 10.0;

			ObjRender_SetPosition(cutin,CenX+200-move02+X,CenY+Y,0);
			ObjPrim_SetVertexAlpha(cutin,0,alpha);
			ObjPrim_SetVertexAlpha(cutin,1,alpha);
			ObjPrim_SetVertexAlpha(cutin,2,alpha);
			ObjPrim_SetVertexAlpha(cutin,3,alpha);
			yield;
		}
	}
	Obj_Delete(cutin);
}

//-----------------------------------------------------------------------
// ■ スペルカード名表示 [th08〜th14]
//-----------------------------------------------------------------------
task Cutin02(type,X,Y,texture,rect01,rect02,rect03,rect04) {}
task Cutin02b(type,X,Y,texture,rect01,rect02,rect03,rect04) {

	let Enemy	= GetEnemyBossObjectID[0];
	let spn01	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let spn02	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let alpha	= 0;
	let scale	= 4;
	let move01	= 0;
	let move02	= 0;
	let rectX	= (rect01+rect03)/2.0;
	let rectY	= (rect02+rect04)/2.0;
	let plU		= 0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 32;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;

	let layer	= 80;

	SpellTimeRing();
	SpellBackGround();

	LoadTexture(texture);
	LoadTexture(imgspelleffect);
	PlaySE(".\se\seUseSpellCard.wav");

	/*****************************************************************
		type 0：妖々夢　
		type 1：永夜抄　風神録　地霊殿　星蓮船　妖精大戦争
		type 2：神霊廟　輝針城
	*****************************************************************/

	if(type==0) { plU = 256; }

	ObjRender_SetX(spn01,CenX+80);
	ObjRender_SetY(spn01,MinY+368);
	ObjPrim_SetTexture(spn01,imgspelleffect);
	ObjRender_SetBlendType(spn01,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(spn01,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(spn01,scale,scale,1.00);
	Obj_SetRenderPriorityI(spn01,layer);
	ObjPrim_SetVertexCount(spn01,4);
	ObjPrim_SetVertexPosition(spn01,0,-128,-32,0);
	ObjPrim_SetVertexPosition(spn01,1,-128, 32,0);
	ObjPrim_SetVertexPosition(spn01,2, 128,-32,0);
	ObjPrim_SetVertexPosition(spn01,3, 128, 32,0);
	ObjPrim_SetVertexUVT(spn01,0,   0+plU, 0);
	ObjPrim_SetVertexUVT(spn01,1,   0+plU,63);
	ObjPrim_SetVertexUVT(spn01,2, 256+plU, 0);
	ObjPrim_SetVertexUVT(spn01,3, 256+plU,63);

	ObjRender_SetX(spn02,CenX+X);
	ObjRender_SetY(spn02,MinY+368+Y);
	ObjPrim_SetTexture(spn02,texture);
	ObjRender_SetBlendType(spn02,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(spn02,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(spn02,scale,scale,1.00);
	Obj_SetRenderPriorityI(spn02,layer);
	ObjPrim_SetVertexCount(spn02,4);
	ObjPrim_SetVertexPosition(spn02,0,-(rectX-rect01),-(rectY-rect02),0);
	ObjPrim_SetVertexPosition(spn02,1,-(rectX-rect01), (rect04-rectY),0);
	ObjPrim_SetVertexPosition(spn02,2, (rect03-rectX),-(rectY-rect02),0);
	ObjPrim_SetVertexPosition(spn02,3, (rect03-rectX), (rect04-rectY),0);
	ObjPrim_SetVertexUVT(spn02,0, rect01, rect02);
	ObjPrim_SetVertexUVT(spn02,1, rect01, rect04);
	ObjPrim_SetVertexUVT(spn02,2, rect03, rect02);
	ObjPrim_SetVertexUVT(spn02,3, rect03, rect04);

	loop(30) {
		move01 += 90/30;
		alpha   = 255*sin(move01);
		scale   = 3.0*sin(move01);

		ObjRender_SetScaleXYZ(spn01,4.0-scale,4.0-scale,1.00);
		ObjRender_SetScaleXYZ(spn02,4.0-scale,4.0-scale,1.00);
		ObjPrim_SetVertexAlpha(spn01,0,alpha);
		ObjPrim_SetVertexAlpha(spn01,1,alpha);
		ObjPrim_SetVertexAlpha(spn01,2,alpha);
		ObjPrim_SetVertexAlpha(spn01,3,alpha);
		ObjPrim_SetVertexAlpha(spn02,0,alpha);
		ObjPrim_SetVertexAlpha(spn02,1,alpha);
		ObjPrim_SetVertexAlpha(spn02,2,alpha);
		ObjPrim_SetVertexAlpha(spn02,3,alpha);
		yield;
	}
	loop(45) { yield; }
	alternative(type)
	case(0,1) {
		loop(45) {
			move01 += 90/45;
			move02  = 340*cos(move01);

			ObjRender_SetY(spn01,MinY+368+move02);
			ObjRender_SetY(spn02,MinY+368+move02+Y);
			yield;
		}
		if(ON_ORIGINAL_SCB==true) {
			SpellBonus_Ex(0,0);
		}
		else {
			SpellBonus(0,0);
		}
	}
	case(2) {
		loop(45) {
			move01 += 90/45;
			move02  = 360*cos(move01);

			ObjRender_SetY(spn01,MinY+368+move02);
			ObjRender_SetY(spn02,MinY+368+move02+Y);
			yield;
		}
		if(ON_ORIGINAL_SCB==true) {
			SpellBonus_Ex(0,-20);
		}
		else {
			SpellBonus(0,-20);
		}
	}
	while(!Obj_IsDeleted(Enemy)) {
		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjPrim_SetVertexAlpha(spn01,0,alpha);
		ObjPrim_SetVertexAlpha(spn01,1,alpha);
		ObjPrim_SetVertexAlpha(spn01,2,alpha);
		ObjPrim_SetVertexAlpha(spn01,3,alpha);
		ObjPrim_SetVertexAlpha(spn02,0,alpha);
		ObjPrim_SetVertexAlpha(spn02,1,alpha);
		ObjPrim_SetVertexAlpha(spn02,2,alpha);
		ObjPrim_SetVertexAlpha(spn02,3,alpha);
		yield;
	}
	Obj_Delete(spn01);
	Obj_Delete(spn02);
}

//-----------------------------------------------------------------------
// ■ スペルカード名表示 [th08〜th14] [文字列指定]
//-----------------------------------------------------------------------
task Cutin03(type,X,Y,spellname) {

	let Enemy	= GetEnemyBossObjectID[0];
	let spn01	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let spn02	= ObjText_Create();
	let alpha	= 0;
	let scale	= 4;
	let move01	= 0;
	let move02	= 0;
	let plU		= 0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 32;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;

	let layer	= 80;
	let FontType	= "HGSｺﾞｼｯｸE";

	//==================================================
	// ■フォントタイプ一覧（原作に近いものを抜粋）
	//--------------------------------------------------
	// ・"HGSｺﾞｼｯｸE"
	// ・"HG平成角ｺﾞｼｯｸ体W5ARIB"
	//==================================================

	SpellTimeRing();
	SpellBackGround();

	LoadTexture(imgspelleffect);
	PlaySE(".\se\seUseSpellCard.wav");

	/*****************************************************************
		type 0：妖々夢　
		type 1：永夜抄　風神録　地霊殿　星蓮船　妖精大戦争
		type 2：神霊廟　輝針城
	*****************************************************************/

	if(type==0) { plU = 256; }

	ObjRender_SetX(spn01,CenX+80);
	ObjRender_SetY(spn01,MinY+368);
	ObjPrim_SetTexture(spn01,imgspelleffect);
	ObjRender_SetBlendType(spn01,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(spn01,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(spn01,scale,scale,1.00);
	Obj_SetRenderPriorityI(spn01,layer);
	ObjPrim_SetVertexCount(spn01,4);
	ObjPrim_SetVertexPosition(spn01,0,-128,-32,0);
	ObjPrim_SetVertexPosition(spn01,1,-128, 32,0);
	ObjPrim_SetVertexPosition(spn01,2, 128,-32,0);
	ObjPrim_SetVertexPosition(spn01,3, 128, 32,0);
	ObjPrim_SetVertexUVT(spn01,0,   0+plU, 0);
	ObjPrim_SetVertexUVT(spn01,1,   0+plU,63);
	ObjPrim_SetVertexUVT(spn01,2, 256+plU, 0);
	ObjPrim_SetVertexUVT(spn01,3, 256+plU,63);

	ObjRender_SetX(spn02,X);
	ObjRender_SetY(spn02,MinY+361+Y);
	ObjRender_SetBlendType(spn02,BLEND_ALPHA);
	ObjRender_SetScaleXYZ(spn02,scale,scale,1.00);
	Obj_SetRenderPriorityI(spn02,layer);
	ObjText_SetText(spn02,spellname);
	ObjText_SetFontType(spn02,FontType);
	ObjText_SetFontSize(spn02,  15);
	ObjText_SetMaxWidth(spn02, 384);
	ObjText_SetLinePitch(spn02,  0);
	ObjText_SetSidePitch(spn02,  0);
	ObjText_SetFontBold(spn02,false);
	ObjText_SetAutoTransCenter(spn02,true);
	ObjText_SetFontBorderType(spn02,BORDER_FULL);
	ObjText_SetHorizontalAlignment(spn02,ALIGNMENT_RIGHT);
	ObjText_SetFontBorderWidth(spn02,1.00);
	ObjText_SetFontBorderColor(spn02, 16, 16, 16);
	ObjText_SetFontColorTop(   spn02,255,255,255);
	ObjText_SetFontColorBottom(spn02,255,255,255);

	loop(30) {
		move01 += 90/30;
		alpha   = 255*sin(move01);
		scale   = 3.0*sin(move01);

		ObjRender_SetScaleXYZ(spn01,4.0-scale,4.0-scale,1.00);
		ObjRender_SetScaleXYZ(spn02,4.0-scale,4.0-scale,1.00);
		ObjPrim_SetVertexAlpha(spn01,0,alpha);
		ObjPrim_SetVertexAlpha(spn01,1,alpha);
		ObjPrim_SetVertexAlpha(spn01,2,alpha);
		ObjPrim_SetVertexAlpha(spn01,3,alpha);
		ObjRender_SetAlpha(spn02,alpha);
		yield;
	}
	loop(45) { yield; }
	alternative(type)
	case(0,1) {
		loop(45) {
			move01 += 90/45;
			move02  = 340*cos(move01);

			ObjRender_SetY(spn01,MinY+368+move02);
			ObjRender_SetY(spn02,MinY+361+move02+Y);
			yield;
		}
		if(ON_ORIGINAL_SCB==true) {
			SpellBonus_Ex(0,0);
		}
		else {
			SpellBonus(0,0);
		}
	}
	case(2) {
		loop(45) {
			move01 += 90/45;
			move02  = 360*cos(move01);

			ObjRender_SetY(spn01,MinY+368+move02);
			ObjRender_SetY(spn02,MinY+361+move02+Y);
			yield;
		}
		if(ON_ORIGINAL_SCB==true) {
			SpellBonus_Ex(0,-20);
		}
		else {
			SpellBonus(0,-20);
		}
	}
	while(!Obj_IsDeleted(Enemy)) {
		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjPrim_SetVertexAlpha(spn01,0,alpha);
		ObjPrim_SetVertexAlpha(spn01,1,alpha);
		ObjPrim_SetVertexAlpha(spn01,2,alpha);
		ObjPrim_SetVertexAlpha(spn01,3,alpha);
		ObjRender_SetAlpha(spn02,alpha);
		yield;
	}
	Obj_Delete(spn01);
	Obj_Delete(spn02);
}

//-----------------------------------------------------------------------
// ■ スペルカード名移動 [th08〜th14] [文字列指定]
//-----------------------------------------------------------------------
task Cutin04(type,X,Y,spellname,delay) {

	let Enemy	= GetEnemyBossObjectID[0];
	let spn01	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let spn02	= ObjText_Create();
	let alpha	= 255;
	let move01	= 0;
	let move02	= 0;
	let plU		= 0;
	let pX		= 0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 32;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;

	let layer	= 80;
	let FontType	= "HGSｺﾞｼｯｸE";

	//==================================================
	// ■フォントタイプ一覧（原作に近いものを抜粋）
	//--------------------------------------------------
	// ・"HGSｺﾞｼｯｸE"
	// ・"HG平成角ｺﾞｼｯｸ体W5ARIB"
	//==================================================

	LoadTexture(imgspelleffect);

	/*****************************************************************
		type 0：妖々夢　
		type 1：永夜抄　風神録　地霊殿　星蓮船　妖精大戦争
		type 2：神霊廟　輝針城
	*****************************************************************/

	if(type==0) { plU = 256; }

	ObjPrim_SetTexture(spn01,imgspelleffect);
	ObjRender_SetBlendType(spn01,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(spn01,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(spn01,1,1,1);
	Obj_SetRenderPriorityI(spn01,layer);
	ObjPrim_SetVertexCount(spn01,4);
	ObjPrim_SetVertexPosition(spn01,0,-128,-32,0);
	ObjPrim_SetVertexPosition(spn01,1,-128, 32,0);
	ObjPrim_SetVertexPosition(spn01,2, 128,-32,0);
	ObjPrim_SetVertexPosition(spn01,3, 128, 32,0);
	ObjPrim_SetVertexUVT(spn01,0,   0+plU, 0);
	ObjPrim_SetVertexUVT(spn01,1,   0+plU,63);
	ObjPrim_SetVertexUVT(spn01,2, 256+plU, 0);
	ObjPrim_SetVertexUVT(spn01,3, 256+plU,63);

	ObjRender_SetBlendType(spn02,BLEND_ALPHA);
	ObjRender_SetScaleXYZ(spn01,1,1,1);
	Obj_SetRenderPriorityI(spn02,layer);
	ObjText_SetText(spn02,spellname);
	ObjText_SetFontType(spn02,FontType);
	ObjText_SetFontSize(spn02,  15);
	ObjText_SetMaxWidth(spn02, 384);
	ObjText_SetLinePitch(spn02,  0);
	ObjText_SetSidePitch(spn02,  0);
	ObjText_SetFontBold(spn02,false);
	ObjText_SetAutoTransCenter(spn02,true);
	ObjText_SetFontBorderType(spn02,BORDER_FULL);
	ObjText_SetHorizontalAlignment(spn02,ALIGNMENT_RIGHT);
	ObjText_SetFontBorderWidth(spn02,1.00);
	ObjText_SetFontBorderColor(spn02, 16, 16, 16);
	ObjText_SetFontColorTop(   spn02,255,255,255);
	ObjText_SetFontColorBottom(spn02,255,255,255);

	alternative(type)
	case(0,1) {
		ObjRender_SetY(spn01,MinY+368+340*cos(180));
		ObjRender_SetY(spn02,MinY+361+340*cos(180)+Y);
	}
	case(2) {
		ObjRender_SetY(spn01,MinY+368+360*cos(180));
		ObjRender_SetY(spn02,MinY+361+360*cos(180)+Y);
	}
	loop(delay) {
		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjRender_SetX(spn01,pX+CenX+80);
		ObjRender_SetX(spn02,pX+X);
		ObjPrim_SetVertexAlpha(spn01,0,alpha);
		ObjPrim_SetVertexAlpha(spn01,1,alpha);
		ObjPrim_SetVertexAlpha(spn01,2,alpha);
		ObjPrim_SetVertexAlpha(spn01,3,alpha);
		ObjRender_SetAlpha(spn02,alpha);
		yield;
	}
	while(ObjRender_GetX(spn02)<=MinX+592) {
		pX += 10.00;

		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjRender_SetX(spn01,pX+CenX+80);
		ObjRender_SetX(spn02,pX+X);
		ObjPrim_SetVertexAlpha(spn01,0,alpha);
		ObjPrim_SetVertexAlpha(spn01,1,alpha);
		ObjPrim_SetVertexAlpha(spn01,2,alpha);
		ObjPrim_SetVertexAlpha(spn01,3,alpha);
		ObjRender_SetAlpha(spn02,alpha);
		yield;
	}
	Obj_Delete(spn01);
	Obj_Delete(spn02);
}

//-----------------------------------------------------------------------
// ■ スペルカード名移動 [th08〜th14]
//-----------------------------------------------------------------------
task SpellCardEnd(type,X,Y,texture,rect01,rect02,rect03,rect04) {

	let spn01	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let spn02	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let alpha	= 255;
	let rectX	= (rect01+rect03)/2.0;
	let rectY	= (rect02+rect04)/2.0;
	let plU		= 0;
	let pX		= 0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 32;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;

	let layer	= 80;

	LoadTexture(texture);
	LoadTexture(imgspelleffect);

	/*****************************************************************
		type 0：妖々夢　
		type 1：永夜抄　風神録　地霊殿　星蓮船　妖精大戦争
		type 2：神霊廟　輝針城
	*****************************************************************/

	if(type==0) { plU = 256; }

	ObjPrim_SetTexture(spn01,imgspelleffect);
	ObjRender_SetBlendType(spn01,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(spn01,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(spn01,1,1,1);
	Obj_SetRenderPriorityI(spn01,layer);
	ObjPrim_SetVertexCount(spn01,4);
	ObjPrim_SetVertexPosition(spn01,0,-128,-32,0);
	ObjPrim_SetVertexPosition(spn01,1,-128, 32,0);
	ObjPrim_SetVertexPosition(spn01,2, 128,-32,0);
	ObjPrim_SetVertexPosition(spn01,3, 128, 32,0);
	ObjPrim_SetVertexUVT(spn01,0,   0+plU, 0);
	ObjPrim_SetVertexUVT(spn01,1,   0+plU,63);
	ObjPrim_SetVertexUVT(spn01,2, 256+plU, 0);
	ObjPrim_SetVertexUVT(spn01,3, 256+plU,63);
	ObjPrim_SetVertexAlpha(spn01,0,255);
	ObjPrim_SetVertexAlpha(spn01,1,255);
	ObjPrim_SetVertexAlpha(spn01,2,255);
	ObjPrim_SetVertexAlpha(spn01,3,255);

	ObjPrim_SetTexture(spn02,texture);
	ObjRender_SetBlendType(spn02,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(spn02,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(spn02,1,1,1);
	Obj_SetRenderPriorityI(spn02,layer);
	ObjPrim_SetVertexCount(spn02,4);
	ObjPrim_SetVertexPosition(spn02,0,-(rectX-rect01),-(rectY-rect02),0);
	ObjPrim_SetVertexPosition(spn02,1,-(rectX-rect01), (rect04-rectY),0);
	ObjPrim_SetVertexPosition(spn02,2, (rect03-rectX),-(rectY-rect02),0);
	ObjPrim_SetVertexPosition(spn02,3, (rect03-rectX), (rect04-rectY),0);
	ObjPrim_SetVertexUVT(spn02,0, rect01, rect02);
	ObjPrim_SetVertexUVT(spn02,1, rect01, rect04);
	ObjPrim_SetVertexUVT(spn02,2, rect03, rect02);
	ObjPrim_SetVertexUVT(spn02,3, rect03, rect04);
	ObjPrim_SetVertexAlpha(spn02,0,255);
	ObjPrim_SetVertexAlpha(spn02,1,255);
	ObjPrim_SetVertexAlpha(spn02,2,255);
	ObjPrim_SetVertexAlpha(spn02,3,255);

	alternative(type)
	case(0,1) {
		ObjRender_SetY(spn01,MinY+368+340*cos(180));
		ObjRender_SetY(spn02,MinY+368+340*cos(180)+Y);
	}
	case(2) {
		ObjRender_SetY(spn01,MinY+368+360*cos(180));
		ObjRender_SetY(spn02,MinY+368+360*cos(180)+Y);
	}
	while(ObjRender_GetX(spn02)<=MinX+592) {
		pX += 10.00;

		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjRender_SetX(spn01,pX+CenX+80);
		ObjRender_SetX(spn02,pX+CenX+X);
		ObjPrim_SetVertexAlpha(spn01,0,alpha);
		ObjPrim_SetVertexAlpha(spn01,1,alpha);
		ObjPrim_SetVertexAlpha(spn01,2,alpha);
		ObjPrim_SetVertexAlpha(spn01,3,alpha);
		ObjPrim_SetVertexAlpha(spn02,0,alpha);
		ObjPrim_SetVertexAlpha(spn02,1,alpha);
		ObjPrim_SetVertexAlpha(spn02,2,alpha);
		ObjPrim_SetVertexAlpha(spn02,3,alpha);
		yield;
	}
	Obj_Delete(spn01);
	Obj_Delete(spn02);
}

//-----------------------------------------------------------------------
// ■ スペルカード名移動 [th08〜th14] [遅延可能]
//-----------------------------------------------------------------------
task SpellCardEnd_Ex(type,X,Y,texture,rect01,rect02,rect03,rect04,delay) {

	let spn01	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let spn02	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let alpha	= 255;
	let rectX	= (rect01+rect03)/2.0;
	let rectY	= (rect02+rect04)/2.0;
	let plU		= 0;
	let pX		= 0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 32;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;

	let layer	= 80;

	LoadTexture(texture);
	LoadTexture(imgspelleffect);

	/*****************************************************************
		type 0：妖々夢　
		type 1：永夜抄　風神録　地霊殿　星蓮船　妖精大戦争
		type 2：神霊廟　輝針城
	*****************************************************************/

	if(type==0) { plU = 256; }

	ObjPrim_SetTexture(spn01,imgspelleffect);
	ObjRender_SetBlendType(spn01,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(spn01,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(spn01,1,1,1);
	Obj_SetRenderPriorityI(spn01,layer);
	ObjPrim_SetVertexCount(spn01,4);
	ObjPrim_SetVertexPosition(spn01,0,-128,-32,0);
	ObjPrim_SetVertexPosition(spn01,1,-128, 32,0);
	ObjPrim_SetVertexPosition(spn01,2, 128,-32,0);
	ObjPrim_SetVertexPosition(spn01,3, 128, 32,0);
	ObjPrim_SetVertexUVT(spn01,0,   0+plU, 0);
	ObjPrim_SetVertexUVT(spn01,1,   0+plU,63);
	ObjPrim_SetVertexUVT(spn01,2, 256+plU, 0);
	ObjPrim_SetVertexUVT(spn01,3, 256+plU,63);
	ObjPrim_SetVertexAlpha(spn01,0,255);
	ObjPrim_SetVertexAlpha(spn01,1,255);
	ObjPrim_SetVertexAlpha(spn01,2,255);
	ObjPrim_SetVertexAlpha(spn01,3,255);

	ObjPrim_SetTexture(spn02,texture);
	ObjRender_SetBlendType(spn02,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(spn02,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(spn02,1,1,1);
	Obj_SetRenderPriorityI(spn02,layer);
	ObjPrim_SetVertexCount(spn02,4);
	ObjPrim_SetVertexPosition(spn02,0,-(rectX-rect01),-(rectY-rect02),0);
	ObjPrim_SetVertexPosition(spn02,1,-(rectX-rect01), (rect04-rectY),0);
	ObjPrim_SetVertexPosition(spn02,2, (rect03-rectX),-(rectY-rect02),0);
	ObjPrim_SetVertexPosition(spn02,3, (rect03-rectX), (rect04-rectY),0);
	ObjPrim_SetVertexUVT(spn02,0, rect01, rect02);
	ObjPrim_SetVertexUVT(spn02,1, rect01, rect04);
	ObjPrim_SetVertexUVT(spn02,2, rect03, rect02);
	ObjPrim_SetVertexUVT(spn02,3, rect03, rect04);
	ObjPrim_SetVertexAlpha(spn02,0,255);
	ObjPrim_SetVertexAlpha(spn02,1,255);
	ObjPrim_SetVertexAlpha(spn02,2,255);
	ObjPrim_SetVertexAlpha(spn02,3,255);

	alternative(type)
	case(0,1) {
		ObjRender_SetY(spn01,MinY+368+340*cos(180));
		ObjRender_SetY(spn02,MinY+368+340*cos(180)+Y);
	}
	case(2) {
		ObjRender_SetY(spn01,MinY+368+360*cos(180));
		ObjRender_SetY(spn02,MinY+368+360*cos(180)+Y);
	}
	loop(delay) {
		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjRender_SetX(spn01,pX+CenX+80);
		ObjRender_SetX(spn02,pX+CenX+X);
		ObjPrim_SetVertexAlpha(spn01,0,alpha);
		ObjPrim_SetVertexAlpha(spn01,1,alpha);
		ObjPrim_SetVertexAlpha(spn01,2,alpha);
		ObjPrim_SetVertexAlpha(spn01,3,alpha);
		ObjPrim_SetVertexAlpha(spn02,0,alpha);
		ObjPrim_SetVertexAlpha(spn02,1,alpha);
		ObjPrim_SetVertexAlpha(spn02,2,alpha);
		ObjPrim_SetVertexAlpha(spn02,3,alpha);
		yield;
	}
	while(ObjRender_GetX(spn02)<=MinX+592) {
		pX += 10.00;

		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjRender_SetX(spn01,pX+CenX+80);
		ObjRender_SetX(spn02,pX+CenX+X);
		ObjPrim_SetVertexAlpha(spn01,0,alpha);
		ObjPrim_SetVertexAlpha(spn01,1,alpha);
		ObjPrim_SetVertexAlpha(spn01,2,alpha);
		ObjPrim_SetVertexAlpha(spn01,3,alpha);
		ObjPrim_SetVertexAlpha(spn02,0,alpha);
		ObjPrim_SetVertexAlpha(spn02,1,alpha);
		ObjPrim_SetVertexAlpha(spn02,2,alpha);
		ObjPrim_SetVertexAlpha(spn02,3,alpha);
		yield;
	}
	Obj_Delete(spn01);
	Obj_Delete(spn02);
}

//-----------------------------------------------------------------------
// ■ スペルカードボーナスの設定
//-----------------------------------------------------------------------
	let ON_ORIGINAL_SCB	= false;
	let SPELL_CARD_BONUS	= 0;
	let ELAPSED_TIME01	= 0;
	let ELAPSED_TIME02	= 0;
//-----------------------------------------------------------------------
task SetScore_Ex(SpellScore,SpellType) {

	let Enemy		= GetEnemyBossObjectID[0];
	let SpellCardTime	= (ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_TIMER)-5)*60;
	let SCB_ReductionRate	= ceil((SpellScore/SpellCardTime)/10)*10;

	ON_ORIGINAL_SCB		= true;
	ELAPSED_TIME01		= 0.00;
	ELAPSED_TIME02		= 0.00;
	SPELL_CARD_BONUS	= SpellScore;

	loop(5*60) {
		ELAPSED_TIME01 += 100/6000;
		ELAPSED_TIME02 += (100/6000)*(60/GetCurrentFps);

		if(SPELL_CARD_BONUS<=0 || ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_PLAYER_SPELL_COUNT)!=0 || ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_PLAYER_SHOOTDOWN_COUNT)!=0) {
			SPELL_CARD_BONUS = 0;
		}

		SetAreaCommonData("spelldata","E_Time01",ELAPSED_TIME01);
		SetAreaCommonData("spelldata","E_Time02",ELAPSED_TIME02);
		SetAreaCommonData("spelldata","SCB",SPELL_CARD_BONUS);
		yield;
	}
	if(SpellType==0) {
		while(ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_TIMER)>=0 && ObjEnemy_GetInfo(Enemy,INFO_LIFE)>0) {
			ELAPSED_TIME01   += 100/6000;
			ELAPSED_TIME02   += (100/6000)*(60/GetCurrentFps);
			SPELL_CARD_BONUS -= SCB_ReductionRate;

			if(SPELL_CARD_BONUS<=0 || ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_PLAYER_SPELL_COUNT)!=0 || ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_PLAYER_SHOOTDOWN_COUNT)!=0) {
				SPELL_CARD_BONUS = 0;
			}

			SetAreaCommonData("spelldata","E_Time01",ELAPSED_TIME01);
			SetAreaCommonData("spelldata","E_Time02",ELAPSED_TIME02);
			SetAreaCommonData("spelldata","SCB",SPELL_CARD_BONUS);
			yield;
		}
	}
	else {
		while(ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_TIMER)>=0 && ObjEnemy_GetInfo(Enemy,INFO_LIFE)>0) {
			ELAPSED_TIME01   += 100/6000;
			ELAPSED_TIME02   += (100/6000)*(60/GetCurrentFps);

			if(SPELL_CARD_BONUS<=0 || ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_PLAYER_SPELL_COUNT)!=0 || ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_PLAYER_SHOOTDOWN_COUNT)!=0) {
				SPELL_CARD_BONUS = 0;
			}

			SetAreaCommonData("spelldata","E_Time01",ELAPSED_TIME01);
			SetAreaCommonData("spelldata","E_Time02",ELAPSED_TIME02);
			SetAreaCommonData("spelldata","SCB",SPELL_CARD_BONUS);
			yield;
		}
	}
}

//-----------------------------------------------------------------------
// ■ スペルカードボーナスの取得
//-----------------------------------------------------------------------
function GetSpellCardBonus {
	let SCB		= GetAreaCommonData("spelldata","SCB",0);
	return SCB;
}

//-----------------------------------------------------------------------
// ■ ゲーム内経過時間の取得
//-----------------------------------------------------------------------
function GetElapsedTimer {
	let ET01	= GetAreaCommonData("spelldata","E_Time01",0);
	return ET01;
}

//-----------------------------------------------------------------------
// ■ 実経過時間の取得
//-----------------------------------------------------------------------
function GetElapsedTime {
	let ET02	= GetAreaCommonData("spelldata","E_Time02",0);
	return ET02;
}

//-----------------------------------------------------------------------
// ■ 前スペルのボーナスと撃破時間の表示
//-----------------------------------------------------------------------
function ViewDataOfBeforeSpell {
	ViewSpellBonus();
	ViewElapsedTimes();
}

//-----------------------------------------------------------------------
// ■ スペルカードボーナスの表示とスコア加算
//-----------------------------------------------------------------------
task ViewSpellBonus {

	LoadTexture(imgspelleffect);
	AddScore_Ex(GetSpellCardBonus(),60);

	let SCB		= GetSpellCardBonus();
	let txt		= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let point	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let score	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let nam		= [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0];
	let rect01	= [144,160,176,192,208,224,240,256,272,288];
	let rect02	= [160,176,192,208,224,240,256,272,288,304];
	let alpha	= [  0,  0,  0,  0,  0,  0,  0,  0,255,255];
	let count	= [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0];
	let RGB		= [255,128,255,128,255,128,255,128,255,128];
	let pX		= [ 52, 40, 28, 12,  0,-12,-28,-40, 20,-20];
	let pY		= 20.00;
	let mX		= 6.000;
	let wait	= 4.000;
	let period	= 30.00;
	let scale	= 1.000;
	let i		= 0.000;
	let i2		= 0.000;
	let i3		= 180.0;
	let i4		= 0.000;
	let i5		= 0.000;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 0;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;

	let layer	= 80;

	if(SCB<=0)        { SCB	= 0; }
	if(SCB>=99999999) { SCB	= 99999999; }

	nam[0]		= truncate((SCB%10));
	nam[1]		= truncate((SCB%100)/10);
	nam[2] 		= truncate((SCB%1000)/100);
	nam[3] 		= truncate((SCB%10000)/1000);
	nam[4] 		= truncate((SCB%100000)/10000);
	nam[5] 		= truncate((SCB%1000000)/100000);
	nam[6] 		= truncate((SCB%10000000)/1000000);
	nam[7] 		= truncate((SCB%100000000)/10000000);

	loop(8) { count[i] = -i*wait;	i++;	}
	i = 0;

	if(SCB<10000000) {
		Obj_Delete(score[7]);
		mX += 6;
		if(SCB<1000000) {
			Obj_Delete(score[6]);
			Obj_Delete(point[1]);
			mX += 8;
			if(SCB<100000) {
				Obj_Delete(score[5]);
				mX += 6;
				if(SCB<10000) {
					Obj_Delete(score[4]);
					mX += 6;
					if(SCB<1000) {
						Obj_Delete(score[3]);
						Obj_Delete(point[0]);
						mX += 8;
						if(SCB<100) {
							Obj_Delete(score[2]);
							mX += 6;
							if(SCB<10) {
								Obj_Delete(score[1]);
								mX += 6;
							}
						}
					}
				}
			}
		}
	}

	ObjRender_SetPosition(txt,CenX,CenY-112,0);
	ObjPrim_SetTexture(txt,imgspelleffect);
	ObjRender_SetBlendType(txt,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(txt,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(txt,1.0,1.0,1.0);
	ObjRender_SetAngleXYZ(txt,0,0,0);
	Obj_SetRenderPriorityI(txt,layer);
	ObjPrim_SetVertexCount(txt,4);
	ObjPrim_SetVertexPosition(txt,0,-112,-16,0);
	ObjPrim_SetVertexPosition(txt,1,-112, 16,0);
	ObjPrim_SetVertexPosition(txt,2, 112,-16,0);
	ObjPrim_SetVertexPosition(txt,3, 112, 16,0);
	ObjPrim_SetVertexUVT(txt,0, 144,192);
	ObjPrim_SetVertexUVT(txt,1, 144,224);
	ObjPrim_SetVertexUVT(txt,2, 368,192);
	ObjPrim_SetVertexUVT(txt,3, 368,224);
	ObjPrim_SetVertexAlpha(txt,0,255);
	ObjPrim_SetVertexAlpha(txt,1,255);
	ObjPrim_SetVertexAlpha(txt,2,255);
	ObjPrim_SetVertexAlpha(txt,3,255);

	ObjRender_SetPosition(point[0],CenX-mX+pX[8],CenY-84,0);
	ObjPrim_SetTexture(point[0],imgspelleffect);
	ObjRender_SetBlendType(point[0],BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(point[0],PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(point[0],1.0,1.0,1.0);
	ObjRender_SetAngleXYZ(point[0],0,0,0);
	Obj_SetRenderPriorityI(point[0],layer);
	ObjPrim_SetVertexCount(point[0],4);
	ObjPrim_SetVertexPosition(point[0],0,  -8,-15,0);
	ObjPrim_SetVertexPosition(point[0],1,  -8, 15,0);
	ObjPrim_SetVertexPosition(point[0],2,   8,-15,0);
	ObjPrim_SetVertexPosition(point[0],3,   8, 15,0);
	ObjPrim_SetVertexUVT(point[0],0, 304,161);
	ObjPrim_SetVertexUVT(point[0],1, 304,191);
	ObjPrim_SetVertexUVT(point[0],2, 320,161);
	ObjPrim_SetVertexUVT(point[0],3, 320,191);
	ObjPrim_SetVertexAlpha(point[0],0,0);
	ObjPrim_SetVertexAlpha(point[0],1,0);
	ObjPrim_SetVertexAlpha(point[0],2,0);
	ObjPrim_SetVertexAlpha(point[0],3,0);

	ObjRender_SetPosition(point[1],CenX-mX+pX[9],CenY-84,0);
	ObjPrim_SetTexture(point[1],imgspelleffect);
	ObjRender_SetBlendType(point[1],BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(point[1],PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(point[1],1.0,1.0,1.0);
	ObjRender_SetAngleXYZ(point[1],0,0,0);
	Obj_SetRenderPriorityI(point[1],layer);
	ObjPrim_SetVertexCount(point[1],4);
	ObjPrim_SetVertexPosition(point[1],0,  -8,-15,0);
	ObjPrim_SetVertexPosition(point[1],1,  -8, 15,0);
	ObjPrim_SetVertexPosition(point[1],2,   8,-15,0);
	ObjPrim_SetVertexPosition(point[1],3,   8, 15,0);
	ObjPrim_SetVertexUVT(point[1],0, 304,161);
	ObjPrim_SetVertexUVT(point[1],1, 304,191);
	ObjPrim_SetVertexUVT(point[1],2, 320,161);
	ObjPrim_SetVertexUVT(point[1],3, 320,191);
	ObjPrim_SetVertexAlpha(point[1],0,0);
	ObjPrim_SetVertexAlpha(point[1],1,0);
	ObjPrim_SetVertexAlpha(point[1],2,0);
	ObjPrim_SetVertexAlpha(point[1],3,0);

	loop(8) {
		ObjRender_SetPosition(score[i],CenX-mX+pX[i],CenY-84,0);
		ObjPrim_SetTexture(score[i],imgspelleffect);
		ObjRender_SetBlendType(score[i],BLEND_ALPHA);
		ObjPrim_SetPrimitiveType(score[i],PRIMITIVE_TRIANGLESTRIP);
		ObjRender_SetScaleXYZ(score[i],1.0,1.0,1.0);
		ObjRender_SetAngleXYZ(score[i],0,0,0);
		Obj_SetRenderPriorityI(score[i],layer);
		ObjPrim_SetVertexCount(score[i],4);
		ObjPrim_SetVertexPosition(score[i],0,-8,-15,0);
		ObjPrim_SetVertexPosition(score[i],1,-8, 15,0);
		ObjPrim_SetVertexPosition(score[i],2, 8,-15,0);
		ObjPrim_SetVertexPosition(score[i],3, 8, 15,0);
		ObjPrim_SetVertexUVT(score[i],0, rect01[nam[i]],161);
		ObjPrim_SetVertexUVT(score[i],1, rect01[nam[i]],191);
		ObjPrim_SetVertexUVT(score[i],2, rect02[nam[i]],161);
		ObjPrim_SetVertexUVT(score[i],3, rect02[nam[i]],191);
		ObjPrim_SetVertexAlpha(score[i],0,0);
		ObjPrim_SetVertexAlpha(score[i],1,0);
		ObjPrim_SetVertexAlpha(score[i],2,0);
		ObjPrim_SetVertexAlpha(score[i],3,0);
		i++;
	}

	if(SCB<=0) {
		ObjPrim_SetVertexUVT(txt,0,144,224);
		ObjPrim_SetVertexUVT(txt,1,144,256);
		ObjPrim_SetVertexUVT(txt,2,368,224);
		ObjPrim_SetVertexUVT(txt,3,368,256);
		loop(15) {
			i2 += 255/15;

			ObjPrim_SetVertexAlpha(txt,0,i2);
			ObjPrim_SetVertexAlpha(txt,1,i2);
			ObjPrim_SetVertexAlpha(txt,2,i2);
			ObjPrim_SetVertexAlpha(txt,3,i2);
			yield;
		}
		loop(120) { yield; }
		loop(15) {
			i2 -= 255/15;

			ObjPrim_SetVertexAlpha(txt,0,i2);
			ObjPrim_SetVertexAlpha(txt,1,i2);
			ObjPrim_SetVertexAlpha(txt,2,i2);
			ObjPrim_SetVertexAlpha(txt,3,i2);
			yield;
		}
	}
	else {
		loop(135) {
			i   = 0;
			i2 += 1;
			i3 += 180/period;
			i4 += 1;

			/******* 点滅処理 *******/
			if(i2>=2) {
				loop(9) {
					i5       = count[i]+1;
					count[i] = i5;

					if(RGB[i]==255) { RGB[i] = 96; }
					else { RGB[i] = 255; }
					if(count[i]>=10) { RGB[i] = 255; }
					i++;
				}
				i  = 0;
				i2 = 0;
			}
			/************************/


			/******* 上下移動と透明度の処理 *******/
			if(i4>=wait*0 && i4<=period+wait*0) { alpha[0] = 255;	ObjRender_SetY(score[0],CenY-84+pY*sin(i3-wait*0*(180/period)));		}
			if(i4>=wait*1 && i4<=period+wait*1) { alpha[1] = 255;	ObjRender_SetY(score[1],CenY-84+pY*sin(i3-wait*1*(180/period)));	}
			if(i4>=wait*2 && i4<=period+wait*2) { alpha[2] = 255;	ObjRender_SetY(score[2],CenY-84+pY*sin(i3-wait*2*(180/period)));	}
			if(i4>=wait*3 && i4<=period+wait*3) { alpha[3] = 255;	ObjRender_SetY(score[3],CenY-84+pY*sin(i3-wait*3*(180/period)));	ObjRender_SetY(point[0],CenY-84+pY*sin(i3-wait*3*(180/period)));	}
			if(i4>=wait*4 && i4<=period+wait*4) { alpha[4] = 255;	ObjRender_SetY(score[4],CenY-84+pY*sin(i3-wait*4*(180/period)));	}
			if(i4>=wait*5 && i4<=period+wait*5) { alpha[5] = 255;	ObjRender_SetY(score[5],CenY-84+pY*sin(i3-wait*5*(180/period)));	}
			if(i4>=wait*6 && i4<=period+wait*6) { alpha[6] = 255;	ObjRender_SetY(score[6],CenY-84+pY*sin(i3-wait*6*(180/period)));	ObjRender_SetY(point[1],CenY-84+pY*sin(i3-wait*6*(180/period)));	}
			if(i4>=wait*7 && i4<=period+wait*7) { alpha[7] = 255;	ObjRender_SetY(score[7],CenY-84+pY*sin(i3-wait*7*(180/period)));	}
			/**************************************/


			ObjPrim_SetVertexColor(txt,     0,RGB[8],RGB[8],RGB[8]);
			ObjPrim_SetVertexColor(txt,     1,RGB[8],RGB[8],RGB[8]);
			ObjPrim_SetVertexColor(txt,     2,RGB[8],RGB[8],RGB[8]);
			ObjPrim_SetVertexColor(txt,     3,RGB[8],RGB[8],RGB[8]);
			ObjPrim_SetVertexColor(point[0],0,RGB[3],RGB[3],RGB[3]);
			ObjPrim_SetVertexColor(point[0],1,RGB[3],RGB[3],RGB[3]);
			ObjPrim_SetVertexColor(point[0],2,RGB[3],RGB[3],RGB[3]);
			ObjPrim_SetVertexColor(point[0],3,RGB[3],RGB[3],RGB[3]);
			ObjPrim_SetVertexColor(point[1],0,RGB[6],RGB[6],RGB[6]);
			ObjPrim_SetVertexColor(point[1],1,RGB[6],RGB[6],RGB[6]);
			ObjPrim_SetVertexColor(point[1],2,RGB[6],RGB[6],RGB[6]);
			ObjPrim_SetVertexColor(point[1],3,RGB[6],RGB[6],RGB[6]);
			ObjPrim_SetVertexAlpha(txt,     0,alpha[8]);
			ObjPrim_SetVertexAlpha(txt,     1,alpha[8]);
			ObjPrim_SetVertexAlpha(txt,     2,alpha[8]);
			ObjPrim_SetVertexAlpha(txt,     3,alpha[8]);
			ObjPrim_SetVertexAlpha(point[0],0,alpha[3]);
			ObjPrim_SetVertexAlpha(point[0],1,alpha[3]);
			ObjPrim_SetVertexAlpha(point[0],2,alpha[3]);
			ObjPrim_SetVertexAlpha(point[0],3,alpha[3]);
			ObjPrim_SetVertexAlpha(point[1],0,alpha[6]);
			ObjPrim_SetVertexAlpha(point[1],1,alpha[6]);
			ObjPrim_SetVertexAlpha(point[1],2,alpha[6]);
			ObjPrim_SetVertexAlpha(point[1],3,alpha[6]);
			loop(8) {
				ObjPrim_SetVertexColor(score[i],0,RGB[i],RGB[i],RGB[i]);
				ObjPrim_SetVertexColor(score[i],1,RGB[i],RGB[i],RGB[i]);
				ObjPrim_SetVertexColor(score[i],2,RGB[i],RGB[i],RGB[i]);
				ObjPrim_SetVertexColor(score[i],3,RGB[i],RGB[i],RGB[i]);
				ObjPrim_SetVertexAlpha(score[i],0,alpha[i]);
				ObjPrim_SetVertexAlpha(score[i],1,alpha[i]);
				ObjPrim_SetVertexAlpha(score[i],2,alpha[i]);
				ObjPrim_SetVertexAlpha(score[i],3,alpha[i]);
				i++;
			}
			yield;
		}
		loop(15) {
			i      = 0;
			scale -= 1.0/15;

			ObjRender_SetScaleXYZ(txt     ,1.0,scale,1.00);
			ObjRender_SetScaleXYZ(point[0],1.0,scale,1.00);
			ObjRender_SetScaleXYZ(point[1],1.0,scale,1.00);
			loop(8) {
				ObjRender_SetScaleXYZ(score[i],1.0,scale,1.00);
				i++;
			}
			yield;
		}
	}

	i=0;
	Obj_Delete(txt);
	Obj_Delete(point[0]);
	Obj_Delete(point[1]);
	loop(8) {
		Obj_Delete(score[i]);
		i++;
	}
}

//-----------------------------------------------------------------------
// ■ 撃破時間と実時間の表示
//-----------------------------------------------------------------------
task ViewElapsedTimes {

	LoadTexture(imgspelleffect);

	let ET01	= GetElapsedTimer();
	let ET02	= GetElapsedTime();
	let txt		= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let point	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let time	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let nam		= [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0];
	let rect01	= [144,160,176,192,208,224,240,256,272,288,  0,  0];
	let rect02	= [160,176,192,208,224,240,256,272,288,304,  0,  0];
	let pX		= [  0, 12, 24, 40, 48,  0, 12, 24, 40, 48, 32, 55];
	let alpha	= 0;
	let i		= 0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 0;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;

	let layer	= 80;

	if(ET01>999) { ET01 = 999.99999; }
	if(ET02>999) { ET02 = 999.99999; }
	if(ET01<= 0) { ET01 = 0.0000000; }
	if(ET02<= 0) { ET02 = 0.0000000; }
	if(ET01<100) {
		Obj_Delete(time[0]);
		if(ET01<10) { Obj_Delete(time[1]); }
	}
	if(ET02<100) {
		Obj_Delete(time[5]);
		if(ET02<10) { Obj_Delete(time[6]); }
	}

	nam[0]		= truncate((ET01%1000)/100);
	nam[1]		= truncate((ET01%100)/10);
	nam[2] 		= truncate(((ET01%10)));
	nam[3] 		= truncate(((ET01*10)%10));
	nam[4] 		= truncate(((ET01*100)%10));

	nam[5]		= truncate((ET02%1000)/100);
	nam[6]		= truncate((ET02%100)/10);
	nam[7] 		= truncate(((ET02%10)));
	nam[8] 		= truncate(((ET02*10)%10));
	nam[9] 		= truncate(((ET02*100)%10));

	ObjRender_SetPosition(txt,CenX-48,CenY-16,0);
	ObjPrim_SetTexture(txt,imgspelleffect);
	ObjRender_SetBlendType(txt,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(txt,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(txt,1.0,1.0,1.0);
	ObjRender_SetAngleXYZ(txt,0,0,0);
	Obj_SetRenderPriorityI(txt,layer);
	ObjPrim_SetVertexCount(txt,4);
	ObjPrim_SetVertexPosition(txt,0,-32,-16,0);
	ObjPrim_SetVertexPosition(txt,1,-32, 16,0);
	ObjPrim_SetVertexPosition(txt,2, 32,-16,0);
	ObjPrim_SetVertexPosition(txt,3, 32, 16,0);
	ObjPrim_SetVertexUVT(txt,0,368,160);
	ObjPrim_SetVertexUVT(txt,1,368,192);
	ObjPrim_SetVertexUVT(txt,2,432,160);
	ObjPrim_SetVertexUVT(txt,3,432,192);

	ObjRender_SetPosition(point[0],CenX+16+pX[10],CenY-24,0);
	ObjPrim_SetTexture(point[0],imgspelleffect);
	ObjRender_SetBlendType(point[0],BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(point[0],PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(point[0],1.0,1.0,1.0);
	ObjRender_SetAngleXYZ(point[0],0,0,0);
	Obj_SetRenderPriorityI(point[0],layer);
	ObjPrim_SetVertexCount(point[0],4);
	ObjPrim_SetVertexPosition(point[0],0,  -8,-15,0);
	ObjPrim_SetVertexPosition(point[0],1,  -8, 15,0);
	ObjPrim_SetVertexPosition(point[0],2,   8,-15,0);
	ObjPrim_SetVertexPosition(point[0],3,   8, 15,0);
	ObjPrim_SetVertexUVT(point[0],0, 304,161);
	ObjPrim_SetVertexUVT(point[0],1, 304,191);
	ObjPrim_SetVertexUVT(point[0],2, 320,161);
	ObjPrim_SetVertexUVT(point[0],3, 320,191);
	ObjPrim_SetVertexColor(point[0],0,255,255,255);
	ObjPrim_SetVertexColor(point[0],1,255,255,255);
	ObjPrim_SetVertexColor(point[0],2,255,255,255);
	ObjPrim_SetVertexColor(point[0],3,255,255,255);
	ObjPrim_SetVertexAlpha(point[0],0,0);
	ObjPrim_SetVertexAlpha(point[0],1,0);
	ObjPrim_SetVertexAlpha(point[0],2,0);
	ObjPrim_SetVertexAlpha(point[0],3,0);

	ObjRender_SetPosition(point[1],CenX+16+pX[10],CenY-8,0);
	ObjPrim_SetTexture(point[1],imgspelleffect);
	ObjRender_SetBlendType(point[1],BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(point[1],PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(point[1],1.0,1.0,1.0);
	ObjRender_SetAngleXYZ(point[1],0,0,0);
	Obj_SetRenderPriorityI(point[1],layer);
	ObjPrim_SetVertexCount(point[1],4);
	ObjPrim_SetVertexPosition(point[1],0,  -8,-15,0);
	ObjPrim_SetVertexPosition(point[1],1,  -8, 15,0);
	ObjPrim_SetVertexPosition(point[1],2,   8,-15,0);
	ObjPrim_SetVertexPosition(point[1],3,   8, 15,0);
	ObjPrim_SetVertexUVT(point[1],0, 304,161);
	ObjPrim_SetVertexUVT(point[1],1, 304,191);
	ObjPrim_SetVertexUVT(point[1],2, 320,161);
	ObjPrim_SetVertexUVT(point[1],3, 320,191);
	ObjPrim_SetVertexColor(point[1],0,255,255,255);
	ObjPrim_SetVertexColor(point[1],1,255,255,255);
	ObjPrim_SetVertexColor(point[1],2,255,255,255);
	ObjPrim_SetVertexColor(point[1],3,255,255,255);
	ObjPrim_SetVertexAlpha(point[1],0,0);
	ObjPrim_SetVertexAlpha(point[1],1,0);
	ObjPrim_SetVertexAlpha(point[1],2,0);
	ObjPrim_SetVertexAlpha(point[1],3,0);

	ObjRender_SetPosition(point[2],CenX+16+pX[11],CenY-22,0);
	ObjPrim_SetTexture(point[2],imgspelleffect);
	ObjRender_SetBlendType(point[2],BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(point[2],PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(point[2],0.7,0.7,1.0);
	ObjRender_SetAngleXYZ(point[2],0,0,0);
	Obj_SetRenderPriorityI(point[2],layer);
	ObjPrim_SetVertexCount(point[2],4);
	ObjPrim_SetVertexPosition(point[2],0,  -8,-15,0);
	ObjPrim_SetVertexPosition(point[2],1,  -8, 15,0);
	ObjPrim_SetVertexPosition(point[2],2,   8,-15,0);
	ObjPrim_SetVertexPosition(point[2],3,   8, 15,0);
	ObjPrim_SetVertexUVT(point[2],0, 320,161);
	ObjPrim_SetVertexUVT(point[2],1, 320,191);
	ObjPrim_SetVertexUVT(point[2],2, 336,161);
	ObjPrim_SetVertexUVT(point[2],3, 336,191);
	ObjPrim_SetVertexColor(point[2],0,255,255,255);
	ObjPrim_SetVertexColor(point[2],1,255,255,255);
	ObjPrim_SetVertexColor(point[2],2,255,255,255);
	ObjPrim_SetVertexColor(point[2],3,255,255,255);
	ObjPrim_SetVertexAlpha(point[2],0,0);
	ObjPrim_SetVertexAlpha(point[2],1,0);
	ObjPrim_SetVertexAlpha(point[2],2,0);
	ObjPrim_SetVertexAlpha(point[2],3,0);

	ObjRender_SetPosition(point[3],CenX+16+pX[11],CenY-6,0);
	ObjPrim_SetTexture(point[3],imgspelleffect);
	ObjRender_SetBlendType(point[3],BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(point[3],PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(point[3],0.7,0.7,1.0);
	ObjRender_SetAngleXYZ(point[3],0,0,0);
	Obj_SetRenderPriorityI(point[3],layer);
	ObjPrim_SetVertexCount(point[3],4);
	ObjPrim_SetVertexPosition(point[3],0,  -8,-15,0);
	ObjPrim_SetVertexPosition(point[3],1,  -8, 15,0);
	ObjPrim_SetVertexPosition(point[3],2,   8,-15,0);
	ObjPrim_SetVertexPosition(point[3],3,   8, 15,0);
	ObjPrim_SetVertexUVT(point[3],0, 320,161);
	ObjPrim_SetVertexUVT(point[3],1, 320,191);
	ObjPrim_SetVertexUVT(point[3],2, 336,161);
	ObjPrim_SetVertexUVT(point[3],3, 336,191);
	ObjPrim_SetVertexColor(point[3],0,255,255,255);
	ObjPrim_SetVertexColor(point[3],1,255,255,255);
	ObjPrim_SetVertexColor(point[3],2,255,255,255);
	ObjPrim_SetVertexColor(point[3],3,255,255,255);
	ObjPrim_SetVertexAlpha(point[3],0,0);
	ObjPrim_SetVertexAlpha(point[3],1,0);
	ObjPrim_SetVertexAlpha(point[3],2,0);
	ObjPrim_SetVertexAlpha(point[3],3,0);

	loop(5) {
		ObjRender_SetPosition(time[i],CenX+16+pX[i],CenY-24,0);
		ObjPrim_SetTexture(time[i],imgspelleffect);
		ObjRender_SetBlendType(time[i],BLEND_ALPHA);
		ObjPrim_SetPrimitiveType(time[i],PRIMITIVE_TRIANGLESTRIP);
		ObjRender_SetScaleXYZ(time[i],1.0,1.0,1.0);
		ObjRender_SetAngleXYZ(time[i],0,0,0);
		Obj_SetRenderPriorityI(time[i],layer);
		ObjPrim_SetVertexCount(time[i],4);
		ObjPrim_SetVertexPosition(time[i],0,-8,-15,0);
		ObjPrim_SetVertexPosition(time[i],1,-8, 15,0);
		ObjPrim_SetVertexPosition(time[i],2, 8,-15,0);
		ObjPrim_SetVertexPosition(time[i],3, 8, 15,0);
		ObjPrim_SetVertexUVT(time[i],0, rect01[nam[i]],161);
		ObjPrim_SetVertexUVT(time[i],1, rect01[nam[i]],191);
		ObjPrim_SetVertexUVT(time[i],2, rect02[nam[i]],161);
		ObjPrim_SetVertexUVT(time[i],3, rect02[nam[i]],191);
		ObjPrim_SetVertexColor(time[i],0,255,255,255);
		ObjPrim_SetVertexColor(time[i],1,255,255,255);
		ObjPrim_SetVertexColor(time[i],2,255,255,255);
		ObjPrim_SetVertexColor(time[i],3,255,255,255);
		ObjPrim_SetVertexAlpha(time[i],0,0);
		ObjPrim_SetVertexAlpha(time[i],1,0);
		ObjPrim_SetVertexAlpha(time[i],2,0);
		ObjPrim_SetVertexAlpha(time[i],3,0);
		i++;
	}
	loop(5) {
		ObjRender_SetPosition(time[i],CenX+16+pX[i],CenY-8,0);
		ObjPrim_SetTexture(time[i],imgspelleffect);
		ObjRender_SetBlendType(time[i],BLEND_ALPHA);
		ObjPrim_SetPrimitiveType(time[i],PRIMITIVE_TRIANGLESTRIP);
		ObjRender_SetScaleXYZ(time[i],1.0,1.0,1.0);
		ObjRender_SetAngleXYZ(time[i],0,0,0);
		Obj_SetRenderPriorityI(time[i],layer);
		ObjPrim_SetVertexCount(time[i],4);
		ObjPrim_SetVertexPosition(time[i],0,-8,-15,0);
		ObjPrim_SetVertexPosition(time[i],1,-8, 15,0);
		ObjPrim_SetVertexPosition(time[i],2, 8,-15,0);
		ObjPrim_SetVertexPosition(time[i],3, 8, 15,0);
		ObjPrim_SetVertexUVT(time[i],0, rect01[nam[i]],161);
		ObjPrim_SetVertexUVT(time[i],1, rect01[nam[i]],191);
		ObjPrim_SetVertexUVT(time[i],2, rect02[nam[i]],161);
		ObjPrim_SetVertexUVT(time[i],3, rect02[nam[i]],191);
		ObjPrim_SetVertexColor(time[i],0,255,255,255);
		ObjPrim_SetVertexColor(time[i],1,255,255,255);
		ObjPrim_SetVertexColor(time[i],2,255,255,255);
		ObjPrim_SetVertexColor(time[i],3,255,255,255);
		ObjPrim_SetVertexAlpha(time[i],0,0);
		ObjPrim_SetVertexAlpha(time[i],1,0);
		ObjPrim_SetVertexAlpha(time[i],2,0);
		ObjPrim_SetVertexAlpha(time[i],3,0);
		i++;
	}

	ObjRender_SetY(time[3],CenY-24+2);
	ObjRender_SetY(time[4],CenY-24+2);
	ObjRender_SetY(time[8],CenY- 8+2);
	ObjRender_SetY(time[9],CenY- 8+2);
	ObjRender_SetScaleXYZ(time[3],0.7,0.7,1.0);
	ObjRender_SetScaleXYZ(time[4],0.7,0.7,1.0);
	ObjRender_SetScaleXYZ(time[8],0.7,0.7,1.0);
	ObjRender_SetScaleXYZ(time[9],0.7,0.7,1.0);

	loop(15) {
		i = 0;
		alpha += 255/15;


		ObjPrim_SetVertexAlpha(txt     ,0,alpha);
		ObjPrim_SetVertexAlpha(txt     ,1,alpha);
		ObjPrim_SetVertexAlpha(txt     ,2,alpha);
		ObjPrim_SetVertexAlpha(txt     ,3,alpha);
		ObjPrim_SetVertexAlpha(point[0],0,alpha);
		ObjPrim_SetVertexAlpha(point[0],1,alpha);
		ObjPrim_SetVertexAlpha(point[0],2,alpha);
		ObjPrim_SetVertexAlpha(point[0],3,alpha);
		ObjPrim_SetVertexAlpha(point[1],0,alpha);
		ObjPrim_SetVertexAlpha(point[1],1,alpha);
		ObjPrim_SetVertexAlpha(point[1],2,alpha);
		ObjPrim_SetVertexAlpha(point[1],3,alpha);
		ObjPrim_SetVertexAlpha(point[2],0,alpha);
		ObjPrim_SetVertexAlpha(point[2],1,alpha);
		ObjPrim_SetVertexAlpha(point[2],2,alpha);
		ObjPrim_SetVertexAlpha(point[2],3,alpha);
		ObjPrim_SetVertexAlpha(point[3],0,alpha);
		ObjPrim_SetVertexAlpha(point[3],1,alpha);
		ObjPrim_SetVertexAlpha(point[3],2,alpha);
		ObjPrim_SetVertexAlpha(point[3],3,alpha);
		ObjPrim_SetVertexColor(point[3],0,128,128,128);
		ObjPrim_SetVertexColor(point[3],1,128,128,128);
		ObjPrim_SetVertexColor(point[3],2,128,128,128);
		ObjPrim_SetVertexColor(point[3],3,128,128,128);
		ObjPrim_SetVertexColor(point[1],0,128,128,128);
		ObjPrim_SetVertexColor(point[1],1,128,128,128);
		ObjPrim_SetVertexColor(point[1],2,128,128,128);
		ObjPrim_SetVertexColor(point[1],3,128,128,128);
		loop(5) {
			ObjPrim_SetVertexAlpha(time[i],0,alpha);
			ObjPrim_SetVertexAlpha(time[i],1,alpha);
			ObjPrim_SetVertexAlpha(time[i],2,alpha);
			ObjPrim_SetVertexAlpha(time[i],3,alpha);
			i++;
		}
		loop(5) {
			ObjPrim_SetVertexColor(time[i],0,128,128,128);
			ObjPrim_SetVertexColor(time[i],1,128,128,128);
			ObjPrim_SetVertexColor(time[i],2,128,128,128);
			ObjPrim_SetVertexColor(time[i],3,128,128,128);
			ObjPrim_SetVertexAlpha(time[i],0,alpha);
			ObjPrim_SetVertexAlpha(time[i],1,alpha);
			ObjPrim_SetVertexAlpha(time[i],2,alpha);
			ObjPrim_SetVertexAlpha(time[i],3,alpha);
			i++;
		}
		yield;
	}
	loop(120) { yield; }
	loop(15) {
		i = 0;
		alpha -= 255/15;

		ObjPrim_SetVertexAlpha(txt     ,0,alpha);
		ObjPrim_SetVertexAlpha(txt     ,1,alpha);
		ObjPrim_SetVertexAlpha(txt     ,2,alpha);
		ObjPrim_SetVertexAlpha(txt     ,3,alpha);
		ObjPrim_SetVertexAlpha(point[0],0,alpha);
		ObjPrim_SetVertexAlpha(point[0],1,alpha);
		ObjPrim_SetVertexAlpha(point[0],2,alpha);
		ObjPrim_SetVertexAlpha(point[0],3,alpha);
		ObjPrim_SetVertexAlpha(point[1],0,alpha);
		ObjPrim_SetVertexAlpha(point[1],1,alpha);
		ObjPrim_SetVertexAlpha(point[1],2,alpha);
		ObjPrim_SetVertexAlpha(point[1],3,alpha);
		ObjPrim_SetVertexAlpha(point[2],0,alpha);
		ObjPrim_SetVertexAlpha(point[2],1,alpha);
		ObjPrim_SetVertexAlpha(point[2],2,alpha);
		ObjPrim_SetVertexAlpha(point[2],3,alpha);
		ObjPrim_SetVertexAlpha(point[3],0,alpha);
		ObjPrim_SetVertexAlpha(point[3],1,alpha);
		ObjPrim_SetVertexAlpha(point[3],2,alpha);
		ObjPrim_SetVertexAlpha(point[3],3,alpha);
		ObjPrim_SetVertexColor(point[3],0,128,128,128);
		ObjPrim_SetVertexColor(point[3],1,128,128,128);
		ObjPrim_SetVertexColor(point[3],2,128,128,128);
		ObjPrim_SetVertexColor(point[3],3,128,128,128);
		ObjPrim_SetVertexColor(point[1],0,128,128,128);
		ObjPrim_SetVertexColor(point[1],1,128,128,128);
		ObjPrim_SetVertexColor(point[1],2,128,128,128);
		ObjPrim_SetVertexColor(point[1],3,128,128,128);
		
		loop(5) {
			ObjPrim_SetVertexAlpha(time[i],0,alpha);
			ObjPrim_SetVertexAlpha(time[i],1,alpha);
			ObjPrim_SetVertexAlpha(time[i],2,alpha);
			ObjPrim_SetVertexAlpha(time[i],3,alpha);
			i++;
		}
		loop(5) {
			ObjPrim_SetVertexColor(time[i],0,128,128,128);
			ObjPrim_SetVertexColor(time[i],1,128,128,128);
			ObjPrim_SetVertexColor(time[i],2,128,128,128);
			ObjPrim_SetVertexColor(time[i],3,128,128,128);
			ObjPrim_SetVertexAlpha(time[i],0,alpha);
			ObjPrim_SetVertexAlpha(time[i],1,alpha);
			ObjPrim_SetVertexAlpha(time[i],2,alpha);
			ObjPrim_SetVertexAlpha(time[i],3,alpha);
			i++;
		}
		yield;
	}
	Obj_Delete(txt);
	i = 0;
	loop(4) {
		Obj_Delete(point[i]);
		i++;
	}
	i = 0;
	loop(10) {
		Obj_Delete(time[i]);
		i++;
	}
}

//-----------------------------------------------------------------------
// ■ スコアを時間を掛けて増やす
//-----------------------------------------------------------------------
task AddScore_Ex(Score,Time) {
	let point	= truncate(Score)/truncate(Time);

	loop(Time) {
		AddScore(truncate(point));
		yield;
	}
	if(Score-(truncate(point)*truncate(Time))>0) {
		AddScore(Score-(truncate(point)*truncate(Time)));
	}
}

//-----------------------------------------------------------------------
// ■ 魔法陣表示 [th10〜th14]
//-----------------------------------------------------------------------
task SpellTimeRing {

	let Enemy	= GetEnemyBossObjectID[0];
	let ring01	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let ring02	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let alpha01	= 160;
	let alpha02	= 160;
	let scale01	= 0;
	let scale02	= 0;
	let angle01	= 0;
	let angle02	= 0;
	let width01	= 6;
	let width02	= 12;
	let maxtime	= ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_TIMER)*60;
	let obj_x	= ObjMove_GetX(Enemy);
	let obj_y	= ObjMove_GetY(Enemy);
	let set_x	= ObjMove_GetX(Enemy);
	let set_y	= ObjMove_GetY(Enemy);
	let i1		= 0;
	let i2		= 0;
	let i3		= 0;
	let i4		= 0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 0;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;

	let layer	= 25;
	let delay	= 0.90;
	let vertex	= 722;

	LoadTexture(imgspelleffect);

	ObjRender_SetPosition(ring01,ObjMove_GetX(Enemy),ObjMove_GetY(Enemy),0);
	ObjPrim_SetTexture(ring01,imgspelleffect);
	ObjRender_SetBlendType(ring01,BLEND_ADD_ARGB);
	ObjPrim_SetPrimitiveType(ring01,PRIMITIVE_TRIANGLESTRIP);
	Obj_SetRenderPriorityI(ring01,layer);
	ObjRender_SetScaleXYZ(ring01,0,0,1);
	ObjPrim_SetVertexCount(ring01,vertex);

	ObjRender_SetPosition(ring02,ObjMove_GetX(Enemy),ObjMove_GetY(Enemy),0);
	ObjPrim_SetTexture(ring02,imgspelleffect);
	ObjRender_SetBlendType(ring02,BLEND_ADD_ARGB);
	ObjPrim_SetPrimitiveType(ring02,PRIMITIVE_TRIANGLESTRIP);
	Obj_SetRenderPriorityI(ring02,layer);
	ObjRender_SetScaleXYZ(ring02,0,0,1);
	ObjPrim_SetVertexCount(ring02,vertex);

	loop(vertex) {
		ObjPrim_SetVertexPosition(ring01,i1+0,-(138+width01)*sin(i2+0),-(138+width01)*cos(i2+0),0);
		ObjPrim_SetVertexPosition(ring01,i1+1,-(138-width01)*sin(i2+2),-(138-width01)*cos(i2+2),0);
		ObjPrim_SetVertexUVT(ring01,i1+0, i4+0, 96);
		ObjPrim_SetVertexUVT(ring01,i1+1, i4+2,128);
		ObjPrim_SetVertexUVT(ring02,i1+0, i4+0,128);
		ObjPrim_SetVertexUVT(ring02,i1+1, i4+2,160);
		ObjPrim_SetVertexAlpha(ring01,i1+0,alpha01);
		ObjPrim_SetVertexAlpha(ring01,i1+1,alpha01);
		ObjPrim_SetVertexAlpha(ring02,i1+0,alpha02);
		ObjPrim_SetVertexAlpha(ring02,i1+1,alpha02);
		i1+=2;
		i2+=1;
		i4+=2;
	}
	loop(45) {
		i1  = 0;
		i2  = 0;
		i3 += 90/45;
		angle01 += 3.0;
		angle02 -= 3.0;
		scale01  = 2.0*sin(i3);
		scale02  = 1.0*sin(i3/2);
		width02  = 9.0+4.5*sin(i3*2-90);

		obj_x	 = ObjRender_GetX(ring01);
		obj_y	 = ObjRender_GetY(ring01);
		set_x	 = (ObjMove_GetX(Enemy)*(1.00-delay))+(obj_x*delay);
		set_y	 = (ObjMove_GetY(Enemy)*(1.00-delay))+(obj_y*delay);

		ObjRender_SetPosition(ring01,ObjMove_GetX(Enemy),ObjMove_GetY(Enemy),0);
		ObjRender_SetPosition(ring02,ObjMove_GetX(Enemy),ObjMove_GetY(Enemy),0);
		ObjRender_SetScaleXYZ(ring01,scale01+0.20,scale01+0.20,1.00);
		ObjRender_SetScaleXYZ(ring02,scale02+0.20,scale02+0.20,1.00);
		ObjRender_SetAngleXYZ(ring01,0,0,angle01);
		ObjRender_SetAngleXYZ(ring02,0,0,angle02);

		loop(vertex) {
			ObjPrim_SetVertexPosition(ring02,i1+0,-(122+width02)*sin(i2+0),-(122+width02)*cos(i2+0),0);
			ObjPrim_SetVertexPosition(ring02,i1+1,-(122-width02)*sin(i2+2),-(122-width02)*cos(i2+2),0);
			i1+=2;
			i2+=1;
		}
		yield;
	}
	while(scale01>=1.0) {
		i1  = 0;
		i2  = 0;
		i3 += 90/45;
		angle01 += 3.0;
		angle02 -= 3.0;
		scale01  = 2.0*sin(i3);
		scale02  = 1.0*sin(i3/2);
		width02  = 9.0+4.5*sin(i3*2-90);

		obj_x	 = ObjRender_GetX(ring01);
		obj_y	 = ObjRender_GetY(ring01);
		set_x	 = (ObjMove_GetX(Enemy)*(1.00-delay))+(obj_x*delay);
		set_y	 = (ObjMove_GetY(Enemy)*(1.00-delay))+(obj_y*delay);

		ObjRender_SetPosition(ring01,set_x,set_y,0);
		ObjRender_SetPosition(ring02,set_x,set_y,0);
		ObjRender_SetScaleXYZ(ring01,scale01+0.20,scale01+0.20,1.00);
		ObjRender_SetScaleXYZ(ring02,scale02+0.20,scale02+0.20,1.00);
		ObjRender_SetAngleXYZ(ring01,0,0,angle01);
		ObjRender_SetAngleXYZ(ring02,0,0,angle02);

		loop(vertex) {
			ObjPrim_SetVertexPosition(ring02,i1+0,-(122+width02)*sin(i2+0),-(122+width02)*cos(i2+0),0);
			ObjPrim_SetVertexPosition(ring02,i1+1,-(122-width02)*sin(i2+2),-(122-width02)*cos(i2+2),0);
			i1+=2;
			i2+=1;
		}
		yield;
	}
	while(!Obj_IsDeleted(Enemy)) {
		angle01 += 3.0;
		angle02 -= 3.0;
		scale01 -= 1.0/maxtime;
		scale02 -= 1.0/maxtime;

		obj_x	 = ObjRender_GetX(ring01);
		obj_y	 = ObjRender_GetY(ring01);
		set_x	 = (ObjMove_GetX(Enemy)*(1.00-delay))+(obj_x*delay);
		set_y	 = (ObjMove_GetY(Enemy)*(1.00-delay))+(obj_y*delay);

		ObjRender_SetPosition(ring01,set_x,set_y,0);
		ObjRender_SetPosition(ring02,set_x,set_y,0);
		ObjRender_SetScaleXYZ(ring01,scale01+0.20,scale01+0.20,1.00);
		ObjRender_SetScaleXYZ(ring02,scale02+0.20,scale02+0.20,1.00);
		ObjRender_SetAngleXYZ(ring01,0,0,angle01);
		ObjRender_SetAngleXYZ(ring02,0,0,angle02);
		yield;
	}
	Obj_Delete(ring01);
	Obj_Delete(ring02);
}

//-----------------------------------------------------------------------
// ■ スペルカード宣言時の背景表示 [th10〜th14]
//-----------------------------------------------------------------------
task SpellBackGround {

	let background01	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let background02	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let alpha01		= 0;
	let alpha02		= 0;
	let angle01		= 0;
	let angle02		= 0;
	let i			= 0;
	let i1			= 0;
	let i2			= 0;
	let pXY			= 0;
	let R			= 144;
	let G			= 144;
	let B			= 144;
	let CenX		= GetStgFrameWidth/2.0;
	let CenY		= GetStgFrameHeight/2.0;
	let MinX		= 0;
	let MinY		= 0;
	let MaxX		= GetStgFrameWidth;
	let MaxY		= GetStgFrameHeight;

	let layer		= 25;

	loop(11) {
		ObjPrim_SetTexture(background01[i],imgspelleffect);
		ObjRender_SetBlendType(background01[i],BLEND_ADD_ARGB);
		ObjPrim_SetPrimitiveType(background01[i],PRIMITIVE_TRIANGLESTRIP);
		Obj_SetRenderPriorityI(background01[i],layer);
		ObjRender_SetScaleXYZ(background01[i],1,1,1);
		ObjRender_SetAngleXYZ(background01[i],0,0,-30);
		ObjPrim_SetVertexCount(background01[i],4);
		ObjPrim_SetVertexPosition(background01[i],0,-512,-16,0);
		ObjPrim_SetVertexPosition(background01[i],1,-512, 16,0);
		ObjPrim_SetVertexPosition(background01[i],2, 512,-16,0);
		ObjPrim_SetVertexPosition(background01[i],3, 512, 16,0);
		ObjPrim_SetVertexUVT(background01[i],0,   0, 64);
		ObjPrim_SetVertexUVT(background01[i],1,   0, 96);
		ObjPrim_SetVertexUVT(background01[i],2,1024, 64);
		ObjPrim_SetVertexUVT(background01[i],3,1024, 96);
		i++;
	}
	i=0;
	ObjRender_SetPosition(background02[0],CenX-112,CenY-160,0);
	ObjRender_SetPosition(background02[1],CenX+112,CenY+160,0);
	ObjRender_SetPosition(background02[2],CenX+112,CenY+160,0);
	ObjRender_SetPosition(background02[3],CenX+112,CenY+160,0);
	loop(4) {
		ObjPrim_SetTexture(background02[i],imgspelleffect);
		ObjRender_SetBlendType(background02[i],BLEND_ADD_ARGB);
		ObjPrim_SetPrimitiveType(background02[i],PRIMITIVE_TRIANGLESTRIP);
		Obj_SetRenderPriorityI(background02[i],layer);
		ObjRender_SetScaleXYZ(background02[i],1,1,1);
		ObjRender_SetAngleXYZ(background02[i],0,0,0);
		ObjPrim_SetVertexCount(background02[i],18);
		ObjPrim_SetVertexUVT(background02[i], 0,  0, 64);
		ObjPrim_SetVertexUVT(background02[i], 1,  0, 96);
		ObjPrim_SetVertexUVT(background02[i], 2,256, 64);
		ObjPrim_SetVertexUVT(background02[i], 3,256, 96);
		ObjPrim_SetVertexUVT(background02[i], 4,  0, 64);
		ObjPrim_SetVertexUVT(background02[i], 5,  0, 96);
		ObjPrim_SetVertexUVT(background02[i], 6,256, 64);
		ObjPrim_SetVertexUVT(background02[i], 7,256, 96);
		ObjPrim_SetVertexUVT(background02[i], 8,  0, 64);
		ObjPrim_SetVertexUVT(background02[i], 9,  0, 96);
		ObjPrim_SetVertexUVT(background02[i],10,256, 64);
		ObjPrim_SetVertexUVT(background02[i],11,256, 96);
		ObjPrim_SetVertexUVT(background02[i],12,  0, 64);
		ObjPrim_SetVertexUVT(background02[i],13,  0, 96);
		ObjPrim_SetVertexUVT(background02[i],14,256, 64);
		ObjPrim_SetVertexUVT(background02[i],15,256, 96);
		ObjPrim_SetVertexUVT(background02[i],16,  0, 64);
		ObjPrim_SetVertexUVT(background02[i],17,  0, 96);
		ObjPrim_SetVertexUVT(background02[i],18,256, 64);
		i++;
	}
	loop(18) {
		ObjPrim_SetVertexPosition(background02[0],i1  ,128*sin(i2)  ,128*cos(i2),0);
		ObjPrim_SetVertexPosition(background02[0],i1+1, 96*sin(i2+1), 96*cos(i2+1),0);
		ObjPrim_SetVertexPosition(background02[1],i1  ,128*sin(i2)  ,128*cos(i2),0);
		ObjPrim_SetVertexPosition(background02[1],i1+1, 96*sin(i2+1), 96*cos(i2+1),0);
		ObjPrim_SetVertexPosition(background02[2],i1  ,160*sin(i2)  ,160*cos(i2),0);
		ObjPrim_SetVertexPosition(background02[2],i1+1,128*sin(i2+1),128*cos(i2+1),0);
		ObjPrim_SetVertexPosition(background02[3],i1  ,192*sin(i2)  ,192*cos(i2),0);
		ObjPrim_SetVertexPosition(background02[3],i1+1,160*sin(i2+1),160*cos(i2+1),0);
		i1 += 2;
		i2 += 360/8;
	}
	loop(75) {
		i=0;
		pXY++;
		alpha02 += 90/60;
		alpha01  = 240*sin(alpha02);
		angle01 += 1.2;
		angle02 -= 1.2;

		ObjRender_SetPosition(background01[0] ,CenX+pXY*cos(-30),CenY-160+pXY*sin(-30),0);
		ObjRender_SetPosition(background01[1] ,CenX-pXY*cos(-30),CenY-128-pXY*sin(-30),0);
		ObjRender_SetPosition(background01[2] ,CenX+pXY*cos(-30),CenY-96 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[3] ,CenX-pXY*cos(-30),CenY-64 -pXY*sin(-30),0);
		ObjRender_SetPosition(background01[4] ,CenX+pXY*cos(-30),CenY-32 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[5] ,CenX-pXY*cos(-30),CenY+0  -pXY*sin(-30),0);
		ObjRender_SetPosition(background01[6] ,CenX+pXY*cos(-30),CenY+32 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[7] ,CenX-pXY*cos(-30),CenY+64 -pXY*sin(-30),0);
		ObjRender_SetPosition(background01[8] ,CenX+pXY*cos(-30),CenY+96 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[9] ,CenX-pXY*cos(-30),CenY+128-pXY*sin(-30),0);
		ObjRender_SetPosition(background01[10],CenX+pXY*cos(-30),CenY+160+pXY*sin(-30),0);
		ObjRender_SetAngleXYZ(background02[0],0,0,angle01);
		ObjRender_SetAngleXYZ(background02[1],0,0,angle02);
		ObjRender_SetAngleXYZ(background02[2],0,0,angle01);
		ObjRender_SetAngleXYZ(background02[3],0,0,angle01);
		loop(11) {
			ObjPrim_SetVertexAlpha(background01[i],0,alpha01);
			ObjPrim_SetVertexAlpha(background01[i],1,alpha01);
			ObjPrim_SetVertexAlpha(background01[i],2,alpha01);
			ObjPrim_SetVertexAlpha(background01[i],3,alpha01);
			ObjPrim_SetVertexColor(background01[i],0,R,G,B);
			ObjPrim_SetVertexColor(background01[i],1,R,G,B);
			ObjPrim_SetVertexColor(background01[i],2,R,G,B);
			ObjPrim_SetVertexColor(background01[i],3,R,G,B);
			i++;
		}
		i=0;
		loop(4) {
			ObjPrim_SetVertexAlpha(background02[i], 0,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 1,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 2,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 3,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 4,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 5,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 6,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 7,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 8,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 9,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],10,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],11,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],12,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],13,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],14,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],15,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],16,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],17,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],18,alpha01);
			ObjPrim_SetVertexColor(background02[i], 0,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 1,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 2,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 3,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 4,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 5,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 6,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 7,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 8,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 9,R,G,B);
			ObjPrim_SetVertexColor(background02[i],10,R,G,B);
			ObjPrim_SetVertexColor(background02[i],11,R,G,B);
			ObjPrim_SetVertexColor(background02[i],12,R,G,B);
			ObjPrim_SetVertexColor(background02[i],13,R,G,B);
			ObjPrim_SetVertexColor(background02[i],14,R,G,B);
			ObjPrim_SetVertexColor(background02[i],15,R,G,B);
			ObjPrim_SetVertexColor(background02[i],16,R,G,B);
			ObjPrim_SetVertexColor(background02[i],17,R,G,B);
			ObjPrim_SetVertexColor(background02[i],18,R,G,B);
			i++;
		}
		yield;
	}
	loop(30) {
		pXY++;
		angle01 += 1.2;
		angle02 -= 1.2;

		ObjRender_SetPosition(background01[0] ,CenX+pXY*cos(-30),CenY-160+pXY*sin(-30),0);
		ObjRender_SetPosition(background01[1] ,CenX-pXY*cos(-30),CenY-128-pXY*sin(-30),0);
		ObjRender_SetPosition(background01[2] ,CenX+pXY*cos(-30),CenY-96 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[3] ,CenX-pXY*cos(-30),CenY-64 -pXY*sin(-30),0);
		ObjRender_SetPosition(background01[4] ,CenX+pXY*cos(-30),CenY-32 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[5] ,CenX-pXY*cos(-30),CenY+0  -pXY*sin(-30),0);
		ObjRender_SetPosition(background01[6] ,CenX+pXY*cos(-30),CenY+32 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[7] ,CenX-pXY*cos(-30),CenY+64 -pXY*sin(-30),0);
		ObjRender_SetPosition(background01[8] ,CenX+pXY*cos(-30),CenY+96 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[9] ,CenX-pXY*cos(-30),CenY+128-pXY*sin(-30),0);
		ObjRender_SetPosition(background01[10],CenX+pXY*cos(-30),CenY+160+pXY*sin(-30),0);
		ObjRender_SetAngleXYZ(background02[0],0,0,angle01);
		ObjRender_SetAngleXYZ(background02[1],0,0,angle02);
		ObjRender_SetAngleXYZ(background02[2],0,0,angle01);
		ObjRender_SetAngleXYZ(background02[3],0,0,angle01);
		yield;
	}
	loop(75) {
		i=0;
		pXY++;
		alpha02 += 90/60;
		alpha01  = 240*sin(alpha02);
		angle01 += 1.2;
		angle02 -= 1.2;

		ObjRender_SetPosition(background01[0] ,CenX+pXY*cos(-30),CenY-160+pXY*sin(-30),0);
		ObjRender_SetPosition(background01[1] ,CenX-pXY*cos(-30),CenY-128-pXY*sin(-30),0);
		ObjRender_SetPosition(background01[2] ,CenX+pXY*cos(-30),CenY-96 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[3] ,CenX-pXY*cos(-30),CenY-64 -pXY*sin(-30),0);
		ObjRender_SetPosition(background01[4] ,CenX+pXY*cos(-30),CenY-32 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[5] ,CenX-pXY*cos(-30),CenY+0  -pXY*sin(-30),0);
		ObjRender_SetPosition(background01[6] ,CenX+pXY*cos(-30),CenY+32 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[7] ,CenX-pXY*cos(-30),CenY+64 -pXY*sin(-30),0);
		ObjRender_SetPosition(background01[8] ,CenX+pXY*cos(-30),CenY+96 +pXY*sin(-30),0);
		ObjRender_SetPosition(background01[9] ,CenX-pXY*cos(-30),CenY+128-pXY*sin(-30),0);
		ObjRender_SetPosition(background01[10],CenX+pXY*cos(-30),CenY+160+pXY*sin(-30),0);
		ObjRender_SetAngleXYZ(background02[0],0,0,angle01);
		ObjRender_SetAngleXYZ(background02[1],0,0,angle02);
		ObjRender_SetAngleXYZ(background02[2],0,0,angle01);
		ObjRender_SetAngleXYZ(background02[3],0,0,angle01);
		loop(11) {
			ObjPrim_SetVertexAlpha(background01[i],0,alpha01);
			ObjPrim_SetVertexAlpha(background01[i],1,alpha01);
			ObjPrim_SetVertexAlpha(background01[i],2,alpha01);
			ObjPrim_SetVertexAlpha(background01[i],3,alpha01);
			ObjPrim_SetVertexColor(background01[i],0,R,G,B);
			ObjPrim_SetVertexColor(background01[i],1,R,G,B);
			ObjPrim_SetVertexColor(background01[i],2,R,G,B);
			ObjPrim_SetVertexColor(background01[i],3,R,G,B);
			i++;
		}
		i=0;
		loop(4) {
			ObjPrim_SetVertexAlpha(background02[i], 0,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 1,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 2,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 3,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 4,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 5,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 6,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 7,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 8,alpha01);
			ObjPrim_SetVertexAlpha(background02[i], 9,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],10,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],11,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],12,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],13,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],14,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],15,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],16,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],17,alpha01);
			ObjPrim_SetVertexAlpha(background02[i],18,alpha01);
			ObjPrim_SetVertexColor(background02[i], 0,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 1,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 2,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 3,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 4,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 5,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 6,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 7,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 8,R,G,B);
			ObjPrim_SetVertexColor(background02[i], 9,R,G,B);
			ObjPrim_SetVertexColor(background02[i],10,R,G,B);
			ObjPrim_SetVertexColor(background02[i],11,R,G,B);
			ObjPrim_SetVertexColor(background02[i],12,R,G,B);
			ObjPrim_SetVertexColor(background02[i],13,R,G,B);
			ObjPrim_SetVertexColor(background02[i],14,R,G,B);
			ObjPrim_SetVertexColor(background02[i],15,R,G,B);
			ObjPrim_SetVertexColor(background02[i],16,R,G,B);
			ObjPrim_SetVertexColor(background02[i],17,R,G,B);
			ObjPrim_SetVertexColor(background02[i],18,R,G,B);
			i++;
		}
		yield;
	}
	i=0;
	loop(11) {
		Obj_Delete(background01[i]);
		i++;
	}
	i=0;
	loop(4) {
		Obj_Delete(background02[i]);
		i++;
	}
}

//-----------------------------------------------------------------------
// ■ スペルカードボーナスの表示 [th10〜th14]
//-----------------------------------------------------------------------
task SpellBonus(X,Y) {

	let Enemy	= GetEnemyBossObjectID[0];
	let bonus	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let score	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let rect01	= [ 7,15,23,31,39,47,55,63,71,79];
	let rect02	= [15,23,31,39,47,55,63,71,79,87];
	let alpha	= 0;
	let i		= 0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 0;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;
	
	LoadTexture(imgspelleffect);

	ObjRender_SetPosition(bonus,CenX,CenY,0);
	ObjPrim_SetTexture(bonus,imgspelleffect);
	ObjRender_SetBlendType(bonus,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(bonus,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(bonus,1,1,1);
	Obj_SetRenderPriorityI(bonus,80);
	ObjPrim_SetVertexCount(bonus,4);
	ObjPrim_SetVertexPosition(bonus,0,-24, -8,0);
	ObjPrim_SetVertexPosition(bonus,1,-24,  8,0);
	ObjPrim_SetVertexPosition(bonus,2, 24, -8,0);
	ObjPrim_SetVertexPosition(bonus,3, 24,  8,0);
	ObjPrim_SetVertexUVT(bonus,0,  0,160);
	ObjPrim_SetVertexUVT(bonus,1,  0,176);
	ObjPrim_SetVertexUVT(bonus,2, 48,160);
	ObjPrim_SetVertexUVT(bonus,3, 48,176);
	ObjPrim_SetVertexAlpha(bonus,0,alpha);
	ObjPrim_SetVertexAlpha(bonus,1,alpha);
	ObjPrim_SetVertexAlpha(bonus,2,alpha);
	ObjPrim_SetVertexAlpha(bonus,3,alpha);

	loop(8){
		ObjRender_SetPosition(score[i],CenX,CenY,0);
		ObjPrim_SetTexture(score[i],imgspelleffect);
		ObjRender_SetBlendType(score[i],BLEND_ALPHA);
		ObjPrim_SetPrimitiveType(score[i],PRIMITIVE_TRIANGLESTRIP);
		ObjRender_SetScaleXYZ(score[i],1,1,1);
		Obj_SetRenderPriorityI(score[i],80);
		ObjPrim_SetVertexCount(score[i],4);
		ObjPrim_SetVertexPosition(score[i],0,-4,-8,0);
		ObjPrim_SetVertexPosition(score[i],1,-4, 8,0);
		ObjPrim_SetVertexPosition(score[i],2, 4,-8,0);
		ObjPrim_SetVertexPosition(score[i],3, 4, 8,0);
		ObjPrim_SetVertexAlpha(score[i],0,alpha);
		ObjPrim_SetVertexAlpha(score[i],1,alpha);
		ObjPrim_SetVertexAlpha(score[i],2,alpha);
		ObjPrim_SetVertexAlpha(score[i],3,alpha);
		i++;
	}

	let ox = MinX+238+X;
	let oy = MaxY-398+Y;

	ObjRender_SetPosition(bonus   ,ox-22,oy,0);
	ObjRender_SetPosition(score[7],ox   ,oy,0);
	ObjRender_SetPosition(score[6],ox+ 7,oy,0);
	ObjRender_SetPosition(score[5],ox+14,oy,0);
	ObjRender_SetPosition(score[4],ox+21,oy,0);
	ObjRender_SetPosition(score[3],ox+28,oy,0);
	ObjRender_SetPosition(score[2],ox+35,oy,0);
	ObjRender_SetPosition(score[1],ox+42,oy,0);
	ObjRender_SetPosition(score[0],ox+49,oy,0);

	while(!Obj_IsDeleted(Enemy) && ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_PLAYER_SPELL_COUNT)==0&&ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_PLAYER_SHOOTDOWN_COUNT)==0){
		i=0;

		let scb    = ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_SPELL_SCORE);
		let score1 = truncate((scb%10));
		let score2 = truncate((scb%100)/10);
		let score3 = truncate((scb%1000)/100);
		let score4 = truncate((scb%10000)/1000);
		let score5 = truncate((scb%100000)/10000);
		let score6 = truncate((scb%1000000)/100000);
		let score7 = truncate((scb%10000000)/1000000);
		let score8 = truncate((scb%100000000)/10000000);

		if(scb>=99999999) {
			score1 = 9;
			score2 = 9;
			score3 = 9;
			score4 = 9;
			score5 = 9;
			score6 = 9;
			score7 = 9;
			score8 = 9;
		}
		if(score8<=0) {
			ObjRender_SetPosition(score[7],-128,-128,0);
			if(score7<=0) {
				ObjRender_SetPosition(score[6],-128,-128,0);
				if(score6<=0) {
					ObjRender_SetPosition(score[5],-128,-128,0);
					if(score5<=0) {
						ObjRender_SetPosition(score[4],-128,-128,0);
						if(score4<=0) {
							ObjRender_SetPosition(score[3],-128,-128,0);
							if(score3<=0) {
								ObjRender_SetPosition(score[2],-128,-128,0);
								if(score2<=0) {
									ObjRender_SetPosition(score[1],-128,-128,0);
								}
							}
						}
					}
				}
			}
		}
		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjPrim_SetVertexAlpha(bonus,0,alpha);
		ObjPrim_SetVertexAlpha(bonus,1,alpha);
		ObjPrim_SetVertexAlpha(bonus,2,alpha);
		ObjPrim_SetVertexAlpha(bonus,3,alpha);
		loop(8){
			ObjPrim_SetVertexAlpha(score[i],0,alpha);
			ObjPrim_SetVertexAlpha(score[i],1,alpha);
			ObjPrim_SetVertexAlpha(score[i],2,alpha);
			ObjPrim_SetVertexAlpha(score[i],3,alpha);
			i++;
		}
		ObjPrim_SetVertexUVT(score[0],0,rect01[score1],192);
		ObjPrim_SetVertexUVT(score[0],1,rect01[score1],208);
		ObjPrim_SetVertexUVT(score[0],2,rect02[score1],192);
		ObjPrim_SetVertexUVT(score[0],3,rect02[score1],208);
		ObjPrim_SetVertexUVT(score[1],0,rect01[score2],192);
		ObjPrim_SetVertexUVT(score[1],1,rect01[score2],208);
		ObjPrim_SetVertexUVT(score[1],2,rect02[score2],192);
		ObjPrim_SetVertexUVT(score[1],3,rect02[score2],208);
		ObjPrim_SetVertexUVT(score[2],0,rect01[score3],192);
		ObjPrim_SetVertexUVT(score[2],1,rect01[score3],208);
		ObjPrim_SetVertexUVT(score[2],2,rect02[score3],192);
		ObjPrim_SetVertexUVT(score[2],3,rect02[score3],208);
		ObjPrim_SetVertexUVT(score[3],0,rect01[score4],192);
		ObjPrim_SetVertexUVT(score[3],1,rect01[score4],208);
		ObjPrim_SetVertexUVT(score[3],2,rect02[score4],192);
		ObjPrim_SetVertexUVT(score[3],3,rect02[score4],208);
		ObjPrim_SetVertexUVT(score[4],0,rect01[score5],192);
		ObjPrim_SetVertexUVT(score[4],1,rect01[score5],208);
		ObjPrim_SetVertexUVT(score[4],2,rect02[score5],192);
		ObjPrim_SetVertexUVT(score[4],3,rect02[score5],208);
		ObjPrim_SetVertexUVT(score[5],0,rect01[score6],192);
		ObjPrim_SetVertexUVT(score[5],1,rect01[score6],208);
		ObjPrim_SetVertexUVT(score[5],2,rect02[score6],192);
		ObjPrim_SetVertexUVT(score[5],3,rect02[score6],208);
		ObjPrim_SetVertexUVT(score[6],0,rect01[score7],192);
		ObjPrim_SetVertexUVT(score[6],1,rect01[score7],208);
		ObjPrim_SetVertexUVT(score[6],2,rect02[score7],192);
		ObjPrim_SetVertexUVT(score[6],3,rect02[score7],208);
		ObjPrim_SetVertexUVT(score[7],0,rect01[score8],192);
		ObjPrim_SetVertexUVT(score[7],1,rect01[score8],208);
		ObjPrim_SetVertexUVT(score[7],2,rect02[score8],192);
		ObjPrim_SetVertexUVT(score[7],3,rect02[score8],208);
		yield;
	}
	Obj_Delete(score[0]);
	Obj_Delete(score[1]);
	Obj_Delete(score[2]);
	Obj_Delete(score[3]);
	Obj_Delete(score[4]);
	Obj_Delete(score[5]);
	Obj_Delete(score[6]);
	ObjRender_SetPosition(score[7],ObjRender_GetX(bonus)+50,ObjRender_GetY(bonus),0);
	ObjPrim_SetVertexPosition(score[7],0,-24, -8,0);
	ObjPrim_SetVertexPosition(score[7],1,-24,  8,0);
	ObjPrim_SetVertexPosition(score[7],2, 24, -8,0);
	ObjPrim_SetVertexPosition(score[7],3, 24,  8,0);
	ObjPrim_SetVertexUVT(score[7],0,  0,176);
	ObjPrim_SetVertexUVT(score[7],1,  0,192);
	ObjPrim_SetVertexUVT(score[7],2, 48,176);
	ObjPrim_SetVertexUVT(score[7],3, 48,192);
	while(!Obj_IsDeleted(Enemy)) {
		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjPrim_SetVertexAlpha(bonus   ,0,alpha);
		ObjPrim_SetVertexAlpha(bonus   ,1,alpha);
		ObjPrim_SetVertexAlpha(bonus   ,2,alpha);
		ObjPrim_SetVertexAlpha(bonus   ,3,alpha);
		ObjPrim_SetVertexAlpha(score[7],0,alpha);
		ObjPrim_SetVertexAlpha(score[7],1,alpha);
		ObjPrim_SetVertexAlpha(score[7],2,alpha);
		ObjPrim_SetVertexAlpha(score[7],3,alpha);
		yield;
	}
	i=0;
	Obj_Delete(bonus);
	loop(8) {
		Obj_Delete(score[i]);
		i++;
	}
}

//-----------------------------------------------------------------------
// ■ スペルカードボーナスの表示（オリジナル算出） [th10〜th14]
//-----------------------------------------------------------------------
task SpellBonus_Ex(X,Y) {

	let Enemy	= GetEnemyBossObjectID[0];
	let bonus	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let score	= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let rect01	= [ 7,15,23,31,39,47,55,63,71,79];
	let rect02	= [15,23,31,39,47,55,63,71,79,87];
	let alpha	= 0;
	let i		= 0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 0;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;
	
	LoadTexture(imgspelleffect);

	ObjRender_SetPosition(bonus,CenX,CenY,0);
	ObjPrim_SetTexture(bonus,imgspelleffect);
	ObjRender_SetBlendType(bonus,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(bonus,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(bonus,1,1,1);
	Obj_SetRenderPriorityI(bonus,80);
	ObjPrim_SetVertexCount(bonus,4);
	ObjPrim_SetVertexPosition(bonus,0,-24, -8,0);
	ObjPrim_SetVertexPosition(bonus,1,-24,  8,0);
	ObjPrim_SetVertexPosition(bonus,2, 24, -8,0);
	ObjPrim_SetVertexPosition(bonus,3, 24,  8,0);
	ObjPrim_SetVertexUVT(bonus,0,  0,160);
	ObjPrim_SetVertexUVT(bonus,1,  0,176);
	ObjPrim_SetVertexUVT(bonus,2, 48,160);
	ObjPrim_SetVertexUVT(bonus,3, 48,176);
	ObjPrim_SetVertexAlpha(bonus,0,alpha);
	ObjPrim_SetVertexAlpha(bonus,1,alpha);
	ObjPrim_SetVertexAlpha(bonus,2,alpha);
	ObjPrim_SetVertexAlpha(bonus,3,alpha);

	loop(8){
		ObjRender_SetPosition(score[i],CenX,CenY,0);
		ObjPrim_SetTexture(score[i],imgspelleffect);
		ObjRender_SetBlendType(score[i],BLEND_ALPHA);
		ObjPrim_SetPrimitiveType(score[i],PRIMITIVE_TRIANGLESTRIP);
		ObjRender_SetScaleXYZ(score[i],1,1,1);
		Obj_SetRenderPriorityI(score[i],80);
		ObjPrim_SetVertexCount(score[i],4);
		ObjPrim_SetVertexPosition(score[i],0,-4,-8,0);
		ObjPrim_SetVertexPosition(score[i],1,-4, 8,0);
		ObjPrim_SetVertexPosition(score[i],2, 4,-8,0);
		ObjPrim_SetVertexPosition(score[i],3, 4, 8,0);
		ObjPrim_SetVertexAlpha(score[i],0,alpha);
		ObjPrim_SetVertexAlpha(score[i],1,alpha);
		ObjPrim_SetVertexAlpha(score[i],2,alpha);
		ObjPrim_SetVertexAlpha(score[i],3,alpha);
		i++;
	}

	let ox = MinX+238+X;
	let oy = MaxY-398+Y;

	ObjRender_SetPosition(bonus   ,ox-22,oy,0);
	ObjRender_SetPosition(score[7],ox   ,oy,0);
	ObjRender_SetPosition(score[6],ox+ 7,oy,0);
	ObjRender_SetPosition(score[5],ox+14,oy,0);
	ObjRender_SetPosition(score[4],ox+21,oy,0);
	ObjRender_SetPosition(score[3],ox+28,oy,0);
	ObjRender_SetPosition(score[2],ox+35,oy,0);
	ObjRender_SetPosition(score[1],ox+42,oy,0);
	ObjRender_SetPosition(score[0],ox+49,oy,0);

	while(!Obj_IsDeleted(Enemy) && ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_PLAYER_SPELL_COUNT)==0&&ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID,INFO_PLAYER_SHOOTDOWN_COUNT)==0){
		i=0;
		let score1 = truncate((GetSpellCardBonus%10));
		let score2 = truncate((GetSpellCardBonus%100)/10);
		let score3 = truncate((GetSpellCardBonus%1000)/100);
		let score4 = truncate((GetSpellCardBonus%10000)/1000);
		let score5 = truncate((GetSpellCardBonus%100000)/10000);
		let score6 = truncate((GetSpellCardBonus%1000000)/100000);
		let score7 = truncate((GetSpellCardBonus%10000000)/1000000);
		let score8 = truncate((GetSpellCardBonus%100000000)/10000000);

		if(GetSpellCardBonus>=99999999) {
			score1 = 9;
			score2 = 9;
			score3 = 9;
			score4 = 9;
			score5 = 9;
			score6 = 9;
			score7 = 9;
			score8 = 9;
		}
		if(GetSpellCardBonus<=0) {
			score1 = 0;
			score2 = 0;
			score3 = 0;
			score4 = 0;
			score5 = 0;
			score6 = 0;
			score7 = 0;
			score8 = 0;
		}
		if(score8<=0) {
			ObjRender_SetPosition(score[7],-128,-128,0);
			if(score7<=0) {
				ObjRender_SetPosition(score[6],-128,-128,0);
				if(score6<=0) {
					ObjRender_SetPosition(score[5],-128,-128,0);
					if(score5<=0) {
						ObjRender_SetPosition(score[4],-128,-128,0);
						if(score4<=0) {
							ObjRender_SetPosition(score[3],-128,-128,0);
							if(score3<=0) {
								ObjRender_SetPosition(score[2],-128,-128,0);
								if(score2<=0) {
									ObjRender_SetPosition(score[1],-128,-128,0);
								}
							}
						}
					}
				}
			}
		}
		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjPrim_SetVertexAlpha(bonus,0,alpha);
		ObjPrim_SetVertexAlpha(bonus,1,alpha);
		ObjPrim_SetVertexAlpha(bonus,2,alpha);
		ObjPrim_SetVertexAlpha(bonus,3,alpha);
		loop(8){
			ObjPrim_SetVertexAlpha(score[i],0,alpha);
			ObjPrim_SetVertexAlpha(score[i],1,alpha);
			ObjPrim_SetVertexAlpha(score[i],2,alpha);
			ObjPrim_SetVertexAlpha(score[i],3,alpha);
			i++;
		}
		ObjPrim_SetVertexUVT(score[0],0,rect01[score1],192);
		ObjPrim_SetVertexUVT(score[0],1,rect01[score1],208);
		ObjPrim_SetVertexUVT(score[0],2,rect02[score1],192);
		ObjPrim_SetVertexUVT(score[0],3,rect02[score1],208);
		ObjPrim_SetVertexUVT(score[1],0,rect01[score2],192);
		ObjPrim_SetVertexUVT(score[1],1,rect01[score2],208);
		ObjPrim_SetVertexUVT(score[1],2,rect02[score2],192);
		ObjPrim_SetVertexUVT(score[1],3,rect02[score2],208);
		ObjPrim_SetVertexUVT(score[2],0,rect01[score3],192);
		ObjPrim_SetVertexUVT(score[2],1,rect01[score3],208);
		ObjPrim_SetVertexUVT(score[2],2,rect02[score3],192);
		ObjPrim_SetVertexUVT(score[2],3,rect02[score3],208);
		ObjPrim_SetVertexUVT(score[3],0,rect01[score4],192);
		ObjPrim_SetVertexUVT(score[3],1,rect01[score4],208);
		ObjPrim_SetVertexUVT(score[3],2,rect02[score4],192);
		ObjPrim_SetVertexUVT(score[3],3,rect02[score4],208);
		ObjPrim_SetVertexUVT(score[4],0,rect01[score5],192);
		ObjPrim_SetVertexUVT(score[4],1,rect01[score5],208);
		ObjPrim_SetVertexUVT(score[4],2,rect02[score5],192);
		ObjPrim_SetVertexUVT(score[4],3,rect02[score5],208);
		ObjPrim_SetVertexUVT(score[5],0,rect01[score6],192);
		ObjPrim_SetVertexUVT(score[5],1,rect01[score6],208);
		ObjPrim_SetVertexUVT(score[5],2,rect02[score6],192);
		ObjPrim_SetVertexUVT(score[5],3,rect02[score6],208);
		ObjPrim_SetVertexUVT(score[6],0,rect01[score7],192);
		ObjPrim_SetVertexUVT(score[6],1,rect01[score7],208);
		ObjPrim_SetVertexUVT(score[6],2,rect02[score7],192);
		ObjPrim_SetVertexUVT(score[6],3,rect02[score7],208);
		ObjPrim_SetVertexUVT(score[7],0,rect01[score8],192);
		ObjPrim_SetVertexUVT(score[7],1,rect01[score8],208);
		ObjPrim_SetVertexUVT(score[7],2,rect02[score8],192);
		ObjPrim_SetVertexUVT(score[7],3,rect02[score8],208);
		yield;
	}
	Obj_Delete(score[0]);
	Obj_Delete(score[1]);
	Obj_Delete(score[2]);
	Obj_Delete(score[3]);
	Obj_Delete(score[4]);
	Obj_Delete(score[5]);
	Obj_Delete(score[6]);
	ObjRender_SetPosition(score[7],ObjRender_GetX(bonus)+50,ObjRender_GetY(bonus),0);
	ObjPrim_SetVertexPosition(score[7],0,-24, -8,0);
	ObjPrim_SetVertexPosition(score[7],1,-24,  8,0);
	ObjPrim_SetVertexPosition(score[7],2, 24, -8,0);
	ObjPrim_SetVertexPosition(score[7],3, 24,  8,0);
	ObjPrim_SetVertexUVT(score[7],0,  0,176);
	ObjPrim_SetVertexUVT(score[7],1,  0,192);
	ObjPrim_SetVertexUVT(score[7],2, 48,176);
	ObjPrim_SetVertexUVT(score[7],3, 48,192);
	while(!Obj_IsDeleted(Enemy)) {
		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjPrim_SetVertexAlpha(bonus   ,0,alpha);
		ObjPrim_SetVertexAlpha(bonus   ,1,alpha);
		ObjPrim_SetVertexAlpha(bonus   ,2,alpha);
		ObjPrim_SetVertexAlpha(bonus   ,3,alpha);
		ObjPrim_SetVertexAlpha(score[7],0,alpha);
		ObjPrim_SetVertexAlpha(score[7],1,alpha);
		ObjPrim_SetVertexAlpha(score[7],2,alpha);
		ObjPrim_SetVertexAlpha(score[7],3,alpha);
		yield;
	}
	i=0;
	Obj_Delete(bonus);
	loop(8) {
		Obj_Delete(score[i]);
		i++;
	}
}

//-----------------------------------------------------------------------
// ■ スペルカード挑戦回数の表示 [th10〜th14]
//-----------------------------------------------------------------------
task History(type,Take,Try) {

	let Enemy	= GetEnemyBossObjectID[0];
	let history	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let slash	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let nam		= [ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D),ObjPrim_Create(OBJ_PRIMITIVE_2D)];
	let rect01	= [ 7,15,23,31,39,47,55,63,71,79];
	let rect02	= [15,23,31,39,47,55,63,71,79,87];
	let alpha	= 0;
	let i		= 0;
	let CenX	= GetStgFrameWidth/2.0;
	let CenY	= GetStgFrameHeight/2.0;
	let MinX	= 0;
	let MinY	= 0;
	let MaxX	= GetStgFrameWidth;
	let MaxY	= GetStgFrameHeight;
	
	LoadTexture(imgspelleffect);

	/*****************************************************************
		type 0：妖々夢　
		type 1：永夜抄　風神録　地霊殿　星蓮船　妖精大戦争
		type 2：神霊廟　輝針城
	*****************************************************************/

	ObjRender_SetPosition(history,CenX,CenY,0);
	ObjPrim_SetTexture(history,imgspelleffect);
	ObjRender_SetBlendType(history,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(history,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(history,1,1,1);
	Obj_SetRenderPriorityI(history,80);
	ObjPrim_SetVertexCount(history,4);
	ObjPrim_SetVertexPosition(history,0,-24, -8,0);
	ObjPrim_SetVertexPosition(history,1,-24,  8,0);
	ObjPrim_SetVertexPosition(history,2, 24, -8,0);
	ObjPrim_SetVertexPosition(history,3, 24,  8,0);
	ObjPrim_SetVertexUVT(history,0, 48,160);
	ObjPrim_SetVertexUVT(history,1, 48,176);
	ObjPrim_SetVertexUVT(history,2, 96,160);
	ObjPrim_SetVertexUVT(history,3, 96,176);
	ObjPrim_SetVertexAlpha(history,0,alpha);
	ObjPrim_SetVertexAlpha(history,1,alpha);
	ObjPrim_SetVertexAlpha(history,2,alpha);
	ObjPrim_SetVertexAlpha(history,3,alpha);

	ObjRender_SetPosition(slash,CenX,CenY,0);
	ObjPrim_SetTexture(slash,imgspelleffect);
	ObjRender_SetBlendType(slash,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(slash,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(slash,1,1,1);
	Obj_SetRenderPriorityI(slash,80);
	ObjPrim_SetVertexCount(slash,4);
	ObjPrim_SetVertexPosition(slash,0,-4, -8,0);
	ObjPrim_SetVertexPosition(slash,1,-4,  8,0);
	ObjPrim_SetVertexPosition(slash,2, 4, -8,0);
	ObjPrim_SetVertexPosition(slash,3, 4,  8,0);
	ObjPrim_SetVertexUVT(slash,0,87,192);
	ObjPrim_SetVertexUVT(slash,1,87,208);
	ObjPrim_SetVertexUVT(slash,2,95,192);
	ObjPrim_SetVertexUVT(slash,3,95,208);
	ObjPrim_SetVertexAlpha(slash,0,alpha);
	ObjPrim_SetVertexAlpha(slash,1,alpha);
	ObjPrim_SetVertexAlpha(slash,2,alpha);
	ObjPrim_SetVertexAlpha(slash,3,alpha);

	loop(4){
		ObjRender_SetPosition(nam[i],CenX,CenY,0);
		ObjPrim_SetTexture(nam[i],imgspelleffect);
		ObjRender_SetBlendType(nam[i],BLEND_ALPHA);
		ObjPrim_SetPrimitiveType(nam[i],PRIMITIVE_TRIANGLESTRIP);
		ObjRender_SetScaleXYZ(nam[i],1,1,1);
		Obj_SetRenderPriorityI(nam[i],80);
		ObjPrim_SetVertexCount(nam[i],4);
		ObjPrim_SetVertexPosition(nam[i],0,-4,-8,0);
		ObjPrim_SetVertexPosition(nam[i],1,-4, 8,0);
		ObjPrim_SetVertexPosition(nam[i],2, 4,-8,0);
		ObjPrim_SetVertexPosition(nam[i],3, 4, 8,0);
		ObjPrim_SetVertexAlpha(nam[i],0,alpha);
		ObjPrim_SetVertexAlpha(nam[i],1,alpha);
		ObjPrim_SetVertexAlpha(nam[i],2,alpha);
		ObjPrim_SetVertexAlpha(nam[i],3,alpha);
		i++;
	}

	let ox = MinX+336;
	let oy = MaxY-398;

	if(type==2) { oy -= 20; }

	ObjRender_SetPosition(history,ox-22,oy,0);
	ObjRender_SetPosition(slash  ,ox+14,oy,0);
	ObjRender_SetPosition(nam[3] ,ox+21,oy,0);
	ObjRender_SetPosition(nam[2] ,ox+28,oy,0);
	ObjRender_SetPosition(nam[1] ,ox   ,oy,0);
	ObjRender_SetPosition(nam[0] ,ox+ 7,oy,0);

	loop(120) { yield; }
	while(Try<100 && !Obj_IsDeleted(Enemy)) {
		i=0;
		let nam1  = truncate((Take%10));
		let nam2  = truncate((Take%100)/10);
		let nam3  = truncate((Try%10));
		let nam4  = truncate((Try%100)/10);

		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjPrim_SetVertexAlpha(history,0,alpha);
		ObjPrim_SetVertexAlpha(history,1,alpha);
		ObjPrim_SetVertexAlpha(history,2,alpha);
		ObjPrim_SetVertexAlpha(history,3,alpha);
		ObjPrim_SetVertexAlpha(slash  ,0,alpha);
		ObjPrim_SetVertexAlpha(slash  ,1,alpha);
		ObjPrim_SetVertexAlpha(slash  ,2,alpha);
		ObjPrim_SetVertexAlpha(slash  ,3,alpha);
		loop(4){
			ObjPrim_SetVertexAlpha(nam[i],0,alpha);
			ObjPrim_SetVertexAlpha(nam[i],1,alpha);
			ObjPrim_SetVertexAlpha(nam[i],2,alpha);
			ObjPrim_SetVertexAlpha(nam[i],3,alpha);
			i++;
		}
		ObjPrim_SetVertexUVT(nam[0],0,rect01[nam1],192);
		ObjPrim_SetVertexUVT(nam[0],1,rect01[nam1],208);
		ObjPrim_SetVertexUVT(nam[0],2,rect02[nam1],192);
		ObjPrim_SetVertexUVT(nam[0],3,rect02[nam1],208);
		ObjPrim_SetVertexUVT(nam[1],0,rect01[nam2],192);
		ObjPrim_SetVertexUVT(nam[1],1,rect01[nam2],208);
		ObjPrim_SetVertexUVT(nam[1],2,rect02[nam2],192);
		ObjPrim_SetVertexUVT(nam[1],3,rect02[nam2],208);
		ObjPrim_SetVertexUVT(nam[2],0,rect01[nam3],192);
		ObjPrim_SetVertexUVT(nam[2],1,rect01[nam3],208);
		ObjPrim_SetVertexUVT(nam[2],2,rect02[nam3],192);
		ObjPrim_SetVertexUVT(nam[2],3,rect02[nam3],208);
		ObjPrim_SetVertexUVT(nam[3],0,rect01[nam4],192);
		ObjPrim_SetVertexUVT(nam[3],1,rect01[nam4],208);
		ObjPrim_SetVertexUVT(nam[3],2,rect02[nam4],192);
		ObjPrim_SetVertexUVT(nam[3],3,rect02[nam4],208);
		yield;
	}
	Obj_Delete(nam[3]);
	while(Take<100 && !Obj_IsDeleted(Enemy)) {
		i=0;
		let nam1  = truncate((Take%10));
		let nam2  = truncate((Take%100)/10);

		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjPrim_SetVertexAlpha(history,0,alpha);
		ObjPrim_SetVertexAlpha(history,1,alpha);
		ObjPrim_SetVertexAlpha(history,2,alpha);
		ObjPrim_SetVertexAlpha(history,3,alpha);
		ObjPrim_SetVertexAlpha(slash,0,alpha);
		ObjPrim_SetVertexAlpha(slash,1,alpha);
		ObjPrim_SetVertexAlpha(slash,2,alpha);
		ObjPrim_SetVertexAlpha(slash,3,alpha);
		loop(3){
			ObjPrim_SetVertexAlpha(nam[i],0,alpha);
			ObjPrim_SetVertexAlpha(nam[i],1,alpha);
			ObjPrim_SetVertexAlpha(nam[i],2,alpha);
			ObjPrim_SetVertexAlpha(nam[i],3,alpha);
			i++;
		}
		ObjPrim_SetVertexUVT(nam[0],0,rect01[nam1],192);
		ObjPrim_SetVertexUVT(nam[0],1,rect01[nam1],208);
		ObjPrim_SetVertexUVT(nam[0],2,rect02[nam1],192);
		ObjPrim_SetVertexUVT(nam[0],3,rect02[nam1],208);
		ObjPrim_SetVertexUVT(nam[1],0,rect01[nam2],192);
		ObjPrim_SetVertexUVT(nam[1],1,rect01[nam2],208);
		ObjPrim_SetVertexUVT(nam[1],2,rect02[nam2],192);
		ObjPrim_SetVertexUVT(nam[1],3,rect02[nam2],208);

		ObjRender_SetPosition(nam[2] ,ox+29,oy,0);
		ObjPrim_SetVertexPosition(nam[2],0,-24, -8,0);
		ObjPrim_SetVertexPosition(nam[2],1,-24,  8,0);
		ObjPrim_SetVertexPosition(nam[2],2, 24, -8,0);
		ObjPrim_SetVertexPosition(nam[2],3, 24,  8,0);
		ObjPrim_SetVertexUVT(nam[2],0, 96,176);
		ObjPrim_SetVertexUVT(nam[2],1, 96,192);
		ObjPrim_SetVertexUVT(nam[2],2,144,176);
		ObjPrim_SetVertexUVT(nam[2],3,144,192);
		yield;
	}
	Obj_Delete(nam[0]);
	Obj_Delete(nam[1]);
	Obj_Delete(nam[2]);
	ObjPrim_SetVertexPosition(slash,0,-24, -8,0);
	ObjPrim_SetVertexPosition(slash,1,-24,  8,0);
	ObjPrim_SetVertexPosition(slash,2, 24, -8,0);
	ObjPrim_SetVertexPosition(slash,3, 24,  8,0);
	ObjPrim_SetVertexUVT(slash,0, 48,176);
	ObjPrim_SetVertexUVT(slash,1, 48,192);
	ObjPrim_SetVertexUVT(slash,2, 96,176);
	ObjPrim_SetVertexUVT(slash,3, 96,192);
	while(!Obj_IsDeleted(Enemy)) {
		if(alpha<255) { alpha += 10; }
		if(GetPlayerY<=MinY+128) { alpha=128; }

		ObjRender_SetPosition(slash,ox+20,oy,0);
		ObjPrim_SetVertexAlpha(history,0,alpha);
		ObjPrim_SetVertexAlpha(history,1,alpha);
		ObjPrim_SetVertexAlpha(history,2,alpha);
		ObjPrim_SetVertexAlpha(history,3,alpha);
		ObjPrim_SetVertexAlpha(slash  ,0,alpha);
		ObjPrim_SetVertexAlpha(slash  ,1,alpha);
		ObjPrim_SetVertexAlpha(slash  ,2,alpha);
		ObjPrim_SetVertexAlpha(slash  ,3,alpha);
		yield;
	}
	i=0;
	Obj_Delete(history);
	Obj_Delete(slash);
	loop(4) {
		Obj_Delete(nam[i]);
		i++;
	}
}
