#include "CS_KanpaDrown.h"
#include "CS_Kanpa.h"
const int CS_KanpaSTATENAME_DROWN = ++entityStateID;
CS_KanpaDrown::CS_KanpaDrown()
{
	stateID = CS_KanpaSTATENAME_DROWN;
}

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

	auto mychar = std::static_pointer_cast<CS_Kanpa>(we);
	we->ani.sprite_index = we->lr == 0 ? L"mc_kanpa_hurt_l" : L"mc_kanpa_hurt_r";
}

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

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