diff --git a/Project/Config/DefaultGameplayTags.ini b/Project/Config/DefaultGameplayTags.ini new file mode 100644 index 0000000..87ede76 --- /dev/null +++ b/Project/Config/DefaultGameplayTags.ini @@ -0,0 +1,16 @@ +[/Script/GameplayTags.GameplayTagsSettings] +ImportTagsFromConfig=True +WarnOnInvalidTags=True +ClearInvalidTags=False +AllowEditorTagUnloading=True +AllowGameTagUnloading=False +FastReplication=False +InvalidTagCharacters="\"\'," ++GameplayTagTableList=/Game/Core/DT_PrimaryAttributes.DT_PrimaryAttributes +NumBitsForContainerSize=6 +NetIndexFirstBitSegment=16 ++GameplayTagList=(Tag="Attributes.Vital.Health",DevComment="") ++GameplayTagList=(Tag="Attributes.Vital.Mana",DevComment="") ++GameplayTagList=(Tag="Attributes.Vital.MaxHealth",DevComment="") ++GameplayTagList=(Tag="Attributes.Vital.MaxMana",DevComment="") + diff --git a/Project/Content/Core/AbilitySystem/GE_CrystalHeal.uasset b/Project/Content/Core/AbilitySystem/GE_CrystalHeal.uasset index ce54ec8..8166681 100644 --- a/Project/Content/Core/AbilitySystem/GE_CrystalHeal.uasset +++ b/Project/Content/Core/AbilitySystem/GE_CrystalHeal.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5e8a67584ec74875fe4aabb0ce488ca4f5218171c77dce9fdc2026c2214c4bc6 -size 13691 +oid sha256:545297b5ea118f000b0d840e4d082a946d9c986fcdf37289cad44071057adb4f +size 14597 diff --git a/Project/Content/Core/AbilitySystem/GE_PotionHealth.uasset b/Project/Content/Core/AbilitySystem/GE_PotionHealth.uasset index 23957af..84cfa24 100644 --- a/Project/Content/Core/AbilitySystem/GE_PotionHealth.uasset +++ b/Project/Content/Core/AbilitySystem/GE_PotionHealth.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:60a1ac3e5f5943b44e737267c9f1e707016991b659f759349d9ad41c9d4842d1 -size 13257 +oid sha256:a088b1e8b1f64550e6feb2589f2a418d4536bcea52a806ecb2dc58bc70f95acf +size 13422 diff --git a/Project/Content/Core/AbilitySystem/GE_PotionMana.uasset b/Project/Content/Core/AbilitySystem/GE_PotionMana.uasset index 8ba9dac..6c1e8e1 100644 --- a/Project/Content/Core/AbilitySystem/GE_PotionMana.uasset +++ b/Project/Content/Core/AbilitySystem/GE_PotionMana.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79661559d5ac68ebc6656d3b32d2615013e495666ce4cac485fffc1bb5601af0 -size 13225 +oid sha256:669466a6f78ce2841ac5abb2ed7b32fa01a8095934dc26a42ea9344af92502df +size 13387 diff --git a/Project/Content/Core/BP_AreaFire.uasset b/Project/Content/Core/BP_AreaFire.uasset deleted file mode 100644 index 85e7a0a..0000000 --- a/Project/Content/Core/BP_AreaFire.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c5b0a685d35e41d29090007064d1f0b4db91ca4dbd4db8d8511d8e86fd68e591 -size 2500 diff --git a/Project/Content/Core/CT_Potion.uasset b/Project/Content/Core/CT_Potion.uasset new file mode 100644 index 0000000..5beb555 --- /dev/null +++ b/Project/Content/Core/CT_Potion.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af048bad73910bf6913ed75293f37a12381f1f46b33258b09aad47c1e60d27b7 +size 2603 diff --git a/Project/Content/Core/DT_PrimaryAttributes.uasset b/Project/Content/Core/DT_PrimaryAttributes.uasset new file mode 100644 index 0000000..c72133b --- /dev/null +++ b/Project/Content/Core/DT_PrimaryAttributes.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18de865771242d2ad5aaa2d109411e14e284da5b640a1d768094faee4de8efe3 +size 2763 diff --git a/Project/Content/Core/Pickups/BP_HealthCrystal.uasset b/Project/Content/Core/Pickups/BP_HealthCrystal.uasset deleted file mode 100644 index 7bd6980..0000000 --- a/Project/Content/Core/Pickups/BP_HealthCrystal.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba96c7d2f601107b37b74822be061af49c588ac10bd6aff61a9dd6355ebc4189 -size 2671 diff --git a/Project/Content/Core/Pickups/BP_HealthPotion.uasset b/Project/Content/Core/Pickups/BP_HealthPotion.uasset deleted file mode 100644 index e152eb9..0000000 --- a/Project/Content/Core/Pickups/BP_HealthPotion.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:56b2157b8d94fb10e4e532c6ecab21abdac7e8720890813e0ce3cf2b62152f82 -size 2576 diff --git a/Project/Content/Core/Pickups/BP_ManaCrystal.uasset b/Project/Content/Core/Pickups/BP_ManaCrystal.uasset deleted file mode 100644 index 4080188..0000000 --- a/Project/Content/Core/Pickups/BP_ManaCrystal.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:755888561fc170e2bbcf5161a12498b020fe7939f885eeb662890a6f36662150 -size 2625 diff --git a/Project/Content/Levels/StartupMap.umap b/Project/Content/Levels/StartupMap.umap index d2df6e9..1e614c0 100644 --- a/Project/Content/Levels/StartupMap.umap +++ b/Project/Content/Levels/StartupMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:37a01442fd9e5f68c902b9c58b308950f37770859615972c6706f3812273dfc1 -size 85861 +oid sha256:1927b2204173c081a7e365c7b4a4ae88cf653435a8de5e73bc7664659b01c280 +size 97017 diff --git a/Project/Saved/AssetData/DataTableEditorLayout/DT_PrimaryAttributes.json b/Project/Saved/AssetData/DataTableEditorLayout/DT_PrimaryAttributes.json new file mode 100644 index 0000000..7548880 --- /dev/null +++ b/Project/Saved/AssetData/DataTableEditorLayout/DT_PrimaryAttributes.json @@ -0,0 +1,7 @@ +{ + "ColumnWidths": + { + "DevComment": 405, + "Tag": 381 + } +} \ No newline at end of file diff --git a/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.cpp b/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.cpp index b14ebfe..953d474 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.cpp +++ b/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.cpp @@ -9,79 +9,74 @@ UGasaAttributeSet::UGasaAttributeSet() { - InitHealth(100.f); - InitMaxHealth(100.f); - InitMana(50.f); - InitMaxMana(50.f); + InitHealth( 100.f ); + InitMaxHealth( 100.f ); + InitMana( 50.f ); + InitMaxMana( 50.f ); } #pragma region Rep Notifies -void UGasaAttributeSet::Client_OnRep_Health(FGameplayAttributeData& PrevHealth) +void UGasaAttributeSet::Client_OnRep_Health( FGameplayAttributeData& PrevHealth ) { // From GAMEPLAYATTRIBUTE_REPNOTIFY - static FProperty* UGasaAttributeSetProperty = FindFieldChecked(StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, Health)); - GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(FGameplayAttribute(UGasaAttributeSetProperty), Health, PrevHealth); + static FProperty* UGasaAttributeSetProperty = FindFieldChecked( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Health ) ); + GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), Health, PrevHealth ); } - -void UGasaAttributeSet::Client_OnRep_MaxHealth(FGameplayAttributeData& PrevMaxHealth) +void UGasaAttributeSet::Client_OnRep_MaxHealth( FGameplayAttributeData& PrevMaxHealth ) { // From GAMEPLAYATTRIBUTE_REPNOTIFY - static FProperty* UGasaAttributeSetProperty = FindFieldChecked(StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, MaxHealth)); - GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(FGameplayAttribute(UGasaAttributeSetProperty), MaxHealth, - PrevMaxHealth); + static FProperty* UGasaAttributeSetProperty = FindFieldChecked( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, MaxHealth ) ); + GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), MaxHealth, PrevMaxHealth ); } - -void UGasaAttributeSet::Client_OnRep_Mana(FGameplayAttributeData& PrevMana) +void UGasaAttributeSet::Client_OnRep_Mana( FGameplayAttributeData& PrevMana ) { // From GAMEPLAYATTRIBUTE_REPNOTIFY - static FProperty* UGasaAttributeSetProperty = FindFieldChecked(StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, Mana)); - GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(FGameplayAttribute(UGasaAttributeSetProperty), Mana, PrevMana); + static FProperty* UGasaAttributeSetProperty = FindFieldChecked( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Mana ) ); + GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), Mana, PrevMana ); } - -void UGasaAttributeSet::Client_OnRep_MaxMana(FGameplayAttributeData& PrevMaxMana) +void UGasaAttributeSet::Client_OnRep_MaxMana( FGameplayAttributeData& PrevMaxMana ) { // From GAMEPLAYATTRIBUTE_REPNOTIFY - static FProperty* UGasaAttributeSetProperty = FindFieldChecked(StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, MaxMana)); - GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(FGameplayAttribute(UGasaAttributeSetProperty), MaxMana, - PrevMaxMana); + static FProperty* UGasaAttributeSetProperty = FindFieldChecked( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, MaxMana ) ); + GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), MaxMana, PrevMaxMana ); } #pragma endregion Rep Notifies -void UGasaAttributeSet::PostGameplayEffectExecute(FGameplayEffectModCallbackData const& Data) +void UGasaAttributeSet::PostGameplayEffectExecute( FGameplayEffectModCallbackData const& Data ) { - Super::PostGameplayEffectExecute(Data); + Super::PostGameplayEffectExecute( Data ); FEffectProperties Props; - Props.Populate(Data); + Props.Populate( Data ); } -void UGasaAttributeSet::PreAttributeChange(FGameplayAttribute const& Attribute, float& NewValue) +void UGasaAttributeSet::PreAttributeChange( FGameplayAttribute const& Attribute, float& NewValue ) { - Super::PreAttributeChange(Attribute, NewValue); + Super::PreAttributeChange( Attribute, NewValue ); - if (Attribute == GetHealthAttribute()) + if ( Attribute == GetHealthAttribute() ) { - NewValue = FMath::Clamp(NewValue, 0, GetMaxHealth()); + NewValue = FMath::Clamp( NewValue, 0, GetMaxHealth() ); } - if (Attribute == GetMaxHealthAttribute()) + if ( Attribute == GetMaxHealthAttribute() ) { - NewValue = FMath::Clamp(NewValue, 0, 99999.000000); + NewValue = FMath::Clamp( NewValue, 0, 99999.000000 ); } - if (Attribute == GetManaAttribute()) + if ( Attribute == GetManaAttribute() ) { - NewValue = FMath::Clamp(NewValue, 0, GetMaxMana()); + NewValue = FMath::Clamp( NewValue, 0, GetMaxMana() ); } - if (Attribute == GetMaxManaAttribute()) + if ( Attribute == GetMaxManaAttribute() ) { - NewValue = FMath::Clamp(NewValue, 0, 99999.000000); + NewValue = FMath::Clamp( NewValue, 0, 99999.000000 ); } } -void UGasaAttributeSet::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const +void UGasaAttributeSet::GetLifetimeReplicatedProps( TArray& OutLifetimeProps ) const { - Super::GetLifetimeReplicatedProps(OutLifetimeProps); + Super::GetLifetimeReplicatedProps( OutLifetimeProps ); - DOREPLIFETIME_DEFAULT_GAS(UGasaAttributeSet, Health); - DOREPLIFETIME_DEFAULT_GAS(UGasaAttributeSet, MaxHealth); - DOREPLIFETIME_DEFAULT_GAS(UGasaAttributeSet, Mana); - DOREPLIFETIME_DEFAULT_GAS(UGasaAttributeSet, MaxMana); + DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Health ); + DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, MaxHealth ); + DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Mana ); + DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, MaxMana ); } diff --git a/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.h b/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.h index 04d6c63..729b6e7 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.h +++ b/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.h @@ -8,50 +8,46 @@ UCLASS() class GASA_API UGasaAttributeSet : public UAttributeSet { GENERATED_BODY() - public: UGasaAttributeSet(); - UPROPERTY(ReplicatedUsing = Client_OnRep_Health, EditAnywhere, BlueprintReadWrite, Category = "Attributes") + UPROPERTY( ReplicatedUsing = Client_OnRep_Health, EditAnywhere, BlueprintReadWrite, Category = "Attributes" ) FGameplayAttributeData Health; - UPROPERTY(ReplicatedUsing = Client_OnRep_MaxHealth, EditAnywhere, BlueprintReadWrite, Category = "Attributes") + UPROPERTY( ReplicatedUsing = Client_OnRep_MaxHealth, EditAnywhere, BlueprintReadWrite, Category = "Attributes" ) FGameplayAttributeData MaxHealth; - UPROPERTY(ReplicatedUsing = Client_OnRep_Mana, EditAnywhere, BlueprintReadWrite, Category = "Attributes") + UPROPERTY( ReplicatedUsing = Client_OnRep_Mana, EditAnywhere, BlueprintReadWrite, Category = "Attributes" ) FGameplayAttributeData Mana; - UPROPERTY(ReplicatedUsing = Client_OnRep_MaxMana, EditAnywhere, BlueprintReadWrite, Category = "Attributes") + UPROPERTY( ReplicatedUsing = Client_OnRep_MaxMana, EditAnywhere, BlueprintReadWrite, Category = "Attributes" ) FGameplayAttributeData MaxMana; UFUNCTION() - void Client_OnRep_Health(FGameplayAttributeData& PrevHealth); + void Client_OnRep_Health( FGameplayAttributeData& PrevHealth ); UFUNCTION() - void Client_OnRep_MaxHealth(FGameplayAttributeData& PrevMaxHealth); + void Client_OnRep_MaxHealth( FGameplayAttributeData& PrevMaxHealth ); UFUNCTION() - void Client_OnRep_Mana(FGameplayAttributeData& PrevMana); + void Client_OnRep_Mana( FGameplayAttributeData& PrevMana ); UFUNCTION() - void Client_OnRep_MaxMana(FGameplayAttributeData& PrevMaxMana); + void Client_OnRep_MaxMana( FGameplayAttributeData& PrevMaxMana ); #pragma region Getters static FGameplayAttribute GetHealthAttribute() { - static FProperty* Prop = FindFieldChecked(UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, Health)); + static FProperty* Prop = FindFieldChecked( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Health ) ); return Prop; } - static FGameplayAttribute GetMaxHealthAttribute() { - static FProperty* Prop = FindFieldChecked(UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, MaxHealth)); + static FProperty* Prop = FindFieldChecked( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, MaxHealth ) ); return Prop; } - static FGameplayAttribute GetManaAttribute() { - static FProperty* Prop = FindFieldChecked(UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, Mana)); + static FProperty* Prop = FindFieldChecked( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Mana ) ); return Prop; } - static FGameplayAttribute GetMaxManaAttribute() { - static FProperty* Prop = FindFieldChecked(UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, MaxMana)); + static FProperty* Prop = FindFieldChecked( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, MaxMana ) ); return Prop; } @@ -59,45 +55,45 @@ public: FORCEINLINE float GetMaxHealth() const { return MaxHealth.GetCurrentValue(); } FORCEINLINE float GetMana() const { return Mana.GetCurrentValue(); } FORCEINLINE float GetMaxMana() const { return MaxMana.GetCurrentValue(); } -#pragma endregion Getters + #pragma endregion Getters #pragma region Setters - FORCEINLINE void SetHealth(float NewVal); - FORCEINLINE void SetMaxHealth(float NewVal); - FORCEINLINE void SetMana(float NewVal); - FORCEINLINE void SetMaxMana(float NewVal); + FORCEINLINE void + SetHealth( float NewVal ); + FORCEINLINE void SetMaxHealth( float NewVal ); + FORCEINLINE void SetMana( float NewVal ); + FORCEINLINE void SetMaxMana( float NewVal ); - FORCEINLINE void InitHealth(float NewVal) + FORCEINLINE void InitHealth( float NewVal ) { - Health.SetBaseValue(NewVal); - Health.SetCurrentValue(NewVal); + Health.SetBaseValue( NewVal ); + Health.SetCurrentValue( NewVal ); } - - FORCEINLINE void InitMaxHealth(float NewVal) + FORCEINLINE void InitMaxHealth( float NewVal ) { - MaxHealth.SetBaseValue(NewVal); - MaxHealth.SetCurrentValue(NewVal); + MaxHealth.SetBaseValue( NewVal ); + MaxHealth.SetCurrentValue( NewVal ); } - - FORCEINLINE void InitMana(float NewVal) + FORCEINLINE void InitMana( float NewVal ) { - Mana.SetBaseValue(NewVal); - Mana.SetCurrentValue(NewVal); + Mana.SetBaseValue( NewVal ); + Mana.SetCurrentValue( NewVal ); } - - FORCEINLINE void InitMaxMana(float NewVal) + FORCEINLINE void InitMaxMana( float NewVal ) { - MaxMana.SetBaseValue(NewVal); - MaxMana.SetCurrentValue(NewVal); + MaxMana.SetBaseValue( NewVal ); + MaxMana.SetCurrentValue( NewVal ); } -#pragma endregion Setters + #pragma endregion Setters #pragma region AttributeSet - void PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) override; - void PostGameplayEffectExecute(FGameplayEffectModCallbackData const& Data) override; -#pragma endregion AttributeSet + void + PreAttributeChange( const FGameplayAttribute& Attribute, float& NewValue ) override; + void PostGameplayEffectExecute( FGameplayEffectModCallbackData const& Data ) override; + #pragma endregion AttributeSet #pragma region UObject - void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; + void + GetLifetimeReplicatedProps( TArray& OutLifetimeProps ) const override; #pragma endregion UObject }; diff --git a/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp b/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp index 0931380..dcb4803 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp +++ b/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp @@ -10,6 +10,8 @@ AGasaEffectActor::AGasaEffectActor() RootComponent = CreateDefaultSubobject("Root"); + Level = 1.f; + InstantEffectUsage = EInstantEffectUsagePolicy::DoNotApply; DurationEffectUsage = DefaultEffectUsagePolicy; InfiniteEffectUsage = DefaultEffectUsagePolicy; @@ -24,7 +26,7 @@ void AGasaEffectActor::ApplyEffectToActor(AActor* Actor, TSubclassOfMakeEffectContext(); Context.AddSourceObject(Actor); - FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( EffectClass, 1.0f, Context ); + FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( EffectClass, Level, Context ); FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); if (bRemoveOnEndOverlap) ActiveEffectsToRemove.Add(ActiveEffect, AS); @@ -39,16 +41,16 @@ void AGasaEffectActor::OnOverlap(AActor* Actor) if (InstantEffectClass && InstantEffectUsage == EInstantEffectUsagePolicy::ApplyOnOverlap) { - FGameplayEffectSpecHandle Spec= AS->MakeOutgoingSpec( InstantEffectClass, 1.0f, Context ); + FGameplayEffectSpecHandle Spec= AS->MakeOutgoingSpec( InstantEffectClass, Level, Context ); AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); } if (DurationEffectClass) { if (Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::ApplyOnOverlap)) { - FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( DurationEffectClass, 1.0f, Context ); + FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( DurationEffectClass, Level, Context ); FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); - if (Bitfield_IsSet(DurationEffectUsage, (int32)EEffectUsagePolicy::RemoveOnEndOverlap)) + if (Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::RemoveOnEndOverlap)) ActiveDuration = ActiveEffect; } if (ActiveDuration.IsValid() && Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::RemoveOnOverlap)) @@ -59,9 +61,9 @@ void AGasaEffectActor::OnOverlap(AActor* Actor) bool bApplyOnOverlap = Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::ApplyOnOverlap); if (bApplyOnOverlap) { - FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( InfiniteEffectClass, 1.0f, Context ); + FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( InfiniteEffectClass, Level, Context ); FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); - if (Bitfield_IsSet(InfiniteEffectUsage, (int32)EEffectUsagePolicy::RemoveOnEndOverlap)) + if (Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::RemoveOnEndOverlap)) ActiveInfinite = ActiveEffect; } if (ActiveInfinite.IsValid() && Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::RemoveOnOverlap)) @@ -81,28 +83,28 @@ void AGasaEffectActor::OnEndOverlap(AActor* Actor) if (InstantEffectClass && InstantEffectUsage == EInstantEffectUsagePolicy::ApplyOnEndOverlap) { - FGameplayEffectSpecHandle Spec= AS->MakeOutgoingSpec( InstantEffectClass, 1.0f, Context ); + FGameplayEffectSpecHandle Spec= AS->MakeOutgoingSpec( InstantEffectClass, Level, Context ); AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); } if (DurationEffectClass) { if (Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::ApplyOnEndOverlap)) { - FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( DurationEffectClass, 1.0f, Context ); + FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( DurationEffectClass, Level, Context ); FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); - if (Bitfield_IsSet(DurationEffectUsage, (int32)EEffectUsagePolicy::RemoveOnOverlap)) + if (Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::RemoveOnOverlap)) ActiveDuration = ActiveEffect; } - if (ActiveDuration.IsValid() && Bitfield_IsSet(DurationEffectUsage, (int32)EEffectUsagePolicy::RemoveOnEndOverlap)) + if (ActiveDuration.IsValid() && Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::RemoveOnEndOverlap)) AS->RemoveActiveGameplayEffect(ActiveDuration); } if (InfiniteEffectClass) { if (Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::ApplyOnEndOverlap)) { - FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( InfiniteEffectClass, 1.0f, Context ); + FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( InfiniteEffectClass, Level, Context ); FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); - if (Bitfield_IsSet(InfiniteEffectUsage, (int32)EEffectUsagePolicy::RemoveOnOverlap)) + if (Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::RemoveOnOverlap)) ActiveInfinite = ActiveEffect; } if (ActiveInfinite.IsValid() && Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::RemoveOnEndOverlap)) diff --git a/Project/Source/Gasa/AbilitySystem/GasaEffectActor.h b/Project/Source/Gasa/AbilitySystem/GasaEffectActor.h index 2697ae0..d82a0c3 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaEffectActor.h +++ b/Project/Source/Gasa/AbilitySystem/GasaEffectActor.h @@ -35,6 +35,11 @@ class GASA_API AGasaEffectActor : public AGasaActor GENERATED_BODY() public: + AGasaEffectActor(); + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects") + float Level; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects") TSubclassOf InstantEffectClass; @@ -61,9 +66,7 @@ public: FActiveGameplayEffectHandle ActiveDuration; FActiveGameplayEffectHandle ActiveInfinite; - - AGasaEffectActor(); - + UFUNCTION(BlueprintCallable, Category = "Gameplay Effects") void ApplyEffectToActor(AActor* Actor, TSubclassOf EffectClass, bool bRemoveOnEndOverlap = false); @@ -73,4 +76,3 @@ public: UFUNCTION(BlueprintCallable) void OnEndOverlap(AActor* Actor); }; -