
task StageTelop(let num)
{
	let obj=SetEffectObject(tex[TEX_SYSTEM],6);
	if(num<7)
	{
		SetEffectObjectRect(obj,432,320+32*(num-1),512,352+32*(num-1));
	}
	else
	{
		let rc=num-6;
		SetEffectObjectRect(obj,256,416+32*(rc-1),416,448+32*(rc-1));
	}
	ObjEffect_SetRenderState(obj,ALPHA);
	ObjEffect_SetScale(obj,1,1);
	
	let sx=cenX;let sy=maxY-50;
	let alpha=4;
	let count=0;
	let v=4;
	while(!Obj_BeDeleted(obj))
	{
		Obj_SetPosition(obj,sx,sy);
		ascent(a in 0..4)
		{
			ObjEffect_SetVertexColor(obj,a,alpha,255,255,255);
		}
		if(!tuning_lightmode){Effect(alpha,num,sx,sy);}
		if(count<30){alpha+=8;}
		if(count>180){alpha-=10;}
		sx+=v;
		v/=1.05;
		count++;
		if(alpha<0){Obj_Delete(obj);}
		yield;
	}
	
	task Effect(let alpha,let num,let sx,let sy)
	{
		let obj=SetEffectObject(tex[TEX_SYSTEM],5);	
		if(num<7)
		{
			SetEffectObjectRect(obj,432,320+32*(num-1),512,352+32*(num-1));
		}
		else
		{
			let rc=num-6;
			SetEffectObjectRect(obj,256,416+32*(rc-1),416,448+32*(rc-1));
		}
		ObjEffect_SetRenderState(obj,ADD);
		let scale=1;
		let v=-2;
		while(!Obj_BeDeleted(obj))
		{
			ObjEffect_SetScale(obj,scale,scale);
			Obj_SetPosition(obj,sx,sy);
			ascent(a in 0..4)
			{
				if(num<7){ObjEffect_SetVertexColor(obj,a,alpha,48,48,255);}
				else{ObjEffect_SetVertexColor(obj,a,alpha,255,48,48);}
			}
			scale-=0.005;
			alpha-=2;
			sx+=v;
			if(alpha<0){Obj_Delete(obj);}
			yield;
		}
	}
}
