Updated Combat to Include Enemy UI

This commit is contained in:
Philip W 2023-04-27 04:24:54 +01:00
parent 2df31aa719
commit 19fcc0c063
3 changed files with 5 additions and 3 deletions

Binary file not shown.

View File

@ -38,6 +38,7 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, bool bWasShot)
EnemyActor = Enemy;
if (bIsInCombat) return;
BookHUD->SetVisibility(ESlateVisibility::SelfHitTestInvisible);
HUD->AddToViewport(-1);
EscapePercentage = CalculateEscapePercentage();
EscapePercentageTextBlock->SetText(FText::Join(FText::FromString(""), FText::FromString(FString::FromInt(EscapePercentage * 100)), FText::FromString("%")));
bIsInCombat = true;
@ -110,6 +111,7 @@ void ATurnBaseCombatV2::CombatCheck(bool bWasShot)
void ATurnBaseCombatV2::EndCombat()
{
BookHUD->SetVisibility(ESlateVisibility::Hidden);
HUD->RemoveFromParent();
Cast<ATempCharacter>(PlayerActor)->ResetWidgetPointer();
TurnIndicatorTextBlock->SetText(FText::FromString(""));
bEnemyHasExtraTurn = false;

View File

@ -52,7 +52,7 @@ public:
UPROPERTY(EditDefaultsOnly)
UNiagaraSystem* GunEffect;
UPROPERTY(VisibleAnywhere)
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
AActor* PlayerActor;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
AActor* EnemyActor;