#pragma once
#include "Entity.h"
#include "EntityStateGravity.h"
#include "EntityStateSplash.h"
#define CS_FALLINGSPIKE_CREATENAME L"CS_fallingspike"
class CS_FallingSpike :
    public Entity
{
public:
    CS_FallingSpike();
    void Init(std::weak_ptr<Entity> self) override;
    void Step() override;
    void SetState(int stateID, int lr) override;
    void Attack(std::weak_ptr<Entity> dst, int* outDamage, float* outAngle, bool* outTakedown, int* outElemType, float* outShockForce, float* outHeavy) override;
    std::weak_ptr<Entity> BeginCaught(std::weak_ptr<Entity> e) override;//开始被某单位抓取（切换到被抓取状态）
    void EndCaught(std::weak_ptr<Entity> e) override;//被某单位抓取结束(退出被抓取状态）
    bool Hurt(std::weak_ptr<Entity> src, int getDamage, float angle, bool bTakedown, int elemType, float shockForce, float heavy, int* outRealDamage) override;
    bool bLanding = false;
    EntityStateGravity stateGravity;
    EntityStateSplash stateSplash;
    bool fix = true;
    float srcY = 0;
};

std::shared_ptr<Entity> CreateCS_FallingSpike();