mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-02 04:38:15 +00:00
Make the damage window more generic
The goal was to handle gameplay event other than damage, such as heals. Renamed it to metric.
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "CogInterfaceDamageActor.generated.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
UENUM(BlueprintType)
|
||||
enum class ECogInterfaceDamageEventType : uint8
|
||||
{
|
||||
DamageDealt,
|
||||
DamageReceived,
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
USTRUCT()
|
||||
struct FCogInterfaceDamageParams
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
ECogInterfaceDamageEventType Type;
|
||||
TObjectPtr<AActor> DamageDealer;
|
||||
TObjectPtr<AActor> DamageReceiver;
|
||||
float MitigatedDamage = 0;
|
||||
float IncomingDamage = 0;
|
||||
bool IsCritical = false;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
DECLARE_MULTICAST_DELEGATE_OneParam(FCogInterfaceOnDamageEvent, const FCogInterfaceDamageParams&);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
UINTERFACE(MinimalAPI, Blueprintable)
|
||||
class UCogInterfaceDamageActor : public UInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
class ICogInterfaceDamageActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
virtual FCogInterfaceOnDamageEvent& OnDamageEvent() = 0;
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "CogInterfaceMetricActor.generated.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
USTRUCT()
|
||||
struct FCogInterfaceMetricEventParams
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
FName Name;
|
||||
|
||||
float MitigatedValue = 0;
|
||||
|
||||
float UnmitigatedValue = 0;
|
||||
|
||||
bool IsCritical = false;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
DECLARE_MULTICAST_DELEGATE_OneParam(FCogInterfaceOnMetricEvent, const FCogInterfaceMetricEventParams&);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
UINTERFACE(MinimalAPI, Blueprintable)
|
||||
class UCogInterfaceMetricActor : public UInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
class ICogInterfaceMetricActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
virtual FCogInterfaceOnMetricEvent& OnMetricEvent() = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user