#include "CS_SantaHurt.h"
const int CS_SantaSTATENAME_HURT = GetNextEntityStateID();
CS_SantaHurt::CS_SantaHurt()
{
	stateID = CS_SantaSTATENAME_HURT;
}

void CS_SantaHurt::State()
{
	auto we = e.lock();
	if (!we)
		return;

	we->ani.sprite_index = we->lr == 0 ? L"mc_santa_hurt_l" : L"mc_santa_hurt_r";
}

void CS_SantaHurt::ChangeStateMsg(int stateID)
{
	if (stateID == GetStateID())
	{
		auto we = e.lock();
		if (!we)
			return;

		auto mychar = std::static_pointer_cast<MyCharEntity>(we);
		enable = true;
		mychar->action_timecounter = 30;
	}
	else
		enable = false;
}
