diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index 57105e6..daf56e5 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -57,6 +57,7 @@ bAuthorizeAutomaticWidgetVariableCreation=False +ActiveGameNameRedirects=(OldGameName="TP_Blank",NewGameName="/Script/Promether") +ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/Promether") +ActiveClassRedirects=(OldClassName="TP_BlankGameModeBase",NewClassName="PrometherGameModeBase") +AssetManagerClassName=/Script/Promether.DefaultAssetManager [/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] bEnablePlugin=True diff --git a/Config/DefaultGameplayTags.ini b/Config/DefaultGameplayTags.ini new file mode 100644 index 0000000..fb2bf5b --- /dev/null +++ b/Config/DefaultGameplayTags.ini @@ -0,0 +1,13 @@ +[/Script/GameplayTags.GameplayTagsSettings] +ImportTagsFromConfig=True +WarnOnInvalidTags=True +ClearInvalidTags=False +AllowEditorTagUnloading=True +AllowGameTagUnloading=False +FastReplication=False +InvalidTagCharacters="\"\'," +NumBitsForContainerSize=6 +NetIndexFirstBitSegment=16 ++GameplayTagList=(Tag="State.Dead",DevComment="") ++GameplayTagList=(Tag="State.EffectTag",DevComment="") + diff --git a/Content/Character/Lb/Abilities/BP_BaseAttack.uasset b/Content/Character/Lb/Abilities/BP_BaseAttack.uasset new file mode 100644 index 0000000..c4b95b9 --- /dev/null +++ b/Content/Character/Lb/Abilities/BP_BaseAttack.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2584a5a086fb10778e20f238a7c7275a8062b7ccb38e2f835785616c12a6813 +size 14879 diff --git a/Content/Character/Lb/Animation/E_Anim.uasset b/Content/Character/Lb/Animation/E_Anim.uasset index 08336fd..31832ef 100644 --- a/Content/Character/Lb/Animation/E_Anim.uasset +++ b/Content/Character/Lb/Animation/E_Anim.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9c8694fccfbab17963a29a270353188444a1c19c30b360475ab981a5ef78c11d -size 90904 +oid sha256:d79984baabf571e7603f02a418a073e333050ec77f10e78c864cf89c67f7a12f +size 89687 diff --git a/Content/Character/Lb/Animation/Q_Anim.uasset b/Content/Character/Lb/Animation/Q_Anim.uasset index bd4789f..a12aeaf 100644 --- a/Content/Character/Lb/Animation/Q_Anim.uasset +++ b/Content/Character/Lb/Animation/Q_Anim.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c9b6cbfa28cc8bfa6d335083479bedaa9ba294a16ff8222a8092aad04160b7ea -size 111852 +oid sha256:eae213f04d636178a734fdd340884d960ec7f449b78366bbe4efcd53b1ef4945 +size 110638 diff --git a/Content/Character/Lb/Animation/R2_Anim.uasset b/Content/Character/Lb/Animation/R2_Anim.uasset index c55daea..9ae7de2 100644 --- a/Content/Character/Lb/Animation/R2_Anim.uasset +++ b/Content/Character/Lb/Animation/R2_Anim.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:accff8903dd24f4e7a6098b890b7afa3d5607c8f50147828ac9a1ff3f93332a2 -size 165959 +oid sha256:bb471f98eb0e0676af92fea68b195de3962ab18473d886fde7ca996b064fe650 +size 164753 diff --git a/Content/Character/Lb/Animation/W_Anim.uasset b/Content/Character/Lb/Animation/W_Anim.uasset index e21ff5f..0f3423d 100644 --- a/Content/Character/Lb/Animation/W_Anim.uasset +++ b/Content/Character/Lb/Animation/W_Anim.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e390834f26d7928c3c811560823959561184107b80f49fe8fbc07afe9e9764f5 -size 119723 +oid sha256:39a541ed5a3e020bcd1fd18a54875b1806156c98953790d523c9b86703f03b7b +size 118508 diff --git a/Content/NewControlRigBlueprint.uasset b/Content/NewControlRigBlueprint.uasset deleted file mode 100644 index 607c67e..0000000 --- a/Content/NewControlRigBlueprint.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a0af49617db05956be7673fd5bec0f1fdb3e31dabaeb9987d052c539ff6acf58 -size 12333 diff --git a/Promether.uproject b/Promether.uproject index 09143f2..595e605 100644 --- a/Promether.uproject +++ b/Promether.uproject @@ -11,7 +11,8 @@ "AdditionalDependencies": [ "Engine", "CoreUObject", - "AIModule" + "AIModule", + "GameplayAbilities" ] } ], diff --git a/Source/Promether/AnimNotify/AN_Skill4_End.cpp b/Source/Promether/AnimNotify/AN_Skill4_End.cpp deleted file mode 100644 index 6b1afdc..0000000 --- a/Source/Promether/AnimNotify/AN_Skill4_End.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "AN_Skill4_End.h" - -#include "../PlayerGeneric/DefaultPlayerCharacter.h" - -void UAN_Skill4_End::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference) -{ - ADefaultPlayerCharacter* MyCharacter = MeshComp->GetOwner(); - if (!MyCharacter) return; - - MyCharacter->Skill4_End(); -} diff --git a/Source/Promether/AnimNotify/AN_Skill4_End.h b/Source/Promether/AnimNotify/AN_Skill4_End.h deleted file mode 100644 index e2750dd..0000000 --- a/Source/Promether/AnimNotify/AN_Skill4_End.h +++ /dev/null @@ -1,19 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "Animation/AnimNotifies/AnimNotify.h" -#include "AN_Skill4_End.generated.h" - -/** - * - */ -UCLASS() -class PROMETHER_API UAN_Skill4_End : public UAnimNotify -{ - GENERATED_BODY() - -public: - virtual void Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference) override; -}; diff --git a/Source/Promether/AnimNotify/AN_Skill5.cpp b/Source/Promether/AnimNotify/AN_Skill5.cpp deleted file mode 100644 index 10c0e7c..0000000 --- a/Source/Promether/AnimNotify/AN_Skill5.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "AN_Skill5.h" - diff --git a/Source/Promether/AnimNotify/AN_Skill6.h b/Source/Promether/AnimNotify/AN_Skill6.h deleted file mode 100644 index 60c37e3..0000000 --- a/Source/Promether/AnimNotify/AN_Skill6.h +++ /dev/null @@ -1,17 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "Animation/AnimNotifies/AnimNotify.h" -#include "AN_Skill6.generated.h" - -/** - * - */ -UCLASS() -class PROMETHER_API UAN_Skill6 : public UAnimNotify -{ - GENERATED_BODY() - -}; diff --git a/Source/Promether/AnimNotify/AN_Skill7.cpp b/Source/Promether/AnimNotify/AN_Skill7.cpp deleted file mode 100644 index 8866e78..0000000 --- a/Source/Promether/AnimNotify/AN_Skill7.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "AN_Skill7.h" - diff --git a/Source/Promether/AnimNotify/AN_Skill7.h b/Source/Promether/AnimNotify/AN_Skill7.h deleted file mode 100644 index 51b923b..0000000 --- a/Source/Promether/AnimNotify/AN_Skill7.h +++ /dev/null @@ -1,17 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "Animation/AnimNotifies/AnimNotify.h" -#include "AN_Skill7.generated.h" - -/** - * - */ -UCLASS() -class PROMETHER_API UAN_Skill7 : public UAnimNotify -{ - GENERATED_BODY() - -}; diff --git a/Source/Promether/DefaultAssetManager.cpp b/Source/Promether/DefaultAssetManager.cpp new file mode 100644 index 0000000..3013e77 --- /dev/null +++ b/Source/Promether/DefaultAssetManager.cpp @@ -0,0 +1,11 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "DefaultAssetManager.h" +#include "AbilitySystemGlobals.h" + +void UDefaultAssetManager::StartInitialLoading() +{ + Super::StartInitialLoading(); + UAbilitySystemGlobals::Get().InitGlobalData(); +} diff --git a/Source/Promether/DefaultAssetManager.h b/Source/Promether/DefaultAssetManager.h new file mode 100644 index 0000000..d3043fa --- /dev/null +++ b/Source/Promether/DefaultAssetManager.h @@ -0,0 +1,19 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Engine/AssetManager.h" +#include "DefaultAssetManager.generated.h" + +/** + * + */ +UCLASS() +class PROMETHER_API UDefaultAssetManager : public UAssetManager +{ + GENERATED_BODY() + +public: + virtual void StartInitialLoading() override; +}; diff --git a/Source/Promether/AnimNotify/AN_Skill6.cpp b/Source/Promether/GAS/Abilities/CharacterGameplayAbility.cpp similarity index 68% rename from Source/Promether/AnimNotify/AN_Skill6.cpp rename to Source/Promether/GAS/Abilities/CharacterGameplayAbility.cpp index e2f2afd..6fa6ab8 100644 --- a/Source/Promether/AnimNotify/AN_Skill6.cpp +++ b/Source/Promether/GAS/Abilities/CharacterGameplayAbility.cpp @@ -1,5 +1,5 @@ // Fill out your copyright notice in the Description page of Project Settings. -#include "AN_Skill6.h" +#include "CharacterGameplayAbility.h" diff --git a/Source/Promether/AnimNotify/AN_Skill5.h b/Source/Promether/GAS/Abilities/CharacterGameplayAbility.h similarity index 51% rename from Source/Promether/AnimNotify/AN_Skill5.h rename to Source/Promether/GAS/Abilities/CharacterGameplayAbility.h index 1d760ab..aca7cb9 100644 --- a/Source/Promether/AnimNotify/AN_Skill5.h +++ b/Source/Promether/GAS/Abilities/CharacterGameplayAbility.h @@ -3,14 +3,14 @@ #pragma once #include "CoreMinimal.h" -#include "Animation/AnimNotifies/AnimNotify.h" -#include "AN_Skill5.generated.h" +#include "Abilities/GameplayAbility.h" +#include "CharacterGameplayAbility.generated.h" /** * */ UCLASS() -class PROMETHER_API UAN_Skill5 : public UAnimNotify +class PROMETHER_API UCharacterGameplayAbility : public UGameplayAbility { GENERATED_BODY() diff --git a/Source/Promether/GAS/AttributeSet/CharacterBaseAttribute.cpp b/Source/Promether/GAS/AttributeSet/CharacterBaseAttribute.cpp new file mode 100644 index 0000000..bfea36c --- /dev/null +++ b/Source/Promether/GAS/AttributeSet/CharacterBaseAttribute.cpp @@ -0,0 +1,35 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "CharacterBaseAttribute.h" +#include "Net/UnrealNetwork.h" + +void UCharacterBaseAttribute::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + DOREPLIFETIME_CONDITION_NOTIFY(UCharacterBaseAttribute, Health, COND_None, REPNOTIFY_Always); + DOREPLIFETIME_CONDITION_NOTIFY(UCharacterBaseAttribute, MaxHealth, COND_None, REPNOTIFY_Always); + DOREPLIFETIME_CONDITION_NOTIFY(UCharacterBaseAttribute, Mana, COND_None, REPNOTIFY_Always); + DOREPLIFETIME_CONDITION_NOTIFY(UCharacterBaseAttribute, MaxMana, COND_None, REPNOTIFY_Always); +} + +void UCharacterBaseAttribute::OnRep_Health(const FGameplayAttributeData& OldHealth) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCharacterBaseAttribute, Health, OldHealth); +} + +void UCharacterBaseAttribute::OnRep_MaxHealth(const FGameplayAttributeData& OldMaxHealth) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCharacterBaseAttribute, MaxHealth, OldMaxHealth); +} + +void UCharacterBaseAttribute::OnRep_Mana(const FGameplayAttributeData& OldMana) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCharacterBaseAttribute, Mana, OldMana); +} + +void UCharacterBaseAttribute::OnRep_MaxMana(const FGameplayAttributeData& OldMaxMana) +{ + GAMEPLAYATTRIBUTE_REPNOTIFY(UCharacterBaseAttribute, MaxMana, OldMaxMana); +} diff --git a/Source/Promether/GAS/AttributeSet/CharacterBaseAttribute.h b/Source/Promether/GAS/AttributeSet/CharacterBaseAttribute.h new file mode 100644 index 0000000..0586507 --- /dev/null +++ b/Source/Promether/GAS/AttributeSet/CharacterBaseAttribute.h @@ -0,0 +1,56 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "AttributeSet.h" +#include "AbilitySystemComponent.h" +#include "CharacterBaseAttribute.generated.h" + +#define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \ + GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \ + GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \ + GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \ + GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName) + +UCLASS() +class PROMETHER_API UCharacterBaseAttribute : public UAttributeSet +{ + GENERATED_BODY() + +public: + //Replicated + virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; + + UPROPERTY(BlueprintReadonly, Category = "Health", ReplicatedUsing = OnRep_Health) + FGameplayAttributeData Health; + ATTRIBUTE_ACCESSORS(UCharacterBaseAttribute, Health) + + UPROPERTY(BlueprintReadonly, Category = "Health", ReplicatedUsing = OnRep_MaxHealth) + FGameplayAttributeData MaxHealth; + ATTRIBUTE_ACCESSORS(UCharacterBaseAttribute, MaxHealth) + + UPROPERTY(BlueprintReadonly, Category = "Mana", ReplicatedUsing = OnRep_Mana) + FGameplayAttributeData Mana; + ATTRIBUTE_ACCESSORS(UCharacterBaseAttribute, Mana) + + UPROPERTY(BlueprintReadonly, Category = "Mana", ReplicatedUsing = OnRep_MaxMana) + FGameplayAttributeData MaxMana; + ATTRIBUTE_ACCESSORS(UCharacterBaseAttribute, MaxMana) + + UFUNCTION() + virtual void OnRep_Health(const FGameplayAttributeData& OldHealth); + UFUNCTION() + virtual void OnRep_MaxHealth(const FGameplayAttributeData& OldMaxHealth); + UFUNCTION() + virtual void OnRep_Mana(const FGameplayAttributeData& OldMana); + UFUNCTION() + virtual void OnRep_MaxMana(const FGameplayAttributeData& OldMaxMana); + +public: + //Not Replicated + UPROPERTY(BlueprintReadonly, Category = "Damage") + FGameplayAttributeData Damage; + ATTRIBUTE_ACCESSORS(UCharacterBaseAttribute, Damage) + +}; diff --git a/Source/Promether/GAS/DefaultAbilitySystemComponent.cpp b/Source/Promether/GAS/DefaultAbilitySystemComponent.cpp new file mode 100644 index 0000000..38a97d0 --- /dev/null +++ b/Source/Promether/GAS/DefaultAbilitySystemComponent.cpp @@ -0,0 +1,9 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "DefaultAbilitySystemComponent.h" + +void UDefaultAbilitySystemComponent::ReceiveDamage(UDefaultAbilitySystemComponent* SourceASC, float UnmitigatedDamage, float MitigatedDamage) +{ + ReceivedDamage.ExecuteIfBound(SourceASC, UnmitigatedDamage, MitigatedDamage); +} diff --git a/Source/Promether/GAS/DefaultAbilitySystemComponent.h b/Source/Promether/GAS/DefaultAbilitySystemComponent.h new file mode 100644 index 0000000..1c7cc0e --- /dev/null +++ b/Source/Promether/GAS/DefaultAbilitySystemComponent.h @@ -0,0 +1,20 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "AbilitySystemComponent.h" +#include "DefaultAbilitySystemComponent.generated.h" + +DECLARE_DYNAMIC_DELEGATE_ThreeParams(FReceivedDamageDelegate, UDefaultAbilitySystemComponent*, SourceASC, float, UnmitigatedDamage, float, MitigatedDamage); + +UCLASS() +class PROMETHER_API UDefaultAbilitySystemComponent : public UAbilitySystemComponent +{ + GENERATED_BODY() +public: + FReceivedDamageDelegate ReceivedDamage; + + virtual void ReceiveDamage(UDefaultAbilitySystemComponent* SourceASC, float UnmitigatedDamage, float MitigatedDamage); + +}; diff --git a/Source/Promether/PlayerGeneric/DefaultPlayerState.cpp b/Source/Promether/PlayerGeneric/DefaultPlayerState.cpp index 2ab440b..13cdf64 100644 --- a/Source/Promether/PlayerGeneric/DefaultPlayerState.cpp +++ b/Source/Promether/PlayerGeneric/DefaultPlayerState.cpp @@ -1,11 +1,24 @@ #include "DefaultPlayerState.h" #include "Net/UnrealNetwork.h" +#include "../GAS/DefaultAbilitySystemComponent.h" +#include "../GAS/AttributeSet/CharacterBaseAttribute.h" ADefaultPlayerState::ADefaultPlayerState() { - CharacterBPRef = nullptr;; + CharacterBPRef = nullptr; Team = TeamType::Null; State = ECharacterState::Idle; + + AbilitySystemComponent = CreateDefaultSubobject(TEXT("AbilitySystemComponent")); + AbilitySystemComponent->SetIsReplicated(true); + AbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Mixed); + + Attribute = CreateDefaultSubobject(TEXT("Attribute")); + + NetUpdateFrequency = 100.0f; + + DeadTag = FGameplayTag::RequestGameplayTag(FName("State.Dead")); + EffectTag = FGameplayTag::RequestGameplayTag(FName("State.EffectTag")); } void ADefaultPlayerState::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const @@ -28,6 +41,31 @@ void ADefaultPlayerState::GetLifetimeReplicatedProps(TArray& DOREPLIFETIME(ADefaultPlayerState, PreviousAttackTarget); } +UAbilitySystemComponent* ADefaultPlayerState::GetAbilitySystemComponent() const +{ + return AbilitySystemComponent; +} + +float ADefaultPlayerState::GetHealth() const +{ + return Attribute->GetHealth(); +} + +float ADefaultPlayerState::GetMaxHealth() const +{ + return Attribute->GetMaxHealth(); +} + +float ADefaultPlayerState::GetMana() const +{ + return Attribute->GetMana(); +} + +float ADefaultPlayerState::GetMaxMana() const +{ + return Attribute->GetMaxMana(); +} + void ADefaultPlayerState::InitPlayerStats_Implementation(const TArray& StatsValue, const TArray& CooldownDurationValue) { MaxStats.Append(StatsValue); @@ -88,6 +126,37 @@ void ADefaultPlayerState::SetPreviousAttackTarget(AActor* Target) Client_SetPreviousAttackTarget(Target); } +void ADefaultPlayerState::BeginPlay() +{ + Super::BeginPlay(); + + if (AbilitySystemComponent) + { + HealthChangedDelegateHandle = AbilitySystemComponent->GetGameplayAttributeValueChangeDelegate(Attribute->GetHealthAttribute()).AddUObject(this, &ADefaultPlayerState::HealthChanged); + MaxHealthChangedDelegateHandle = AbilitySystemComponent->GetGameplayAttributeValueChangeDelegate(Attribute->GetMaxHealthAttribute()).AddUObject(this, &ADefaultPlayerState::MaxHealthChanged); + ManaChangedDelegateHandle = AbilitySystemComponent->GetGameplayAttributeValueChangeDelegate(Attribute->GetManaAttribute()).AddUObject(this, &ADefaultPlayerState::ManaChanged); + MaxManaChangedDelegateHandle = AbilitySystemComponent->GetGameplayAttributeValueChangeDelegate(Attribute->GetMaxManaAttribute()).AddUObject(this, &ADefaultPlayerState::MaxManaChanged); + + //AbilitySystemComponent->RegisterGameplayTagEvent(FGameplayTag::Request) + } +} + +void ADefaultPlayerState::HealthChanged(const FOnAttributeChangeData& Data) +{ +} + +void ADefaultPlayerState::MaxHealthChanged(const FOnAttributeChangeData& Data) +{ +} + +void ADefaultPlayerState::ManaChanged(const FOnAttributeChangeData& Data) +{ +} + +void ADefaultPlayerState::MaxManaChanged(const FOnAttributeChangeData& Data) +{ +} + void ADefaultPlayerState::Server_SetPreviousAttackTarget_Implementation(AActor* Target) { PreviousAttackTarget = Target; diff --git a/Source/Promether/PlayerGeneric/DefaultPlayerState.h b/Source/Promether/PlayerGeneric/DefaultPlayerState.h index a37ea68..a7cf137 100644 --- a/Source/Promether/PlayerGeneric/DefaultPlayerState.h +++ b/Source/Promether/PlayerGeneric/DefaultPlayerState.h @@ -4,16 +4,18 @@ #include "CoreMinimal.h" #include "GameFramework/PlayerState.h" +#include "AbilitySystemInterface.h" +#include "GameplayTagContainer.h" +#include "GameplayEffectTypes.h" #include #include #include "../PrometherEnum.h" #include "DefaultPlayerCharacter.h" -#include "../StatusEffect/StatusEffect.h" #include "DefaultPlayerState.generated.h" UCLASS() -class PROMETHER_API ADefaultPlayerState : public APlayerState +class PROMETHER_API ADefaultPlayerState : public APlayerState, public IAbilitySystemInterface { GENERATED_BODY() @@ -21,14 +23,27 @@ public: ADefaultPlayerState(); void GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const override; + virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override; + UFUNCTION(Server, Reliable) void InitPlayerStats(const TArray& StatsValue, const TArray& CooldownDurationValue); void SetCharacterBPRef(UClass* Value) { CharacterBPRef = Value; } UClass* GetCharacterBPRef() const { return CharacterBPRef; } - + UFUNCTION(BlueprintCallable, Category = "Attributes") + float GetHealth() const; + UFUNCTION(BlueprintCallable, Category = "Attributes") + float GetMaxHealth() const; + UFUNCTION(BlueprintCallable, Category = "Attributes") + float GetMana() const; + UFUNCTION(BlueprintCallable, Category = "Attributes") + float GetMaxMana() const; + class UCharacterBaseAttribute* GetAttributeSet() const; + + //UFUNCTION(BlueprintCallable) + //bool IsDead() const; UFUNCTION(BlueprintCallable) void SetTeam(TeamType Value) { Team = Value; } @@ -90,7 +105,28 @@ public: UPROPERTY(Replicated, Transient, BlueprintReadWrite) TArray MaxCooldownDuration; - +protected: + class UDefaultAbilitySystemComponent* AbilitySystemComponent; + class UCharacterBaseAttribute* Attribute; + + FGameplayTag DeadTag; + FGameplayTag EffectTag; + + FDelegateHandle HealthChangedDelegateHandle; + FDelegateHandle MaxHealthChangedDelegateHandle; + FDelegateHandle ManaChangedDelegateHandle; + FDelegateHandle MaxManaChangedDelegateHandle; + + virtual void BeginPlay() override; + + virtual void HealthChanged(const FOnAttributeChangeData& Data); + virtual void MaxHealthChanged(const FOnAttributeChangeData& Data); + virtual void ManaChanged(const FOnAttributeChangeData& Data); + virtual void MaxManaChanged(const FOnAttributeChangeData& Data); + + UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Abilities") + TSubclassOf DefaultAttributes; + private: UPROPERTY(Replicated, Transient) UClass* CharacterBPRef; diff --git a/Source/Promether/Promether.h b/Source/Promether/Promether.h index 677c8e2..0284f0f 100644 --- a/Source/Promether/Promether.h +++ b/Source/Promether/Promether.h @@ -4,3 +4,18 @@ #include "CoreMinimal.h" +UENUM(BlueprintType) +enum class EDefaultAbilityID : uint8 +{ + None UMETA(DisplayName = "None"), + BaseAttack UMETA(DisplayName = "BaseAttack"), + Skill1 UMETA(DisplayName = "Skill1"), + Skill2 UMETA(DisplayName = "Skill2"), + Skill3 UMETA(DisplayName = "Skill3"), + Skill4 UMETA(DisplayName = "Skill4"), + RuneSpell1 UMETA(DisplayName = "RuneSpell1"), + RuneSpell2 UMETA(DisplayName = "RuneSpell2"), + Ward UMETA(DisplayName = "Ward"), + Bomb UMETA(DisplayName = "Bomb"), + SIZE +}; \ No newline at end of file diff --git a/Source/Promether/StatusEffect/StatusEffect.cpp b/Source/Promether/StatusEffect/StatusEffect.cpp deleted file mode 100644 index 0d5e504..0000000 --- a/Source/Promether/StatusEffect/StatusEffect.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "StatusEffect.h" - diff --git a/Source/Promether/StatusEffect/StatusEffect.h b/Source/Promether/StatusEffect/StatusEffect.h deleted file mode 100644 index 29e7bd8..0000000 --- a/Source/Promether/StatusEffect/StatusEffect.h +++ /dev/null @@ -1,19 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "UObject/NoExportTypes.h" -#include "StatusEffect.generated.h" - -/** - * - */ -UCLASS() -class PROMETHER_API UStatusEffect : public UObject -{ - GENERATED_BODY() - -public: - -};