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

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

	we->ani.sprite_index = we->lr == 0 ? L"mc_jack_hurt_l" : L"mc_jack_hurt_r";
}

void CS_JackHurt::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;
}
