Setting the stage for bazaar upgrade system

This commit is contained in:
2026-08-30 22:05:10 +02:00
parent a6f88e19d4
commit 694a8ba792
5 changed files with 73 additions and 9 deletions

View File

@@ -9,3 +9,33 @@ void UBazarSettingsDataAsset::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;
}