#include "CS_BubbleWallUnbreakable.h"
#include "CS_PeSmoke.h"

CS_BubbleWallUnbreakable::CS_BubbleWallUnbreakable()
{
	//启用碰撞
	cbRect.enableCbRect = true;
	cbRect.enableSoild = true;
	cbRect.enableMovePlatform = true;
	//设置动画
	ani.png = L"CS_CaveStoryMod";
	ani.sprite_index = L"ls_bubblewall_unbreakable";
}

void CS_BubbleWallUnbreakable::SetState(std::wstring stateName, int lr)
{
	if (stateName == L"break")
	{
		gameFunc->PlaySound(L"CS_021_bubble");
		//创建云团
		SetCS_PeSmokeWater(shared_from_this(), x, y, 2);
		Destroy();
	}
}

bool CS_BubbleWallUnbreakable::Hurt(std::weak_ptr<Entity> src, int getDamage, float angle, bool bTakedown, int elemType, float shockForce, float heavy, int* outRealDamage)
{
	*outRealDamage = 0;
	return true;
}

std::shared_ptr<Entity> CreateCS_BubbleWallUnbreakable()
{
	return std::make_shared<CS_BubbleWallUnbreakable>();
}
