// Project Lab - NHTV Igad

#pragma once

#include "Creatures/NetworkCharacter.h"
#include "IllusionCharacter.generated.h"

/**
 * 
 */
UCLASS()
class UNREALPROJECT_API AIllusionCharacter : public ANetworkCharacter
{
	GENERATED_BODY()
public:
	AIllusionCharacter();
	virtual void BeginPlay() override;
	virtual void Tick(float deltaTime)override;
	virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
	void MoveTo(FVector Location);
	void Attack();
	UFUNCTION(BluePrintCallable, Category = "Illusion Properties")
	void Kill();
	class ANetworkCharacter* target;
	class ANetworkCharacter* GetClosestTarget();
	// float percentage is a range between 0 and 100 where 100 is always attacking and 0 never attacking
	bool IsAttacking(float changePercentage);
	UPROPERTY(EditAnywhere, BlueprintReadWrite,Category = "Illusion Properties", meta = (ExposeOnSpawn))
	class ANetworkPlayer* illOwner;
	UPROPERTY(editAnywhere, Category = "Illusion Properties")
	float aggroRange;

	UPROPERTY(editAnywhere, BlueprintReadWrite,Category = "Illusion Properties", meta = (ExposeOnSpawn))
		float lifeTime;
	UPROPERTY(editAnywhere, BlueprintReadWrite, Category = "Illusion Properties", meta = (ExposeOnSpawn))
	class UAbilityInfo* abilityInfo;
	UPROPERTY(editAnywhere, Category = "Illusion Properties")
	float acceptenceDistance;
	UPROPERTY(editAnywhere, BlueprintReadWrite, Category = "Illusion Properties", meta = (ExposeOnSpawn))
	TArray<class ANetworkCharacter*> targetList;
	bool attacking;

private:
	bool m_isdying;

};
