Refactor and remove gameplay ability system, replace with own one
This commit is contained in:
@@ -236,6 +236,24 @@ bool UStatForgeComponent::RemoveGameplayStatEffect(FGuid EffectId)
|
||||
return false;
|
||||
}
|
||||
|
||||
void UStatForgeComponent::RemoveAllGameplayStatEffects()
|
||||
{
|
||||
ActiveEffectsArray.Empty();
|
||||
}
|
||||
|
||||
void UStatForgeComponent::ModifyGeDuration(FGuid EffectId, float NewRemainingDuration, float NewNextTickDuration)
|
||||
{
|
||||
for (int32 i = ActiveEffectsArray.Num() - 1; i >= 0; --i)
|
||||
{
|
||||
if (ActiveEffectsArray[i].Handle == EffectId)
|
||||
{
|
||||
ActiveEffectsArray[i].RemainingDuration = NewRemainingDuration;
|
||||
ActiveEffectsArray[i].NextTickDuration = NewNextTickDuration;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool UStatForgeComponent::HasStat(const FName& StatName) const
|
||||
{
|
||||
for (const FStatRuntimeDef& Stat : StatArray)
|
||||
|
||||
@@ -123,6 +123,12 @@ protected:
|
||||
bool CanApplyEffect(const UGameplayStatEffect* StatEffect) const;
|
||||
bool CanTickEffect(const UGameplayStatEffect* StatEffect) const;
|
||||
|
||||
// CAUTION, only to be used inside AEleriGameState to load game
|
||||
void RemoveAllGameplayStatEffects();
|
||||
void ModifyGeDuration(FGuid EffectId, float NewRemainingDuration, float NewNextTickDuration);
|
||||
const TArray<FStatRuntimeDef>& GetStatArray() { return StatArray; }
|
||||
const TArray<FActiveGameplayStatEffect>& GetActiveEffectsArray() { return ActiveEffectsArray; }
|
||||
|
||||
UPROPERTY()
|
||||
TArray<FStatRuntimeDef> StatArray;
|
||||
|
||||
@@ -136,4 +142,7 @@ protected:
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Stat Forge|Tags")
|
||||
FGameplayTagContainer CharacterGameplayTags;
|
||||
|
||||
friend class AEleriGameState;
|
||||
friend struct FSaveData;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user