#pragma once
#include "CS_MyCharAi.h"
#include "CS_Ai_AtkZone.h"
#define CS_JACKAI_CREATENAME L"CS_jack_ai"
class CS_Jack;
//战斗的boss对象
class CS_Boss_ControlCore;
//杰克AI
class CS_JackAi :
    public CS_MyCharAi
{
public:
    CS_JackAi();
    void Init(std::weak_ptr<Entity> self) override;
    void Step() override;
    void SetState(std::wstring stateName, int lr) override;
    void Destroy() override;
    bool AttackAround() override;//攻击周围的敌人
    void FaceAtWind();//面向水流方向
    //攻击区域
    std::weak_ptr<CS_Ai_AtkZone> atkZone;
    std::vector<std::weak_ptr<Entity>> enemyList;
    int atk_interval_counter = 0;
    int atk_interval_counter_max = 60;
    int stateID = 0;
    int charge_counter = 0;
    std::weak_ptr<CS_Boss_ControlCore> controlCore;
    void FightControlCore();
    void FightPuuTala();
    bool StaticAttack(std::weak_ptr<Entity> e);
    bool MovingAttack(std::weak_ptr<Entity> e);
    bool FilterEnemy();
    std::weak_ptr<Entity> GetClosestEnemy(float* outDis = nullptr);
    std::weak_ptr<Entity> GetPlayer();
    bool AttackStep();
    bool enableAttack = true;
    void SkillAttack(std::shared_ptr<CS_Jack>& mychar);
    void CatchSpecialTarget();
    std::list<GameInput> shadowOpList;
};

std::shared_ptr<Entity> CreateCS_JackAi();