task SpellDisplay(number,time)//Apocalypse‚š•\ˇ¦
{
	let yAddRate=1;
		let scx=0.75+0.25;
		let scy=0.75+0.25;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgSpell);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -360, -10);
		ObjEffect_SetVertexXY(obj, 1,0,  -10);
		ObjEffect_SetVertexXY(obj, 2,0, 10);
		ObjEffect_SetVertexXY(obj, 3,  -360, 10);
	
if(number<=10)
{	
		ObjEffect_SetVertexUV(obj, 0,  0,  1+number*19);
		ObjEffect_SetVertexUV(obj, 1,  360, 1+number*19);
		ObjEffect_SetVertexUV(obj, 2, 360, 19+number*19);
		ObjEffect_SetVertexUV(obj, 3, 0, 19+number*19);
}
if(number==11)
{	
		ObjEffect_SetVertexUV(obj, 0,  0,  212);
		ObjEffect_SetVertexUV(obj, 1,  360, 212);
		ObjEffect_SetVertexUV(obj, 2, 360, 229);
		ObjEffect_SetVertexUV(obj, 3, 0, 229);
		yAddRate=1.75;
		
}
	
if(number>11 && number<=15)
{	
		ObjEffect_SetVertexUV(obj, 0,  0,  1+number*19+3);
		ObjEffect_SetVertexUV(obj, 1,  360, 1+number*19+3);
		ObjEffect_SetVertexUV(obj, 2, 360, 19+number*19+3);
		ObjEffect_SetVertexUV(obj, 3, 0, 19+number*19+3);
}

if(number==16)
{	
		ObjEffect_SetVertexUV(obj, 0,  0,  310);
		ObjEffect_SetVertexUV(obj, 1,  360, 310);
		ObjEffect_SetVertexUV(obj, 2, 360, 327);
		ObjEffect_SetVertexUV(obj, 3, 0, 327);
		
}

if(number>16 && number<=100)
{	
		ObjEffect_SetVertexUV(obj, 0,  0,  1+number*19+6);
		ObjEffect_SetVertexUV(obj, 1,  360, 1+number*19+6);
		ObjEffect_SetVertexUV(obj, 2, 360, 19+number*19+6);
		ObjEffect_SetVertexUV(obj, 3, 0, 19+number*19+6);
}
if(number==45){yAddRate=1.75;}
		let Alpha=0;

		let R=255;
		let G=255;
		let B=255;
		alternative(StageProgress)
		case(1){R=0;G=250;B=154;}
		case(2){R=255;G=100;B=0;}
		case(3){R=148;G=0;B=211;}
		case(4){R=0;G=100;B=255;}
		case(5){R=255;G=255;B=0;}
		if(GetCommonDataDefault("STAGE2MIDBOSS",false)){R=255;G=255;B=127;}
		if(GetCommonDataDefault("STAGE3MIDBOSS",false)){R=0;G=84;B=166;}
		if(GetCommonDataDefault("STAGE4MIDBOSS",false)){R=255;G=69;B=30;}
		if(GetCommonDataDefault("STAGE5MIDBOSS",false)){R=0;G=255;B=255;}
		ascent(i in 0..4)
		{
		ObjEffect_SetVertexColor(obj,i,Alpha,R,G,B);
		}

		ObjEffect_SetLayer(obj,7);
		
		Obj_SetX(obj,GetClipMaxX-2);
		Obj_SetY(obj,GetClipMaxY-16);

		ObjEffect_SetScale(obj, scx,scy);
		let y=GetClipMaxY+16;

		let HueCount=number*100-4000;
		let color=HueDifine(HueCount);
		loop(60)
		{
			Obj_SetY(obj,y);
			ascent(i in 0..4)
			{
				ObjEffect_SetVertexColor(obj,i,Alpha,R,G,B);
			}
			y-=0.5*yAddRate;
			Alpha+=255/60;
			if(GetCommonDataDefault("TrueBossFlag",false))
			{
				color=HueDifine(HueCount);
				R=color[0];
				G=color[1];
				B=color[2];
				HueCount+=3;
			}
			yield;
		}
		let AlphaAngle=0;
		loop(time-120)
		{
			ascent(i in 0..4)
			{
				ObjEffect_SetVertexColor(obj,i,Alpha,R,G,B);
			}	
			if(GetCommonDataDefault("BossLife",0)<=0){break;}
			if(GetCommonDataDefault("SpellDrawStop",false)){break;}
			if(GetCommonDataDefault("TrueBossFlag",false))
			{
				color=HueDifine(HueCount);
				R=color[0];
				G=color[1];
				B=color[2];
				HueCount+=3;
			}
			yield;
		}
		loop(60)
		{
			Obj_SetY(obj,y);
			ascent(i in 0..4)
			{
				ObjEffect_SetVertexColor(obj,i,Alpha,R,G,B);
			}
			y+=0.5*yAddRate;
			Alpha-=255/60;
			if(GetCommonDataDefault("TrueBossFlag",false))
			{
				color=HueDifine(HueCount);
				R=color[0];
				G=color[1];
				B=color[2];
				HueCount+=3;
			}
			yield;
		}
		SetCommonData("SpellDrawStop",false);
		Obj_Delete(obj);
}