Setting the stage for bazaar upgrade system
This commit is contained in:
@@ -47,6 +47,7 @@ NetIndexFirstBitSegment=16
|
|||||||
+GameplayTagList=(Tag="SaveGameTags",DevComment="")
|
+GameplayTagList=(Tag="SaveGameTags",DevComment="")
|
||||||
+GameplayTagList=(Tag="SaveGameTags.Alchemy.TableLevel",DevComment="")
|
+GameplayTagList=(Tag="SaveGameTags.Alchemy.TableLevel",DevComment="")
|
||||||
+GameplayTagList=(Tag="SaveGameTags.Bazar.Table.InventorySpace",DevComment="")
|
+GameplayTagList=(Tag="SaveGameTags.Bazar.Table.InventorySpace",DevComment="")
|
||||||
|
+GameplayTagList=(Tag="SaveGameTags.Bazar.Table.UpgradeLevel.Capacity",DevComment="")
|
||||||
+GameplayTagList=(Tag="SaveGameTags.Chest",DevComment="")
|
+GameplayTagList=(Tag="SaveGameTags.Chest",DevComment="")
|
||||||
+GameplayTagList=(Tag="SaveGameTags.Chest.Locked",DevComment="")
|
+GameplayTagList=(Tag="SaveGameTags.Chest.Locked",DevComment="")
|
||||||
+GameplayTagList=(Tag="SaveGameTags.Chest.Opened",DevComment="")
|
+GameplayTagList=(Tag="SaveGameTags.Chest.Opened",DevComment="")
|
||||||
@@ -57,4 +58,6 @@ NetIndexFirstBitSegment=16
|
|||||||
+GameplayTagList=(Tag="Skins.Eleri.Body",DevComment="")
|
+GameplayTagList=(Tag="Skins.Eleri.Body",DevComment="")
|
||||||
+GameplayTagList=(Tag="Skins.Eleri.Default",DevComment="")
|
+GameplayTagList=(Tag="Skins.Eleri.Default",DevComment="")
|
||||||
+GameplayTagList=(Tag="Skins.Eleri.DefaultNoHat",DevComment="")
|
+GameplayTagList=(Tag="Skins.Eleri.DefaultNoHat",DevComment="")
|
||||||
|
+GameplayTagList=(Tag="Upgrade.Bazaar",DevComment="")
|
||||||
|
+GameplayTagList=(Tag="Upgrade.Bazaar.Capacity",DevComment="")
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -9,3 +9,33 @@ void UBazarSettingsDataAsset::PostLoad()
|
|||||||
Super::PostLoad();
|
Super::PostLoad();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32 UBazarSettingsDataAsset::GetCostOfUpgrade(const FGameplayTag& Tag, const int32 Level)
|
||||||
|
{
|
||||||
|
if (!Tag.IsValid() || Level > 10 || Level < 0) return 0;
|
||||||
|
|
||||||
|
for (auto Upgrade : UpgradeArray)
|
||||||
|
{
|
||||||
|
if (Tag == Upgrade.UpgradeTag)
|
||||||
|
{
|
||||||
|
return Upgrade.UpgradeCostCurve.GetRichCurveConst()->Eval(Level);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
float UBazarSettingsDataAsset::GetUpgradeBenefitAmount(const FGameplayTag& Tag, const int32 Level)
|
||||||
|
{
|
||||||
|
if (!Tag.IsValid() || Level > 10 || Level < 0) return 0.f;
|
||||||
|
|
||||||
|
for (auto Upgrade : UpgradeArray)
|
||||||
|
{
|
||||||
|
if (Tag == Upgrade.UpgradeTag)
|
||||||
|
{
|
||||||
|
return Upgrade.UpgradeBenefitCurve.GetRichCurveConst()->Eval(Level);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0.f;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "GameplayTagContainer.h"
|
||||||
#include "Engine/DataAsset.h"
|
#include "Engine/DataAsset.h"
|
||||||
#include "BazarSettingsDataAsset.generated.h"
|
#include "BazarSettingsDataAsset.generated.h"
|
||||||
|
|
||||||
@@ -68,6 +69,26 @@ struct FBazaarHaggleCardData
|
|||||||
int32 CardDifficulty;
|
int32 CardDifficulty;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
USTRUCT(BlueprintType)
|
||||||
|
struct FBazaarUpgradeData
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (GameplayTagFilter = "Upgrade.Bazaar"))
|
||||||
|
FGameplayTag UpgradeTag;
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
FText UpgradeName;
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
FText UpgradeDescription;
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
TSoftObjectPtr<UTexture2D> UpgradeIcon;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
FRuntimeFloatCurve UpgradeCostCurve;
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
FRuntimeFloatCurve UpgradeBenefitCurve;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -77,18 +98,28 @@ class PROJECTELERI_API UBazarSettingsDataAsset : public UDataAsset
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
public:
|
public:
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Eleri|Bazaar|Tresholds")
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Tresholds")
|
||||||
int32 HappyThreshold = 50;
|
int32 HappyThreshold = 50;
|
||||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Eleri|Bazaar|Tresholds")
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Tresholds")
|
||||||
int32 EmotionLowerThreshold = 65;
|
int32 EmotionLowerThreshold = 65;
|
||||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Eleri|Bazaar|Tresholds")
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Tresholds")
|
||||||
int32 EmotionUpperThreshold = 80;
|
int32 EmotionUpperThreshold = 80;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Eleri|Bazaar")
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "General")
|
||||||
TArray<FBazarDialogueEmotionData> AvailableDialogueEmotionData;
|
TArray<FBazarDialogueEmotionData> AvailableDialogueEmotionData;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Eleri|Bazaar")
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "General")
|
||||||
TArray<FBazaarHaggleCardData> HaggleCards;
|
TArray<FBazaarHaggleCardData> HaggleCards;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Upgrades")
|
||||||
|
TArray<FBazaarUpgradeData> UpgradeArray;
|
||||||
|
|
||||||
|
|
||||||
virtual void PostLoad() override;
|
virtual void PostLoad() override;
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintPure, Category = "Bazaar")
|
||||||
|
int32 GetCostOfUpgrade(const FGameplayTag& Tag, const int32 Level);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintPure, Category = "Bazaar")
|
||||||
|
float GetUpgradeBenefitAmount(const FGameplayTag& Tag, const int32 Level);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user