Skip to content

Commit

Permalink
feat : cpp 에서 native tag 추가 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisu96 committed Jun 7, 2024
1 parent 2bc8056 commit 75ad559
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 13 deletions.
2 changes: 0 additions & 2 deletions Config/DefaultGameplayTags.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ NumBitsForContainerSize=6
NetIndexFirstBitSegment=16
+GameplayTagList=(Tag="Attributes.Vital.Health",DevComment="Amount of dmg a player can take before death")
+GameplayTagList=(Tag="Attributes.Vital.Mana",DevComment="")
+GameplayTagList=(Tag="Attributes.Vital.MaxHealth",DevComment="")
+GameplayTagList=(Tag="Attributes.Vital.MaxMana",DevComment="")
+GameplayTagList=(Tag="Message.HealthCrystal",DevComment="")
+GameplayTagList=(Tag="Message.HealthPotion",DevComment="")
+GameplayTagList=(Tag="Message.ManaCrystal",DevComment="")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
void UAuraAbilitySystemComponent::AbilityActorInfoSet()
{
OnGameplayEffectAppliedDelegateToSelf.AddUObject(this,&UAuraAbilitySystemComponent::EffectApplied);

const FAuraGameplayTags& GameplayTags= FAuraGameplayTags::Get();
//GameplayTags.Attributes_Secondary_Armor.ToString();
GEngine->AddOnScreenDebugMessage(
-1,10.f,FColor::Orange,FString::Printf(TEXT("Tag : %s"),*GameplayTags.Attributes_Secondary_Armor.ToString()));

}

void UAuraAbilitySystemComponent::EffectApplied(UAbilitySystemComponent* AbilitySystemComponent,
Expand Down
78 changes: 76 additions & 2 deletions Source/Aura/Private/AuraGameplayTags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,80 @@ FAuraGameplayTags FAuraGameplayTags::GameplayTags; //전역변수

void FAuraGameplayTags::InitializeNativeGameplayTags()
{
//단순히 태그를 추가
GameplayTags.Attributes_Secondary_Armor = UGameplayTagsManager::Get().AddNativeGameplayTag(FName("Attributes.Secondary.Armor"),FString("Reduces damage taken, improves Block Chance"));
/*
* Primary Attributes
*/
GameplayTags.Attributes_Primary_Strength = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Primary.Strength"),
FString("Increases physical damage")
);

GameplayTags.Attributes_Primary_Intelligence = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Primary.Intelligence"),
FString("Increases magical damage")
);

GameplayTags.Attributes_Primary_Resilience = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Primary.Resilience"),
FString("Increases Armor and Armor Penetration")
);

GameplayTags.Attributes_Primary_Vigor = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Primary.Vigor"),
FString("Increases Health")
);

/*
* Secondary Attributes
*/

GameplayTags.Attributes_Secondary_Armor = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Secondary.Armor"),
FString("Reduces damage taken, improves Block Chance")
);

GameplayTags.Attributes_Secondary_ArmorPenetration = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Secondary.ArmorPenetration"),
FString("Ignores Percentage of enemy Armor, increases Critical Hit Chance")
);

GameplayTags.Attributes_Secondary_BlockChance = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Secondary.BlockChance"),
FString("Chance to cut incoming damage in half")
);

GameplayTags.Attributes_Secondary_CriticalHitChance = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Secondary.CriticalHitChance"),
FString("Chance to double damage plus critical hit bonus")
);

GameplayTags.Attributes_Secondary_CriticalHitDamage = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Secondary.CriticalHitDamage"),
FString("Bonus damage added when a critical hit is scored")
);

GameplayTags.Attributes_Secondary_CriticalHitResistance = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Secondary.CriticalHitResistance"),
FString("Reduces Critical Hit Chance of attacking enemies")
);

GameplayTags.Attributes_Secondary_HealthRegeneration = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Secondary.HealthRegeneration"),
FString("Amount of Health regenerated every 1 second")
);

GameplayTags.Attributes_Secondary_ManaRegeneration = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Secondary.ManaRegeneration"),
FString("Amount of Mana regenerated every 1 second")
);

GameplayTags.Attributes_Secondary_MaxHealth = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Secondary.MaxHealth"),
FString("Maximum amount of Health obtainable")
);

GameplayTags.Attributes_Secondary_MaxMana = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Attributes.Secondary.MaxMana"),
FString("Maximum amount of Mana obtainable")
);
}
21 changes: 17 additions & 4 deletions Source/Aura/Public/AuraGameplayTags.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,26 @@
struct FAuraGameplayTags
{
public:
static const FAuraGameplayTags& Get(){ return GameplayTags; }
static void InitializeNativeGameplayTags(); //@Setter
static const FAuraGameplayTags& Get(){ return GameplayTags; }
static void InitializeNativeGameplayTags(); //@Setter
FGameplayTag Attributes_Primary_Strength;
FGameplayTag Attributes_Primary_Intelligence;
FGameplayTag Attributes_Primary_Resilience;
FGameplayTag Attributes_Primary_Vigor;

FGameplayTag Attributes_Secondary_Armor;
FGameplayTag Attributes_Secondary_Armor;
FGameplayTag Attributes_Secondary_ArmorPenetration;
FGameplayTag Attributes_Secondary_BlockChance;
FGameplayTag Attributes_Secondary_CriticalHitChance;
FGameplayTag Attributes_Secondary_CriticalHitDamage;
FGameplayTag Attributes_Secondary_CriticalHitResistance;
FGameplayTag Attributes_Secondary_HealthRegeneration;
FGameplayTag Attributes_Secondary_ManaRegeneration;
FGameplayTag Attributes_Secondary_MaxHealth;
FGameplayTag Attributes_Secondary_MaxMana;

protected:

private:
static FAuraGameplayTags GameplayTags;
static FAuraGameplayTags GameplayTags;
};

0 comments on commit 75ad559

Please sign in to comment.