task DrawMultiplyCount(let basenum,let scp)
{
	let sx=525;
	let sy=450;
	let leng=16*1.5;
	let lp=floor(log10(basenum))+1;
	let i=lp;
	let scale=1.5;
	Msg(sx-54,sy);
	loop(lp)
	{
		
		let posx=sx+(lp-i)*(leng/1.4);
		let posy=sy;
		let rc=(basenum%(10^i)-basenum%(10^(i-1)))/(10^(i-1));
		
		Number(rc,posx,posy);
		i--;
	}
	if(basenum==0)
	{
		Number(0,sx,sy);
	}
	Number(10,sx+(lp-i)*(leng/1.4),sy);
	
	task Msg(let x,let y)
	{
		let obj=SetEffectObject(tex[TEX_SYSTEM],8);
		SetEffectObjectRect(obj,0,16,64,32);
		ObjEffect_SetScale(obj,1.5,1.5);
		let alpha=255;
		while(!Obj_BeDeleted(obj))
		{
			if(alpha==255){ObjEffect_SetRenderState(obj,ALPHA);}
			else{ObjEffect_SetRenderState(obj,ADD);}
			Obj_SetPosition(obj,x,y);
			ascent(a in 0..4)
			{
				ObjEffect_SetVertexColor(obj,a,alpha,255,255,255);
			}
			if(alpha<254){alpha-=254;}
			alpha--;
			x+=1;
			y+=1;
			if(alpha<0){Obj_Delete(obj);}
			yield;
		}
	}
	
	task Number(let num,let x,let y)
	{
		let obj=SetEffectObject(tex[TEX_SYSTEM],8);
		SetEffectObjectRect(obj,256+16*num,32,272+16*num,48);
		let alpha=255;
		if(scp!=0&&!tuning_lightmode){alpha=64;}
		while(!Obj_BeDeleted(obj))
		{
			if(alpha==255){ObjEffect_SetRenderState(obj,ALPHA);}
			else{ObjEffect_SetRenderState(obj,ADD);}
			Obj_SetPosition(obj,x,y);
			ObjEffect_SetScale(obj,scale,scale);
			ascent(a in 0..4)
			{
				ObjEffect_SetVertexColor(obj,a,alpha,255,255,255);
			}
			if(tuning_lightmode)
			{
				if(alpha<254){alpha-=254;}
				alpha--;
			}
			else
			{
				if(scp==0)
				{
					alpha-=80;
					x+=1;
					y+=1;
				}
				else
				{
					alpha-=5;
					x+=2;
					y+=2;
					scale+=scp;
				}
			}
			if(alpha<0){Obj_Delete(obj);}
			yield;
		}
	}
}



task DrawBaseCount(let basenum,let scp)
{
	let sx=520;
	let sy=420;
	let leng=16*1.5;
	let lp=floor(log10(basenum))+1;
	let i=lp;
	let scale=1.5;
	Msg(sx-60,sy);
	Number(11,sx-leng/1.4,sy);
	loop(lp)
	{
		
		let posx=sx+(lp-i)*(leng/1.4);
		let posy=sy;
		let rc=(basenum%(10^i)-basenum%(10^(i-1)))/(10^(i-1));
		
		Number(rc,posx,posy);
		i--;
	}
	if(basenum==0)
	{
		Number(0,sx,sy);
	}
	
	task Msg(let x,let y)
	{
		let obj=SetEffectObject(tex[TEX_SYSTEM],8);
		SetEffectObjectRect(obj,64,16,128,32);
		ObjEffect_SetScale(obj,1.5,1.5);
		let alpha=255;
		while(!Obj_BeDeleted(obj))
		{
			if(alpha==255){ObjEffect_SetRenderState(obj,ALPHA);}
			else{ObjEffect_SetRenderState(obj,ADD);}
			Obj_SetPosition(obj,x,y);
			
			ascent(a in 0..4)
			{
				ObjEffect_SetVertexColor(obj,a,alpha,255,255,255);
			}
			if(alpha<254){alpha-=254;}
			alpha--;
			x+=1;
			y+=1;
			if(alpha<0){Obj_Delete(obj);}
			yield;
		}
	}
	
	task Number(let num,let x,let y)
	{
		let obj=SetEffectObject(tex[TEX_SYSTEM],8);
		SetEffectObjectRect(obj,256+16*num,32,272+16*num,48);
		let alpha=255;
		if(scp!=0&&!tuning_lightmode){alpha=48;}
		while(!Obj_BeDeleted(obj))
		{
			if(alpha==255){ObjEffect_SetRenderState(obj,ALPHA);}
			else{ObjEffect_SetRenderState(obj,ADD);}
			Obj_SetPosition(obj,x,y);
			ObjEffect_SetScale(obj,scale,scale);
			ascent(a in 0..4)
			{
				ObjEffect_SetVertexColor(obj,a,alpha,255,255,255);
			}
			if(tuning_lightmode)
			{
				if(alpha<254){alpha-=254;}
				alpha--;
			}
			else
			{
				if(scp==0)
				{
					alpha-=80;
					x+=1;
					y+=1;
				}
				else
				{
					alpha-=5;
					x+=2;
					y+=2;
					scale+=scp;
				}
			}
			if(alpha<0){Obj_Delete(obj);}
			yield;
		}
	}
}


