// Project Lab - NHTV Igad

#pragma once

#include "Creatures/BossBase.h"
#include "TouhouBoss.generated.h"

/**
 * 
 */
UCLASS()
class UNREALPROJECT_API ATouhouBoss : public ABossBase
{
	GENERATED_BODY()
	
public:
	ATouhouBoss();
	virtual void BeginPlay() override;
	virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
	virtual void Tick(float deltaTime) override;
	void WalkPhase(float deltaTime);
	virtual void m_SpawnModifiers() override;

	//UFUNCTION(NetMulticast, Reliable)
	//void PlayEngageSound();

	//UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Audio Component")
	//UAudioComponent* AudioComp;

	DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnBossKilled, int32, team);
	UPROPERTY(BlueprintAssignable, Category = "Game")
	FOnBossKilled onBossKilled;

	UPROPERTY(EditDefaultsOnly, Category = "Shoot Phase")
	class UAbilityInfo* ability;
	UPROPERTY(EditDefaultsOnly, Category = "Shoot Phase")
	class UAbilityInfo* abilityChannel;
	UPROPERTY(EditDefaultsOnly, Category = "Shoot Phase")
	float rotationSpeed;
	UPROPERTY(EditDefaultsOnly, Category = "Shoot Phase")
	float cooldown;
	UPROPERTY(EditAnywhere, Category = "Modifiers")
	float outOfCombatRegen;
	UPROPERTY(EditAnywhere, Category = "State Transition", meta = (ClampMin = "0.0", ClampMax = "1.0", UIMin = "0.0", UIMax = "1.0"))
	float secondPhasePercentage;

	UFUNCTION(BlueprintNativeEvent)
		void SetShield(bool on);
private:
	virtual void m_Engaged();
	virtual void m_Disengaged();
	float m_walkTimer;
	bool m_engaged;

	UPROPERTY()
	class AModifier* m_regenModifier;

	UPROPERTY()
	class AModifier* m_invincibilityModifier;
};
