#pragma once
#include "Entity.h"
#include "EntityState.h"
#include "EntityStateFlashEffect.h"
#include "EntityStateInvincible.h"
#include "CS_QuoteGravity.h"
#include "CS_CurlyWater.h"
#include "CS_CurlyDrown.h"
#include "CS_CurlyControl.h"
#include "CS_CurlyResist.h"
#include "CS_CurlyJump.h"
#include "CS_CurlyStand.h"
#include "CS_CurlyMove.h"
#include "CS_CurlyAir.h"
#include "CS_CurlyFaceToBack.h"
#include "CS_CurlyHurt.h"
#include "CS_CurlyBooster.h"
#include "CS_QuoteTeleport.h"
#include "CS_CurlyFire.h"
#include "CS_CurlyMachineGun.h"
#include "CS_CurlyNemesis.h"
#include "CS_CurlyEnergyShield.h"
#include "CS_PeAirTankBubble.h"
#define CS_CURLY_CREATENAME L"CS_mychar_curly"
//玩家角色 卡莉
class CS_Curly :
    public MyCharEntity
{
public:
    CS_Curly();
	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 Destroy() override;
	void GetIcon(std::wstring& png, std::wstring& sprite_index, int& image_index, std::set<int>& hideLayerList) override;
	void CrushDeath();
	//图层显示
	bool showGun = false;//显示枪
	float animation_moveSpeed = 0x200 / ts;
	bool animation_delay = false;//走路动画延迟一帧（对齐到整格）
	bool fishState = false;//变成鱼的形态
	int fishState_counter = 0;
	float floatSrcX = 0;//悬浮位置
	float floatSrcY = 0;
	bool bSetTarget = false;
	std::weak_ptr<Entity> animation_target;
	bool bSetLanding = false;
	//状态模块
	EntityStateFlashEffect stateFlash;
	EntityStateInvincible stateInvincible;
	CS_QuoteGravity stateGravity;
	CS_CurlyWater stateWater;
	CS_CurlyDrown stateDrown;
	CS_CurlyControl stateControl;
	CS_CurlyResist stateResist;
	CS_CurlyJump stateJump;
	CS_CurlyStand stateStand;
	CS_CurlyMove stateMove;
	CS_CurlyAir stateAir;
	CS_CurlyFaceToBack stateFaceToBack;
	CS_CurlyHurt stateHurt;
	CS_CurlyBooster stateBooster;
	CS_QuoteTeleport stateTeleport;
	//技能模块
	EntitySkillState* lastGun = nullptr;
	CS_CurlyFire skillFire;
	CS_CurlyMachineGun skillMachineGun;
	CS_CurlyNemesis skillNemesis;
	CS_CurlyEnergyShield skillEnergyShield;
	//其他变量
	std::wstring crushEvent;
	//氧气瓶效果
	std::weak_ptr<CS_PeAirTankBubble> airTankBubble;
private:
	void GunAnimate();//动画
};

std::shared_ptr<Entity> CreateCS_Curly();