diff --git a/Config/DefaultGameplayTags.ini b/Config/DefaultGameplayTags.ini index e067393..1934d36 100644 --- a/Config/DefaultGameplayTags.ini +++ b/Config/DefaultGameplayTags.ini @@ -9,4 +9,5 @@ InvalidTagCharacters="\"\'," NumBitsForContainerSize=6 NetIndexFirstBitSegment=16 +GameplayTagList=(Tag="GameplayCue.Ability.Hero1.PuhBack",DevComment="") ++GameplayTagList=(Tag="GameplayCue.Ability.Hero1.Shield",DevComment="") diff --git a/Config/Game/Hero1_Attributes.csv b/Config/Game/Hero1_Attributes.csv new file mode 100644 index 0000000..991383f --- /dev/null +++ b/Config/Game/Hero1_Attributes.csv @@ -0,0 +1,3 @@ +---,1.000000 +MaxStamina,1000.000000 +StaminaRegen,10.000000 diff --git a/Content/Characters/Abilities/Death/GA_Character_Death.uasset b/Content/Characters/Abilities/Death/GA_Character_Death.uasset index ba7057a..ca8dd47 100644 Binary files a/Content/Characters/Abilities/Death/GA_Character_Death.uasset and b/Content/Characters/Abilities/Death/GA_Character_Death.uasset differ diff --git a/Content/Characters/Abilities/Revive/GA_Character_Revive.uasset b/Content/Characters/Abilities/Revive/GA_Character_Revive.uasset index 6e72ff1..c5f1a32 100644 Binary files a/Content/Characters/Abilities/Revive/GA_Character_Revive.uasset and b/Content/Characters/Abilities/Revive/GA_Character_Revive.uasset differ diff --git a/Content/Characters/BP_Character.uasset b/Content/Characters/BP_Character.uasset index 985bb7b..d99eba5 100644 Binary files a/Content/Characters/BP_Character.uasset and b/Content/Characters/BP_Character.uasset differ diff --git a/Content/Characters/Children/Creature1/BP_Creature1.uasset b/Content/Characters/Children/Creature1/BP_Creature1.uasset index 86c02b0..750342d 100644 Binary files a/Content/Characters/Children/Creature1/BP_Creature1.uasset and b/Content/Characters/Children/Creature1/BP_Creature1.uasset differ diff --git a/Content/Characters/Children/Creature2/BP_Creature2.uasset b/Content/Characters/Children/Creature2/BP_Creature2.uasset index b0d332b..454bd1d 100644 Binary files a/Content/Characters/Children/Creature2/BP_Creature2.uasset and b/Content/Characters/Children/Creature2/BP_Creature2.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/Ability3/GA_Hero1_Ability3.uasset b/Content/Characters/Children/Hero1/Abilities/Ability3/GA_Hero1_Ability3.uasset deleted file mode 100644 index 9c58c6d..0000000 Binary files a/Content/Characters/Children/Hero1/Abilities/Ability3/GA_Hero1_Ability3.uasset and /dev/null differ diff --git a/Content/Characters/Children/Hero1/Abilities/Blast/AM_Hero1_Blast.uasset b/Content/Characters/Children/Hero1/Abilities/Blast/AM_Hero1_Blast.uasset new file mode 100644 index 0000000..654e440 Binary files /dev/null and b/Content/Characters/Children/Hero1/Abilities/Blast/AM_Hero1_Blast.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/Blast/AN_Hero1_Blast.uasset b/Content/Characters/Children/Hero1/Abilities/Blast/AN_Hero1_Blast.uasset new file mode 100644 index 0000000..c8d7d96 Binary files /dev/null and b/Content/Characters/Children/Hero1/Abilities/Blast/AN_Hero1_Blast.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/Blast/GA_Hero1_Blast.uasset b/Content/Characters/Children/Hero1/Abilities/Blast/GA_Hero1_Blast.uasset new file mode 100644 index 0000000..321b3af Binary files /dev/null and b/Content/Characters/Children/Hero1/Abilities/Blast/GA_Hero1_Blast.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/PushBack/GC_Hero1_PushBack.uasset b/Content/Characters/Children/Hero1/Abilities/Blast/GC_Hero1_Blast_Area.uasset similarity index 57% rename from Content/Characters/Children/Hero1/Abilities/PushBack/GC_Hero1_PushBack.uasset rename to Content/Characters/Children/Hero1/Abilities/Blast/GC_Hero1_Blast_Area.uasset index 143d639..9e087ab 100644 Binary files a/Content/Characters/Children/Hero1/Abilities/PushBack/GC_Hero1_PushBack.uasset and b/Content/Characters/Children/Hero1/Abilities/Blast/GC_Hero1_Blast_Area.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/Blast/GE_Hero1_Blast_Target.uasset b/Content/Characters/Children/Hero1/Abilities/Blast/GE_Hero1_Blast_Target.uasset new file mode 100644 index 0000000..13ed499 Binary files /dev/null and b/Content/Characters/Children/Hero1/Abilities/Blast/GE_Hero1_Blast_Target.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/Blast/VFX_Hero1_Blast_Area.uasset b/Content/Characters/Children/Hero1/Abilities/Blast/VFX_Hero1_Blast_Area.uasset new file mode 100644 index 0000000..2cfdb18 Binary files /dev/null and b/Content/Characters/Children/Hero1/Abilities/Blast/VFX_Hero1_Blast_Area.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/Jump/GA_Hero1_Jump.uasset b/Content/Characters/Children/Hero1/Abilities/Jump/GA_Hero1_Jump.uasset index 6499a61..fade22b 100644 Binary files a/Content/Characters/Children/Hero1/Abilities/Jump/GA_Hero1_Jump.uasset and b/Content/Characters/Children/Hero1/Abilities/Jump/GA_Hero1_Jump.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/PushBack/AM_Hero1_PushBack.uasset b/Content/Characters/Children/Hero1/Abilities/PushBack/AM_Hero1_PushBack.uasset deleted file mode 100644 index 3bb3639..0000000 Binary files a/Content/Characters/Children/Hero1/Abilities/PushBack/AM_Hero1_PushBack.uasset and /dev/null differ diff --git a/Content/Characters/Children/Hero1/Abilities/PushBack/GA_Hero1_PushBack.uasset b/Content/Characters/Children/Hero1/Abilities/PushBack/GA_Hero1_PushBack.uasset deleted file mode 100644 index f0294b5..0000000 Binary files a/Content/Characters/Children/Hero1/Abilities/PushBack/GA_Hero1_PushBack.uasset and /dev/null differ diff --git a/Content/Characters/Children/Hero1/Abilities/PushBack/MI_Hero1_Pushback_Area.uasset b/Content/Characters/Children/Hero1/Abilities/PushBack/MI_Hero1_Pushback_Area.uasset deleted file mode 100644 index dd8250a..0000000 Binary files a/Content/Characters/Children/Hero1/Abilities/PushBack/MI_Hero1_Pushback_Area.uasset and /dev/null differ diff --git a/Content/Characters/Children/Hero1/Abilities/PushBack/VFX_Hero1_PushBack_Area.uasset b/Content/Characters/Children/Hero1/Abilities/PushBack/VFX_Hero1_PushBack_Area.uasset deleted file mode 100644 index 162580a..0000000 Binary files a/Content/Characters/Children/Hero1/Abilities/PushBack/VFX_Hero1_PushBack_Area.uasset and /dev/null differ diff --git a/Content/Characters/Children/Hero1/Abilities/Shield/GA_Hero1_Shield.uasset b/Content/Characters/Children/Hero1/Abilities/Shield/GA_Hero1_Shield.uasset new file mode 100644 index 0000000..31a3309 Binary files /dev/null and b/Content/Characters/Children/Hero1/Abilities/Shield/GA_Hero1_Shield.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/Shield/GC_Hero1_Shield.uasset b/Content/Characters/Children/Hero1/Abilities/Shield/GC_Hero1_Shield.uasset new file mode 100644 index 0000000..cf29839 Binary files /dev/null and b/Content/Characters/Children/Hero1/Abilities/Shield/GC_Hero1_Shield.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/Shield/GE_Hero1_Shield.uasset b/Content/Characters/Children/Hero1/Abilities/Shield/GE_Hero1_Shield.uasset new file mode 100644 index 0000000..86c9dc2 Binary files /dev/null and b/Content/Characters/Children/Hero1/Abilities/Shield/GE_Hero1_Shield.uasset differ diff --git a/Content/Characters/Children/Hero1/Abilities/Shield/VFX_Hero1_Shield.uasset b/Content/Characters/Children/Hero1/Abilities/Shield/VFX_Hero1_Shield.uasset new file mode 100644 index 0000000..34f4d2a Binary files /dev/null and b/Content/Characters/Children/Hero1/Abilities/Shield/VFX_Hero1_Shield.uasset differ diff --git a/Content/Characters/Children/Hero1/Attributes/CT_Hero1_Attributes.uasset b/Content/Characters/Children/Hero1/Attributes/CT_Hero1_Attributes.uasset new file mode 100644 index 0000000..1e35364 Binary files /dev/null and b/Content/Characters/Children/Hero1/Attributes/CT_Hero1_Attributes.uasset differ diff --git a/Content/Characters/Children/Hero1/Attributes/GE_Hero1_Attributes.uasset b/Content/Characters/Children/Hero1/Attributes/GE_Hero1_Attributes.uasset new file mode 100644 index 0000000..dfa35dc Binary files /dev/null and b/Content/Characters/Children/Hero1/Attributes/GE_Hero1_Attributes.uasset differ diff --git a/Content/Characters/Children/Hero1/BP_Hero1.uasset b/Content/Characters/Children/Hero1/BP_Hero1.uasset index aaac6cf..25029fe 100644 Binary files a/Content/Characters/Children/Hero1/BP_Hero1.uasset and b/Content/Characters/Children/Hero1/BP_Hero1.uasset differ diff --git a/Content/Characters/Children/Hero1/Effects/GE_Hero1.uasset b/Content/Characters/Children/Hero1/Effects/GE_Hero1.uasset deleted file mode 100644 index 41a1b1c..0000000 Binary files a/Content/Characters/Children/Hero1/Effects/GE_Hero1.uasset and /dev/null differ diff --git a/Content/Characters/Children/Hero2/BP_Hero2.uasset b/Content/Characters/Children/Hero2/BP_Hero2.uasset index 208fcd2..46edd7a 100644 Binary files a/Content/Characters/Children/Hero2/BP_Hero2.uasset and b/Content/Characters/Children/Hero2/BP_Hero2.uasset differ diff --git a/Content/Core/Debug/Cheats/AM_Cheat_PlayAnim.uasset b/Content/Core/Debug/Cheats/AM_Cheat_PlayAnim.uasset deleted file mode 100644 index 387f7f0..0000000 Binary files a/Content/Core/Debug/Cheats/AM_Cheat_PlayAnim.uasset and /dev/null differ diff --git a/Content/Core/Debug/Cheats/GA_Cheat_DoubleJump.uasset b/Content/Core/Debug/Cheats/GA_Cheat_DoubleJump.uasset deleted file mode 100644 index 68646f9..0000000 Binary files a/Content/Core/Debug/Cheats/GA_Cheat_DoubleJump.uasset and /dev/null differ diff --git a/Content/Core/Debug/Cheats/GA_Cheat_PlayMontage.uasset b/Content/Core/Debug/Cheats/GA_Cheat_PlayMontage.uasset deleted file mode 100644 index 223cc71..0000000 Binary files a/Content/Core/Debug/Cheats/GA_Cheat_PlayMontage.uasset and /dev/null differ diff --git a/Content/Core/Debug/Cheats/GE_Cheat_Cooldown.uasset b/Content/Core/Debug/Cheats/GE_Cheat_Cooldown.uasset new file mode 100644 index 0000000..def697d Binary files /dev/null and b/Content/Core/Debug/Cheats/GE_Cheat_Cooldown.uasset differ diff --git a/Content/Core/Debug/Cheats/GE_Cheat_Cost.uasset b/Content/Core/Debug/Cheats/GE_Cheat_Cost.uasset new file mode 100644 index 0000000..01e8b92 Binary files /dev/null and b/Content/Core/Debug/Cheats/GE_Cheat_Cost.uasset differ diff --git a/Content/Core/Debug/Cheats/GE_Cheat_Ghost.uasset b/Content/Core/Debug/Cheats/GE_Cheat_Ghost.uasset index 81d0eaf..a8ba546 100644 Binary files a/Content/Core/Debug/Cheats/GE_Cheat_Ghost.uasset and b/Content/Core/Debug/Cheats/GE_Cheat_Ghost.uasset differ diff --git a/Content/Core/Debug/Cheats/GE_Cheat_God.uasset b/Content/Core/Debug/Cheats/GE_Cheat_God.uasset index 40b7eb2..6bb0693 100644 Binary files a/Content/Core/Debug/Cheats/GE_Cheat_God.uasset and b/Content/Core/Debug/Cheats/GE_Cheat_God.uasset differ diff --git a/Content/Core/Debug/Cheats/GE_Cheat_Immobilize.uasset b/Content/Core/Debug/Cheats/GE_Cheat_Immobilize.uasset index 1e0ad02..af4f266 100644 Binary files a/Content/Core/Debug/Cheats/GE_Cheat_Immobilize.uasset and b/Content/Core/Debug/Cheats/GE_Cheat_Immobilize.uasset differ diff --git a/Content/Core/Debug/Cheats/GE_Cheat_Slow.uasset b/Content/Core/Debug/Cheats/GE_Cheat_Slow.uasset index 85187f3..a3e1186 100644 Binary files a/Content/Core/Debug/Cheats/GE_Cheat_Slow.uasset and b/Content/Core/Debug/Cheats/GE_Cheat_Slow.uasset differ diff --git a/Content/Core/Debug/Cheats/GE_Cheat_Stun.uasset b/Content/Core/Debug/Cheats/GE_Cheat_Stun.uasset index d55a400..0d12f43 100644 Binary files a/Content/Core/Debug/Cheats/GE_Cheat_Stun.uasset and b/Content/Core/Debug/Cheats/GE_Cheat_Stun.uasset differ diff --git a/Content/Core/Debug/DA_Debug_Abilities.uasset b/Content/Core/Debug/DA_Debug_Abilities.uasset index 71d060f..39fa80f 100644 Binary files a/Content/Core/Debug/DA_Debug_Abilities.uasset and b/Content/Core/Debug/DA_Debug_Abilities.uasset differ diff --git a/Content/Core/Debug/DA_Debug_Cheats.uasset b/Content/Core/Debug/DA_Debug_Cheats.uasset index 551b7d8..9d53ecd 100644 Binary files a/Content/Core/Debug/DA_Debug_Cheats.uasset and b/Content/Core/Debug/DA_Debug_Cheats.uasset differ diff --git a/Content/Core/Debug/DA_Debug_Pools.uasset b/Content/Core/Debug/DA_Debug_Pools.uasset index 410e49c..2332c28 100644 Binary files a/Content/Core/Debug/DA_Debug_Pools.uasset and b/Content/Core/Debug/DA_Debug_Pools.uasset differ diff --git a/Content/Core/Effects/BP_PoolRegen_Health.uasset b/Content/Core/Effects/BP_PoolRegen_Health.uasset new file mode 100644 index 0000000..ebb9981 Binary files /dev/null and b/Content/Core/Effects/BP_PoolRegen_Health.uasset differ diff --git a/Content/Core/Effects/BP_PoolRegen_Stamina.uasset b/Content/Core/Effects/BP_PoolRegen_Stamina.uasset new file mode 100644 index 0000000..793dc64 Binary files /dev/null and b/Content/Core/Effects/BP_PoolRegen_Stamina.uasset differ diff --git a/Content/Core/Effects/GE_Cooldown.uasset b/Content/Core/Effects/GE_Cooldown.uasset new file mode 100644 index 0000000..f16387f Binary files /dev/null and b/Content/Core/Effects/GE_Cooldown.uasset differ diff --git a/Content/Core/Effects/GE_Cost_Stamina.uasset b/Content/Core/Effects/GE_Cost_Stamina.uasset new file mode 100644 index 0000000..117b77e Binary files /dev/null and b/Content/Core/Effects/GE_Cost_Stamina.uasset differ diff --git a/Content/Core/Effects/GE_Regen.uasset b/Content/Core/Effects/GE_Regen.uasset new file mode 100644 index 0000000..e6be213 Binary files /dev/null and b/Content/Core/Effects/GE_Regen.uasset differ diff --git a/Content/Core/IKRetargeter_Mixamo.uasset b/Content/Core/IKRetargeter_Mixamo.uasset new file mode 100644 index 0000000..84604f3 Binary files /dev/null and b/Content/Core/IKRetargeter_Mixamo.uasset differ diff --git a/Content/Core/Mannequins/Animations/ABP_Manny.uasset b/Content/Core/Mannequins/Animations/ABP_Manny.uasset index 161c15c..d03ac0f 100644 Binary files a/Content/Core/Mannequins/Animations/ABP_Manny.uasset and b/Content/Core/Mannequins/Animations/ABP_Manny.uasset differ diff --git a/Content/Core/Materials/M_Basic_Additive.uasset b/Content/Core/Materials/M_Basic_Additive.uasset deleted file mode 100644 index 5560527..0000000 Binary files a/Content/Core/Materials/M_Basic_Additive.uasset and /dev/null differ diff --git a/Content/Core/Materials/M_Basic_Solid.uasset b/Content/Core/Materials/M_Basic_Solid.uasset deleted file mode 100644 index 0df20fd..0000000 Binary files a/Content/Core/Materials/M_Basic_Solid.uasset and /dev/null differ diff --git a/Content/Core/Materials/M_Basic_Translucent.uasset b/Content/Core/Materials/M_Basic_Translucent.uasset deleted file mode 100644 index 9539266..0000000 Binary files a/Content/Core/Materials/M_Basic_Translucent.uasset and /dev/null differ diff --git a/Content/Core/Materials/M_Particle_Additive.uasset b/Content/Core/Materials/M_Particle_Additive.uasset new file mode 100644 index 0000000..004dd5e Binary files /dev/null and b/Content/Core/Materials/M_Particle_Additive.uasset differ diff --git a/Content/Core/Materials/M_Particle_Solid.uasset b/Content/Core/Materials/M_Particle_Solid.uasset new file mode 100644 index 0000000..83ce3e0 Binary files /dev/null and b/Content/Core/Materials/M_Particle_Solid.uasset differ diff --git a/Content/Core/Materials/M_Particle_Translucent.uasset b/Content/Core/Materials/M_Particle_Translucent.uasset new file mode 100644 index 0000000..60e0f14 Binary files /dev/null and b/Content/Core/Materials/M_Particle_Translucent.uasset differ diff --git a/Content/__ExternalActors__/Maps/L_Default/5/88/NDHUEK1ROBM2RCW7ZU51MM.uasset b/Content/__ExternalActors__/Maps/L_Default/5/88/NDHUEK1ROBM2RCW7ZU51MM.uasset index 2fadfcc..165bcb7 100644 Binary files a/Content/__ExternalActors__/Maps/L_Default/5/88/NDHUEK1ROBM2RCW7ZU51MM.uasset and b/Content/__ExternalActors__/Maps/L_Default/5/88/NDHUEK1ROBM2RCW7ZU51MM.uasset differ diff --git a/Content/__ExternalActors__/Maps/L_Default/6/U3/6O7DJ03I0JB041XHH0L21L.uasset b/Content/__ExternalActors__/Maps/L_Default/6/U3/6O7DJ03I0JB041XHH0L21L.uasset index 5ea5f7c..68bcb71 100644 Binary files a/Content/__ExternalActors__/Maps/L_Default/6/U3/6O7DJ03I0JB041XHH0L21L.uasset and b/Content/__ExternalActors__/Maps/L_Default/6/U3/6O7DJ03I0JB041XHH0L21L.uasset differ diff --git a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Selection.cpp b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Selection.cpp index 3c5dc23..99108d4 100644 --- a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Selection.cpp +++ b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Selection.cpp @@ -393,7 +393,7 @@ bool UCogEngineWindow_Selection::ComputeBoundingBoxScreenPosition(const APlayerC //-------------------------------------------------------------------------------------------------------------------------- void UCogEngineWindow_Selection::DrawMainMenuWidget(bool Draw, float& Width) { - const float PickButtonWidth = FCogWindowWidgets::GetFontWidth() * 5; + const float PickButtonWidth = FCogWindowWidgets::GetFontWidth() * 6; const float SelectionButtonWidth = FCogWindowWidgets::GetFontWidth() * 30; const float ResetButtonWidth = FCogWindowWidgets::GetFontWidth() * 2; Width = PickButtonWidth + SelectionButtonWidth + ResetButtonWidth; diff --git a/Plugins/CogImgui/Source/CogImgui/Private/CogImguiWidget.cpp b/Plugins/CogImgui/Source/CogImgui/Private/CogImguiWidget.cpp index 38b5175..c12ec3a 100644 --- a/Plugins/CogImgui/Source/CogImgui/Private/CogImguiWidget.cpp +++ b/Plugins/CogImgui/Source/CogImgui/Private/CogImguiWidget.cpp @@ -454,7 +454,11 @@ FReply SCogImguiWidget::OnMouseMove(const FGeometry& MyGeometry, const FPointerE //-------------------------------------------------------------------------------------------------------------------------- FReply SCogImguiWidget::OnFocusReceived(const FGeometry& MyGeometry, const FFocusEvent& FocusEvent) { - return Super::OnFocusReceived(MyGeometry, FocusEvent); + Super::OnFocusReceived(MyGeometry, FocusEvent); + + FSlateApplication::Get().ResetToDefaultPointerInputSettings(); + + return FReply::Handled(); } //-------------------------------------------------------------------------------------------------------------------------- diff --git a/Source/CogSample/CogSample.Build.cs b/Source/CogSample/CogSample.Build.cs index 04328f7..3c0691b 100644 --- a/Source/CogSample/CogSample.Build.cs +++ b/Source/CogSample/CogSample.Build.cs @@ -13,6 +13,7 @@ public class CogSample : ModuleRules "CoreUObject", "Engine", "EnhancedInput", + "GameplayTasks", "GameplayAbilities", "GameplayTags", "HeadMountedDisplay", diff --git a/Source/CogSample/CogSampleAttributeSet_Caster.cpp b/Source/CogSample/CogSampleAttributeSet_Caster.cpp new file mode 100644 index 0000000..1b0e727 --- /dev/null +++ b/Source/CogSample/CogSampleAttributeSet_Caster.cpp @@ -0,0 +1,132 @@ +#include "CogSampleAttributeSet_Caster.h" + +#include "Net/Core/PushModel/PushModel.h" +#include "Net/UnrealNetwork.h" + +//-------------------------------------------------------------------------------------------------------------------------- +UCogSampleAttributeSet_Caster::UCogSampleAttributeSet_Caster() +{ + InitBaseDamage(100.0f); + InitCooldownReduction(0.0f); + InitAreaRadiusModifier(0.0f); + InitMinStamina(-500.0f); + InitStamina(1000.0f); + InitMaxStamina(1000.0f); + InitStaminaRegen(1.0f); + InitStaminaCostReduction(0.0f); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + FDoRepLifetimeParams Params; + Params.bIsPushBased = true; + Params.RepNotifyCondition = REPNOTIFY_Always; + + DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Caster, BaseDamage, Params); + DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Caster, CooldownReduction, Params); + DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Caster, AreaRadiusModifier, Params); + DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Caster, Stamina, Params); + DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Caster, MinStamina, Params); + DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Caster, MaxStamina, Params); + DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Caster, StaminaRegen, Params); + DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Caster, StaminaCostReduction, Params); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::OnRep_BaseDamage(const FGameplayAttributeData& PrevBaseDamage) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Caster, BaseDamage, PrevBaseDamage); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::OnRep_CooldownReduction(const FGameplayAttributeData& PrevCooldownReduction) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Caster, CooldownReduction, PrevCooldownReduction); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::OnRep_AreaRadiusModifier(const FGameplayAttributeData& PrevAreaRadiusModifier) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Caster, AreaRadiusModifier, PrevAreaRadiusModifier); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::OnRep_Stamina(const FGameplayAttributeData& PrevStamina) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Caster, Stamina, PrevStamina); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::OnRep_MinStamina(const FGameplayAttributeData& PrevMinStamina) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Caster, MinStamina, PrevMinStamina); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::OnRep_MaxStamina(const FGameplayAttributeData& PrevMaxStamina) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Caster, MaxStamina, PrevMaxStamina); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::OnRep_StaminaRegen(const FGameplayAttributeData& PrevStaminaRegen) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Caster, StaminaRegen, PrevStaminaRegen); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::OnRep_StaminaCostReduction(const FGameplayAttributeData& PrevStaminaCostReduction) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Caster, StaminaCostReduction, PrevStaminaCostReduction); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::PreAttributeBaseChange(const FGameplayAttribute& Attribute, float& NewValue) const +{ + Super::PreAttributeBaseChange(Attribute, NewValue); + + if (Attribute == GetStaminaAttribute()) + { + NewValue = FMath::Clamp(NewValue, GetMinStamina(), GetMaxStamina()); + } +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) +{ + Super::PreAttributeChange(Attribute, NewValue); + ClampAttributes(Attribute, NewValue); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::PostAttributeChange(const FGameplayAttribute& Attribute, float OldValue, float NewValue) +{ + Super::PostAttributeChange(Attribute, OldValue, NewValue); + + if (Attribute == GetMaxStaminaAttribute()) + { + UCogSampleFunctionLibrary_Gameplay::AdjustAttributeForMaxChange(GetOwningAbilitySystemComponent(), Stamina, OldValue, NewValue, GetStaminaAttribute()); + } + else + { + ClampAttributes(Attribute, NewValue); + } +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::PostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data) +{ + Super::PostGameplayEffectExecute(Data); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleAttributeSet_Caster::ClampAttributes(const FGameplayAttribute& Attribute, float& NewValue) const +{ + if (Attribute == GetStaminaAttribute()) + { + NewValue = FMath::Clamp(NewValue, GetMinStamina(), GetMaxStamina()); + } +} \ No newline at end of file diff --git a/Source/CogSample/CogSampleAttributeSet_Caster.h b/Source/CogSample/CogSampleAttributeSet_Caster.h new file mode 100644 index 0000000..ea16b51 --- /dev/null +++ b/Source/CogSample/CogSampleAttributeSet_Caster.h @@ -0,0 +1,86 @@ +#pragma once + +#include "CoreMinimal.h" +#include "AttributeSet.h" +#include "AbilitySystemComponent.h" +#include "CogSampleFunctionLibrary_Gameplay.h" +#include "CogSampleAttributeSet_Caster.generated.h" + +UCLASS() +class UCogSampleAttributeSet_Caster : public UAttributeSet +{ + GENERATED_BODY() + +public: + + UCogSampleAttributeSet_Caster(); + + UFUNCTION() + virtual void OnRep_BaseDamage(const FGameplayAttributeData& PrevBaseDamage); + + UFUNCTION() + virtual void OnRep_CooldownReduction(const FGameplayAttributeData& PrevCooldownReduction); + + UFUNCTION() + virtual void OnRep_AreaRadiusModifier(const FGameplayAttributeData& PrevAreaRadiusModifier); + + UFUNCTION() + virtual void OnRep_Stamina(const FGameplayAttributeData& PrevStamina); + + UFUNCTION() + virtual void OnRep_MinStamina(const FGameplayAttributeData& PrevMinStamina); + + UFUNCTION() + virtual void OnRep_MaxStamina(const FGameplayAttributeData& PrevMaxStamina); + + UFUNCTION() + virtual void OnRep_StaminaRegen(const FGameplayAttributeData& PrevStaminaRegen); + + UFUNCTION() + virtual void OnRep_StaminaCostReduction(const FGameplayAttributeData& PrevStaminaCostReduction); + + virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; + virtual void PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) override; + virtual void PostAttributeChange(const FGameplayAttribute& Attribute, float OldValue, float NewValue) override; + virtual void PreAttributeBaseChange(const FGameplayAttribute& Attribute, float& NewValue) const override; + virtual void PostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data) override; + +private: + + UPROPERTY(BlueprintReadOnly, Category = "Damage", ReplicatedUsing = OnRep_BaseDamage, meta = (AllowPrivateAccess = "true")) + FGameplayAttributeData BaseDamage; + + UPROPERTY(BlueprintReadOnly, Category = "Modifier", ReplicatedUsing = OnRep_CooldownReduction, meta = (AllowPrivateAccess = "true")) + FGameplayAttributeData CooldownReduction; + + UPROPERTY(BlueprintReadOnly, Category = "Modifier", ReplicatedUsing = OnRep_AreaRadiusModifier, meta = (AllowPrivateAccess = "true")) + FGameplayAttributeData AreaRadiusModifier; + + UPROPERTY(BlueprintReadOnly, Category = "Stamina", ReplicatedUsing = OnRep_Stamina, meta = (AllowPrivateAccess = "true")) + FGameplayAttributeData Stamina; + + UPROPERTY(BlueprintReadOnly, Category = "Stamina", ReplicatedUsing = OnRep_MinStamina, meta = (AllowPrivateAccess = "true")) + FGameplayAttributeData MinStamina; + + UPROPERTY(BlueprintReadOnly, Category = "Stamina", ReplicatedUsing = OnRep_MaxStamina, meta = (AllowPrivateAccess = "true")) + FGameplayAttributeData MaxStamina; + + UPROPERTY(BlueprintReadOnly, Category = "Stamina", ReplicatedUsing = OnRep_StaminaRegen, meta = (AllowPrivateAccess = "true")) + FGameplayAttributeData StaminaRegen; + + UPROPERTY(BlueprintReadOnly, Category = "Stamina", ReplicatedUsing = OnRep_StaminaCostReduction, meta = (AllowPrivateAccess = "true")) + FGameplayAttributeData StaminaCostReduction; + + void ClampAttributes(const FGameplayAttribute& Attribute, float& NewValue) const; + +public: + ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Caster, BaseDamage); + ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Caster, CooldownReduction); + ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Caster, AreaRadiusModifier); + ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Caster, Stamina); + ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Caster, StaminaRegen) + ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Caster, MinStamina); + ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Caster, MaxStamina); + ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Caster, StaminaCostReduction); +}; + diff --git a/Source/CogSample/CogSampleAttributeSet_Health.cpp b/Source/CogSample/CogSampleAttributeSet_Health.cpp index 9b292a3..3cc530a 100644 --- a/Source/CogSample/CogSampleAttributeSet_Health.cpp +++ b/Source/CogSample/CogSampleAttributeSet_Health.cpp @@ -11,9 +11,6 @@ UCogSampleAttributeSet_Health::UCogSampleAttributeSet_Health() InitMaxHealth(1000.0f); InitHealth(1000.0f); InitHealthRegen(10.0f); - - InitMaxArmor(500.f); - InitArmorRegen(0.f); } //-------------------------------------------------------------------------------------------------------------------------- @@ -34,24 +31,6 @@ void UCogSampleAttributeSet_Health::OnRep_HealthRegen(const FGameplayAttributeDa GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Health, HealthRegen, PrevHealthRegen); } -//-------------------------------------------------------------------------------------------------------------------------- -void UCogSampleAttributeSet_Health::OnRep_Armor(const FGameplayAttributeData& PrevArmor) -{ - GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Health, Armor, PrevArmor); -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogSampleAttributeSet_Health::OnRep_MaxArmor(const FGameplayAttributeData& PrevMaxArmor) -{ - GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Health, MaxArmor, PrevMaxArmor); -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogSampleAttributeSet_Health::OnRep_ArmorRegen(const FGameplayAttributeData& PrevArmorRegen) -{ - GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Health, ArmorRegen, PrevArmorRegen); -} - //-------------------------------------------------------------------------------------------------------------------------- void UCogSampleAttributeSet_Health::OnRep_DamageResistance(const FGameplayAttributeData& PrevDamageResistance) { @@ -70,9 +49,6 @@ void UCogSampleAttributeSet_Health::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const -{ - Super::GetLifetimeReplicatedProps(OutLifetimeProps); - - FDoRepLifetimeParams Params; - Params.bIsPushBased = true; - Params.RepNotifyCondition = REPNOTIFY_Always; - - DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Stamina, Stamina, Params); - DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Stamina, MinStamina, Params); - DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Stamina, MaxStamina, Params); - DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Stamina, StaminaRegen, Params); -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogSampleAttributeSet_Stamina::PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) -{ - Super::PreAttributeChange(Attribute, NewValue); - - if (Attribute == GetStaminaAttribute()) - { - NewValue = FMath::Clamp(NewValue, GetMinStamina(), GetMaxStamina()); - } -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogSampleAttributeSet_Stamina::PreAttributeBaseChange(const FGameplayAttribute& Attribute, float& NewValue) const -{ - Super::PreAttributeBaseChange(Attribute, NewValue); - ClampAttributes(Attribute, NewValue); -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogSampleAttributeSet_Stamina::PostAttributeChange(const FGameplayAttribute& Attribute, float OldValue, float NewValue) -{ - Super::PostAttributeChange(Attribute, OldValue, NewValue); - - if (Attribute == GetMaxStaminaAttribute()) - { - UCogSampleFunctionLibrary_Gameplay::AdjustAttributeForMaxChange(GetOwningAbilitySystemComponent(), Stamina, OldValue, NewValue, GetStaminaAttribute()); - } - else - { - ClampAttributes(Attribute, NewValue); - } -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogSampleAttributeSet_Stamina::PostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data) -{ - Super::PostGameplayEffectExecute(Data); -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogSampleAttributeSet_Stamina::ClampAttributes(const FGameplayAttribute& Attribute, float& NewValue) const -{ - if (Attribute == GetStaminaAttribute()) - { - NewValue = FMath::Clamp(NewValue, GetMinStamina(), GetMaxStamina()); - } -} diff --git a/Source/CogSample/CogSampleAttributeSet_Stamina.h b/Source/CogSample/CogSampleAttributeSet_Stamina.h index 45a2386..e69de29 100644 --- a/Source/CogSample/CogSampleAttributeSet_Stamina.h +++ b/Source/CogSample/CogSampleAttributeSet_Stamina.h @@ -1,59 +0,0 @@ -#pragma once - -#include "CoreMinimal.h" -#include "AttributeSet.h" -#include "AbilitySystemComponent.h" -#include "CogSampleFunctionLibrary_Gameplay.h" -#include "CogSampleAttributeSet_Stamina.generated.h" - -UCLASS() -class UCogSampleAttributeSet_Stamina : public UAttributeSet -{ - GENERATED_BODY() - -public: - - UCogSampleAttributeSet_Stamina(); - - UFUNCTION() - virtual void OnRep_Stamina(const FGameplayAttributeData& PrevStamina); - - UFUNCTION() - virtual void OnRep_MinStamina(const FGameplayAttributeData& PrevMinStamina); - - UFUNCTION() - virtual void OnRep_MaxStamina(const FGameplayAttributeData& PrevMaxStamina); - - UFUNCTION() - virtual void OnRep_StaminaRegen(const FGameplayAttributeData& PrevStaminaRegen); - - virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; - virtual void PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) override; - virtual void PostAttributeChange(const FGameplayAttribute& Attribute, float OldValue, float NewValue) override; - virtual void PreAttributeBaseChange(const FGameplayAttribute& Attribute, float& NewValue) const override; - virtual void PostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data) override; - -private: - - UPROPERTY(BlueprintReadOnly, Category = "Stamina", ReplicatedUsing = OnRep_Stamina, meta = (AllowPrivateAccess = "true")) - FGameplayAttributeData Stamina; - - UPROPERTY(BlueprintReadOnly, Category = "Stamina", ReplicatedUsing = OnRep_MinStamina, meta = (AllowPrivateAccess = "true")) - FGameplayAttributeData MinStamina; - - UPROPERTY(BlueprintReadOnly, Category = "Stamina", ReplicatedUsing = OnRep_MaxStamina, meta = (AllowPrivateAccess = "true")) - FGameplayAttributeData MaxStamina; - - UPROPERTY(BlueprintReadOnly, Category = "Stamina", ReplicatedUsing = OnRep_StaminaRegen, meta = (AllowPrivateAccess = "true")) - FGameplayAttributeData StaminaRegen; - - void ClampAttributes(const FGameplayAttribute& Attribute, float& NewValue) const; - -public: - ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Stamina, Stamina); - ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Stamina, StaminaRegen) - ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Stamina, MinStamina); - ATTRIBUTE_ACCESSORS(UCogSampleAttributeSet_Stamina, MaxStamina); - -}; - diff --git a/Source/CogSample/CogSampleCharacter.cpp b/Source/CogSample/CogSampleCharacter.cpp index d2a55ba..7a8bc77 100644 --- a/Source/CogSample/CogSampleCharacter.cpp +++ b/Source/CogSample/CogSampleCharacter.cpp @@ -6,8 +6,9 @@ #include "CogSampleAttributeSet_Health.h" #include "CogSampleAttributeSet_Misc.h" #include "CogSampleCharacterMovementComponent.h" -#include "CogSampleForcedMove.h" +#include "CogSampleGameplayAbility.h" #include "CogSampleLogCategories.h" +#include "CogSampleRootMotionParams.h" #include "CogSampleTagLibrary.h" #include "Components/CapsuleComponent.h" #include "Components/InputComponent.h" @@ -163,12 +164,26 @@ void ACogSampleCharacter::InitializeAbilitySystem() AbilitySystem->GiveAbility(Spec); } + int32 Index = 0; for (FActiveAbilityInfo& AbilityInfo : ActiveAbilities) { const FGameplayAbilitySpec Spec(AbilityInfo.Ability, 1, INDEX_NONE, this); FGameplayAbilitySpecHandle Handle = AbilitySystem->GiveAbility(Spec); ActiveAbilityHandles.Add(Handle); + + if (FGameplayAbilitySpec* AddedSpec = AbilitySystem->FindAbilitySpecFromHandle(Handle)) + { + if (UCogSampleGameplayAbility* Ab = Cast(AddedSpec->GetPrimaryInstance())) + { + Ab->SetSlotTag(FCogSampleTagLibrary::ActiveAbilityCooldownTags[Index]); + } + } + + Index++; } + + UpdateActiveAbilitySlots(); + MARK_PROPERTY_DIRTY_FROM_NAME(ACogSampleCharacter, ActiveAbilityHandles, this); } @@ -497,7 +512,7 @@ void ACogSampleCharacter::SetTeamID(int32 Value) } //-------------------------------------------------------------------------------------------------------------------------- -int32 ACogSampleCharacter::ApplyForcedMove(const FCogSampleForcedMoveParams& Params) +int32 ACogSampleCharacter::ApplyRootMotion(const FCogSampleRootMotionParams& Params) { if (HasAuthority() == false) { @@ -518,22 +533,22 @@ int32 ACogSampleCharacter::ApplyForcedMove(const FCogSampleForcedMoveParams& Par } } - Client_ApplyForcedMove(Params); - int32 RootMotionSourceID = ApplyForcedMoveInternal(Params); + Client_ApplyRootMotion(Params); + int32 RootMotionSourceID = ApplyRootMotionShared(Params); return RootMotionSourceID; } //-------------------------------------------------------------------------------------------------------------------------- -void ACogSampleCharacter::Client_ApplyForcedMove_Implementation(const FCogSampleForcedMoveParams& Params) +void ACogSampleCharacter::Client_ApplyRootMotion_Implementation(const FCogSampleRootMotionParams& Params) { if (GetWorld()->GetNetMode() == NM_Client) { - ApplyForcedMoveInternal(Params); + ApplyRootMotionShared(Params); } } //-------------------------------------------------------------------------------------------------------------------------- -uint16 ACogSampleCharacter::ApplyForcedMoveInternal(const FCogSampleForcedMoveParams& Params) +uint16 ACogSampleCharacter::ApplyRootMotionShared(const FCogSampleRootMotionParams& Params) { UCogSampleCharacterMovementComponent* MovementComponent = Cast(GetMovementComponent()); if (MovementComponent == nullptr) @@ -558,4 +573,39 @@ uint16 ACogSampleCharacter::ApplyForcedMoveInternal(const FCogSampleForcedMovePa uint16 RootMotionSourceID = MovementComponent->ApplyRootMotionSource(JumpForce); return RootMotionSourceID; +} + +//-------------------------------------------------------------------------------------------------------------------------- +void ACogSampleCharacter::OnRep_ActiveAbilityHandles() +{ + UpdateActiveAbilitySlots(); +} + +//-------------------------------------------------------------------------------------------------------------------------- +void ACogSampleCharacter::UpdateActiveAbilitySlots() +{ + for (int32 i = 0; i < ActiveAbilityHandles.Num(); ++i) + { + FGameplayAbilitySpecHandle& Handle = ActiveAbilityHandles[i]; + + if (FCogSampleTagLibrary::ActiveAbilityCooldownTags.IsValidIndex(i) == false) + { + return; + } + + FGameplayAbilitySpec* Spec = AbilitySystem->FindAbilitySpecFromHandle(Handle); + if (Spec == nullptr) + { + continue; + } + + UCogSampleGameplayAbility* AbilityInstance = Cast(Spec->GetPrimaryInstance()); + if (AbilityInstance == nullptr) + { + continue; + } + + FGameplayTag SlotTag = FCogSampleTagLibrary::ActiveAbilityCooldownTags[i]; + AbilityInstance->SetSlotTag(SlotTag); + } } \ No newline at end of file diff --git a/Source/CogSample/CogSampleCharacter.h b/Source/CogSample/CogSampleCharacter.h index f2e1c39..4b0ac15 100644 --- a/Source/CogSample/CogSampleCharacter.h +++ b/Source/CogSample/CogSampleCharacter.h @@ -22,7 +22,7 @@ class UInputAction; class UInputMappingContext; class USpringArmComponent; struct FActiveGameplayEffect; -struct FCogSampleForcedMoveParams; +struct FCogSampleRootMotionParams; struct FGameplayEffectSpec; struct FOnAttributeChangeData; @@ -190,10 +190,10 @@ public: int32 TeamID = 0; //---------------------------------------------------------------------------------------------------------------------- - // Forced Move + // Root Motion //---------------------------------------------------------------------------------------------------------------------- UFUNCTION(BlueprintCallable) - int32 ApplyForcedMove(const FCogSampleForcedMoveParams& Params); + int32 ApplyRootMotion(const FCogSampleRootMotionParams& Params); private: @@ -227,16 +227,21 @@ private: void OnScaleAttributeChanged(const FOnAttributeChangeData& Data); + void UpdateActiveAbilitySlots(); + + UFUNCTION() + void OnRep_ActiveAbilityHandles(); + //---------------------------------------------------------------------------------------------------------------------- - // Forced Move + // Root Motion //---------------------------------------------------------------------------------------------------------------------- UFUNCTION(Reliable, Client) - void Client_ApplyForcedMove(const FCogSampleForcedMoveParams& Params); + void Client_ApplyRootMotion(const FCogSampleRootMotionParams& Params); - uint16 ApplyForcedMoveInternal(const FCogSampleForcedMoveParams& Params); + uint16 ApplyRootMotionShared(const FCogSampleRootMotionParams& Params); //---------------------------------------------------------------------------------------------------------------------- - UPROPERTY(Replicated, Transient) + UPROPERTY(ReplicatedUsing=OnRep_ActiveAbilityHandles, Transient) TArray ActiveAbilityHandles; FDelegateHandle GameplayEffectAddedHandle; diff --git a/Source/CogSample/CogSampleExecCalculation_PoolRegen.cpp b/Source/CogSample/CogSampleExecCalculation_PoolRegen.cpp new file mode 100644 index 0000000..ca43ca8 --- /dev/null +++ b/Source/CogSample/CogSampleExecCalculation_PoolRegen.cpp @@ -0,0 +1,56 @@ +#include "CogSampleExecCalculation_PoolRegen.h" + +#include "AbilitySystemComponent.h" + +//-------------------------------------------------------------------------------------------------------------------------- +UCogSampleExecCalculation_PoolRegen::UCogSampleExecCalculation_PoolRegen() +{ +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleExecCalculation_PoolRegen::Execute_Implementation(const FGameplayEffectCustomExecutionParameters& ExecutionParams, OUT FGameplayEffectCustomExecutionOutput& OutExecutionOutput) const +{ + UAbilitySystemComponent* TargetAbilitySystem = ExecutionParams.GetTargetAbilitySystemComponent(); + + const FGameplayEffectSpec& Spec = ExecutionParams.GetOwningSpec(); + FAggregatorEvaluateParameters EvaluationParameters; + EvaluationParameters.SourceTags = Spec.CapturedSourceTags.GetAggregatedTags(); + EvaluationParameters.TargetTags = Spec.CapturedTargetTags.GetAggregatedTags(); + + const float Period = ExecutionParams.GetOwningSpec().GetPeriod(); + + float RegenRateValue = 0.0f; + + if (TargetAbilitySystem->HasMatchingGameplayTag(DisableRegenTag) == false) + { + switch (Mode) + { + case ECogSamplePoolRegenMode::Attribute: + { + RegenRateValue = TargetAbilitySystem->GetNumericAttribute(RegenRateAttribute); + } + break; + + case ECogSamplePoolRegenMode::ScalableFloatRate: + { + RegenRateValue = RegenRate.GetValueAtLevel(Spec.GetLevel()); + } + + case ECogSamplePoolRegenMode::MaxPoolDuration: + { + const float MaxAmount = TargetAbilitySystem->GetNumericAttribute(MaxAmountAttribute); + const float TotalDurationValue = TotalDuration.GetValueAtLevel(Spec.GetLevel()); + RegenRateValue = TotalDurationValue > 0 ? (MaxAmount / TotalDurationValue) * Period : 0.0f; + } + break; + + default: + break; + } + } + + if (RegenRateValue != 0.0f) + { + OutExecutionOutput.AddOutputModifier(FGameplayModifierEvaluatedData(AmountAttribute, EGameplayModOp::Additive, RegenRateValue)); + } +} diff --git a/Source/CogSample/CogSampleExecCalculation_PoolRegen.h b/Source/CogSample/CogSampleExecCalculation_PoolRegen.h new file mode 100644 index 0000000..e4d35bb --- /dev/null +++ b/Source/CogSample/CogSampleExecCalculation_PoolRegen.h @@ -0,0 +1,46 @@ +#pragma once + +#include "CoreMinimal.h" +#include "GameplayEffectExecutionCalculation.h" +#include "ScalableFloat.h" +#include "CogSampleExecCalculation_PoolRegen.generated.h" + +UENUM() +enum class ECogSamplePoolRegenMode : uint8 +{ + Attribute, + MaxPoolDuration, + ScalableFloatRate, +}; + +UCLASS() +class UCogSampleExecCalculation_PoolRegen : public UGameplayEffectExecutionCalculation +{ + GENERATED_BODY() + +public: + UCogSampleExecCalculation_PoolRegen(); + + UPROPERTY(EditAnywhere, BlueprintReadOnly) + FGameplayAttribute AmountAttribute; + + UPROPERTY(EditAnywhere, BlueprintReadOnly) + FGameplayTag DisableRegenTag; + + UPROPERTY(EditAnywhere, BlueprintReadOnly) + ECogSamplePoolRegenMode Mode = ECogSamplePoolRegenMode::MaxPoolDuration; + + UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (EditConditionHides, EditCondition = "Mode == ECogSamplePoolRegenMode::Attribute")) + FGameplayAttribute RegenRateAttribute; + + UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (EditConditionHides, EditCondition = "Mode == ECogSamplePoolRegenMode::ScalableFloatRate")) + FScalableFloat RegenRate; + + UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (EditConditionHides, EditCondition = "Mode == ECogSamplePoolRegenMode::MaxPoolDuration")) + FGameplayAttribute MaxAmountAttribute; + + UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (EditConditionHides, EditCondition = "Mode == ECogSamplePoolRegenMode::MaxPoolDuration")) + FScalableFloat TotalDuration; + + virtual void Execute_Implementation(const FGameplayEffectCustomExecutionParameters& ExecutionParams, OUT FGameplayEffectCustomExecutionOutput& OutExecutionOutput) const override; +}; diff --git a/Source/CogSample/CogSampleFunctionLibrary_Gameplay.cpp b/Source/CogSample/CogSampleFunctionLibrary_Gameplay.cpp index 0a5451d..70fcc7d 100644 --- a/Source/CogSample/CogSampleFunctionLibrary_Gameplay.cpp +++ b/Source/CogSample/CogSampleFunctionLibrary_Gameplay.cpp @@ -1,7 +1,15 @@ #include "CogSampleFunctionLibrary_Gameplay.h" +#include "Abilities/GameplayAbility.h" #include "AbilitySystemComponent.h" +#include "AbilitySystemGlobals.h" +#include "CogSampleGameplayEffectContext.h" +#include "Components/CapsuleComponent.h" +#include "GameFramework/Character.h" +#include "GameplayCueNotifyTypes.h" #include "GameplayEffectTypes.h" +#include "Particles/ParticleSystemComponent.h" +#include "ScalableFloat.h" //-------------------------------------------------------------------------------------------------------------------------- void UCogSampleFunctionLibrary_Gameplay::AdjustAttributeForMaxChange(UAbilitySystemComponent* AbilityComponent, FGameplayAttributeData& AffectedAttribute, float OldValue, float NewMaxValue, const FGameplayAttribute& AffectedAttributeProperty) @@ -21,4 +29,82 @@ void UCogSampleFunctionLibrary_Gameplay::AdjustAttributeForMaxChange(UAbilitySys const float NewDelta = (OldValue > 0.f) ? (CurrentValue * NewMaxValue / OldValue) - CurrentValue : NewMaxValue; AbilityComponent->ApplyModToAttributeUnsafe(AffectedAttributeProperty, EGameplayModOp::Additive, NewDelta); -} \ No newline at end of file +} + +//-------------------------------------------------------------------------------------------------------------------------- +FVector UCogSampleFunctionLibrary_Gameplay::GetActorBottomLocation(const AActor* Actor) +{ + const FVector Location = Actor->GetActorLocation(); + + if (const ACharacter* Character = Cast(Actor)) + { + const UCapsuleComponent* CapsuleComponent = Character->GetCapsuleComponent(); + const FVector BottomLocation = Location - FVector::UpVector * CapsuleComponent->GetScaledCapsuleHalfHeight(); + return BottomLocation; + } + + return Location; +} + +//-------------------------------------------------------------------------------------------------------------------------- +bool UCogSampleFunctionLibrary_Gameplay::FindAbilitySpecHandleFromClass(UAbilitySystemComponent* AbilitySystemComponent, TSubclassOf AbilityClass, FGameplayAbilitySpecHandle& SpecHandle) +{ + if (const FGameplayAbilitySpec* Spec = AbilitySystemComponent->FindAbilitySpecFromClass(AbilityClass)) + { + SpecHandle = Spec->Handle; + return true; + } + + return false; +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleFunctionLibrary_Gameplay::ApplyAllGameplayEffectContextValues(const FGameplayCueParameters& Parameters, const FGameplayCueNotify_SpawnResult& SpawnResult) +{ + TArray Entries; + UCogSampleEffectContextLibrary::EffectContextGetAllFloatValues(Parameters.EffectContext, Entries); + + for (TObjectPtr FXSystemComponent : SpawnResult.FxSystemComponents) + { + if (UFXSystemComponent* FXSystemComponentPtr = FXSystemComponent.Get()) + { + for (const FCogSampleGameplayEffectContextFloatValue& Entry : Entries) + { + FXSystemComponentPtr->SetFloatParameter(Entry.Name, Entry.Value); + } + } + } +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleFunctionLibrary_Gameplay::SendMontageEvent(AActor* Actor, FGameplayTag EventTag, FGameplayEventData Payload) +{ + if (::IsValid(Actor)) + { + UAbilitySystemComponent* AbilitySystemComponent = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(Actor); + if (AbilitySystemComponent != nullptr && IsValidChecked(AbilitySystemComponent)) + { + FScopedPredictionWindow NewScopedWindow(AbilitySystemComponent, true); + AbilitySystemComponent->HandleGameplayEvent(EventTag, &Payload); + } + } +} + +//-------------------------------------------------------------------------------------------------------------------------- +float UCogSampleFunctionLibrary_Gameplay::GetFloatValue(const FScalableFloat& ScalableFloat, int32 Level) +{ + return ScalableFloat.GetValueAtLevel(Level); +} + +//-------------------------------------------------------------------------------------------------------------------------- +bool UCogSampleFunctionLibrary_Gameplay::GetBoolValue(const FScalableFloat& ScalableFloat, int32 Level) +{ + return ScalableFloat.GetValueAtLevel(Level) > 0; +} + +//-------------------------------------------------------------------------------------------------------------------------- +int32 UCogSampleFunctionLibrary_Gameplay::GetIntValue(const FScalableFloat& ScalableFloat, int32 Level) +{ + return (int32)ScalableFloat.GetValueAtLevel(Level); +} + diff --git a/Source/CogSample/CogSampleFunctionLibrary_Gameplay.h b/Source/CogSample/CogSampleFunctionLibrary_Gameplay.h index 0e52d24..29a58ac 100644 --- a/Source/CogSample/CogSampleFunctionLibrary_Gameplay.h +++ b/Source/CogSample/CogSampleFunctionLibrary_Gameplay.h @@ -4,8 +4,12 @@ #include "CogSampleFunctionLibrary_Gameplay.generated.h" class UAbilitySystemComponent; +class UGameplayAbility; +struct FGameplayAbilitySpecHandle; struct FGameplayAttribute; struct FGameplayAttributeData; +struct FGameplayCueNotify_SpawnResult; +struct FGameplayCueParameters; #define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \ GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \ @@ -21,4 +25,28 @@ class UCogSampleFunctionLibrary_Gameplay : public UBlueprintFunctionLibrary public: static void AdjustAttributeForMaxChange(UAbilitySystemComponent* AbilityComponent, FGameplayAttributeData& AffectedAttribute, float OldValue, float NewMaxValue, const FGameplayAttribute& AffectedAttributeProperty); + + UFUNCTION(BlueprintPure) + static FVector GetActorBottomLocation(const AActor* Actor); + + UFUNCTION(BlueprintCallable) + static bool FindAbilitySpecHandleFromClass(UAbilitySystemComponent* AbilitySystemComponent, TSubclassOf AbilityClass, FGameplayAbilitySpecHandle& SpecHandle); + + UFUNCTION(BlueprintCallable) + static void ApplyAllGameplayEffectContextValues(const FGameplayCueParameters& Parameters, const FGameplayCueNotify_SpawnResult& SpawnResult); + + /* Same as UAbilitySystemBlueprintLibrary::SendGameplayEventToActor but doesn't log an error when the ability system + * is not found. When a montage is played in the montage editor the notifications are executed and if a notification + * uses SendGameplayEventToActor it will log an error. */ + UFUNCTION(BlueprintCallable) + static void SendMontageEvent(AActor* Actor, FGameplayTag EventTag, FGameplayEventData Payload); + + UFUNCTION(BlueprintPure) + static float GetFloatValue(const FScalableFloat& ScalableFloat, int32 Level); + + UFUNCTION(BlueprintPure) + static bool GetBoolValue(const FScalableFloat& ScalableFloat, int32 Level); + + UFUNCTION(BlueprintPure) + static int32 GetIntValue(const FScalableFloat& ScalableFloat, int32 Level); }; diff --git a/Source/CogSample/CogSampleGameplayAbility.cpp b/Source/CogSample/CogSampleGameplayAbility.cpp new file mode 100644 index 0000000..6fabb95 --- /dev/null +++ b/Source/CogSample/CogSampleGameplayAbility.cpp @@ -0,0 +1,193 @@ +#include "CogSampleGameplayAbility.h" + +#include "CogSampleTagLibrary.h" +#include "CogSampleGameplayEffectContext.h" +#include "CogSampleFunctionLibrary_Gameplay.h" +#include "CogSampleAttributeSet_Caster.h" + +//-------------------------------------------------------------------------------------------------------------------------- +UCogSampleGameplayAbility::UCogSampleGameplayAbility() +{ + InstancingPolicy = EGameplayAbilityInstancingPolicy::InstancedPerActor; + ActivationBlockedTags.AddTag(Tag_Status_Dead); +} + +//-------------------------------------------------------------------------------------------------------------------------- +float UCogSampleGameplayAbility::GetUnmitigatedCooldownDuration_Implementation() const +{ + return Cooldown.GetValueAtLevel(GetAbilityLevel()); +} + +//-------------------------------------------------------------------------------------------------------------------------- +float UCogSampleGameplayAbility::GetUnmitigatedCost_Implementation() const +{ + return Cost.GetValueAtLevel(GetAbilityLevel()); +} + +//-------------------------------------------------------------------------------------------------------------------------- +bool UCogSampleGameplayAbility::CheckCooldown(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, OUT FGameplayTagContainer* OptionalRelevantTags /*= nullptr*/) const +{ + if (ActorInfo == nullptr) + { + return false; + } + + if (ActorInfo->AbilitySystemComponent->HasMatchingGameplayTag(Tag_Status_NoCooldown)) + { + return true; + } + + if (Super::CheckCooldown(Handle, ActorInfo, OptionalRelevantTags)) + { + return true; + } + + if (OptionalRelevantTags != nullptr) + { + OptionalRelevantTags->AddTag(Tag_Ability_Activation_Fail_Cooldown); + } + + return false; +} + +//-------------------------------------------------------------------------------------------------------------------------- +bool UCogSampleGameplayAbility::CheckCost(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, OUT FGameplayTagContainer* OptionalRelevantTags /*= nullptr*/) const +{ + if (ActorInfo == nullptr) + { + return false; + } + + if (ActorInfo->AbilitySystemComponent->HasMatchingGameplayTag(Tag_Status_NoCost)) + { + return true; + } + + UGameplayEffect* CostEffect = GetCostGameplayEffect(); + if (CostEffect != nullptr) + { + //----------------------------------------------------------------------------------- + // Can always start ability if cost == 0. + //----------------------------------------------------------------------------------- + if (IsCostGameplayEffectIsZero(CostEffect, GetAbilityLevel(Handle, ActorInfo), MakeEffectContext(Handle, ActorInfo))) + { + return true; + } + + //----------------------------------------------------------------------------------- + // Can start ability if it cost stamina and stamina > 0 + //----------------------------------------------------------------------------------- + if (CostEffect->InheritableGameplayEffectTags.CombinedTags.HasTag(Tag_Effect_Type_Cost_Stamina)) + { + const float Stamina = ActorInfo->AbilitySystemComponent->GetNumericAttribute(UCogSampleAttributeSet_Caster::GetStaminaAttribute()); + if (Stamina > 0) + { + return true; + } + } + } + + //----------------------------------------------------------------------------------- + // Handle general case + //----------------------------------------------------------------------------------- + if (Super::CheckCost(Handle, ActorInfo, OptionalRelevantTags)) + { + return true; + } + + if (OptionalRelevantTags != nullptr) + { + OptionalRelevantTags->AddTag(Tag_Ability_Activation_Fail_Cost); + } + + return false; +} + +//-------------------------------------------------------------------------------------------------------------------------- +const FGameplayTagContainer* UCogSampleGameplayAbility::GetCooldownTags() const +{ + FGameplayTagContainer* MutableTags = const_cast(&CachedCooldownTags); + MutableTags->Reset(); + const FGameplayTagContainer* ParentTags = Super::GetCooldownTags(); + if (ParentTags) + { + MutableTags->AppendTags(*ParentTags); + } + MutableTags->AddTag(SlotTag); + + return MutableTags; +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleGameplayAbility::ApplyCooldown(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo) const +{ + if (GetUnmitigatedCooldownDuration() <= 0.0f) + { + return; + } + + if (UGameplayEffect* CooldownEffect = GetCooldownGameplayEffect()) + { + FGameplayEffectSpecHandle SpecHandle = MakeOutgoingGameplayEffectSpec(CooldownEffect->GetClass(), GetAbilityLevel()); + SpecHandle.Data.Get()->DynamicGrantedTags.AddTag(SlotTag); + ApplyGameplayEffectSpecToOwner(Handle, ActorInfo, ActivationInfo, SpecHandle); + } +} + +//-------------------------------------------------------------------------------------------------------------------------- +void UCogSampleGameplayAbility::ApplyCost(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo) const +{ + if (GetUnmitigatedCost() <= 0.0f) + { + return; + } + + if (UGameplayEffect* CostEffect = GetCostGameplayEffect()) + { + FGameplayEffectSpecHandle SpecHandle = MakeOutgoingGameplayEffectSpec(CostEffect->GetClass(), GetAbilityLevel()); + ApplyGameplayEffectSpecToOwner(Handle, ActorInfo, ActivationInfo, SpecHandle); + } +} + + +//-------------------------------------------------------------------------------------------------------------------------- +bool UCogSampleGameplayAbility::IsCostGameplayEffectIsZero(const UGameplayEffect* GameplayEffect, float Level, const FGameplayEffectContextHandle& EffectContext) const +{ + FGameplayEffectSpec Spec(GameplayEffect, EffectContext, Level); + Spec.CalculateModifierMagnitudes(); + + for (int32 ModIdx = 0; ModIdx < Spec.Modifiers.Num(); ++ModIdx) + { + const FGameplayModifierInfo& ModDef = Spec.Def->Modifiers[ModIdx]; + const FModifierSpec& ModSpec = Spec.Modifiers[ModIdx]; + const float CostValue = ModSpec.GetEvaluatedMagnitude(); + + //---------------------------------------------------------------------------------------------- + // The Cost in the Data is positive, but UCogSampleModifierCalculation_Cost negates it. + // Therefore a cost less than zero is an actual cost, and a cost of 0 or greater can be ignored + //---------------------------------------------------------------------------------------------- + if (CostValue < 0) + { + return false; + } + } + return true; +} + +//-------------------------------------------------------------------------------------------------------------------------- +float UCogSampleGameplayAbility::GetFloatValueAtAbilityLevel(const FScalableFloat& ScalableFloat) const +{ + return UCogSampleFunctionLibrary_Gameplay::GetFloatValue(ScalableFloat, GetAbilityLevel()); +} + +//-------------------------------------------------------------------------------------------------------------------------- +bool UCogSampleGameplayAbility::GetBoolValueAtAbilityLevel(const FScalableFloat& ScalableFloat) const +{ + return UCogSampleFunctionLibrary_Gameplay::GetBoolValue(ScalableFloat, GetAbilityLevel()); +} + +//-------------------------------------------------------------------------------------------------------------------------- +int32 UCogSampleGameplayAbility::GetIntValueAtAbilityLevel(const FScalableFloat& ScalableFloat) const +{ + return UCogSampleFunctionLibrary_Gameplay::GetIntValue(ScalableFloat, GetAbilityLevel()); +} diff --git a/Source/CogSample/CogSampleGameplayAbility.h b/Source/CogSample/CogSampleGameplayAbility.h new file mode 100644 index 0000000..d5302af --- /dev/null +++ b/Source/CogSample/CogSampleGameplayAbility.h @@ -0,0 +1,70 @@ +#pragma once + +#include "CoreMinimal.h" +#include "Abilities/GameplayAbility.h" +#include "CogSampleGameplayAbility.generated.h" + +UCLASS() +class UCogSampleGameplayAbility : public UGameplayAbility +{ + GENERATED_BODY() + +public: + + UCogSampleGameplayAbility(); + + const FGameplayTag& GetSlotTag() const { return SlotTag; } + + void SetSlotTag(FGameplayTag Value) { SlotTag = Value; } + + //---------------------------------------------------------------------------------------------------------------------- + // Cooldown & Cost + //---------------------------------------------------------------------------------------------------------------------- + + UFUNCTION(BlueprintNativeEvent, BlueprintPure, Category = Ability) + float GetUnmitigatedCooldownDuration() const; + + UFUNCTION(BlueprintNativeEvent, BlueprintPure, Category = Ability) + float GetUnmitigatedCost() const; + + virtual const FGameplayTagContainer* GetCooldownTags() const override; + + virtual void ApplyCooldown(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo) const override; + + virtual bool CheckCooldown(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, OUT FGameplayTagContainer* OptionalRelevantTags = nullptr) const override; + + virtual bool CheckCost(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, OUT FGameplayTagContainer* OptionalRelevantTags = nullptr) const override; + + virtual void ApplyCost(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo) const override; + + + //---------------------------------------------------------------------------------------------------------------------- + // Scalable Float + //---------------------------------------------------------------------------------------------------------------------- + + UFUNCTION(BlueprintPure) + float GetFloatValueAtAbilityLevel(const FScalableFloat& ScalableFloat) const; + + UFUNCTION(BlueprintPure) + bool GetBoolValueAtAbilityLevel(const FScalableFloat& ScalableFloat) const; + + UFUNCTION(BlueprintPure) + int32 GetIntValueAtAbilityLevel(const FScalableFloat& ScalableFloat) const; + +private: + + bool IsCostGameplayEffectIsZero(const UGameplayEffect* GameplayEffect, float Level, const FGameplayEffectContextHandle& EffectContext) const; + + UPROPERTY(BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) + FGameplayTag SlotTag; + + UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Cooldowns", meta = (AllowPrivateAccess = "true")) + FScalableFloat Cooldown; + + UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Costs", meta = (AllowPrivateAccess = "true")) + FScalableFloat Cost; + + UPROPERTY(Transient) + FGameplayTagContainer CachedCooldownTags; + +}; diff --git a/Source/CogSample/CogSampleGameplayLibrary.cpp b/Source/CogSample/CogSampleGameplayLibrary.cpp deleted file mode 100644 index 69b50e9..0000000 --- a/Source/CogSample/CogSampleGameplayLibrary.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "CogSampleGameplayLibrary.h" - -#include "Abilities/GameplayAbility.h" -#include "AbilitySystemComponent.h" -#include "AbilitySystemGlobals.h" -#include "CogSampleGameplayEffectContext.h" -#include "Components/CapsuleComponent.h" -#include "GameFramework/Character.h" -#include "GameplayCueNotifyTypes.h" -#include "Particles/ParticleSystemComponent.h" - -//-------------------------------------------------------------------------------------------------------------------------- -FVector UCogSampleGameplayLibrary::GetActorBottomLocation(const AActor* Actor) -{ - const FVector Location = Actor->GetActorLocation(); - - if (const ACharacter* Character = Cast(Actor)) - { - const UCapsuleComponent* CapsuleComponent = Character->GetCapsuleComponent(); - const FVector BottomLocation = Location - FVector::UpVector * CapsuleComponent->GetScaledCapsuleHalfHeight(); - return BottomLocation; - } - - return Location; -} - -//-------------------------------------------------------------------------------------------------------------------------- -bool UCogSampleGameplayLibrary::FindAbilitySpecHandleFromClass(UAbilitySystemComponent* AbilitySystemComponent, TSubclassOf AbilityClass, FGameplayAbilitySpecHandle& SpecHandle) -{ - if (const FGameplayAbilitySpec* Spec = AbilitySystemComponent->FindAbilitySpecFromClass(AbilityClass)) - { - SpecHandle = Spec->Handle; - return true; - } - - return false; -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogSampleGameplayLibrary::ApplyAllGameplayEffectContextValues(const FGameplayCueParameters& Parameters, const FGameplayCueNotify_SpawnResult& SpawnResult) -{ - TArray Entries; - UCogSampleEffectContextLibrary::EffectContextGetAllFloatValues(Parameters.EffectContext, Entries); - - for (TObjectPtr FXSystemComponent : SpawnResult.FxSystemComponents) - { - if (UFXSystemComponent* FXSystemComponentPtr = FXSystemComponent.Get()) - { - for (const FCogSampleGameplayEffectContextFloatValue& Entry : Entries) - { - FXSystemComponentPtr->SetFloatParameter(Entry.Name, Entry.Value); - } - } - } -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogSampleGameplayLibrary::SendMontageEvent(AActor* Actor, FGameplayTag EventTag, FGameplayEventData Payload) -{ - if (::IsValid(Actor)) - { - UAbilitySystemComponent* AbilitySystemComponent = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(Actor); - if (AbilitySystemComponent != nullptr && IsValidChecked(AbilitySystemComponent)) - { - FScopedPredictionWindow NewScopedWindow(AbilitySystemComponent, true); - AbilitySystemComponent->HandleGameplayEvent(EventTag, &Payload); - } - } -} \ No newline at end of file diff --git a/Source/CogSample/CogSampleGameplayLibrary.h b/Source/CogSample/CogSampleGameplayLibrary.h deleted file mode 100644 index 95c1c6e..0000000 --- a/Source/CogSample/CogSampleGameplayLibrary.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include "CoreMinimal.h" -#include "Kismet/KismetSystemLibrary.h" -#include "CogSampleGameplayLibrary.generated.h" - -class UAbilitySystemComponent; -class UGameplayAbility; -struct FGameplayAbilitySpecHandle; -struct FGameplayCueParameters; -struct FGameplayCueNotify_SpawnResult; - -//-------------------------------------------------------------------------------------------------------------------------- -UCLASS(meta = (ScriptName = "CogSampleGameplayLibrary")) -class UCogSampleGameplayLibrary : public UBlueprintFunctionLibrary -{ - GENERATED_BODY() - -public: - - UFUNCTION(BlueprintPure) - static FVector GetActorBottomLocation(const AActor* Actor); - - UFUNCTION(BlueprintCallable) - static bool FindAbilitySpecHandleFromClass(UAbilitySystemComponent* AbilitySystemComponent, TSubclassOf AbilityClass, FGameplayAbilitySpecHandle& SpecHandle); - - UFUNCTION(BlueprintCallable) - static void ApplyAllGameplayEffectContextValues(const FGameplayCueParameters& Parameters, const FGameplayCueNotify_SpawnResult& SpawnResult); - - /* Same as UAbilitySystemBlueprintLibrary::SendGameplayEventToActor but doesn't log an error when the ability system - * is not found. When a montage is played in the montage editor the notifications are executed and if a notification - * uses SendGameplayEventToActor it will log an error. */ - UFUNCTION(BlueprintCallable) - static void SendMontageEvent(AActor* Actor, FGameplayTag EventTag, FGameplayEventData Payload); - -}; - diff --git a/Source/CogSample/CogSampleLogCategories.cpp b/Source/CogSample/CogSampleLogCategories.cpp index defe467..53da048 100644 --- a/Source/CogSample/CogSampleLogCategories.cpp +++ b/Source/CogSample/CogSampleLogCategories.cpp @@ -22,7 +22,7 @@ namespace CogSampleLog { #if USE_COG FCogDebugLogCategoryManager::AddLogCategory(LogCogAlways, "Always", false); - FCogDebugLogCategoryManager::AddLogCategory(LogAbilitySystem, "AbilitySystem"); + FCogDebugLogCategoryManager::AddLogCategory(LogAbilitySystem, "Ability System"); FCogDebugLogCategoryManager::AddLogCategory(LogGameplayEffects, "Gameplay Effects"); FCogDebugLogCategoryManager::AddLogCategory(LogCogCollision, "Collision"); FCogDebugLogCategoryManager::AddLogCategory(LogCogInput, "Input"); diff --git a/Source/CogSample/CogSampleModifierCalculation_Cooldown.cpp b/Source/CogSample/CogSampleModifierCalculation_Cooldown.cpp new file mode 100644 index 0000000..cc7caaf --- /dev/null +++ b/Source/CogSample/CogSampleModifierCalculation_Cooldown.cpp @@ -0,0 +1,29 @@ +#include "CogSampleModifierCalculation_Cooldown.h" + +#include "CogSampleGameplayAbility.h" +#include "CogSampleAttributeSet_Caster.h" + +//-------------------------------------------------------------------------------------------------------------------------- +UCogSampleModifierCalculation_Cooldown::UCogSampleModifierCalculation_Cooldown() +{ + CooldownReductionDef.AttributeToCapture = UCogSampleAttributeSet_Caster::GetCooldownReductionAttribute(); + CooldownReductionDef.AttributeSource = EGameplayEffectAttributeCaptureSource::Source; + CooldownReductionDef.bSnapshot = false; + + RelevantAttributesToCapture.Add(CooldownReductionDef); +} + +//-------------------------------------------------------------------------------------------------------------------------- +float UCogSampleModifierCalculation_Cooldown::CalculateBaseMagnitude_Implementation(const FGameplayEffectSpec& Spec) const +{ + FAggregatorEvaluateParameters EvaluationParameters; + float CooldownReduction = 0.0f; + GetCapturedAttributeMagnitude(CooldownReductionDef, Spec, EvaluationParameters, CooldownReduction); + + const UCogSampleGameplayAbility* Ability = Cast(Spec.GetContext().GetAbilityInstance_NotReplicated()); + + const float UnmitigatedCooldown = (Ability != nullptr) ? Ability->GetUnmitigatedCooldownDuration() : 0.0f; + const float MitigatedCooldown = UnmitigatedCooldown * FMath::Max(0.0f, 1.0f - CooldownReduction); + + return MitigatedCooldown; +} diff --git a/Source/CogSample/CogSampleModifierCalculation_Cooldown.h b/Source/CogSample/CogSampleModifierCalculation_Cooldown.h new file mode 100644 index 0000000..57a37e0 --- /dev/null +++ b/Source/CogSample/CogSampleModifierCalculation_Cooldown.h @@ -0,0 +1,22 @@ +#pragma once + +#include "CoreMinimal.h" +#include "GameplayModMagnitudeCalculation.h" +#include "GameplayEffectTypes.h" +#include "CogSampleModifierCalculation_Cooldown.generated.h" + +UCLASS(BlueprintType, Blueprintable) +class UCogSampleModifierCalculation_Cooldown : public UGameplayModMagnitudeCalculation +{ + GENERATED_BODY() + +public: + + UCogSampleModifierCalculation_Cooldown(); + + float CalculateBaseMagnitude_Implementation(const FGameplayEffectSpec& Spec) const override; + +private: + + FGameplayEffectAttributeCaptureDefinition CooldownReductionDef; +}; diff --git a/Source/CogSample/CogSampleModifierCalculation_Cost.cpp b/Source/CogSample/CogSampleModifierCalculation_Cost.cpp new file mode 100644 index 0000000..b7eca7e --- /dev/null +++ b/Source/CogSample/CogSampleModifierCalculation_Cost.cpp @@ -0,0 +1,40 @@ +#include "CogSampleModifierCalculation_Cost.h" + +#include "CogSampleGameplayAbility.h" +#include "CogSampleAttributeSet_Caster.h" +#include "CogSampleTagLibrary.h" + +//-------------------------------------------------------------------------------------------------------------------------- +UCogSampleModifierCalculation_Cost::UCogSampleModifierCalculation_Cost() +{ + StaminaCostReductionDef.AttributeToCapture = UCogSampleAttributeSet_Caster::GetStaminaCostReductionAttribute(); + StaminaCostReductionDef.AttributeSource = EGameplayEffectAttributeCaptureSource::Source; + StaminaCostReductionDef.bSnapshot = false; + + RelevantAttributesToCapture.Add(StaminaCostReductionDef); +} + +//-------------------------------------------------------------------------------------------------------------------------- +float UCogSampleModifierCalculation_Cost::CalculateBaseMagnitude_Implementation(const FGameplayEffectSpec& Spec) const +{ + const FGameplayTagContainer* SourceTags = Spec.CapturedSourceTags.GetAggregatedTags(); + FAggregatorEvaluateParameters EvaluationParameters; + EvaluationParameters.SourceTags = SourceTags; + + float CostReduction = 0.0f; + GetCapturedAttributeMagnitude(StaminaCostReductionDef, Spec, EvaluationParameters, CostReduction); + + const UCogSampleGameplayAbility* Ability = Cast(Spec.GetContext().GetAbilityInstance_NotReplicated()); + const float UnmitigatedCost = (Ability != nullptr) ? Ability->GetUnmitigatedCost() : 0.0f; + float MitigatedCost = UnmitigatedCost * FMath::Max(0.0f, 1.0f - CostReduction); + + if (SourceTags->HasTag(Tag_Effect_Type_Cost_Overtime)) + { + const float Period = Spec.GetPeriod(); + MitigatedCost *= Period; + } + + return -MitigatedCost; +} + + diff --git a/Source/CogSample/CogSampleModifierCalculation_Cost.h b/Source/CogSample/CogSampleModifierCalculation_Cost.h new file mode 100644 index 0000000..768ebd8 --- /dev/null +++ b/Source/CogSample/CogSampleModifierCalculation_Cost.h @@ -0,0 +1,22 @@ +#pragma once + +#include "CoreMinimal.h" +#include "GameplayModMagnitudeCalculation.h" +#include "GameplayEffectTypes.h" +#include "CogSampleModifierCalculation_Cost.generated.h" + +UCLASS(BlueprintType, Blueprintable) +class UCogSampleModifierCalculation_Cost : public UGameplayModMagnitudeCalculation +{ + GENERATED_BODY() + +public: + + UCogSampleModifierCalculation_Cost(); + + float CalculateBaseMagnitude_Implementation(const FGameplayEffectSpec& Spec) const override; + +private: + + FGameplayEffectAttributeCaptureDefinition StaminaCostReductionDef; +}; \ No newline at end of file diff --git a/Source/CogSample/CogSampleForcedMove.h b/Source/CogSample/CogSampleRootMotionParams.h similarity index 93% rename from Source/CogSample/CogSampleForcedMove.h rename to Source/CogSample/CogSampleRootMotionParams.h index 384f5d1..ab97d02 100644 --- a/Source/CogSample/CogSampleForcedMove.h +++ b/Source/CogSample/CogSampleRootMotionParams.h @@ -2,13 +2,13 @@ #include "CoreMinimal.h" #include "GameFramework/RootMotionSource.h" -#include "CogSampleForcedMove.generated.h" +#include "CogSampleRootMotionParams.generated.h" class UGameplayEffect; //-------------------------------------------------------------------------------------------------------------------------- USTRUCT(BlueprintType) -struct FCogSampleForcedMoveParams +struct FCogSampleRootMotionParams { GENERATED_BODY() @@ -27,7 +27,7 @@ public: FRotator Rotation; UPROPERTY(EditAnywhere, BlueprintReadWrite) - bool IsAdditive = true; + bool IsAdditive = false; UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 Priority = 0; diff --git a/Source/CogSample/CogSampleTagLibrary.cpp b/Source/CogSample/CogSampleTagLibrary.cpp index 3537ec1..6fb0aec 100644 --- a/Source/CogSample/CogSampleTagLibrary.cpp +++ b/Source/CogSample/CogSampleTagLibrary.cpp @@ -1,15 +1,42 @@ #include "CogSampleTagLibrary.h" +UE_DEFINE_GAMEPLAY_TAG(Tag_Ability_Activation_Fail_Cooldown, "Ability.Activation.Fail.Cooldown"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Ability_Activation_Fail_Cost, "Ability.Activation.Fail.Cost"); + +UE_DEFINE_GAMEPLAY_TAG(Tag_Ability_Cooldown_1, "Ability.Cooldown.1"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Ability_Cooldown_2, "Ability.Cooldown.2"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Ability_Cooldown_3, "Ability.Cooldown.3"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Ability_Cooldown_4, "Ability.Cooldown.4"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Ability_Cooldown_5, "Ability.Cooldown.5"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Ability_Cooldown_6, "Ability.Cooldown.6"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Ability_Cooldown_7, "Ability.Cooldown.7"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Ability_Cooldown_8, "Ability.Cooldown.8"); + UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Alignment_Negative, "Effect.Alignment.Negative"); UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Alignment_Positive, "Effect.Alignment.Positive"); UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Data_Amount, "Effect.Data.Amount"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Data_Cooldown, "Effect.Data.Cooldown"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Data_Cost, "Effect.Data.Cost"); UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Data_Damage, "Effect.Data.Damage"); UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Data_Heal, "Effect.Data.Heal"); UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Type_Damage_Kill, "Effect.Type.Damage.Kill"); UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Type_Heal_Full, "Effect.Type.Heal.Full"); UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Type_Heal_Revive, "Effect.Type.Heal.Revive"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Type_Cost_Free, "Effect.Type.Cost.Free"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Type_Cost_Overtime, "Effect.Type.Cost.Overtime"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Effect_Type_Cost_Stamina, "Effect.Type.Cost.Stamina"); + +UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Dead, "Status.Dead"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Ghost, "Status.Ghost"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Immobilized, "Status.Immobilized"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Immune_Damage, "Status.Immune.Damage"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Revived, "Status.Revived"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Silenced, "Status.Silenced"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Status_NoCooldown, "Status.NoColdown"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Status_NoCost, "Status.NoCost"); +UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Stunned, "Status.Stunned"); UE_DEFINE_GAMEPLAY_TAG(Tag_GameplayEvent_Killed, "GameplayEvent.Killed"); UE_DEFINE_GAMEPLAY_TAG(Tag_GameplayEvent_Revived, "GameplayEvent.Revived"); @@ -17,13 +44,17 @@ UE_DEFINE_GAMEPLAY_TAG(Tag_GameplayEvent_Revived, "GameplayEvent.Revived"); UE_DEFINE_GAMEPLAY_TAG(Tag_MontageEvent_Cast_Begin, "MontageEvent.Cast.Begin"); UE_DEFINE_GAMEPLAY_TAG(Tag_MontageEvent_Cast_End, "MontageEvent.Cast.End"); -UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Dead, "Effect.Status.Dead"); -UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Ghost, "Effect.Status.Ghost"); -UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Immobilized, "Effect.Status.Immobilized"); -UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Immune_Damage, "Effect.Status.Immune.Damage"); -UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Revived, "Effect.Status.Revived"); -UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Silenced, "Effect.Status.Silenced"); -UE_DEFINE_GAMEPLAY_TAG(Tag_Status_Stunned, "Effect.Status.Stunned"); - UE_DEFINE_GAMEPLAY_TAG(Tag_Unit_Hero, "Unit.Hero"); UE_DEFINE_GAMEPLAY_TAG(Tag_Unit_Creature, "Unit.Creature"); + +TArray FCogSampleTagLibrary::ActiveAbilityCooldownTags = +{ + Tag_Ability_Cooldown_1, + Tag_Ability_Cooldown_2, + Tag_Ability_Cooldown_3, + Tag_Ability_Cooldown_4, + Tag_Ability_Cooldown_5, + Tag_Ability_Cooldown_6, + Tag_Ability_Cooldown_7, + Tag_Ability_Cooldown_8, +}; \ No newline at end of file diff --git a/Source/CogSample/CogSampleTagLibrary.h b/Source/CogSample/CogSampleTagLibrary.h index 698d24f..a0ad93b 100644 --- a/Source/CogSample/CogSampleTagLibrary.h +++ b/Source/CogSample/CogSampleTagLibrary.h @@ -3,16 +3,42 @@ #include "CoreMinimal.h" #include "NativeGameplayTags.h" +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Ability_Activation_Fail_Cooldown); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Ability_Activation_Fail_Cost); + +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Ability_Cooldown_1); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Ability_Cooldown_2); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Ability_Cooldown_3); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Ability_Cooldown_4); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Ability_Cooldown_5); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Ability_Cooldown_6); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Ability_Cooldown_7); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Ability_Cooldown_8); + UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Alignment_Negative); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Alignment_Positive); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Data_Amount); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Data_Cooldown); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Data_Cost); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Data_Damage); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Data_Heal); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Type_Damage_Kill); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Type_Heal_Full); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Type_Heal_Revive); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Type_Cost_Overtime); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Effect_Type_Cost_Stamina); + +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Dead); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Ghost); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Immobilized); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Immune_Damage); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_NoCooldown); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_NoCost); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Revived); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Silenced); +UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Stunned); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_GameplayEvent_Killed); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_GameplayEvent_Revived); @@ -20,16 +46,12 @@ UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_GameplayEvent_Revived); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_MontageEvent_Cast_Begin); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_MontageEvent_Cast_End); -UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Dead); -UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Ghost); -UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Immobilized); -UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Immune_Damage); -UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Revived); -UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Silenced); -UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Status_Stunned); - UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Unit_Hero); UE_DECLARE_GAMEPLAY_TAG_EXTERN(Tag_Unit_Creature); +struct FCogSampleTagLibrary +{ +public: - + static TArray ActiveAbilityCooldownTags; +}; \ No newline at end of file