#pragma once
#include "Entity.h"
#define CS_AMELECTRICCIRCLE_CREATENAME L"CS_am_electriccircle"
//µç»·
class CS_AmElectricCircle :
    public ActionEntity
{
public:
    CS_AmElectricCircle();
    void Init(std::weak_ptr<Entity> self) override;
    void Step() override;
    void Destroy() override;
    bool Hurt(std::weak_ptr<Entity> src, int getDamage, float angle, bool bTakedown, int elemType, float shockForce, float heavy, int* outRealDamage) override;
    void Attack(std::weak_ptr<Entity> dst, int* outDamage, float* outAngle, bool* outTakedown, int* outElemType, float* outShockForce, float* outHeavy) override;
    float r = 32;
    int existTime = 600;
    struct Point
    {
        float x, y;
        Point(float x = 0, float y = 0) : x(x), y(y) {}
    };
    std::vector<CS_AmElectricCircle::Point> polyline;
    void GenerateWavyCircle(float centerX, float centerY, float radius, int segments,float waveAmplitude, int waveFrequency, float noiseAmplitude = 0.0f);
    void DrawPolyline();
    bool bLeave = false;
    BYTE alpha = 0xff;
    std::weak_ptr<Entity> core;
    bool bHurtBlock = true;
};

std::shared_ptr<Entity> CreateCS_AmElectricCircle();