
task Bdraw//ボーナスポイント表示のタスク
{
	let bx=GetClipMaxX+190;
	let by=GetClipMinY+167;
wait(5);
while(GetCommonDataDefault("TitleMenu",false)){yield;}
if(GetCommonDataDefault("SELECTEDDIFFICULT","None")=="None")
{return;}
let Bnum=[];
loop(8){Bnum=Bnum~[0];}
loop{

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

Bonusnum(bx,by,Bnum[0]);

ascent(let i in 1..7)
{
	if(MagicCounter>=10^i)
	{
		Bonusnum(bx-i*12,by,Bnum[i]);
	}
}

		yield;


}
}

task Rankdraw//ボーナスポイント表示のタスク
{
	let bx=GetClipMaxX+178;
	let by=GetClipMinY+217;
wait(5);
while(GetCommonDataDefault("TitleMenu",false)){yield;}
if(GetCommonDataDefault("SELECTEDDIFFICULT","None")=="None")
{return;}
let Bnum=[];
loop(8){Bnum=Bnum~[0];}
loop{
let Efficiency=10000-BurstRank*1000;
Bnum[0]=trunc(Efficiency%10);
Bnum[1]=trunc(Efficiency%100/10);
Bnum[2]=trunc(Efficiency%1000/100);
Bnum[3]=trunc(Efficiency%10000/1000);
Bnum[4]=trunc(Efficiency%100000/10000);

Bonusnum(bx,by,Bnum[0]);

ascent(let i in 1..2)
{
	if(Efficiency>=10^i)
	{
		Bonusnum(bx-i*12,by,Bnum[i]);
	}
}
	Bonusnum(bx-2*12,by,10);
ascent(let i in 2..5)
{
	if(Efficiency>=10^i)
	{
		Bonusnum(bx-(i+1)*12,by,Bnum[i]);
	}
}

		yield;


}
}

task Bonusnum(x,y,num)
{
		let scx=0.6;
		let scy=0.6;
		let obj0 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj0,imgNumber);
		ObjEffect_SetPrimitiveType(obj0, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj0, ADD); 
		ObjEffect_CreateVertex(obj0, 4);
		ObjEffect_SetVertexXY(obj0, 0, -13, -16);
		ObjEffect_SetVertexXY(obj0, 1, 13,  -16);
		ObjEffect_SetVertexXY(obj0, 2, 13, 16);
		ObjEffect_SetVertexXY(obj0, 3,  -13,  16);
		
		ObjEffect_SetVertexUV(obj0, 0,  0+40*num,  6);
		ObjEffect_SetVertexUV(obj0, 1,  26+40*num, 6);
		ObjEffect_SetVertexUV(obj0, 2, 26+40*num,  38);
		ObjEffect_SetVertexUV(obj0, 3, 0+40*num, 38);

	/*	ObjEffect_SetVertexColor(obj0,0,Alpha,R,G,B);
		ObjEffect_SetVertexColor(obj0,1,Alpha,R,G,B);
		ObjEffect_SetVertexColor(obj0,2,Alpha,R,G,B);
		ObjEffect_SetVertexColor(obj0,3,Alpha,R,G,B);
	*/	
		ObjEffect_SetScale(obj0, scx,scy);
		Obj_SetPosition(obj0,x,y+5);
		ObjEffect_SetLayer(obj0,8);
		wait(1);
		Obj_Delete(obj0);
}


task DeleteShotNumdraw(Dnum,x,y,type)//ボーナスポイント表示のタスク
{
if(IsBossExisting)
{
x=GetPlayerX;
y=GetPlayerY-30;
}
let Bnum=[];
let number;
loop(4){Bnum=Bnum~[0];}

Bnum[0]=trunc(Dnum%10);
Bnum[1]=trunc(Dnum%100/10);
Bnum[2]=trunc(Dnum%1000/100);
Bnum[3]=trunc(Dnum%10000/1000);

ascent(let i in 0..4)
{
	if(Dnum>=10^i)
	{
		DeleteBonusnum(x-i*12,y,Bnum[i],type);
		number=i+1;
	}
}
if(type==1)
{
	DeleteBonusnum(x-number*12,y,12,type);
}
if(type==2)
{
	DeleteBonusnum(x-number*12,y,12,type);
}
}

task DeleteBonusnum(x,y,num,type)
{
		let Alpha=0;
		let R;let G;let B;
		if(type==1)
		{
			R=255;G=127;B=127;
		}
		if(type==2)
		{
			R=127;G=127;B=255;
		}
		let scx=0.6;
		let scy=0.6;
		let obj0 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj0,imgNumber);
		ObjEffect_SetPrimitiveType(obj0, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj0, ADD); 
		ObjEffect_CreateVertex(obj0, 4);
		ObjEffect_SetVertexXY(obj0, 0, -13, -16);
		ObjEffect_SetVertexXY(obj0, 1, 13,  -16);
		ObjEffect_SetVertexXY(obj0, 2, 13, 16);
		ObjEffect_SetVertexXY(obj0, 3,  -13,  16);
		
		ObjEffect_SetVertexUV(obj0, 0,  0+40*num,  6);
		ObjEffect_SetVertexUV(obj0, 1,  26+40*num, 6);
		ObjEffect_SetVertexUV(obj0, 2, 26+40*num,  38);
		ObjEffect_SetVertexUV(obj0, 3, 0+40*num, 38);

		ascent(let i in 0..4)
		{	
			ObjEffect_SetVertexColor(obj0,i,Alpha,R,G,B);
		}
		
		ObjEffect_SetScale(obj0, scx,scy);
		Obj_SetPosition(obj0,x,y+5);
		ObjEffect_SetLayer(obj0,8);
		loop(30)
		{
		ascent(let i in 0..4)
		{	
			ObjEffect_SetVertexColor(obj0,i,Alpha,R,G,B);
		}
		Alpha+=8;
		Obj_SetY(obj0,Obj_GetY(obj0)-0.1);
		yield;
		}
		loop(30)
		{
		Obj_SetY(obj0,Obj_GetY(obj0)-0.1);
		yield;
		}
		loop(30)
		{
		ascent(let i in 0..4)
		{	
			ObjEffect_SetVertexColor(obj0,i,Alpha,R,G,B);
		}
		Obj_SetY(obj0,Obj_GetY(obj0)-0.1);
		Alpha-=8;
		yield;
		}
		Obj_Delete(obj0);
}