task DiaBubble(x, y, line, type, frame, width, ang)
{
	let obj  = ObjPrim_Create(OBJ_SPRITE_2D);
	let obj1 = ObjPrim_Create(OBJ_SPRITE_2D);
	let obj2 = ObjPrim_Create(OBJ_SPRITE_2D);

	let objScene = GetEnemyBossSceneObjectID();

	AutoDelete(objScene, obj);
	AutoDelete(objScene, obj1);
	AutoDelete(objScene, obj2);
	
	ObjPrim_SetTexture(obj, GetCurrentScriptDirectory~"../img/balloon.png");
	ObjSprite2D_SetSourceRect(obj, 1, 672, 96, 849);
	ObjRender_SetScaleXYZ(obj, 0.5, line / 4,0);
	Obj_SetRenderPriorityI(obj, 100);
	ObjSprite2D_SetDestRect(obj, 0, 0, 48, 177);
	ObjRender_SetPosition(obj, x, y, 0);
	ObjRender_SetAngleX(obj, 90);
	ObjRender_SetBlendType(obj,BLEND_ALPHA);

	ObjPrim_SetTexture(obj1, GetCurrentScriptDirectory~"../img/balloon.png");
	ObjSprite2D_SetSourceRect(obj1, 96, 672, 191, 849);
	ObjRender_SetScaleXYZ(obj1, 0.5, line / 4, 0);
	Obj_SetRenderPriorityI(obj1, 100);
	ObjSprite2D_SetDestRect(obj1, 0, 0, 48, 177);
	ObjRender_SetPosition(obj1, x + 22 + width * 64, y, 0);
	ObjRender_SetAngleX(obj1, 90);
	ObjRender_SetBlendType(obj1, BLEND_ALPHA);
		
	ObjPrim_SetTexture(obj2, GetCurrentScriptDirectory~"../img/balloon.png");
	ObjSprite2D_SetSourceRect(obj2, 194, 672, 254, 849);
	ObjRender_SetScaleXYZ(obj2, width, line / 4, 0);
	Obj_SetRenderPriorityI(obj2, 100);
	ObjSprite2D_SetDestRect(obj2, 0, 0, 64, 177);
	ObjRender_SetPosition(obj2, x + 24, y, 0);
	ObjRender_SetAngleX(obj2, 90);
	ObjRender_SetBlendType(obj2, BLEND_ALPHA);

	let dif = -(90 - ang);
	let angleX = 90;
	
	SEPlay("bubble", 80);
	
	loop(10)
	{
		angleX += dif/10;
		ObjRender_SetAngleX(obj,angleX);
		ObjRender_SetAngleX(obj1,angleX);
		ObjRender_SetAngleX(obj2,angleX);
		yield;
	}
	
	if(type == "WAIT"){ loop(frame){ yield; } }
	if(type == "CONTROL_ALL"){ while(GetVirtualKeyState(VK_SHOT) != KEY_PUSH && GetVirtualKeyState(VK_CANCEL) != KEY_PUSH){ yield; } }
	if(type == "CONTROL"){ while(GetVirtualKeyState(VK_SHOT) != KEY_PUSH){ yield; } }

	loop(10)
	{
		angleX += dif/10;
		ObjRender_SetAngleX(obj, angleX);
		ObjRender_SetAngleX(obj1, angleX);
		ObjRender_SetAngleX(obj2, angleX);
		yield;
	}
	Obj_Delete(obj);
	Obj_Delete(obj1);
	Obj_Delete(obj2);
}

task DiaText(x, y, text, type, frame, size)
{
	let objText = ObjText_Create;
	InstallFont(GetCurrentScriptDirectory ~ "./Cirno.ttf");
	ObjRender_SetAlpha(objText, 0);
	ObjRender_SetPosition(objText, x, y, 0);
	
	ObjText_SetText(objText, text);
	ObjText_SetFontSize(objText, size);
	ObjText_SetFontType(objText,"Cirno");
	ObjText_SetFontColorTop(objText, 10, 10, 10);
	ObjText_SetFontColorBottom(objText, 10, 10, 10);
	ObjText_SetFontBorderType(objText, BORDER_NONE);
	ObjText_SetHorizontalAlignment(objText, ALIGNMENT_LEFT);
	ObjText_SetMaxWidth(objText, 400);
	ObjText_SetFontBold(objText, true);
	Obj_SetRenderPriority(objText, 150);
	
	loop(5){ yield; }
	let alpha = 0;
	loop(5)
	{
		alpha+=255/5;
		ObjRender_SetAlpha(objText,alpha);
		yield;
	}
	
	if(type == "WAIT"){ loop(frame){ yield; } }
	if(type == "CONTROL_ALL"){ while(GetVirtualKeyState(VK_SHOT) != KEY_PUSH && GetVirtualKeyState(VK_SPELL) != KEY_PUSH){ yield; } }
	if(type == "CONTROL"){ while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){ yield; } }
	
	loop(5)
	{
		alpha-=255/5;
		ObjRender_SetAlpha(objText,alpha);
		yield;
	}
	
	Obj_Delete(objText);

}