Save and save often
This commit is contained in:
37
Source/Aura/Private/AbilitySystem/MMC/MMC_MaxHealth.cpp
Normal file
37
Source/Aura/Private/AbilitySystem/MMC/MMC_MaxHealth.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright Echo Devgroup
|
||||
|
||||
|
||||
#include "AbilitySystem/MMC/MMC_MaxHealth.h"
|
||||
|
||||
#include "AbilitySystem/AuraAttributeSet.h"
|
||||
#include "Interact/CombatInterface.h"
|
||||
|
||||
UMMC_MaxHealth::UMMC_MaxHealth()
|
||||
{
|
||||
VigorDef.AttributeToCapture = UAuraAttributeSet::GetVigorAttribute();
|
||||
VigorDef.AttributeSource = EGameplayEffectAttributeCaptureSource::Target;
|
||||
VigorDef.bSnapshot = false;
|
||||
|
||||
RelevantAttributesToCapture.Add(VigorDef);
|
||||
}
|
||||
|
||||
float UMMC_MaxHealth::CalculateBaseMagnitude_Implementation(const FGameplayEffectSpec& Spec) const
|
||||
{
|
||||
|
||||
const FGameplayTagContainer* SourceTags = Spec.CapturedSourceTags.GetAggregatedTags();
|
||||
const FGameplayTagContainer* TargetTags = Spec.CapturedTargetTags.GetAggregatedTags();
|
||||
|
||||
FAggregatorEvaluateParameters EvaluateParams;
|
||||
EvaluateParams.SourceTags = SourceTags;
|
||||
EvaluateParams.TargetTags = TargetTags;
|
||||
|
||||
float Vigor = 0.f;
|
||||
GetCapturedAttributeMagnitude(VigorDef, Spec, EvaluateParams, Vigor);
|
||||
Vigor = FMath::Max<float>(Vigor, 0.0f);
|
||||
|
||||
ICombatInterface* CombatInterface = Cast<ICombatInterface>(Spec.GetContext().GetSourceObject());
|
||||
const int32 PlayerLevel = CombatInterface->GetPlayerLevel();
|
||||
|
||||
|
||||
return 80.f + 2.5f * Vigor + 10.f * PlayerLevel;
|
||||
}
|
||||
Reference in New Issue
Block a user