#include "CS_Enemy_RollRockBase.h"
#include "CS_Enemy_RollRock.h"
CS_Enemy_RollRockBase::CS_Enemy_RollRockBase()
{
	type = 0;
	action_timecounter_max = 60;
	action_timecounter = rand() % action_timecounter_max;
}

void CS_Enemy_RollRockBase::Step()
{
	if (action_timecounter > 0)
	{
		action_timecounter--;
		if (action_timecounter == 0)
		{
			action_timecounter = Random(200, action_timecounter_max);
			//²úÉúÐéÄâÂäÊ¯
			auto we = std::make_shared<CS_Enemy_RollRock>();
			we->el.eventName = el.eventName;
			we->el.flag = el.flag;
			we->last_x = we->x = x;
			we->last_y = we->y = y;
			gameFunc->SetEntity(shared_from_this(), we);
		}
	}
}

void CS_Enemy_RollRockBase::SetState(int stateID, int lr)
{
	action_timecounter_max = 400;
}

std::shared_ptr<Entity> CreateCS_Enemy_RollRockBase()
{
	return std::make_shared<CS_Enemy_RollRockBase>();
}
