37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
// Copyright Echo Devgroup
|
|
|
|
|
|
#include "AbilitySystem/MMC/MMC_MaxMana.h"
|
|
|
|
#include "AbilitySystem/AuraAttributeSet.h"
|
|
#include "Interact/CombatInterface.h"
|
|
|
|
UMMC_MaxMana::UMMC_MaxMana()
|
|
{
|
|
IntDef.AttributeToCapture = UAuraAttributeSet::GetIntelligenceAttribute();
|
|
IntDef.AttributeSource = EGameplayEffectAttributeCaptureSource::Target;
|
|
IntDef.bSnapshot = false;
|
|
|
|
RelevantAttributesToCapture.Add(IntDef);
|
|
}
|
|
|
|
float UMMC_MaxMana::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 Int = 0.f;
|
|
GetCapturedAttributeMagnitude(IntDef, Spec, EvaluateParams, Int);
|
|
Int = FMath::Max<float>(Int, 0.0f);
|
|
|
|
ICombatInterface* CombatInterface = Cast<ICombatInterface>(Spec.GetContext().GetSourceObject());
|
|
const int32 PlayerLevel = CombatInterface->GetPlayerLevel();
|
|
|
|
|
|
return 50.f + 2.5f * Int + 5.f * PlayerLevel;
|
|
}
|