Save and save often
This commit is contained in:
36
Source/Aura/Private/AbilitySystem/MMC/MMC_MaxMana.cpp
Normal file
36
Source/Aura/Private/AbilitySystem/MMC/MMC_MaxMana.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user