From 6e21026fcb753e16d8ca6647b0e64cb5aa009d45 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Thu, 11 May 2023 01:17:21 +0100 Subject: [PATCH] Updated Eatable Items to Balance Resource Amounts --- .../the_twilight_abyss/BaseItems/Items/EatableItems.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp index 0271615..cab1c7a 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp +++ b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp @@ -47,7 +47,7 @@ void UEatableItems::Use(ATempCharacter* Character) if (TurnBaseCombat->ProbertiumResource < 10) { UE_LOG(LogTemp, Warning, TEXT("Probertium eaten")); - TurnBaseCombat->ProbertiumResource += 5; + TurnBaseCombat->ProbertiumResource = FMath::Clamp(TurnBaseCombat->ProbertiumResource + 2, 0, 10); Character->Inventory->RemoveItem(this); } } @@ -58,7 +58,7 @@ void UEatableItems::Use(ATempCharacter* Character) if (TurnBaseCombat->EisResource < 10) { UE_LOG(LogTemp, Warning, TEXT("Eis eaten")); - TurnBaseCombat->EisResource += 5; + TurnBaseCombat->EisResource = FMath::Clamp(TurnBaseCombat->EisResource + 2, 0, 10); Character->Inventory->RemoveItem(this); } } @@ -69,7 +69,7 @@ void UEatableItems::Use(ATempCharacter* Character) if (TurnBaseCombat->AzosResource < 10) { UE_LOG(LogTemp, Warning, TEXT("Azos eaten")); - TurnBaseCombat->AzosResource += 5; + TurnBaseCombat->AzosResource = FMath::Clamp(TurnBaseCombat->AzosResource + 2, 0, 10); Character->Inventory->RemoveItem(this); } } @@ -80,7 +80,7 @@ void UEatableItems::Use(ATempCharacter* Character) if (TurnBaseCombat->IroquoidResource < 10) { UE_LOG(LogTemp, Warning, TEXT("Iroq eaten")); - TurnBaseCombat->IroquoidResource += 5; + TurnBaseCombat->IroquoidResource = FMath::Clamp(TurnBaseCombat->IroquoidResource + 3, 0, 10); Character->Inventory->RemoveItem(this); } }