50 lines
1.5 KiB
C++
50 lines
1.5 KiB
C++
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "AbilitySystemComponent.h"
|
|
#include "OLSAttributeSetBase.h"
|
|
#include "OLSCombatAttributeSet.generated.h"
|
|
|
|
/**
|
|
* UOLSCombatAttributeSet
|
|
*
|
|
* Class that defines attributes that are necessary for applying damage or healing.
|
|
* Attribute examples include: damage, healing, attack power, and shield penetrations.
|
|
*/
|
|
UCLASS(BlueprintType)
|
|
class OLS_API UOLSCombatAttributeSet : public UOLSAttributeSetBase
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
|
|
UOLSCombatAttributeSet();
|
|
|
|
//~ Begin UObject interface.
|
|
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
|
|
//~ End UObject interface.
|
|
|
|
ATTRIBUTE_ACCESSORS(ThisClass, BaseDamage);
|
|
ATTRIBUTE_ACCESSORS(ThisClass, BaseHeal);
|
|
|
|
protected:
|
|
|
|
UFUNCTION()
|
|
void OnRep_BaseDamage(const FGameplayAttributeData& oldValue);
|
|
|
|
UFUNCTION()
|
|
void OnRep_BaseHeal(const FGameplayAttributeData& oldValue);
|
|
|
|
private:
|
|
|
|
// The base amount of damage to apply in the damage execution.
|
|
UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_BaseDamage, Category = "OLS|Combat", Meta = (AllowPrivateAccess = true))
|
|
FGameplayAttributeData BaseDamage;
|
|
|
|
// The base amount of healing to apply in the heal execution.
|
|
UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_BaseHeal, Category = "OLS|Combat", Meta = (AllowPrivateAccess = true))
|
|
FGameplayAttributeData BaseHeal;
|
|
};
|