#pragma once
#include "Entity.h"
#include "EntityState.h"
#include "EntityStateFlashEffect.h"
#include "EntityStateInvincible.h"
#include "EntityStateGravity.h"
#include "CS_QuoteGravity.h"
#include "CS_KanpaWater.h"
#include "CS_KanpaDrown.h"
#include "CS_KanpaControl.h"
#include "CS_KanpaResist.h"
#include "CS_KanpaJump.h"
#include "CS_KanpaStand.h"
#include "CS_KanpaMove.h"
#include "CS_KanpaAir.h"
#include "CS_KanpaFaceToBack.h"
#include "CS_KanpaHurt.h"
#include "CS_KanpaStepOn.h"
#include "CS_KanpaFishing.h"
#include "CS_KanpaGrapplingHook.h"
//动画
#include "CS_KanpaAniHook.h"
#define CS_KANPA_CREATENAME L"CS_mychar_kanpa"
//玩家角色 间八
class CS_Kanpa :
    public MyCharEntity
{
public:
    CS_Kanpa();
    void Init(std::weak_ptr<Entity> self) override;
    void Step() override;
    void SetState(int stateID, int lr) override;
    void SetState(std::wstring stateName, int lr) override;
    void LoadSaveData() override;//加载保存数据
    void WriteSaveData() override;//写入保存数据
    bool Hurt(std::weak_ptr<Entity> src, int getDamage, float angle, bool bTakedown, int elemType, float shockForce, float heavy, int* outRealDamage) override;
    void Gain(std::weak_ptr<Entity> item) override;
    void GetCameraPos(float* outX, float* outY) override;
    void GetIcon(std::wstring& png, std::wstring& sprite_index, int& image_index, std::set<int>& hideLayerList) override;
    void CrushDeath();
    //图层显示
    bool showFishingRod = 0;//是否显示钓竿
    float animation_moveSpeed = 0x200 / ts;
    bool animation_delay = false;//走路动画延迟一帧（对齐到整格）
    //状态模块
    EntityStateFlashEffect stateFlash;
    EntityStateInvincible stateInvincible;
    CS_QuoteGravity stateGravity;
    CS_KanpaWater stateWater;
    CS_KanpaDrown stateDrown;
    CS_KanpaControl stateControl;
    CS_KanpaResist stateResist;
    CS_KanpaJump stateJump;
    CS_KanpaStand stateStand;
    CS_KanpaMove stateMove;
    CS_KanpaAir stateAir;
    CS_KanpaFaceToBack stateFaceToBack;
    CS_KanpaHurt stateHurt;
    //技能模块
    CS_KanpaStepOn skillStepOn;
    CS_KanpaFishing skillFishing;
    CS_KanpaGrapplingHook skillGrapplingHook;
    //动画
    std::weak_ptr<CS_KanpaAniHook> aniHook;
    bool hook_ani_set_target = false;
    //移动模式
    int moveMode = 0;
    int face = 0;//表情
    bool showSweat = false;
    int showSweat_counter = 0;
    int showSweat_counter_max = 24;
    std::wstring crushEvent;
private:
    void AnimateStep();//动画
};

std::shared_ptr<Entity> CreateCS_Kanpa();