Bugfix TurnBaseCombat Not Checking Resource Count

This commit is contained in:
Philip W 2022-11-15 01:21:47 +00:00
parent 9d72f60208
commit e57c99d103

View File

@ -100,12 +100,12 @@ void ATurnBaseCombat::ExecuteCast(FString Combo)
case true: case true:
// Player Turn // Player Turn
DamageEnemy(*ValidCombos.Find(Combo)); DamageEnemy(*ValidCombos.Find(Combo));
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, FString::Printf(TEXT("Enemy Damaged %d"), *ValidCombos.Find(Combo))); GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, FString::Printf(TEXT("Enemy Damaged %d"), *ValidCombos.Find(Combo)));
break; break;
case false: case false:
// Enemy Turn // Enemy Turn
DamagePlayer(*ValidCombos.Find(Combo)); DamagePlayer(*ValidCombos.Find(Combo));
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, FString::Printf(TEXT("Player Damaged %d"), *ValidCombos.Find(Combo))); GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, FString::Printf(TEXT("Player Damaged %d"), *ValidCombos.Find(Combo)));
break; break;
} }
//End Combat if either the player or enemy is dead //End Combat if either the player or enemy is dead
@ -186,7 +186,12 @@ void ATurnBaseCombat::FButtonOnClick()
{ {
if (ActiveActionPoints >= DefaultActionPoints) if (ActiveActionPoints >= DefaultActionPoints)
{ {
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, TEXT("No More Action Points")); GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Action Points"));
return;
}
if (IronResource <= 0)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Iron"));
return; return;
} }
UseActionPoint(); UseActionPoint();
@ -200,7 +205,12 @@ void ATurnBaseCombat::WButtonOnClick()
{ {
if (ActiveActionPoints >= DefaultActionPoints) if (ActiveActionPoints >= DefaultActionPoints)
{ {
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, TEXT("No More Action Points")); GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Action Points"));
return;
}
if (SulfurResource <= 0)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Sulfur"));
return; return;
} }
UseActionPoint(); UseActionPoint();
@ -214,7 +224,7 @@ void ATurnBaseCombat::BackspaceButtonOnClick()
{ {
if (CurrentComboString.Len() <= 0) if (CurrentComboString.Len() <= 0)
{ {
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, TEXT("Blank Combo")); GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Blank Combo"));
return; return;
} }
ReuseActionPoint(); ReuseActionPoint();