Updated Combat to Disable Escaping in Boss Battle

This commit is contained in:
Philip W 2023-05-20 02:01:08 +01:00
parent e67e32387c
commit e5b26c20ed
3 changed files with 8 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -86,6 +86,7 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, const bool bWasShot)
LookAtRotation.Pitch += 10; //Offset LookAtRotation.Pitch += 10; //Offset
PlayerController->SetControlRotation(LookAtRotation); PlayerController->SetControlRotation(LookAtRotation);
EnemyName = FText::FromString("Crystal Mutant"); EnemyName = FText::FromString("Crystal Mutant");
RunButton->SetIsEnabled(false);
} }
else EnemyName = FText::FromString("Feral Goat"); else EnemyName = FText::FromString("Feral Goat");
@ -781,7 +782,9 @@ void ATurnBaseCombatV2::EnableButtons() const
ToggleButtonIfResourceAvailable(); ToggleButtonIfResourceAvailable();
BackspaceButton->SetIsEnabled(true); BackspaceButton->SetIsEnabled(true);
CastButton->SetIsEnabled(true); CastButton->SetIsEnabled(true);
RunButton->SetIsEnabled(true); FProperty* IsBossProperty = FindFieldChecked<FProperty>(EnemyActor->GetClass(), "IsBoss");
const FBoolProperty* IsBossBoolProperty = CastFieldChecked<FBoolProperty>(IsBossProperty);
if (!IsBossBoolProperty->GetPropertyValue_InContainer(EnemyActor)) RunButton->SetIsEnabled(true);
} }
void ATurnBaseCombatV2::EnemyTurn() void ATurnBaseCombatV2::EnemyTurn()