task magiccircle(boss,size,r,g,b,type){
	let obj = ObjPrim_Create(OBJ_SPRITE_2D);
	let img = GetCurrentScriptDirectory~"img/MG.png";
	let spin = 0;
	LoadTexture(img);
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,0,0,126,128);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetScaleXYZ(obj,size,size,size);
	ObjRender_SetColor(obj,r,g,b); // GREEN
	ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	while(!Obj_IsDeleted(boss)){
		spin ++;
		ObjRender_SetAngleXYZ(obj,0,0,spin*5);
		ObjRender_SetPosition(obj,ObjMove_GetX(boss),ObjMove_GetY(boss),0);
		if(type==true){
			ObjRender_SetScaleXYZ(obj,size+0.2*sin(spin),size+0.2*sin(spin),0);
		}	
		ObjMove_SetPosition(obj,ObjMove_GetX(boss),ObjMove_GetY(boss));
		yield;
	}
	Obj_Delete(obj);
}
