Updated Eatable Items to Balance Resource Amounts

This commit is contained in:
Philip W 2023-05-11 01:17:21 +01:00
parent 918ea38889
commit 6e21026fcb

View File

@ -47,7 +47,7 @@ void UEatableItems::Use(ATempCharacter* Character)
if (TurnBaseCombat->ProbertiumResource < 10) if (TurnBaseCombat->ProbertiumResource < 10)
{ {
UE_LOG(LogTemp, Warning, TEXT("Probertium eaten")); UE_LOG(LogTemp, Warning, TEXT("Probertium eaten"));
TurnBaseCombat->ProbertiumResource += 5; TurnBaseCombat->ProbertiumResource = FMath::Clamp(TurnBaseCombat->ProbertiumResource + 2, 0, 10);
Character->Inventory->RemoveItem(this); Character->Inventory->RemoveItem(this);
} }
} }
@ -58,7 +58,7 @@ void UEatableItems::Use(ATempCharacter* Character)
if (TurnBaseCombat->EisResource < 10) if (TurnBaseCombat->EisResource < 10)
{ {
UE_LOG(LogTemp, Warning, TEXT("Eis eaten")); UE_LOG(LogTemp, Warning, TEXT("Eis eaten"));
TurnBaseCombat->EisResource += 5; TurnBaseCombat->EisResource = FMath::Clamp(TurnBaseCombat->EisResource + 2, 0, 10);
Character->Inventory->RemoveItem(this); Character->Inventory->RemoveItem(this);
} }
} }
@ -69,7 +69,7 @@ void UEatableItems::Use(ATempCharacter* Character)
if (TurnBaseCombat->AzosResource < 10) if (TurnBaseCombat->AzosResource < 10)
{ {
UE_LOG(LogTemp, Warning, TEXT("Azos eaten")); UE_LOG(LogTemp, Warning, TEXT("Azos eaten"));
TurnBaseCombat->AzosResource += 5; TurnBaseCombat->AzosResource = FMath::Clamp(TurnBaseCombat->AzosResource + 2, 0, 10);
Character->Inventory->RemoveItem(this); Character->Inventory->RemoveItem(this);
} }
} }
@ -80,7 +80,7 @@ void UEatableItems::Use(ATempCharacter* Character)
if (TurnBaseCombat->IroquoidResource < 10) if (TurnBaseCombat->IroquoidResource < 10)
{ {
UE_LOG(LogTemp, Warning, TEXT("Iroq eaten")); UE_LOG(LogTemp, Warning, TEXT("Iroq eaten"));
TurnBaseCombat->IroquoidResource += 5; TurnBaseCombat->IroquoidResource = FMath::Clamp(TurnBaseCombat->IroquoidResource + 3, 0, 10);
Character->Inventory->RemoveItem(this); Character->Inventory->RemoveItem(this);
} }
} }