task BreakEffectObject(let sx,let sy,let speed,let angle,let type)
{
	let wt=120;
	
	let obj=SetEffectObject(tex[TEX_SYSTEM],5);
	ObjEffect_SetRenderState(obj,ADD);
	SetEffectObjectRect(obj,160+(type%3)*16,0,172+(type%3)*16,16);
	let alpha=255;
	let scale=3;
	let rotx=rand(0,360);let roty=rand(0,360);let rotz=rand(0,360);
	let vx=rand(-10,10);let vy=rand(-10,10);let vz=rand(-10,10);
	while(!Obj_BeDeleted(obj))
	{
		Obj_SetPosition(obj,sx,sy);
		ObjEffect_SetAngle(obj,rotx,roty,rotz);
		ObjEffect_SetScale(obj,scale,scale);
		ascent(a in 0..4){ObjEffect_SetVertexColor(obj,a,alpha,255,255,255);}
		
		sx+=speed*cos(angle);
		sy+=speed*sin(angle);
		alpha-=255/wt;
		scale-=3/wt;
		rotx+=vx;
		roty+=vy;
		rotz+=vz;
		
		if(alpha<0){Obj_Delete(obj);}
		yield;
	}
}