From b189594f8fd2209c913fb9a85c760ce8571deb12 Mon Sep 17 00:00:00 2001 From: Guy Elsmore-Paddock Date: Sun, 14 Jul 2024 20:00:05 -0400 Subject: [PATCH] [#60] Update Code References to Gameplay Tags for New Tag Names --- .../Attacks/PF2SimpleDamageExecution.cpp | 14 +- .../Attacks/PF2SpellAttackRollCalculation.cpp | 2 +- .../Abilities/PF2InteractableAbilityBase.cpp | 31 +- .../Components/PF2AbilitySystemComponent.cpp | 13 +- .../AbilityBoosts/PF2AbilityBoostBase.cpp | 6 +- .../PF2ApplyDamageFromSourceExecution.cpp | 17 +- .../PF2ArmorClassCalculation.cpp | 20 +- .../PF2CharacterAttributeSet.cpp | 9 +- .../PF2ClassDifficultyClassCalculation.cpp | 2 +- .../PF2KeyAbilityTemlCalculationBase.cpp | 2 +- .../PF2SpellDifficultyClassCalculation.cpp | 2 +- .../Private/Libraries/PF2TagLibrary.cpp | 6 +- .../ModesOfPlay/PF2ModeOfPlayRuleSetBase.cpp | 20 +- .../Private/PF2CharacterBase.cpp | 4 +- .../Utilities/PF2GameplayAbilityUtilities.cpp | 2 +- ...AbilityAsync_WaitCharacterConditionAdded.h | 2 +- ...ilityAsync_WaitCharacterConditionRemoved.h | 6 +- .../Async/PF2AbilityAsync_WaitConditionBase.h | 2 +- .../Attacks/PF2AttackAttributeStatics.h | 44 +- .../Attacks/PF2SimpleDamageExecution.h | 34 -- .../Abilities/PF2InteractableAbilityBase.h | 18 - .../Components/PF2AbilitySystemComponent.h | 17 - .../AbilityBoosts/PF2AbilityBoostBase.h | 5 - .../PF2ApplyDamageFromSourceExecution.h | 16 - .../CharacterStats/PF2ArmorClassCalculation.h | 2 +- .../CharacterStats/PF2CharacterAttributeSet.h | 26 - .../PF2CharacterAttributeStaticsBase.h | 44 +- .../PF2KeyAbilityTemlCalculationBase.h | 11 +- .../Public/Items/Weapons/PF2Weapon.h | 2 +- .../Public/Libraries/PF2AttackStatLibrary.h | 4 +- .../Public/Libraries/PF2TagLibrary.h | 6 +- .../ModesOfPlay/PF2ModeOfPlayRuleSetBase.h | 49 -- .../Public/PF2CharacterBase.h | 2 +- .../Public/PF2CharacterConstants.h | 16 +- .../Public/PF2MonetaryValue.h | 4 +- .../PF2SpellAttackRollCalculation.spec.cpp | 4 +- .../PF2PerceptionModifierCalculation.spec.cpp | 2 +- ...PF2SavingThrowModifierCalculation.spec.cpp | 5 +- .../PF2ArmorClassCalculation.spec.cpp | 4 +- ...F2ClassDifficultyClassCalculation.spec.cpp | 4 +- ...F2SpellDifficultyClassCalculation.spec.cpp | 6 +- .../PF2SkillModifierCalculation.spec.cpp | 5 +- .../Tests/Libraries/PF2TagLibrary.spec.cpp | 46 +- ...PF2ConditionsDyingRecoveryByCheck.spec.cpp | 475 +++++------------- ...2ConditionsDyingRecoveryByHealing.spec.cpp | 389 +++++--------- .../PF2ConditionsKnockoutAndDeath.spec.cpp | 290 ++++------- .../Private/Tests/PF2KeyAbilityBoost.spec.cpp | 2 +- .../Private/Tests/PF2SpecBase.cpp | 14 +- .../OpenPF2Tests/Public/Tests/PF2SpecBase.h | 16 +- 49 files changed, 537 insertions(+), 1185 deletions(-) diff --git a/Source/OpenPF2GameFramework/Private/Abilities/Attacks/PF2SimpleDamageExecution.cpp b/Source/OpenPF2GameFramework/Private/Abilities/Attacks/PF2SimpleDamageExecution.cpp index 73b6e2685..542e788cc 100644 --- a/Source/OpenPF2GameFramework/Private/Abilities/Attacks/PF2SimpleDamageExecution.cpp +++ b/Source/OpenPF2GameFramework/Private/Abilities/Attacks/PF2SimpleDamageExecution.cpp @@ -16,20 +16,20 @@ #include "CharacterStats/PF2TargetCharacterAttributeStatics.h" +#include "GameplayTags/GameplayEffects/SetByCallerParameters.h" + #include "Libraries/PF2AbilitySystemLibrary.h" #include "Utilities/PF2GameplayAbilityUtilities.h" -UPF2SimpleDamageExecution::UPF2SimpleDamageExecution() : - DamageParameterTag(FGameplayTag::RequestGameplayTag(this->DamageParameterTagName)), - ResistanceParameterTag(FGameplayTag::RequestGameplayTag(this->ResistanceParameterTagName)) +UPF2SimpleDamageExecution::UPF2SimpleDamageExecution() { #if WITH_EDITORONLY_DATA // Expose the damage parameter tag and resistance parameter tag for use in calculations in the editor. // The ValidTransientAggregatorIdentifiers property only exists for use in the editor. It does NOT exist at run-time // nor in Shipping builds. - this->ValidTransientAggregatorIdentifiers.AddTag(this->DamageParameterTag); - this->ValidTransientAggregatorIdentifiers.AddTag(this->ResistanceParameterTag); + this->ValidTransientAggregatorIdentifiers.AddTag(Pf2TagGameplayEffectParameterDamage); + this->ValidTransientAggregatorIdentifiers.AddTag(Pf2TagGameplayEffectParameterResistance); #endif } @@ -46,13 +46,13 @@ void UPF2SimpleDamageExecution::Execute_Implementation( UPF2AbilitySystemLibrary::BuildEvaluationParameters(Spec); ExecutionParams.AttemptCalculateTransientAggregatorMagnitude( - this->DamageParameterTag, + Pf2TagGameplayEffectParameterDamage, EvaluationParameters, IncomingDamage ); ExecutionParams.AttemptCalculateTransientAggregatorMagnitude( - this->ResistanceParameterTag, + Pf2TagGameplayEffectParameterResistance, EvaluationParameters, Resistance ); diff --git a/Source/OpenPF2GameFramework/Private/Abilities/Attacks/PF2SpellAttackRollCalculation.cpp b/Source/OpenPF2GameFramework/Private/Abilities/Attacks/PF2SpellAttackRollCalculation.cpp index baa7dce90..a465dfa1d 100644 --- a/Source/OpenPF2GameFramework/Private/Abilities/Attacks/PF2SpellAttackRollCalculation.cpp +++ b/Source/OpenPF2GameFramework/Private/Abilities/Attacks/PF2SpellAttackRollCalculation.cpp @@ -6,6 +6,6 @@ #include "Abilities/Attacks/PF2SpellAttackRollCalculation.h" UPF2SpellAttackRollCalculation::UPF2SpellAttackRollCalculation() : - UPF2KeyAbilityTemlCalculationBase(TEXT("SpellAttack"), TEXT("SpellcastingAbility")) + UPF2KeyAbilityTemlCalculationBase(TEXT("PF2.Proficiency.SpellAttack"), TEXT("PF2.SpellcastingAbility")) { } diff --git a/Source/OpenPF2GameFramework/Private/Abilities/PF2InteractableAbilityBase.cpp b/Source/OpenPF2GameFramework/Private/Abilities/PF2InteractableAbilityBase.cpp index 53144fff9..2f8e979e2 100644 --- a/Source/OpenPF2GameFramework/Private/Abilities/PF2InteractableAbilityBase.cpp +++ b/Source/OpenPF2GameFramework/Private/Abilities/PF2InteractableAbilityBase.cpp @@ -5,36 +5,15 @@ #include "Abilities/PF2InteractableAbilityBase.h" -#include "OpenPF2GameFramework.h" - #include "Abilities/PF2EffectCauseWrapper.h" +#include "GameplayTags/Traits/Abilities.h" + UPF2InteractableAbilityBase::UPF2InteractableAbilityBase(): Icon(nullptr) { - if (!CommonAbilityTag.IsValid()) - { - // Rather than crashing the game/engine, we soften this to a log error so that a game designer can still - // correct the error by possibly loading/defining tags. - const FGameplayTag Tag = FGameplayTag::RequestGameplayTag(CommonAbilityTagName, false); - - if (Tag.IsValid()) - { - CommonAbilityTag = Tag; - } - else - { - UE_LOG( - LogPf2Abilities, - Error, - TEXT("The common ability tag '%s' is missing."), - *(CommonAbilityTagName.ToString()) - ); - } - } - - // Default to "Trait.Ability.Common" on interactable abilities. Game designers can remove this tag on abilities that - // have a pre-req and/or are rare. - this->AbilityTags.AddTag(CommonAbilityTag); + // Default to "PF2.Trait.Ability.Common" on interactable abilities. Game designers can remove this tag on abilities + // that have a pre-req and/or are rare. + this->AbilityTags.AddTag(Pf2TagTraitAbilityCommon); } FString UPF2InteractableAbilityBase::GetIdForLogs() const diff --git a/Source/OpenPF2GameFramework/Private/Actors/Components/PF2AbilitySystemComponent.cpp b/Source/OpenPF2GameFramework/Private/Actors/Components/PF2AbilitySystemComponent.cpp index 747b86bb4..3b9fa37c6 100644 --- a/Source/OpenPF2GameFramework/Private/Actors/Components/PF2AbilitySystemComponent.cpp +++ b/Source/OpenPF2GameFramework/Private/Actors/Components/PF2AbilitySystemComponent.cpp @@ -13,14 +13,13 @@ #include "Abilities/PF2InteractableAbilityInterface.h" +#include "GameplayTags/GameplayAbilities/AbilityTypes.h" + #include "Utilities/PF2ArrayUtilities.h" #include "Utilities/PF2EnumUtilities.h" #include "Utilities/PF2InterfaceUtilities.h" #include "Utilities/PF2LogUtilities.h" -const FName UPF2AbilitySystemComponent::DefaultMovementAbilityTagName = FName(TEXT("GameplayAbility.Type.DefaultMovement")); -const FName UPF2AbilitySystemComponent::DefaultFaceTargetAbilityTagName = FName(TEXT("GameplayAbility.Type.DefaultFaceTarget")); - UPF2AbilitySystemComponent::UPF2AbilitySystemComponent() : Events(nullptr), bAreAbilitiesAvailable(false) { const FString DynamicTagsGeFilename = @@ -624,7 +623,7 @@ TArray> UPF2AbilitySystemComponent:: TArray MatchingGameplayAbilitySpecs; this->GetActivatableGameplayAbilitySpecsByAllMatchingTags( - FGameplayTagContainer(PF2GameplayAbilityUtilities::GetTag(FName("GameplayAbility.Type.AbilityBoost"))), + FGameplayTagContainer(Pf2TagGameplayAbilityTypeAbilityBoost), MatchingGameplayAbilitySpecs, false ); @@ -683,8 +682,7 @@ bool UPF2AbilitySystemComponent::HasDefaultMovementAbility() const FGameplayAbilitySpecHandle UPF2AbilitySystemComponent::FindDefaultMovementAbilityHandle(bool& bOutMatchFound) const { - const FGameplayTag MovementTag = PF2GameplayAbilityUtilities::GetTag(DefaultMovementAbilityTagName); - const FGameplayTagContainer SearchTags = FGameplayTagContainer(MovementTag); + const FGameplayTagContainer SearchTags = FGameplayTagContainer(Pf2TagGameplayAbilityTypeDefaultMovement); return this->FindAbilityHandleByTags(SearchTags, bOutMatchFound, false); } @@ -700,8 +698,7 @@ bool UPF2AbilitySystemComponent::HasDefaultFaceTargetAbility() const FGameplayAbilitySpecHandle UPF2AbilitySystemComponent::FindDefaultFaceTargetAbilityHandle(bool& bOutMatchFound) const { - const FGameplayTag FacingTag = PF2GameplayAbilityUtilities::GetTag(DefaultFaceTargetAbilityTagName); - const FGameplayTagContainer SearchTags = FGameplayTagContainer(FacingTag); + const FGameplayTagContainer SearchTags = FGameplayTagContainer(Pf2TagGameplayAbilityTypeDefaultFaceTarget); return this->FindAbilityHandleByTags(SearchTags, bOutMatchFound, false); } diff --git a/Source/OpenPF2GameFramework/Private/CharacterStats/AbilityBoosts/PF2AbilityBoostBase.cpp b/Source/OpenPF2GameFramework/Private/CharacterStats/AbilityBoosts/PF2AbilityBoostBase.cpp index 25731fd0d..fd4c4c51f 100644 --- a/Source/OpenPF2GameFramework/Private/CharacterStats/AbilityBoosts/PF2AbilityBoostBase.cpp +++ b/Source/OpenPF2GameFramework/Private/CharacterStats/AbilityBoosts/PF2AbilityBoostBase.cpp @@ -10,19 +10,21 @@ #include "CharacterStats/AbilityBoosts/PF2AbilityBoostRuleOptionValidator.h" #include "CharacterStats/AbilityBoosts/PF2GameplayAbilityTargetData_BoostAbility.h" +#include "GameplayTags/GameplayAbilities/AbilityTypes.h" + UPF2AbilityBoostBase::UPF2AbilityBoostBase() { FAbilityTriggerData TriggerData; TriggerData.TriggerSource = EGameplayAbilityTriggerSource::GameplayEvent; - TriggerData.TriggerTag = GetTriggerTag(); + TriggerData.TriggerTag = Pf2TagGameplayAbilityTypeAbilityBoost; this->AbilityTriggers.Add(TriggerData); // We don't maintain any local state. this->InstancingPolicy = EGameplayAbilityInstancingPolicy::NonInstanced; - this->AbilityTags.AddTag(PF2GameplayAbilityUtilities::GetTag(FName("GameplayAbility.Type.AbilityBoost"))); + this->AbilityTags.AddTag(Pf2TagGameplayAbilityTypeAbilityBoost); } bool UPF2AbilityBoostBase::CheckCost( diff --git a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ApplyDamageFromSourceExecution.cpp b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ApplyDamageFromSourceExecution.cpp index b84a27027..9987c20f4 100644 --- a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ApplyDamageFromSourceExecution.cpp +++ b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ApplyDamageFromSourceExecution.cpp @@ -18,6 +18,8 @@ #include "CharacterStats/PF2TargetCharacterAttributeStatics.h" +#include "GameplayTags/GameplayCues.h" + #include "Libraries/PF2AbilitySystemLibrary.h" #include "Utilities/PF2GameplayAbilityUtilities.h" @@ -33,11 +35,6 @@ UPF2ApplyDamageFromSourceExecution::UPF2ApplyDamageFromSourceExecution() { this->RelevantAttributesToCapture.Add(*Capture); } - - // Cache the tag to avoid lookup overhead. - this->InflictDamageCueTag = PF2GameplayAbilityUtilities::GetTag( - FName("GameplayCue.Character.InflictDamage") - ); } void UPF2ApplyDamageFromSourceExecution::Execute_Implementation( @@ -139,10 +136,7 @@ void UPF2ApplyDamageFromSourceExecution::Execute_Implementation( CueParams.RawMagnitude = EffectiveDamage; - TargetAsc->ExecuteGameplayCue( - this->InflictDamageCueTag, - CueParams - ); + TargetAsc->ExecuteGameplayCue(Pf2TagGameplayCueCharacterInflictDamage, CueParams); } } @@ -153,9 +147,6 @@ void UPF2ApplyDamageFromSourceExecution::Execute_Implementation( CueParams.RawMagnitude = 0; - TargetAsc->ExecuteGameplayCue( - this->InflictDamageCueTag, - CueParams - ); + TargetAsc->ExecuteGameplayCue(Pf2TagGameplayCueCharacterInflictDamage, CueParams); } } diff --git a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ArmorClassCalculation.cpp b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ArmorClassCalculation.cpp index a32aa635a..11074ba44 100644 --- a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ArmorClassCalculation.cpp +++ b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ArmorClassCalculation.cpp @@ -17,6 +17,8 @@ #include "CharacterStats/PF2TargetCharacterAttributeStatics.h" #include "CharacterStats/PF2TemlCalculation.h" +#include "GameplayTags/Stats/Equipment.h" + #include "Libraries/PF2AbilitySystemLibrary.h" #include "Utilities/PF2GameplayAbilityUtilities.h" @@ -74,7 +76,7 @@ float UPF2ArmorClassCalculation::CalculateArmorTypeProficiencyBonus(const FGamep { const FGameplayTagContainer* SourceTags = Spec.CapturedSourceTags.GetAggregatedTags(); const FString ArmorType = DetermineArmorType(SourceTags), - ArmorTypeProficiencyPrefix = "Armor.Category." + ArmorType; + ArmorTypeProficiencyPrefix = TEXT("PF2.Proficiency.Armor.Category.") + ArmorType; const float ProficiencyBonus = FPF2TemlCalculation(ArmorTypeProficiencyPrefix, Spec).GetValue(); @@ -92,22 +94,22 @@ float UPF2ArmorClassCalculation::CalculateArmorTypeProficiencyBonus(const FGamep FString UPF2ArmorClassCalculation::DetermineArmorType(const FGameplayTagContainer* SourceTags) const { // Default to no armor. - FString ArmorType = "Unarmored"; + FString ArmorType = TEXT("Unarmored"); // Bypass additional checks if the character has no armor equipped, to avoid checking every armor type. - if (PF2GameplayAbilityUtilities::HasTag(SourceTags, FName("Armor.Equipped"))) + if (SourceTags->HasTag(Pf2TagEquippedArmor)) { - if (PF2GameplayAbilityUtilities::HasTag(SourceTags, FName("Armor.Equipped.Heavy"))) + if (SourceTags->HasTag(Pf2TagEquippedArmorHeavy)) { - ArmorType = "Heavy"; + ArmorType = TEXT("Heavy"); } - else if (PF2GameplayAbilityUtilities::HasTag(SourceTags, FName("Armor.Equipped.Medium"))) + else if (SourceTags->HasTag(Pf2TagEquippedArmorMedium)) { - ArmorType = "Medium"; + ArmorType = TEXT("Medium"); } - else if (PF2GameplayAbilityUtilities::HasTag(SourceTags, FName("Armor.Equipped.Light"))) + else if (SourceTags->HasTag(Pf2TagEquippedArmorLight)) { - ArmorType = "Light"; + ArmorType = TEXT("Light"); } } diff --git a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2CharacterAttributeSet.cpp b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2CharacterAttributeSet.cpp index aec07eecd..7308248f9 100644 --- a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2CharacterAttributeSet.cpp +++ b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2CharacterAttributeSet.cpp @@ -22,6 +22,8 @@ #include "OpenPF2GameFramework.h" #include "PF2CharacterInterface.h" +#include "GameplayTags/GameplayAbilities/WaitForEvents.h" + #include "Libraries/PF2AbilitySystemLibrary.h" #include "Utilities/PF2InterfaceUtilities.h" @@ -100,9 +102,6 @@ UPF2CharacterAttributeSet::UPF2CharacterAttributeSet() : EncMaxReactionPoints(0.0f), TmpDamageIncoming(0.0f) { - // Cache the tags to avoid lookup overhead. - this->DamageReceivedEventTag = PF2GameplayAbilityUtilities::GetTag(DamageReceivedEventTagName); - this->HitPointsChangedEventTag = PF2GameplayAbilityUtilities::GetTag(HitPointsChangedEventTagName); } void UPF2CharacterAttributeSet::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const @@ -671,7 +670,7 @@ void UPF2CharacterAttributeSet::Native_OnDamageIncomingChanged(const FGameplayEf // Enable condition check GAs to react to incoming damage. this->EmitGameplayEvent( - DamageReceivedEventTag, + Pf2TagGameplayAbilityWaitForEventDamageReceived, LocalDamage, TargetCharacter, SourceEffectSpec @@ -726,7 +725,7 @@ void UPF2CharacterAttributeSet::Native_OnHitPointsChanged(const FGameplayEffectS } this->EmitGameplayEvent( - HitPointsChangedEventTag, + Pf2TagGameplayAbilityWaitForEventHitPointsChanged, ValueDelta, TargetCharacter, SourceEffectSpec diff --git a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ClassDifficultyClassCalculation.cpp b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ClassDifficultyClassCalculation.cpp index 158f2d7fc..72bb8446c 100644 --- a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ClassDifficultyClassCalculation.cpp +++ b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2ClassDifficultyClassCalculation.cpp @@ -6,6 +6,6 @@ #include "CharacterStats/PF2ClassDifficultyClassCalculation.h" UPF2ClassDifficultyClassCalculation::UPF2ClassDifficultyClassCalculation() : - UPF2KeyAbilityTemlCalculationBase(TEXT("ClassDc"), TEXT("KeyAbility"), 10.0f) + UPF2KeyAbilityTemlCalculationBase(TEXT("PF2.Proficiency.ClassDc"), TEXT("PF2.KeyAbility"), 10.0f) { } diff --git a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2KeyAbilityTemlCalculationBase.cpp b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2KeyAbilityTemlCalculationBase.cpp index d615a7ee2..4b4a37f0a 100644 --- a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2KeyAbilityTemlCalculationBase.cpp +++ b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2KeyAbilityTemlCalculationBase.cpp @@ -24,7 +24,7 @@ UPF2KeyAbilityTemlCalculationBase::UPF2KeyAbilityTemlCalculationBase() : UPF2KeyAbilityTemlCalculationBase( TEXT(""), - TEXT("KeyAbility") + TEXT("PF2.KeyAbility") ) { } diff --git a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2SpellDifficultyClassCalculation.cpp b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2SpellDifficultyClassCalculation.cpp index 82413c43b..daf61d177 100644 --- a/Source/OpenPF2GameFramework/Private/CharacterStats/PF2SpellDifficultyClassCalculation.cpp +++ b/Source/OpenPF2GameFramework/Private/CharacterStats/PF2SpellDifficultyClassCalculation.cpp @@ -6,6 +6,6 @@ #include "CharacterStats/PF2SpellDifficultyClassCalculation.h" UPF2SpellDifficultyClassCalculation::UPF2SpellDifficultyClassCalculation() : - UPF2KeyAbilityTemlCalculationBase(TEXT("SpellDc"), TEXT("SpellcastingAbility"), 10.0f) + UPF2KeyAbilityTemlCalculationBase(TEXT("PF2.Proficiency.SpellDc"), TEXT("PF2.SpellcastingAbility"), 10.0f) { } diff --git a/Source/OpenPF2GameFramework/Private/Libraries/PF2TagLibrary.cpp b/Source/OpenPF2GameFramework/Private/Libraries/PF2TagLibrary.cpp index 7ef5b5ec8..91c3aadeb 100644 --- a/Source/OpenPF2GameFramework/Private/Libraries/PF2TagLibrary.cpp +++ b/Source/OpenPF2GameFramework/Private/Libraries/PF2TagLibrary.cpp @@ -7,6 +7,8 @@ #include "OpenPF2GameFramework.h" +#include "Utilities/PF2GameplayAbilityUtilities.h" + FGameplayTag UPF2TagLibrary::FindChildTag(const FGameplayTagContainer& AllTags, const FGameplayTag& ParentTag, bool& bMatchFound) @@ -58,8 +60,8 @@ uint8 UPF2TagLibrary::ParseConditionLevel(const FGameplayTag& Tag, const FGamepl if (Tag.RequestDirectParent().MatchesTagExact(ParentTag)) { - // If ParentTag is "Condition.Dying" and the tag is "Condition.Dying.3", then starting at ParentTag.Len() + 1 - // in the tag should give us "3". + // If ParentTag is "PF2.Trait.Condition.Dying" and the tag is "PF2.Trait.Condition.Dying.3", then starting at + // ParentTag.Len() + 1 in the tag should give us "3". const FString ParentTagString = ParentTag.ToString(), SuffixString = Tag.ToString().Mid(ParentTagString.Len() + 1); diff --git a/Source/OpenPF2GameFramework/Private/ModesOfPlay/PF2ModeOfPlayRuleSetBase.cpp b/Source/OpenPF2GameFramework/Private/ModesOfPlay/PF2ModeOfPlayRuleSetBase.cpp index a0a5a970b..cb7f6ba4c 100644 --- a/Source/OpenPF2GameFramework/Private/ModesOfPlay/PF2ModeOfPlayRuleSetBase.cpp +++ b/Source/OpenPF2GameFramework/Private/ModesOfPlay/PF2ModeOfPlayRuleSetBase.cpp @@ -15,18 +15,13 @@ #include "Commands/PF2CharacterCommandInterface.h" #include "Commands/PF2CommandQueueInterface.h" +#include "GameplayTags/Traits/Conditions.h" + #include "Libraries/PF2CharacterCommandLibrary.h" #include "Libraries/PF2CharacterLibrary.h" #include "Utilities/PF2InterfaceUtilities.h" -APF2ModeOfPlayRuleSetBase::APF2ModeOfPlayRuleSetBase() -{ - this->DyingConditionTag = PF2GameplayAbilityUtilities::GetTag(DyingConditionTagName); - this->DeadConditionTag = PF2GameplayAbilityUtilities::GetTag(DeadConditionTagName); - this->UnconsciousConditionTag = PF2GameplayAbilityUtilities::GetTag(UnconsciousConditionTagName); -} - void APF2ModeOfPlayRuleSetBase::OnModeOfPlayStart(const EPF2ModeOfPlayType ModeOfPlay) { this->BP_OnModeOfPlayStart(ModeOfPlay); @@ -52,23 +47,28 @@ void APF2ModeOfPlayRuleSetBase::OnCharacterAddedToEncounter(const TScriptInterfa } else { + // The MoPRS listens for a tag of this type to be added to or removed from a character in order to fire the + // OnCharacterUnconscious() and OnCharacterConscious(), respectively. this->RegisterTagCallback( CharacterPtr, - this->UnconsciousConditionTag, + Pf2TagTraitConditionUnconscious, &APF2ModeOfPlayRuleSetBase::Native_OnCharacterUnconscious, &APF2ModeOfPlayRuleSetBase::Native_OnCharacterConscious ); + // The MoPRS listens for a tag of this type to be added to or removed from a character in order to fire the + // Native_OnCharacterDying() and Native_OnCharacterRecoveredFromDying(), respectively. this->RegisterTagCallback( CharacterPtr, - this->DyingConditionTag, + Pf2TagTraitConditionDying, &APF2ModeOfPlayRuleSetBase::Native_OnCharacterDying, &APF2ModeOfPlayRuleSetBase::Native_OnCharacterRecoveredFromDying ); + // The MoPRS listens for a tag of this type to be added to a character in order to fire OnCharacterDead(). this->RegisterTagCallback( CharacterPtr, - this->DeadConditionTag, + Pf2TagTraitConditionDead, &APF2ModeOfPlayRuleSetBase::Native_OnCharacterDead, nullptr ); diff --git a/Source/OpenPF2GameFramework/Private/PF2CharacterBase.cpp b/Source/OpenPF2GameFramework/Private/PF2CharacterBase.cpp index e84c371c1..ddc4ba9b9 100644 --- a/Source/OpenPF2GameFramework/Private/PF2CharacterBase.cpp +++ b/Source/OpenPF2GameFramework/Private/PF2CharacterBase.cpp @@ -24,6 +24,8 @@ #include "Commands/PF2CommandQueueComponent.h" +#include "GameplayTags/GameplayAbilities/AbilityTypes.h" + #include "Utilities/PF2InterfaceUtilities.h" #include "Utilities/PF2LogUtilities.h" @@ -466,7 +468,7 @@ void APF2CharacterBase::ActivateAbilityBoost( Asc->TriggerAbilityFromGameplayEvent( BoostSpec->Handle, Asc->AbilityActorInfo.Get(), - UPF2AbilityBoostBase::GetTriggerTag(), + Pf2TagGameplayAbilityTypeAbilityBoost, &BoostEventInfo, *Asc ); diff --git a/Source/OpenPF2GameFramework/Private/Utilities/PF2GameplayAbilityUtilities.cpp b/Source/OpenPF2GameFramework/Private/Utilities/PF2GameplayAbilityUtilities.cpp index 20279e9bd..34c1e91b5 100644 --- a/Source/OpenPF2GameFramework/Private/Utilities/PF2GameplayAbilityUtilities.cpp +++ b/Source/OpenPF2GameFramework/Private/Utilities/PF2GameplayAbilityUtilities.cpp @@ -32,7 +32,7 @@ namespace PF2GameplayAbilityUtilities FName GetWeightGroupOfGameplayEffect(const TSubclassOf GameplayEffect, const FName DefaultWeight) { FName WeightGroup; - const FGameplayTag WeightTagParent = GetTag(FName(TEXT("GameplayEffect.WeightGroup"))); + const FGameplayTag WeightTagParent = GetTag(FName(TEXT("PF2.GameplayEffect.WeightGroup"))); const UGameplayEffect* Effect = GameplayEffect.GetDefaultObject(); const FGameplayTagContainer WeightTags = Effect->GetAssetTags().Filter(FGameplayTagContainer(WeightTagParent)); diff --git a/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitCharacterConditionAdded.h b/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitCharacterConditionAdded.h index f6774a2d2..6b343e26c 100644 --- a/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitCharacterConditionAdded.h +++ b/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitCharacterConditionAdded.h @@ -57,7 +57,7 @@ class OPENPF2GAMEFRAMEWORK_API UPF2AbilityAsync_WaitCharacterConditionAdded : pu * @param Character * The character for which condition levels are being monitored. * @param ConditionParentTag - * The tag immediately above the tag that contains the integer condition level (e.g., "Trait.Condition.Dying"). + * The tag immediately above the tag that contains the integer condition level (e.g., "PF2.Trait.Condition.Dying"). * @param bFireImmediatelyIfAlreadySatisfied * Whether to evaluate the tag criterion upon starting this task and then fire the callback if has been satisfied. * @param bOnlyTriggerOnce diff --git a/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitCharacterConditionRemoved.h b/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitCharacterConditionRemoved.h index e2b35179e..5386ee103 100644 --- a/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitCharacterConditionRemoved.h +++ b/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitCharacterConditionRemoved.h @@ -49,8 +49,8 @@ class OPENPF2GAMEFRAMEWORK_API UPF2AbilityAsync_WaitCharacterConditionRemoved : * removed, and it will broadcast again on future removals unless "Only trigger once" is "false". If the character * does not have the specified condition when this task is started, the event will be broadcast immediately. * - * The task does not broadcast on changes to the level of a condition (e.g., going from "Trait.Condition.Dying.1" to - * "Trait.Condition.Dying.2"), only on a removal of the condition entirely. + * The task does not broadcast on changes to the level of a condition (e.g., going from "PF2.Trait.Condition.Dying.1" to + * "PF2.Trait.Condition.Dying.2"), only on a removal of the condition entirely. * * If "Fire Immediately If Already Satisfied" is "true" and the target character does not have the specified * condition, the "On Condition Removed" event will be broadcast immediately. @@ -58,7 +58,7 @@ class OPENPF2GAMEFRAMEWORK_API UPF2AbilityAsync_WaitCharacterConditionRemoved : * @param Character * The character for which condition levels are being monitored. * @param ConditionParentTag - * The tag immediately above the tag that contains the integer condition level (e.g., "Trait.Condition.Dying"). + * The tag immediately above the tag that contains the integer condition level (e.g., "PF2.Trait.Condition.Dying"). * @param bFireImmediatelyIfAlreadySatisfied * Whether to evaluate the tag criterion upon starting this task and then fire the callback if has been satisfied. * @param bOnlyTriggerOnce diff --git a/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitConditionBase.h b/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitConditionBase.h index c2e94a162..28ee2fb82 100644 --- a/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitConditionBase.h +++ b/Source/OpenPF2GameFramework/Public/Abilities/Async/PF2AbilityAsync_WaitConditionBase.h @@ -40,7 +40,7 @@ class OPENPF2GAMEFRAMEWORK_API UPF2AbilityAsync_WaitCharacterConditionBase : pub // Protected Fields // ================================================================================================================= /** - * The tag immediately above the tag that contains the integer condition level (e.g., "Trait.Condition.Dying"). + * The tag immediately above the tag that contains the integer condition level (e.g., "PF2.Trait.Condition.Dying"). */ FGameplayTag ConditionParentTag; diff --git a/Source/OpenPF2GameFramework/Public/Abilities/Attacks/PF2AttackAttributeStatics.h b/Source/OpenPF2GameFramework/Public/Abilities/Attacks/PF2AttackAttributeStatics.h index eee29f4cf..b35f60399 100644 --- a/Source/OpenPF2GameFramework/Public/Abilities/Attacks/PF2AttackAttributeStatics.h +++ b/Source/OpenPF2GameFramework/Public/Abilities/Attacks/PF2AttackAttributeStatics.h @@ -27,28 +27,28 @@ struct OPENPF2GAMEFRAMEWORK_API FPF2AttackAttributeStatics : FPF2AttributeStatic * Map from each damage type tag to the transient attack attribute for that damage type. */ inline static const TMap DamageTypeToTransientDamageAttributeMap = { - { "DamageType.Physical.Bludgeoning", "TmpDmgTypePhysicalBludgeoning" }, - { "DamageType.Physical.Piercing", "TmpDmgTypePhysicalPiercing" }, - { "DamageType.Physical.Slashing", "TmpDmgTypePhysicalSlashing" }, - - { "DamageType.Energy.Acid", "TmpDmgTypeEnergyAcid" }, - { "DamageType.Energy.Cold", "TmpDmgTypeEnergyCold" }, - { "DamageType.Energy.Electricity", "TmpDmgTypeEnergyElectricity" }, - { "DamageType.Energy.Fire", "TmpDmgTypeEnergyFire" }, - { "DamageType.Energy.Sonic", "TmpDmgTypeEnergySonic" }, - { "DamageType.Energy.Positive", "TmpDmgTypeEnergyPositive" }, - { "DamageType.Energy.Negative", "TmpDmgTypeEnergyNegative" }, - { "DamageType.Energy.Force", "TmpDmgTypeEnergyForce" }, - - { "DamageType.Alignment.Chaotic", "TmpDmgTypeAlignmentChaotic" }, - { "DamageType.Alignment.Evil", "TmpDmgTypeAlignmentEvil" }, - { "DamageType.Alignment.Good", "TmpDmgTypeAlignmentGood" }, - { "DamageType.Alignment.Lawful", "TmpDmgTypeAlignmentLawful" }, - - { "DamageType.Mental", "TmpDmgTypeMental" }, - { "DamageType.Poison", "TmpDmgTypePoison" }, - { "DamageType.Bleed", "TmpDmgTypeBleed" }, - { "DamageType.Precision", "TmpDmgTypePrecision" }, + { "PF2.DamageType.Physical.Bludgeoning", "TmpDmgTypePhysicalBludgeoning" }, + { "PF2.DamageType.Physical.Piercing", "TmpDmgTypePhysicalPiercing" }, + { "PF2.DamageType.Physical.Slashing", "TmpDmgTypePhysicalSlashing" }, + + { "PF2.DamageType.Energy.Acid", "TmpDmgTypeEnergyAcid" }, + { "PF2.DamageType.Energy.Cold", "TmpDmgTypeEnergyCold" }, + { "PF2.DamageType.Energy.Electricity", "TmpDmgTypeEnergyElectricity" }, + { "PF2.DamageType.Energy.Fire", "TmpDmgTypeEnergyFire" }, + { "PF2.DamageType.Energy.Sonic", "TmpDmgTypeEnergySonic" }, + { "PF2.DamageType.Energy.Positive", "TmpDmgTypeEnergyPositive" }, + { "PF2.DamageType.Energy.Negative", "TmpDmgTypeEnergyNegative" }, + { "PF2.DamageType.Energy.Force", "TmpDmgTypeEnergyForce" }, + + { "PF2.DamageType.Alignment.Chaotic", "TmpDmgTypeAlignmentChaotic" }, + { "PF2.DamageType.Alignment.Evil", "TmpDmgTypeAlignmentEvil" }, + { "PF2.DamageType.Alignment.Good", "TmpDmgTypeAlignmentGood" }, + { "PF2.DamageType.Alignment.Lawful", "TmpDmgTypeAlignmentLawful" }, + + { "PF2.DamageType.Mental", "TmpDmgTypeMental" }, + { "PF2.DamageType.Poison", "TmpDmgTypePoison" }, + { "PF2.DamageType.Bleed", "TmpDmgTypeBleed" }, + { "PF2.DamageType.Precision", "TmpDmgTypePrecision" }, }; public: diff --git a/Source/OpenPF2GameFramework/Public/Abilities/Attacks/PF2SimpleDamageExecution.h b/Source/OpenPF2GameFramework/Public/Abilities/Attacks/PF2SimpleDamageExecution.h index 96c386e4b..1565d1c73 100644 --- a/Source/OpenPF2GameFramework/Public/Abilities/Attacks/PF2SimpleDamageExecution.h +++ b/Source/OpenPF2GameFramework/Public/Abilities/Attacks/PF2SimpleDamageExecution.h @@ -22,40 +22,6 @@ class OPENPF2GAMEFRAMEWORK_API UPF2SimpleDamageExecution : public UGameplayEffec { GENERATED_BODY() -protected: - // ================================================================================================================= - // Protected Constants - // ================================================================================================================= - /** - * Name of the tag that is used to pass a dynamic damage amount into the calculation. - */ - const FName DamageParameterTagName = "GameplayEffect.Parameter.Damage"; - - /** - * Name of the tag that is used to pass a dynamic resistance amount into the calculation. - */ - const FName ResistanceParameterTagName = "GameplayEffect.Parameter.Resistance"; - - // ================================================================================================================= - // Protected Fields - // ================================================================================================================= - /** - * The tag for the parameter that is used to pass a dynamic damage amount into the calculation. - * - * The parameter is typically read from a set-by-caller tag-based value so that GAs can populate damage dynamically, - * unless the GE is expected to hard-code a specific amount of damage or read it from a data table. - */ - FGameplayTag DamageParameterTag; - - /** - * The tag that is used to pass a dynamic resistance amount into the calculation. - * - * The parameter should be provided via an attribute-based modifier that reads it from the appropriate resistance - * attribute of the character's attribute set (e.g., typically an attribute having a name that starts with "Rst", - * such as "RstPhysicalBludgeoning", "RstEnergyCold", etc.). - */ - FGameplayTag ResistanceParameterTag; - public: // ================================================================================================================= // Public Constructors diff --git a/Source/OpenPF2GameFramework/Public/Abilities/PF2InteractableAbilityBase.h b/Source/OpenPF2GameFramework/Public/Abilities/PF2InteractableAbilityBase.h index 7bcf9e5e1..f5311f0d8 100644 --- a/Source/OpenPF2GameFramework/Public/Abilities/PF2InteractableAbilityBase.h +++ b/Source/OpenPF2GameFramework/Public/Abilities/PF2InteractableAbilityBase.h @@ -35,24 +35,6 @@ class UPF2InteractableAbilityBase : GENERATED_BODY() protected: - // ================================================================================================================= - // Protected Constants - // ================================================================================================================= - /** - * The name of the gameplay tag that is applied to abilities any player can activate. - */ - static inline FName CommonAbilityTagName = FName(TEXT("Trait.Ability.Common")); - - // ================================================================================================================= - // Protected Static Fields - // ================================================================================================================= - /** - * The gameplay tag that applies to "common" abilities, which is the default for interactable abilities. - * - * This is cached for performance. - */ - inline static FGameplayTag CommonAbilityTag = FGameplayTag(); - // ================================================================================================================= // Protected Fields // ================================================================================================================= diff --git a/Source/OpenPF2GameFramework/Public/Actors/Components/PF2AbilitySystemComponent.h b/Source/OpenPF2GameFramework/Public/Actors/Components/PF2AbilitySystemComponent.h index 35c5e84b3..e889f4df0 100644 --- a/Source/OpenPF2GameFramework/Public/Actors/Components/PF2AbilitySystemComponent.h +++ b/Source/OpenPF2GameFramework/Public/Actors/Components/PF2AbilitySystemComponent.h @@ -30,23 +30,6 @@ class OPENPF2GAMEFRAMEWORK_API UPF2AbilitySystemComponent : GENERATED_BODY() protected: - // ================================================================================================================= - // Protected Constants - // ================================================================================================================= - /** - * The name of the tag that designates an ability the default movement ability. - * - * This ability is used to move a character to a location, such as within range of another actor/character. - */ - static const FName DefaultMovementAbilityTagName; - - /** - * The name of the tag that designates an ability the default "face target" ability. - * - * This ability is used to rotate a character to face another actor/character. - */ - static const FName DefaultFaceTargetAbilityTagName; - // ================================================================================================================= // Protected Fields // ================================================================================================================= diff --git a/Source/OpenPF2GameFramework/Public/CharacterStats/AbilityBoosts/PF2AbilityBoostBase.h b/Source/OpenPF2GameFramework/Public/CharacterStats/AbilityBoosts/PF2AbilityBoostBase.h index 77862111b..04b189639 100644 --- a/Source/OpenPF2GameFramework/Public/CharacterStats/AbilityBoosts/PF2AbilityBoostBase.h +++ b/Source/OpenPF2GameFramework/Public/CharacterStats/AbilityBoosts/PF2AbilityBoostBase.h @@ -60,11 +60,6 @@ class OPENPF2GAMEFRAMEWORK_API UPF2AbilityBoostBase : public UGameplayAbility, p public: UPF2AbilityBoostBase(); - FORCEINLINE static FGameplayTag GetTriggerTag() - { - return PF2GameplayAbilityUtilities::GetTag(FName("GameplayAbility.Type.AbilityBoost")); - }; - // ================================================================================================================= // Public Methods - UGameplayAbility Implementation // ================================================================================================================= diff --git a/Source/OpenPF2GameFramework/Public/CharacterStats/PF2ApplyDamageFromSourceExecution.h b/Source/OpenPF2GameFramework/Public/CharacterStats/PF2ApplyDamageFromSourceExecution.h index 6a8382f38..f2d80051a 100644 --- a/Source/OpenPF2GameFramework/Public/CharacterStats/PF2ApplyDamageFromSourceExecution.h +++ b/Source/OpenPF2GameFramework/Public/CharacterStats/PF2ApplyDamageFromSourceExecution.h @@ -28,11 +28,6 @@ class OPENPF2GAMEFRAMEWORK_API UPF2ApplyDamageFromSourceExecution : public UGame { GENERATED_BODY() - /** - * The gameplay tag for gameplay cues that activate upon damage being inflicted to the target. - */ - FGameplayTag InflictDamageCueTag; - public: // ================================================================================================================= // Constructors @@ -50,17 +45,6 @@ class OPENPF2GAMEFRAMEWORK_API UPF2ApplyDamageFromSourceExecution : public UGame FGameplayEffectCustomExecutionOutput& OutExecutionOutput) const override; protected: - /** - * Gets the gameplay tag for gameplay cues that activate upon damage being inflicted to the target. - * - * @return - * The gameplay tag for the damage cue. - */ - FORCEINLINE const FGameplayTag& GetInflictDamageCueTag() const - { - return this->InflictDamageCueTag; - } - /** * Populates parameters from a gameplay cue from the parameters of the current GE execution. * diff --git a/Source/OpenPF2GameFramework/Public/CharacterStats/PF2ArmorClassCalculation.h b/Source/OpenPF2GameFramework/Public/CharacterStats/PF2ArmorClassCalculation.h index da7994abc..6f97a5bc1 100644 --- a/Source/OpenPF2GameFramework/Public/CharacterStats/PF2ArmorClassCalculation.h +++ b/Source/OpenPF2GameFramework/Public/CharacterStats/PF2ArmorClassCalculation.h @@ -79,7 +79,7 @@ class OPENPF2GAMEFRAMEWORK_API UPF2ArmorClassCalculation : public UGameplayModMa * * @param SourceTags * The tags on the character. A tag in this list should indicate the character's equipped armor (e.g. - * "Armor.Equipped.Unarmored", "Armor.Equipped.Light", etc.). + * "PF2.Equipped.Armor.Unarmored", "PF2.Equipped.Armor.Light", etc.). * * @return * The name of the armor type ("Unarmored", "Light", "Medium", or "Heavy"). diff --git a/Source/OpenPF2GameFramework/Public/CharacterStats/PF2CharacterAttributeSet.h b/Source/OpenPF2GameFramework/Public/CharacterStats/PF2CharacterAttributeSet.h index ba73f3243..cc2651aef 100644 --- a/Source/OpenPF2GameFramework/Public/CharacterStats/PF2CharacterAttributeSet.h +++ b/Source/OpenPF2GameFramework/Public/CharacterStats/PF2CharacterAttributeSet.h @@ -1054,32 +1054,6 @@ class OPENPF2GAMEFRAMEWORK_API UPF2CharacterAttributeSet : public UAttributeSet virtual void OnRep_EncMaxMultipleAttackPenalty(const FGameplayAttributeData& OldValue); protected: - // ================================================================================================================= - // Protected Constants - // ================================================================================================================= - /** - * The name of the gameplay tag for events to notify passive condition check GAs about incoming damage. - */ - inline static const FName DamageReceivedEventTagName = TEXT("GameplayAbility.GameplayEvent.DamageReceived"); - - /** - * The name of the gameplay tag for events to notify passive condition check GAs about changes in hit points. - */ - inline static const FName HitPointsChangedEventTagName = TEXT("GameplayAbility.GameplayEvent.HitPointsChanged"); - - // ================================================================================================================= - // Protected Fields - // ================================================================================================================= - /** - * The gameplay tag for events to notify passive condition check GAs about changes in hit points. - */ - FGameplayTag DamageReceivedEventTag; - - /** - * The gameplay tag for events to notify passive condition check GAs about changes in hit points. - */ - FGameplayTag HitPointsChangedEventTag; - // ================================================================================================================= // Protected Methods // ================================================================================================================= diff --git a/Source/OpenPF2GameFramework/Public/CharacterStats/PF2CharacterAttributeStaticsBase.h b/Source/OpenPF2GameFramework/Public/CharacterStats/PF2CharacterAttributeStaticsBase.h index ebf963165..fa6318844 100644 --- a/Source/OpenPF2GameFramework/Public/CharacterStats/PF2CharacterAttributeStaticsBase.h +++ b/Source/OpenPF2GameFramework/Public/CharacterStats/PF2CharacterAttributeStaticsBase.h @@ -31,28 +31,28 @@ struct OPENPF2GAMEFRAMEWORK_API FPF2CharacterAttributeStaticsBase : FPF2Attribut * Map from each damage type tag to the attribute that tracks a character's resistance to that damage type. */ inline static const TMap DamageTypeToResistanceAttributeMap = { - { "DamageType.Physical.Bludgeoning", "RstPhysicalBludgeoning" }, - { "DamageType.Physical.Piercing", "RstPhysicalPiercing" }, - { "DamageType.Physical.Slashing", "RstPhysicalSlashing" }, - - { "DamageType.Energy.Acid", "RstEnergyAcid" }, - { "DamageType.Energy.Cold", "RstEnergyCold" }, - { "DamageType.Energy.Electricity", "RstEnergyElectricity" }, - { "DamageType.Energy.Fire", "RstEnergyFire" }, - { "DamageType.Energy.Sonic", "RstEnergySonic" }, - { "DamageType.Energy.Positive", "RstEnergyPositive" }, - { "DamageType.Energy.Negative", "RstEnergyNegative" }, - { "DamageType.Energy.Force", "RstEnergyForce" }, - - { "DamageType.Alignment.Chaotic", "RstAlignmentChaotic" }, - { "DamageType.Alignment.Evil", "RstAlignmentEvil" }, - { "DamageType.Alignment.Good", "RstAlignmentGood" }, - { "DamageType.Alignment.Lawful", "RstAlignmentLawful" }, - - { "DamageType.Mental", "RstMental" }, - { "DamageType.Poison", "RstPoison" }, - { "DamageType.Bleed", "RstBleed" }, - { "DamageType.Precision", "RstPrecision" }, + { "PF2.DamageType.Physical.Bludgeoning", "RstPhysicalBludgeoning" }, + { "PF2.DamageType.Physical.Piercing", "RstPhysicalPiercing" }, + { "PF2.DamageType.Physical.Slashing", "RstPhysicalSlashing" }, + + { "PF2.DamageType.Energy.Acid", "RstEnergyAcid" }, + { "PF2.DamageType.Energy.Cold", "RstEnergyCold" }, + { "PF2.DamageType.Energy.Electricity", "RstEnergyElectricity" }, + { "PF2.DamageType.Energy.Fire", "RstEnergyFire" }, + { "PF2.DamageType.Energy.Sonic", "RstEnergySonic" }, + { "PF2.DamageType.Energy.Positive", "RstEnergyPositive" }, + { "PF2.DamageType.Energy.Negative", "RstEnergyNegative" }, + { "PF2.DamageType.Energy.Force", "RstEnergyForce" }, + + { "PF2.DamageType.Alignment.Chaotic", "RstAlignmentChaotic" }, + { "PF2.DamageType.Alignment.Evil", "RstAlignmentEvil" }, + { "PF2.DamageType.Alignment.Good", "RstAlignmentGood" }, + { "PF2.DamageType.Alignment.Lawful", "RstAlignmentLawful" }, + + { "PF2.DamageType.Mental", "RstMental" }, + { "PF2.DamageType.Poison", "RstPoison" }, + { "PF2.DamageType.Bleed", "RstBleed" }, + { "PF2.DamageType.Precision", "RstPrecision" }, }; public: diff --git a/Source/OpenPF2GameFramework/Public/CharacterStats/PF2KeyAbilityTemlCalculationBase.h b/Source/OpenPF2GameFramework/Public/CharacterStats/PF2KeyAbilityTemlCalculationBase.h index 866775db4..af9f1199b 100644 --- a/Source/OpenPF2GameFramework/Public/CharacterStats/PF2KeyAbilityTemlCalculationBase.h +++ b/Source/OpenPF2GameFramework/Public/CharacterStats/PF2KeyAbilityTemlCalculationBase.h @@ -44,11 +44,11 @@ class OPENPF2GAMEFRAMEWORK_API UPF2KeyAbilityTemlCalculationBase : public UGamep * boost. * * @param StatGameplayTagPrefix - * The tag prefix to use for checking a character's training in the stat. For example, "ClassDc", "SpellAttack", - * or "SpellDc". + * The tag prefix to use for checking a character's training in the stat. For example, "PF2.Proficiency.ClassDc", + * "PF2.Proficiency.SpellAttack", or "PF2.Proficiency.SpellDc". * @param KeyAbilityGameplayTagPrefix - * The tag prefix to use to determine the key ability for this stat. For the Class DC, this is "KeyAbility". For - * Spell Attack and Spell DC, this is "SpellcastingAbility". + * The tag prefix to use to determine the key ability for this stat. For the Class DC, this is "PF2.KeyAbility". + * For Spell Attack and Spell DC, this is "PF2.SpellcastingAbility". * @param BaseValue * The base value for this stat. For DC stats, this is usually "10". For other stats (e.g. Spell Attack Roll), * this is 0. @@ -114,7 +114,8 @@ class OPENPF2GAMEFRAMEWORK_API UPF2KeyAbilityTemlCalculationBase : public UGamep * This is used to ensure we can retrieve the modifier for the specified ability later in the calculation phase. * * @param KeyAbilityTagName - * The name of the gameplay tag that a character must have for the ability to be considered "key". + * The name of the gameplay tag that a character must have for the ability to be considered "key". For example, + * "PF2.KeyAbility.Strength" or "PF2.SpellcastingAbility.Intelligence". * @param Attribute * The definition of the attribute to capture. */ diff --git a/Source/OpenPF2GameFramework/Public/Items/Weapons/PF2Weapon.h b/Source/OpenPF2GameFramework/Public/Items/Weapons/PF2Weapon.h index e36dea157..03a719299 100644 --- a/Source/OpenPF2GameFramework/Public/Items/Weapons/PF2Weapon.h +++ b/Source/OpenPF2GameFramework/Public/Items/Weapons/PF2Weapon.h @@ -190,7 +190,7 @@ class OPENPF2GAMEFRAMEWORK_API UPF2Weapon : public UPF2Item, public IPF2WeaponIn UPROPERTY( EditDefaultsOnly, BlueprintReadOnly, - meta=(Categories="Trait.Weapon"), + meta=(Categories="PF2.Trait.Weapon"), Category="OpenPF2 - Weapon Statistics" ) FGameplayTagContainer Traits; diff --git a/Source/OpenPF2GameFramework/Public/Libraries/PF2AttackStatLibrary.h b/Source/OpenPF2GameFramework/Public/Libraries/PF2AttackStatLibrary.h index 04fadfdb2..580f930a5 100644 --- a/Source/OpenPF2GameFramework/Public/Libraries/PF2AttackStatLibrary.h +++ b/Source/OpenPF2GameFramework/Public/Libraries/PF2AttackStatLibrary.h @@ -39,8 +39,8 @@ class OPENPF2GAMEFRAMEWORK_API UPF2AttackStatLibrary final : public UBlueprintFu /** * The maximum level for a character's "dying" condition trait. * - * This level actually signifies that the character is dead. It is therefore synonymous with "Trait.Condition.Dead", - * which is an OpenPF2 extension to "Dying 4" ("Trait.Condition.Dying.4") from the Core Rulebook. + * This level actually signifies that the character is dead. It is therefore synonymous with "PF2.Trait.Condition.Dead", + * which is an OpenPF2 extension to "Dying 4" ("PF2.Trait.Condition.Dying.4") from the Core Rulebook. */ static constexpr uint8 MaxDyingConditionLevel = 4; diff --git a/Source/OpenPF2GameFramework/Public/Libraries/PF2TagLibrary.h b/Source/OpenPF2GameFramework/Public/Libraries/PF2TagLibrary.h index 17b19e46f..8805e6dcf 100644 --- a/Source/OpenPF2GameFramework/Public/Libraries/PF2TagLibrary.h +++ b/Source/OpenPF2GameFramework/Public/Libraries/PF2TagLibrary.h @@ -48,8 +48,8 @@ class OPENPF2GAMEFRAMEWORK_API UPF2TagLibrary final : public UBlueprintFunctionL /** * Finds the condition trait tag having the specified parent tag and parses the condition level into an integer. * - * For example, given a container with the following tags and a parent tag of "Condition.Dying", this would parse - * and return a value of "3": + * For example, given a container with the following tags and a parent tag of "PF2.Trait.Condition.Dying", this + * would parse and return a value of "3": * - CreatureSize.Medium * - CreatureAlignment.Neutral.Good * - KeyAbility.Intelligence @@ -80,7 +80,7 @@ class OPENPF2GAMEFRAMEWORK_API UPF2TagLibrary final : public UBlueprintFunctionL /** * Parses the condition level suffix from a condition trait tag into an integer. * - * For example, this parses tags like "Trait.Condition.Dying.4" and "Trait.Condition.Wounded.3" into the values + * For example, this parses tags like "PF2.Trait.Condition.Dying.4" and "PF2.Trait.Condition.Wounded.3" into the values * "4" and "3", respectively. * * @param Tag diff --git a/Source/OpenPF2GameFramework/Public/ModesOfPlay/PF2ModeOfPlayRuleSetBase.h b/Source/OpenPF2GameFramework/Public/ModesOfPlay/PF2ModeOfPlayRuleSetBase.h index 7c5f1af3d..e38e69fd8 100644 --- a/Source/OpenPF2GameFramework/Public/ModesOfPlay/PF2ModeOfPlayRuleSetBase.h +++ b/Source/OpenPF2GameFramework/Public/ModesOfPlay/PF2ModeOfPlayRuleSetBase.h @@ -27,64 +27,15 @@ class OPENPF2GAMEFRAMEWORK_API APF2ModeOfPlayRuleSetBase : public AActor, public GENERATED_BODY() protected: - // ================================================================================================================= - // Protected Constants - // ================================================================================================================= - /** - * The name of the root of tags that indicate that a character is in the process of dying. - */ - inline static const FName DyingConditionTagName = FName("Trait.Condition.Dying"); - - /** - * The name of the tag that indicates a character is dead. This is equivalent to Trait.Condition.Dying.4. - */ - inline static const FName DeadConditionTagName = FName("Trait.Condition.Dead"); - - /** - * The name of the tag that indicates a character is no longer conscious. - */ - inline static const FName UnconsciousConditionTagName = FName("Trait.Condition.Unconscious"); - // ================================================================================================================= // Protected Fields // ================================================================================================================= - /** - * The root of tags that signify a character is dying. - * - * An MoPRS listens for a tag of this type to be added to or removed from a character in order to fire the - * Native_OnCharacterDying() and Native_OnCharacterRecoveredFromDying(), respectively. - */ - FGameplayTag DyingConditionTag; - - /** - * The tag that signifies a character is dead. - * - * An MoPRS listens for a tag of this type to be added to a character in order to fire OnCharacterDead(). - */ - FGameplayTag DeadConditionTag; - - /** - * The tag that signifies a character is unconscious. - * - * An MoPRS listens for a tag of this type to be added to or removed from a character in order to fire the - * OnCharacterUnconscious() and OnCharacterConscious(), respectively. - */ - FGameplayTag UnconsciousConditionTag; - /** * Map of handles for callback delegates on condition tags. */ TMap, TMap> ConditionCallbackHandles; public: - // ================================================================================================================= - // Public Constructor - // ================================================================================================================= - /** - * Default constructor for APF2ModeOfPlayRuleSetBase. - */ - explicit APF2ModeOfPlayRuleSetBase(); - // ================================================================================================================= // Public Methods - IPF2ModeOfPlayRuleSetInterface Implementation // ================================================================================================================= diff --git a/Source/OpenPF2GameFramework/Public/PF2CharacterBase.h b/Source/OpenPF2GameFramework/Public/PF2CharacterBase.h index fdf3526f8..5766c1c16 100644 --- a/Source/OpenPF2GameFramework/Public/PF2CharacterBase.h +++ b/Source/OpenPF2GameFramework/Public/PF2CharacterBase.h @@ -172,7 +172,7 @@ class OPENPF2GAMEFRAMEWORK_API APF2CharacterBase : * Each value is a gameplay effect and the key is the weight group of that GE (sorted alphanumerically). The weight * controls the order that all GEs are applied. Lower weights are applied earlier than higher weights. * - * The names of each group are exposed as tags in the "GameplayEffect.WeightGroup" tag list so that they can be + * The names of each group are exposed as tags in the "PF2.GameplayEffect.WeightGroup" tag list so that they can be * applied to GEs by game designers to control the default group that a GE gets added to. A GE can also be * explicitly added to a group via the AddPassiveGameplayEffectWithWeight() method on the Character ASC. */ diff --git a/Source/OpenPF2GameFramework/Public/PF2CharacterConstants.h b/Source/OpenPF2GameFramework/Public/PF2CharacterConstants.h index fef144ae2..af38f8802 100644 --- a/Source/OpenPF2GameFramework/Public/PF2CharacterConstants.h +++ b/Source/OpenPF2GameFramework/Public/PF2CharacterConstants.h @@ -16,7 +16,7 @@ namespace PF2CharacterConstants * Weight groups are evaluated in the order that their names are sorted. Placing different GEs in different groups * allows game designers to control the order that GEs are applied to an OpenPF2 character. * - * For consistency, each name in this list must exactly match a tag in the "GameplayEffect.WeightGroup" group. This + * For consistency, each name in this list must exactly match a tag in the "PF2.GameplayEffect.WeightGroup" group. This * ensures that game designers have the same options for placing a GE in a weight group as exists in backend code. */ namespace GeWeightGroups @@ -24,40 +24,40 @@ namespace PF2CharacterConstants /** * The weight group used for GEs that initialize base stats. */ - static const FName InitializeBaseStats = FName(TEXT("GameplayEffect.WeightGroup.00_InitializeBaseStats")); + static const FName InitializeBaseStats = FName(TEXT("PF2.GameplayEffect.WeightGroup.00_InitializeBaseStats")); /** * The weight group used for GEs provided by the game designer that have to run right after base stats. */ static const FName PostInitializeBaseStats = - FName(TEXT("GameplayEffect.WeightGroup.05_PostInitializeBaseStats")); + FName(TEXT("PF2.GameplayEffect.WeightGroup.05_PostInitializeBaseStats")); /** * The weight group used for GEs generated from other values on this character (managed by ASC logic). */ - static const FName ManagedEffects = FName(TEXT("GameplayEffect.WeightGroup.10_ManagedEffects")); + static const FName ManagedEffects = FName(TEXT("PF2.GameplayEffect.WeightGroup.10_ManagedEffects")); /** * The default weight group for custom, passive GEs from a game designer; applied before ability boosts. */ - static const FName PreAbilityBoosts = FName(TEXT("GameplayEffect.WeightGroup.15_PreAbilityBoosts")); + static const FName PreAbilityBoosts = FName(TEXT("PF2.GameplayEffect.WeightGroup.15_PreAbilityBoosts")); /** * The weight group used for ability boosts selected by the player or a game designer. */ - static const FName AbilityBoosts = FName(TEXT("GameplayEffect.WeightGroup.20_AbilityBoosts")); + static const FName AbilityBoosts = FName(TEXT("PF2.GameplayEffect.WeightGroup.20_AbilityBoosts")); /** * The weight group used for custom GEs provided by the game designer that must run before the last group of * stats GEs. */ - static const FName PreFinalizeStats = FName(TEXT("GameplayEffect.WeightGroup.25_PreFinalizeStats")); + static const FName PreFinalizeStats = FName(TEXT("PF2.GameplayEffect.WeightGroup.25_PreFinalizeStats")); /** * The weight group used for GEs that need to run last because they heavily depend on the results of earlier * GEs. */ - static const FName FinalizeStats = FName(TEXT("GameplayEffect.WeightGroup.30_FinalizeStats")); + static const FName FinalizeStats = FName(TEXT("PF2.GameplayEffect.WeightGroup.30_FinalizeStats")); } /** diff --git a/Source/OpenPF2GameFramework/Public/PF2MonetaryValue.h b/Source/OpenPF2GameFramework/Public/PF2MonetaryValue.h index 6997c17b9..8957b55f1 100644 --- a/Source/OpenPF2GameFramework/Public/PF2MonetaryValue.h +++ b/Source/OpenPF2GameFramework/Public/PF2MonetaryValue.h @@ -7,6 +7,8 @@ #include "GameplayTagContainer.h" +#include "GameplayTags/CurrencyUnits.h" + #include "Utilities/PF2GameplayAbilityUtilities.h" #include "PF2MonetaryValue.generated.h" @@ -49,7 +51,7 @@ struct FPF2MonetaryValue FPF2MonetaryValue(const float Amount, const FGameplayTag MonetaryUnit) : Amount(Amount), MonetaryUnit(MonetaryUnit) { checkf( - PF2GameplayAbilityUtilities::HasTag(&MonetaryUnit.GetSingleTagContainer(), FName("CurrencyUnit")), + MonetaryUnit.MatchesTag(Pf2TagCurrencyUnits), TEXT("Monetary unit must be a CurrencyUnit tag.") ); } diff --git a/Source/OpenPF2Tests/Private/Tests/Abilities/Attacks/PF2SpellAttackRollCalculation.spec.cpp b/Source/OpenPF2Tests/Private/Tests/Abilities/Attacks/PF2SpellAttackRollCalculation.spec.cpp index ee8af3714..82a7ca1aa 100644 --- a/Source/OpenPF2Tests/Private/Tests/Abilities/Attacks/PF2SpellAttackRollCalculation.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/Abilities/Attacks/PF2SpellAttackRollCalculation.spec.cpp @@ -79,7 +79,7 @@ void FPF2SpellAttackRollCalculationsSpec::Define() { BeforeEach([=, this]() { - this->ApplyUnreplicatedTag(FString::Format(TEXT("SpellcastingAbility.{0}"), {SpellAbilityName})); + this->ApplyUnreplicatedTag(TEXT("PF2.SpellcastingAbility.") + SpellAbilityName); }); for (auto& BoostedAbility : this->AllAbilityModifierAttributes) @@ -108,7 +108,7 @@ void FPF2SpellAttackRollCalculationsSpec::Define() BeforeEach([=, this]() { - this->ApplyUnreplicatedTag(FString::Format(TEXT("SpellAttack.{0}"), {ProficiencyLevel})); + this->ApplyUnreplicatedTag(TEXT("PF2.Proficiency.SpellAttack.") + ProficiencyLevel); }); if (SpellAbilityName == BoostedAbilityName) diff --git a/Source/OpenPF2Tests/Private/Tests/CharacterStats/AbilityModifiers/PF2PerceptionModifierCalculation.spec.cpp b/Source/OpenPF2Tests/Private/Tests/CharacterStats/AbilityModifiers/PF2PerceptionModifierCalculation.spec.cpp index 3ee88c2ef..98b0d0848 100644 --- a/Source/OpenPF2Tests/Private/Tests/CharacterStats/AbilityModifiers/PF2PerceptionModifierCalculation.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/CharacterStats/AbilityModifiers/PF2PerceptionModifierCalculation.spec.cpp @@ -114,7 +114,7 @@ void FPF2PerceptionModifierCalculationSpec::VerifyPerceptionModifier(const float const FGameplayAttributeData* PcpAttribute = Attributes[this->PcpModAttributeName]; const TSubclassOf& EffectBP = this->LoadGE(); - this->ApplyUnreplicatedTag(FString::Format(TEXT("Perception.{0}"), {ProficiencyLevel})); + this->ApplyUnreplicatedTag(TEXT("PF2.Proficiency.Perception.") + ProficiencyLevel); this->InitializeAttributeAndApplyEffect(*AbModAttribute, AbModScore, EffectBP); TestEqual( diff --git a/Source/OpenPF2Tests/Private/Tests/CharacterStats/AbilityModifiers/PF2SavingThrowModifierCalculation.spec.cpp b/Source/OpenPF2Tests/Private/Tests/CharacterStats/AbilityModifiers/PF2SavingThrowModifierCalculation.spec.cpp index 775410771..c16205d86 100644 --- a/Source/OpenPF2Tests/Private/Tests/CharacterStats/AbilityModifiers/PF2SavingThrowModifierCalculation.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/CharacterStats/AbilityModifiers/PF2SavingThrowModifierCalculation.spec.cpp @@ -178,7 +178,10 @@ void FPF2SavingThrowModifierCalculationSpec::VerifySavingThrowModifier(const FSt const FGameplayAttributeData* SavingAttribute = Attributes[SavingModAttributeName]; const TSubclassOf& EffectBP = this->LoadGE(); - this->ApplyUnreplicatedTag(FString::Format(TEXT("SavingThrow.{0}.{1}"), {SavingModAttributeFriendlyName, ProficiencyLevel})); + this->ApplyUnreplicatedTag( + FString::Format(TEXT("PF2.Proficiency.SavingThrow.{0}.{1}"), {SavingModAttributeFriendlyName, ProficiencyLevel}) + ); + this->InitializeAttributeAndApplyEffect(*AbModAttribute, AbModScore, EffectBP); TestEqual( diff --git a/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2ArmorClassCalculation.spec.cpp b/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2ArmorClassCalculation.spec.cpp index ab0c752e2..7ac174430 100644 --- a/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2ArmorClassCalculation.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2ArmorClassCalculation.spec.cpp @@ -77,7 +77,7 @@ void FPF2ArmorClassCalculationSpec::Define() { BeforeEach([=, this]() { - this->ApplyUnreplicatedTag(FString::Format(TEXT("Armor.Equipped.{0}"), {ArmorClassEquipped})); + this->ApplyUnreplicatedTag(TEXT("PF2.Equipped.Armor.") + ArmorClassEquipped); }); for (auto& ArmorClassProficient : this->ArmorClasses) @@ -95,7 +95,7 @@ void FPF2ArmorClassCalculationSpec::Define() { this->ApplyUnreplicatedTag( FString::Format( - TEXT("Armor.Category.{0}.{1}"), + TEXT("PF2.Proficiency.Armor.Category.{0}.{1}"), {ArmorClassProficient, ProficiencyLevel} ) ); diff --git a/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2ClassDifficultyClassCalculation.spec.cpp b/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2ClassDifficultyClassCalculation.spec.cpp index f4babb4ae..79e10d7f3 100644 --- a/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2ClassDifficultyClassCalculation.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2ClassDifficultyClassCalculation.spec.cpp @@ -75,7 +75,7 @@ void FPF2ClassDifficultyClassCalculationSpec::Define() { BeforeEach([=, this]() { - this->ApplyUnreplicatedTag(FString::Format(TEXT("KeyAbility.{0}"), {KeyAbilityName})); + this->ApplyUnreplicatedTag(TEXT("PF2.KeyAbility.") + KeyAbilityName); }); for (auto& BoostedAbility : this->AbilityModifierAttributes) @@ -104,7 +104,7 @@ void FPF2ClassDifficultyClassCalculationSpec::Define() BeforeEach([=, this]() { - this->ApplyUnreplicatedTag(FString::Format(TEXT("ClassDc.{0}"), {ProficiencyLevel})); + this->ApplyUnreplicatedTag(TEXT("PF2.Proficiency.ClassDc.") + ProficiencyLevel); }); if (KeyAbilityName == BoostedAbilityName) diff --git a/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2SpellDifficultyClassCalculation.spec.cpp b/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2SpellDifficultyClassCalculation.spec.cpp index 3fa22d92c..71eddf027 100644 --- a/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2SpellDifficultyClassCalculation.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/CharacterStats/PF2SpellDifficultyClassCalculation.spec.cpp @@ -79,7 +79,7 @@ void FPF2SpellDifficultyClassCalculationsSpec::Define() { BeforeEach([=, this]() { - this->ApplyUnreplicatedTag(FString::Format(TEXT("SpellcastingAbility.{0}"), {SpellAbilityName})); + this->ApplyUnreplicatedTag(TEXT("PF2.SpellcastingAbility.") + SpellAbilityName); }); for (auto& BoostedAbility : this->AllAbilityModifierAttributes) @@ -108,7 +108,9 @@ void FPF2SpellDifficultyClassCalculationsSpec::Define() BeforeEach([=, this]() { - this->ApplyUnreplicatedTag(FString::Format(TEXT("SpellDc.{0}"), {ProficiencyLevel})); + this->ApplyUnreplicatedTag( + TEXT("PF2.Proficiency.SpellDc.") + ProficiencyLevel + ); }); if (SpellAbilityName == BoostedAbilityName) diff --git a/Source/OpenPF2Tests/Private/Tests/CharacterStats/Skills/PF2SkillModifierCalculation.spec.cpp b/Source/OpenPF2Tests/Private/Tests/CharacterStats/Skills/PF2SkillModifierCalculation.spec.cpp index d2a1b0890..68e9b7184 100644 --- a/Source/OpenPF2Tests/Private/Tests/CharacterStats/Skills/PF2SkillModifierCalculation.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/CharacterStats/Skills/PF2SkillModifierCalculation.spec.cpp @@ -403,7 +403,10 @@ void FPF2SkillModifierCalculationSpec::VerifySkillModifier(const FString& AbModA const FGameplayAttributeData* SkillAttribute = Attributes[SkillModAttributeName]; const TSubclassOf& EffectBP = this->LoadGE(); - this->ApplyUnreplicatedTag(FString::Format(TEXT("Skill.{0}.{1}"), {SkillModAttributeFriendlyName, ProficiencyLevel})); + this->ApplyUnreplicatedTag( + FString::Format(TEXT("PF2.Proficiency.Skill.{0}.{1}"), {SkillModAttributeFriendlyName, ProficiencyLevel}) + ); + this->InitializeAttributeAndApplyEffect(*AbModAttribute, AbModScore, EffectBP); TestEqual( diff --git a/Source/OpenPF2Tests/Private/Tests/Libraries/PF2TagLibrary.spec.cpp b/Source/OpenPF2Tests/Private/Tests/Libraries/PF2TagLibrary.spec.cpp index 9f270eae4..df3e76dac 100644 --- a/Source/OpenPF2Tests/Private/Tests/Libraries/PF2TagLibrary.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/Libraries/PF2TagLibrary.spec.cpp @@ -3,12 +3,14 @@ // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not // distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. +#include "GameplayTags/Stats/CreatureAlignments.h" +#include "GameplayTags/Stats/CreatureSizes.h" +#include "GameplayTags/Traits/Conditions.h" + #include "Libraries/PF2TagLibrary.h" #include "Tests/PF2SpecBase.h" -#include "Utilities/PF2GameplayAbilityUtilities.h" - BEGIN_DEFINE_PF_SPEC(FPF2TagLibrarySpec, "OpenPF2.Libraries.Tag", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) @@ -16,26 +18,26 @@ END_DEFINE_PF_SPEC(FPF2TagLibrarySpec) void FPF2TagLibrarySpec::Define() { - static const TArray TagNames = { - "CreatureSize.Medium", - "Trait.Condition.Dying.4", - "Trait.Condition.Wounded.3", - "Trait.Condition.Wounded.2", - "CreatureAlignment.Chaotic.Good" + static const TArray Tags = { + Pf2TagCreatureSizeMedium, + Pf2TagTraitConditionDying4, + Pf2TagTraitConditionWounded3, + Pf2TagTraitConditionWounded2, + Pf2TagCreatureAlignmentChaoticGood, }; - static const FGameplayTag DoomedTag = FGameplayTag::RequestGameplayTag("Trait.Condition.Doomed"), - DyingParentTag = FGameplayTag::RequestGameplayTag("Trait.Condition.Dying"), - WoundedParentTag = FGameplayTag::RequestGameplayTag("Trait.Condition.Wounded"), - ConditionTag = FGameplayTag::RequestGameplayTag("Trait.Condition"), - Dying4Tag = FGameplayTag::RequestGameplayTag("Trait.Condition.Dying.4"), - Wounded3Tag = FGameplayTag::RequestGameplayTag("Trait.Condition.Wounded.3"); + static const FGameplayTag DoomedTag = Pf2TagTraitConditionDoomed, + DyingParentTag = Pf2TagTraitConditionDying, + WoundedParentTag = Pf2TagTraitConditionWounded, + ConditionTag = Pf2TagTraitConditions, + Dying4Tag = Pf2TagTraitConditionDying4, + Wounded3Tag = Pf2TagTraitConditionWounded3; static FGameplayTagContainer TagList; - for (const FName& TagName : TagNames) + for (const FGameplayTag& Tag : Tags) { - TagList.AddTag(FGameplayTag::RequestGameplayTag(TagName)); + TagList.AddTag(Tag); } Describe(TEXT("FindChildTag"), [=, this] @@ -73,7 +75,9 @@ void FPF2TagLibrarySpec::Define() FGameplayTag Result; AddExpectedError( - TEXT("More than one child tag \\('Trait\\.Condition\\.Wounded\\.3, Trait\\.Condition\\.Wounded\\.2'\\) matched parent tag \\('Trait\\.Condition\\.Wounded'\\)\\."), + TEXT("More than one child tag \\('PF2\\.Trait\\.Condition\\.Wounded\\.3, " + "PF2\\.Trait\\.Condition\\.Wounded\\.2'\\) matched parent tag " + "\\('PF2\\.Trait\\.Condition\\.Wounded'\\)\\."), EAutomationExpectedErrorFlags::Exact, 1 ); @@ -106,7 +110,9 @@ void FPF2TagLibrarySpec::Define() int8 Result; AddExpectedError( - TEXT("More than one child tag \\('Trait\\.Condition\\.Dying\\.4, Trait\\.Condition\\.Wounded\\.3, Trait\\.Condition\\.Wounded.2'\\) matched parent tag \\('Trait\\.Condition'\\)\\."), + TEXT("More than one child tag \\('PF2\\.Trait\\.Condition\\.Dying\\.4, " + "PF2\\.Trait\\.Condition\\.Wounded\\.3, PF2\\.Trait\\.Condition\\.Wounded.2'\\) matched parent tag " + "\\('PF2\\.Trait\\.Condition'\\)\\."), EAutomationExpectedErrorFlags::Exact, 1 ); @@ -134,7 +140,9 @@ void FPF2TagLibrarySpec::Define() int8 Result; AddExpectedError( - TEXT("More than one child tag \\('Trait\\.Condition\\.Wounded\\.3, Trait\\.Condition\\.Wounded\\.2'\\) matched parent tag \\('Trait\\.Condition\\.Wounded'\\)\\."), + TEXT("More than one child tag \\('PF2\\.Trait\\.Condition\\.Wounded\\.3, " + "PF2\\.Trait\\.Condition\\.Wounded\\.2'\\) matched parent tag " + "\\('PF2\\.Trait\\.Condition\\.Wounded'\\)\\."), EAutomationExpectedErrorFlags::Exact, 1 ); diff --git a/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsDyingRecoveryByCheck.spec.cpp b/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsDyingRecoveryByCheck.spec.cpp index 6545c2a7c..b64650fca 100644 --- a/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsDyingRecoveryByCheck.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsDyingRecoveryByCheck.spec.cpp @@ -3,6 +3,8 @@ // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not // distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. +#include "GameplayTags/Traits/Conditions.h" + #include "Libraries/PF2DiceLibrary.h" #include "ModesOfPlay/Encounter/PF2EncounterModeOfPlayRuleSetBase.h" @@ -191,7 +193,7 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() this->DestroyWorld(); }); - Describe("when a character is starting a turn with a 'Trait_Condition_Dying_1' tag (DC: 10 + 1 = 11)", [=, this] + Describe("when a character is starting a turn with a 'PF2_Trait_Condition_Dying_1' tag (DC: 10 + 1 = 11)", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -210,35 +212,25 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return 6; } ); - Describe("when the character does not have any 'Trait_Condition_Wounded' tags", [=, this] + Describe("when the character does not have any 'PF2_Trait_Condition_Wounded' tags", [=, this] { - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 1 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 1); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_1' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_1' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -247,33 +239,23 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded1_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 2 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 2); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_2' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_2' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -282,33 +264,23 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded2_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 3 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 3); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_3' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_3' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -317,33 +289,23 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded3_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_4' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_4' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -352,29 +314,19 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded4_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("retains the 'Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); }); @@ -389,35 +341,25 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return 13; } ); - Describe("when the character does not have any 'Trait_Condition_Wounded' tags", [=, this] + Describe("when the character does not have any 'PF2_Trait_Condition_Wounded' tags", [=, this] { - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 1 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 1); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_1' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_1' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -426,33 +368,23 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded1_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 2 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 2); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_2' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_2' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -461,33 +393,23 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded2_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 3 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 3); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_3' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_3' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -496,33 +418,23 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded3_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_4' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_4' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -531,29 +443,19 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded4_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("retains the 'Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); }); @@ -568,21 +470,14 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return 1; } ); - It("replaces the 'Trait_Condition_Dying_1' gameplay tag with 'Trait_Condition_Dying_2' on the character", [=, this] + It("replaces the 'PF2_Trait_Condition_Dying_1' gameplay tag with 'PF2_Trait_Condition_Dying_2' on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 2 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 2); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); @@ -596,26 +491,19 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return 20; } ); - It("replaces the 'Trait_Condition_Dying_1' gameplay tag with 'Trait_Condition_Dying_3' on the character", [=, this] + It("replaces the 'PF2_Trait_Condition_Dying_1' gameplay tag with 'PF2_Trait_Condition_Dying_3' on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 3 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 3); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); }); - Describe("when a character is starting a turn with a 'Trait_Condition_Dying_2' tag (DC: 10 + 2 = 12)", [=, this] + Describe("when a character is starting a turn with a 'PF2_Trait_Condition_Dying_2' tag (DC: 10 + 2 = 12)", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -634,35 +522,25 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return 6; } ); - Describe("when the character does not have any 'Trait_Condition_Wounded' tags", [=, this] + Describe("when the character does not have any 'PF2_Trait_Condition_Wounded' tags", [=, this] { - It("removes the 'Trait_Condition_Dying_2' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_2' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 1 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 1); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_1' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_1' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -671,33 +549,23 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded1_Effect })); } ); - It("removes the 'Trait_Condition_Dying_2' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_2' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 2 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 2); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_2' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_2' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -706,33 +574,23 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded2_Effect })); } ); - It("removes the 'Trait_Condition_Dying_2' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_2' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 3 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 3); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_3' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_3' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -741,33 +599,23 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded3_Effect })); } ); - It("removes the 'Trait_Condition_Dying_2' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_2' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_4' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_4' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -776,29 +624,19 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded4_Effect })); } ); - It("removes the 'Trait_Condition_Dying_2' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_2' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("retains the 'Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); }); @@ -813,21 +651,14 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return 9; } ); - It("replaces the 'Trait_Condition_Dying_2' gameplay tag with 'Trait_Condition_Dying_1' on the character", [=, this] + It("replaces the 'PF2_Trait_Condition_Dying_2' gameplay tag with 'PF2_Trait_Condition_Dying_1' on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 1 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 1); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); @@ -841,21 +672,14 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return 13; } ); - It("replaces the 'Trait_Condition_Dying_2' gameplay tag with 'Trait_Condition_Dying_3' on the character", [=, this] + It("replaces the 'PF2_Trait_Condition_Dying_2' gameplay tag with 'PF2_Trait_Condition_Dying_3' on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 3 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 3); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); @@ -871,15 +695,12 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() It("kills the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); }); - Describe("when a character is starting a turn with a 'Trait_Condition_Dying_3' tag (DC: 10 + 3 = 13)", [=, this] + Describe("when a character is starting a turn with a 'PF2_Trait_Condition_Dying_3' tag (DC: 10 + 3 = 13)", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, @@ -898,21 +719,14 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return 6; } ); - It("replaces the 'Trait_Condition_Dying_3' gameplay tag with 'Trait_Condition_Dying_1' on the character", [=, this] + It("replaces the 'PF2_Trait_Condition_Dying_3' gameplay tag with 'PF2_Trait_Condition_Dying_1' on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 1 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 1); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); @@ -926,21 +740,14 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() { return 0; } ); - It("replaces the 'Trait_Condition_Dying_3' gameplay tag with 'Trait_Condition_Dying_2' on the character", [=, this] + It("replaces the 'PF2_Trait_Condition_Dying_3' gameplay tag with 'PF2_Trait_Condition_Dying_2' on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 2 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 2); }); - It("retains the 'Trait_Condition_Unconscious' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Unconscious' gameplay tag on the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); @@ -956,10 +763,7 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() It("kills the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); @@ -975,15 +779,12 @@ void FPF2ConditionsDyingRecoveryByCheck::Define() It("kills the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); }); - Describe("when a character is starting a turn with a 'Trait_Condition_Dying_4' tag (DC: 10 + 4 = 14)", [=, this] + Describe("when a character is starting a turn with a 'PF2_Trait_Condition_Dying_4' tag (DC: 10 + 4 = 14)", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeStartOfTurn, diff --git a/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsDyingRecoveryByHealing.spec.cpp b/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsDyingRecoveryByHealing.spec.cpp index 1d3f9a4cf..ca276eca8 100644 --- a/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsDyingRecoveryByHealing.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsDyingRecoveryByHealing.spec.cpp @@ -8,6 +8,9 @@ #include "CharacterStats/PF2CharacterAttributeSet.h" +#include "GameplayTags/GameplayEffects/SetByCallerParameters.h" +#include "GameplayTags/Traits/Conditions.h" + #include "Tests/PF2SpecBase.h" BEGIN_DEFINE_PF_SPEC(FPF2ConditionsDyingRecoveryByHealing, @@ -133,7 +136,7 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() this->DestroyWorld(); }); - Describe("when a character has a 'Trait_Condition_Dying_1' gameplay tag", [=, this] + Describe("when a character has a 'PF2_Trait_Condition_Dying_1' gameplay tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -144,35 +147,25 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() Describe("when the character receives healing", [=, this] { - Describe("when the character does not have any 'Trait_Condition_Wounded' tags", [=, this] + Describe("when the character does not have any 'PF2_Trait_Condition_Wounded' tags", [=, this] { - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 1 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 1); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_1' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_1' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -181,33 +174,23 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded1_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 2 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 2); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_2' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_2' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -216,33 +199,23 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded2_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 3 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 3); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_3' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_3' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -251,33 +224,23 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded3_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_4' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_4' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -286,35 +249,25 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded4_Effect })); } ); - It("removes the 'Trait_Condition_Dying_1' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_1' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("retains the 'Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); }); }); - Describe("when a character has a 'Trait_Condition_Dying_2' gameplay tag", [=, this] + Describe("when a character has a 'PF2_Trait_Condition_Dying_2' gameplay tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -325,35 +278,25 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() Describe("when the character receives healing", [=, this] { - Describe("when the character does not have any 'Trait_Condition_Wounded' tags", [=, this] + Describe("when the character does not have any 'PF2_Trait_Condition_Wounded' tags", [=, this] { - It("removes the 'Trait_Condition_Dying_2' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_2' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 1 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 1); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_1' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_1' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -362,33 +305,23 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded1_Effect })); } ); - It("removes the 'Trait_Condition_Dying_2' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_2' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 2 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 2); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_2' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_2' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -397,33 +330,23 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded2_Effect })); } ); - It("removes the 'Trait_Condition_Dying_2' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_2' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 3 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 3); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_3' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_3' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -432,33 +355,23 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded3_Effect })); } ); - It("removes the 'Trait_Condition_Dying_2' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_2' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_4' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_4' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -467,35 +380,25 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded4_Effect })); } ); - It("removes the 'Trait_Condition_Dying_2' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_2' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("retains the 'Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); }); }); - Describe("when a character has a 'Trait_Condition_Dying_3' gameplay tag (DC: 10 + 3 = 13)", [=, this] + Describe("when a character has a 'PF2_Trait_Condition_Dying_3' gameplay tag (DC: 10 + 3 = 13)", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -506,35 +409,25 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() Describe("when the character receives healing", [=, this] { - Describe("when the character does not have any 'Trait_Condition_Wounded' tags", [=, this] + Describe("when the character does not have any 'PF2_Trait_Condition_Wounded' tags", [=, this] { - It("removes the 'Trait_Condition_Dying_3' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_3' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_1' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 1 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 1); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_1' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_1' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -543,33 +436,23 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded1_Effect })); } ); - It("removes the 'Trait_Condition_Dying_3' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_3' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_2' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 2 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 2); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_2' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_2' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -578,33 +461,23 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded2_Effect })); } ); - It("removes the 'Trait_Condition_Dying_3' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_3' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_3' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 3 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 3); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_3' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_3' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -613,33 +486,23 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded3_Effect })); } ); - It("removes the 'Trait_Condition_Dying_3' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_3' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("applies the 'Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Wounded_4' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_4' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_4' tag", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -648,35 +511,25 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { return PF2ArrayUtilities::Concatenate(**Previous, TArray({ BP_Wounded4_Effect })); } ); - It("removes the 'Trait_Condition_Dying_3' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Dying_3' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); - It("retains the 'Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] + It("retains the 'PF2_Trait_Condition_Wounded_4' gameplay tag on the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Wounded")), - 4 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionWounded, 4); }); - It("removes the 'Trait_Condition_Unconscious' gameplay tag from the character", [=, this] + It("removes the 'PF2_Trait_Condition_Unconscious' gameplay tag from the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); }); }); }); - Describe("when a character has a 'Trait_Condition_Dying_4' gameplay tag (DC: 10 + 4 = 14)", [=, this] + Describe("when a character has a 'PF2_Trait_Condition_Dying_4' gameplay tag (DC: 10 + 4 = 14)", [=, this] { REDEFINE_LET( GameplayEffectsToApplyBeforeTest, @@ -689,16 +542,8 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() { It("has no effect because the character is already dead", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 4 - ); - - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 4); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); }); @@ -706,13 +551,11 @@ void FPF2ConditionsDyingRecoveryByHealing::Define() void FPF2ConditionsDyingRecoveryByHealing::HealTestCharacter(const float HealingAmount) const { - FGameplayEffectSpecHandle EffectSpecHandle; - - EffectSpecHandle = + const FGameplayEffectSpecHandle EffectSpecHandle = this->BuildEffectSpec( this->HealEffect, { - {"GameplayEffect.Parameter.Healing", HealingAmount}, + {Pf2TagGameplayEffectParameterHealing, HealingAmount}, } ); diff --git a/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsKnockoutAndDeath.spec.cpp b/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsKnockoutAndDeath.spec.cpp index a841490ad..261cee812 100644 --- a/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsKnockoutAndDeath.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/ModesOfPlay/Encounter/Conditions/PF2ConditionsKnockoutAndDeath.spec.cpp @@ -5,6 +5,9 @@ #include "Abilities/PF2DegreeOfSuccess.h" +#include "GameplayTags/Traits/Conditions.h" +#include "GameplayTags/Traits/Effects.h" + #include "Libraries/PF2AttackStatLibrary.h" #include "ModesOfPlay/Encounter/PF2EncounterModeOfPlayRuleSetBase.h" @@ -273,34 +276,25 @@ void FPF2ConditionsKnockoutAndDeath::Define() ); }); - It("does not apply the 'Trait_Condition_Unconscious' gameplay tag to the character", [=, this] + It("does not apply the 'PF2_Trait_Condition_Unconscious' gameplay tag to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); - Describe("when the character does not have any 'Trait_Condition_Wounded' tags", [=, this] + Describe("when the character does not have any 'PF2_Trait_Condition_Wounded' tags", [=, this] { - It("does not apply any 'Trait_Condition_Dying' gameplay tags to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tags to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); It("does not kill the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_1' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_1' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -309,24 +303,18 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded1GeSpec }; } ); - It("does not apply any 'Trait_Condition_Dying' gameplay tags to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tags to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); It("does not kill the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_2' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_2' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -335,24 +323,18 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded2GeSpec }; } ); - It("does not apply any 'Trait_Condition_Dying' gameplay tags to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tags to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); It("does not kill the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_3' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_3' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -361,24 +343,18 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded3GeSpec }; } ); - It("does not apply any 'Trait_Condition_Dying' gameplay tags to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tags to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); It("does not kill the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_4' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_4' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -387,20 +363,14 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded4GeSpec }; } ); - It("does not apply any 'Trait_Condition_Dying' gameplay tags to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tags to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); It("does not kill the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); }); @@ -427,34 +397,25 @@ void FPF2ConditionsKnockoutAndDeath::Define() ); }); - It("does not apply the 'Trait_Condition_Unconscious' gameplay tag to the character", [=, this] + It("does not apply the 'PF2_Trait_Condition_Unconscious' gameplay tag to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); - Describe("when the character does not have any 'Trait_Condition_Wounded' tags", [=, this] + Describe("when the character does not have any 'PF2_Trait_Condition_Wounded' tags", [=, this] { - It("does not apply any 'Trait_Condition_Dying' gameplay tags to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tags to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); It("does not kill the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_1' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_1' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -463,24 +424,18 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded1GeSpec }; } ); - It("does not apply any 'Trait_Condition_Dying' gameplay tags to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tags to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); It("does not kill the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_2' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_2' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -489,24 +444,18 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded2GeSpec }; } ); - It("does not apply any 'Trait_Condition_Dying' gameplay tags to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tags to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); It("does not kill the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_3' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_3' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -515,24 +464,18 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded3GeSpec }; } ); - It("does not apply any 'Trait_Condition_Dying' gameplay tags to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tags to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); It("does not kill the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_4' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_4' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -541,20 +484,14 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded4GeSpec }; } ); - It("does not apply any 'Trait_Condition_Dying' gameplay tags to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tags to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); It("does not kill the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); }); @@ -566,7 +503,7 @@ void FPF2ConditionsKnockoutAndDeath::Define() TagsAppliedToAbilityBeforeAttack, FGameplayTagContainer, [this], - {return FGameplayTagContainer(FGameplayTag::RequestGameplayTag("Trait.Effect.Nonlethal")); } + {return FGameplayTagContainer(Pf2TagTraitEffectNonlethal); } ); It("has no effect on the initiative position of the character", [=, this] @@ -582,20 +519,14 @@ void FPF2ConditionsKnockoutAndDeath::Define() ); }); - It("does not apply the 'Trait_Condition_Unconscious' gameplay tag to the character", [=, this] + It("does not apply the 'PF2_Trait_Condition_Unconscious' gameplay tag to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); - It("does not apply any 'Trait_Condition_Dying' gameplay tag to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tag to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); }); }); @@ -651,27 +582,20 @@ void FPF2ConditionsKnockoutAndDeath::Define() ); }); - It("applies the 'Trait_Condition_Unconscious' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Unconscious' gameplay tag to the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); - Describe("when the character does not have any 'Trait_Condition_Wounded' tags", [=, this] + Describe("when the character does not have any 'PF2_Trait_Condition_Wounded' tags", [=, this] { - It("applies the 'Trait_Condition_Dying_1' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Dying_1' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 1 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 1); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_1' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_1' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -680,17 +604,13 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded1GeSpec }; } ); - It("applies the 'Trait_Condition_Dying_2' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Dying_2' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 2 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 2); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_2' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_2' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -699,17 +619,13 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded2GeSpec }; } ); - It("applies the 'Trait_Condition_Dying_3' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Dying_3' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 3 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 3); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_3' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_3' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -720,14 +636,11 @@ void FPF2ConditionsKnockoutAndDeath::Define() It("kills the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_4' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_4' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -738,10 +651,7 @@ void FPF2ConditionsKnockoutAndDeath::Define() It("kills the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); }); @@ -768,27 +678,20 @@ void FPF2ConditionsKnockoutAndDeath::Define() ); }); - It("applies the 'Trait_Condition_Unconscious' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Unconscious' gameplay tag to the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); - Describe("when the character does not have any 'Trait_Condition_Wounded' tags", [=, this] + Describe("when the character does not have any 'PF2_Trait_Condition_Wounded' tags", [=, this] { - It("applies the 'Trait_Condition_Dying_2' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Dying_2' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 2 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 2); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_1' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_1' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -797,17 +700,13 @@ void FPF2ConditionsKnockoutAndDeath::Define() { return TArray{ *Wounded1GeSpec }; } ); - It("applies the 'Trait_Condition_Dying_3' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Dying_3' gameplay tag to the character", [=, this] { - TestCharacterHasConditionLevel( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")), - 3 - ); + TestCharacterHasConditionLevel(this->TestCharacter, Pf2TagTraitConditionDying, 3); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_2' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_2' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -818,14 +717,11 @@ void FPF2ConditionsKnockoutAndDeath::Define() It("kills the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_3' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_3' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -836,14 +732,11 @@ void FPF2ConditionsKnockoutAndDeath::Define() It("kills the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); - Describe("when the character has the 'Trait_Condition_Wounded_4' tag", [=, this] + Describe("when the character has the 'PF2_Trait_Condition_Wounded_4' tag", [=, this] { REDEFINE_LET( EffectSpecsAppliedToTargetBeforeAttack, @@ -854,10 +747,7 @@ void FPF2ConditionsKnockoutAndDeath::Define() It("kills the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dead")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionDead); }); }); }); @@ -869,7 +759,7 @@ void FPF2ConditionsKnockoutAndDeath::Define() TagsAppliedToAbilityBeforeAttack, FGameplayTagContainer, [this], - {return FGameplayTagContainer(FGameplayTag::RequestGameplayTag("Trait.Effect.Nonlethal")); } + {return FGameplayTagContainer(Pf2TagTraitEffectNonlethal); } ); It("moves the initiative position of the character directly before the turn in which they were reduced to 0 HP", [=, this] @@ -885,20 +775,14 @@ void FPF2ConditionsKnockoutAndDeath::Define() ); }); - It("applies the 'Trait_Condition_Unconscious' gameplay tag to the character", [=, this] + It("applies the 'PF2_Trait_Condition_Unconscious' gameplay tag to the character", [=, this] { - TestCharacterHasCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Unconscious")) - ); + TestCharacterHasCondition(this->TestCharacter, Pf2TagTraitConditionUnconscious); }); - It("does not apply any 'Trait_Condition_Dying' gameplay tag to the character", [=, this] + It("does not apply any 'PF2_Trait_Condition_Dying' gameplay tag to the character", [=, this] { - TestCharacterNotHaveCondition( - this->TestCharacter, - FGameplayTag::RequestGameplayTag(TEXT("Trait.Condition.Dying")) - ); + TestCharacterNotHaveCondition(this->TestCharacter, Pf2TagTraitConditionDying); }); }); }); @@ -926,7 +810,7 @@ void FPF2ConditionsKnockoutAndDeath::ApplyDamageToTestCharacter( Attacker, AttackAbility, { - {"GameplayEffect.Parameter.Damage", DamageAmount}, + {"PF2.GameplayEffect.Parameter.Damage", DamageAmount}, } ); diff --git a/Source/OpenPF2Tests/Private/Tests/PF2KeyAbilityBoost.spec.cpp b/Source/OpenPF2Tests/Private/Tests/PF2KeyAbilityBoost.spec.cpp index 16437c1db..04fefa92f 100644 --- a/Source/OpenPF2Tests/Private/Tests/PF2KeyAbilityBoost.spec.cpp +++ b/Source/OpenPF2Tests/Private/Tests/PF2KeyAbilityBoost.spec.cpp @@ -57,7 +57,7 @@ void FKeyAbilityBoostSpec::Define() const UPF2CharacterAttributeSet* AttributeSet = this->TestPawnAsc->GetSet(); FAttributeCapture Attributes = CaptureAbilityAttributes(AttributeSet); FGameplayAttributeData* KeyAbilityAttribute = Attributes[KeyAbilityAttributeName]; - const FString TagName = FString::Format(TEXT("KeyAbility.{0}"), {KeyAbilityName}); + const FString TagName = TEXT("PF2.KeyAbility.") + KeyAbilityName; const TSubclassOf& EffectBP = this->LoadGE(); // Start all attributes from a known value. diff --git a/Source/OpenPF2Tests/Private/Tests/PF2SpecBase.cpp b/Source/OpenPF2Tests/Private/Tests/PF2SpecBase.cpp index bb14beb7a..46ac9253c 100644 --- a/Source/OpenPF2Tests/Private/Tests/PF2SpecBase.cpp +++ b/Source/OpenPF2Tests/Private/Tests/PF2SpecBase.cpp @@ -192,19 +192,15 @@ FActiveGameplayEffectHandle FPF2SpecBase::ApplyGameplayEffectToTestCharacter( FGameplayEffectSpecHandle FPF2SpecBase::BuildEffectSpec( const TSubclassOf& EffectClass, - const TMap& SetByCallerMagnitudesMap) const + const TMap& SetByCallerMagnitudesMap) const { - FGameplayEffectSpecHandle EffectSpec; - - EffectSpec = this->TestCharacterAsc->MakeOutgoingSpec(EffectClass, 1.0, FGameplayEffectContextHandle()); + FGameplayEffectSpecHandle EffectSpec = + this->TestCharacterAsc->MakeOutgoingSpec(EffectClass, 1.0, FGameplayEffectContextHandle()); for (const auto& [ParameterTag, ParameterValue] : SetByCallerMagnitudesMap) { - EffectSpec = UAbilitySystemBlueprintLibrary::AssignTagSetByCallerMagnitude( - EffectSpec, - FGameplayTag::RequestGameplayTag(ParameterTag), - ParameterValue - ); + EffectSpec = + UAbilitySystemBlueprintLibrary::AssignTagSetByCallerMagnitude(EffectSpec, ParameterTag, ParameterValue); } return EffectSpec; diff --git a/Source/OpenPF2Tests/Public/Tests/PF2SpecBase.h b/Source/OpenPF2Tests/Public/Tests/PF2SpecBase.h index 2dba786e6..95504d206 100644 --- a/Source/OpenPF2Tests/Public/Tests/PF2SpecBase.h +++ b/Source/OpenPF2Tests/Public/Tests/PF2SpecBase.h @@ -341,14 +341,14 @@ class OPENPF2TESTS_API FPF2SpecBase : public FEnhancedAutomationSpecBase * @param EffectClass * The type of GE for which a spec is desired. * @param SetByCallerMagnitudesMap - * An optional map of set-by-caller-magnitudes/parameters to parameters, to pass into the GE. + * An optional map of set-by-caller-magnitudes/parameters to parameter values, to pass into the GE. * * @return * The server-side handle of the GE specification. */ FGameplayEffectSpecHandle BuildEffectSpec( const TSubclassOf& EffectClass, - const TMap& SetByCallerMagnitudesMap = {}) const; + const TMap& SetByCallerMagnitudesMap = {}) const; /** * Builds a Gameplay Effect (GE) specification for the given GE type, instigated by the given ability and character. @@ -516,7 +516,7 @@ class OPENPF2TESTS_API FPF2SpecBase : public FEnhancedAutomationSpecBase * @param Character * The character to test. * @param ConditionTag - * The parent condition level tag (e.g., "Trait.Condition.Dying", "Trait.Condition.Wounded", etc.). + * The parent condition level tag (e.g., "PF2.Trait.Condition.Dying", "PF2.Trait.Condition.Wounded", etc.). */ void TestCharacterHasCondition( const TScriptInterface& Character, @@ -534,7 +534,7 @@ class OPENPF2TESTS_API FPF2SpecBase : public FEnhancedAutomationSpecBase * @param AbilitySystemComponent * The ASC to test. * @param ConditionTag - * The parent condition level tag (e.g., "Trait.Condition.Dying", "Trait.Condition.Wounded", etc.). + * The parent condition level tag (e.g., "PF2.Trait.Condition.Dying", "PF2.Trait.Condition.Wounded", etc.). */ void TestAscHasCondition( const FString& WhatAsc, @@ -550,7 +550,7 @@ class OPENPF2TESTS_API FPF2SpecBase : public FEnhancedAutomationSpecBase * @param Character * The character to test. * @param ConditionTag - * The parent condition level tag (e.g., "Trait.Condition.Dying", "Trait.Condition.Wounded", etc.). + * The parent condition level tag (e.g., "PF2.Trait.Condition.Dying", "PF2.Trait.Condition.Wounded", etc.). */ void TestCharacterNotHaveCondition( const TScriptInterface& Character, @@ -567,7 +567,7 @@ class OPENPF2TESTS_API FPF2SpecBase : public FEnhancedAutomationSpecBase * @param AbilitySystemComponent * The ASC to test. * @param ConditionTag - * The parent condition level tag (e.g., "Trait.Condition.Dying", "Trait.Condition.Wounded", etc.). + * The parent condition level tag (e.g., "PF2.Trait.Condition.Dying", "PF2.Trait.Condition.Wounded", etc.). */ void TestAscNotHaveCondition( const FString& WhatAsc, @@ -580,7 +580,7 @@ class OPENPF2TESTS_API FPF2SpecBase : public FEnhancedAutomationSpecBase * @param Character * The character to test. * @param ParentTag - * The parent condition level tag (e.g., "Trait.Condition.Dying", "Trait.Condition.Wounded", etc.). + * The parent condition level tag (e.g., "PF2.Trait.Condition.Dying", "PF2.Trait.Condition.Wounded", etc.). * @param ExpectedLevel * The condition level expected for the tag. */ @@ -597,7 +597,7 @@ class OPENPF2TESTS_API FPF2SpecBase : public FEnhancedAutomationSpecBase * @param AbilitySystemComponent * The ASC to test. * @param ParentTag - * The parent condition level tag (e.g., "Trait.Condition.Dying", "Trait.Condition.Wounded", etc.). + * The parent condition level tag (e.g., "PF2.Trait.Condition.Dying", "PF2.Trait.Condition.Wounded", etc.). * @param ExpectedLevel * The condition level expected for the tag. */