From ccb50a804ee94ae5b806aa5723449a7dfa32940f Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Mon, 22 May 2023 17:12:08 +0100 Subject: [PATCH] Bugfix Player Getting Damaged Once Boss was Dead --- .../TurnBasedCombatV2/TurnBaseCombatV2.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index e0dbdff..9dfb719 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -62,7 +62,7 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, const bool bWasShot) PlayerActor->CallFunctionByNameWithArguments(*Command, AR, nullptr, true); const FString Command69 = FString::Printf(TEXT("CloseEscapeMenu")); PlayerActor->CallFunctionByNameWithArguments(*Command69, AR, nullptr, true); - + //Disable Character Movement APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); PlayerController->SetIgnoreMoveInput(true); @@ -112,7 +112,7 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, const bool bWasShot) void ATurnBaseCombatV2::CombatCheck(const bool bWasShot) { const UBlackboardComponent* EnemyBlackboard = Cast(EnemyActor->GetInstigatorController())->GetBlackboardComponent(); - + ChainDamageMultiplier = 0; BaseDamageMultiplier = DefaultBaseDamageMultiplier; EnemyBaseDamageMultiplier = DefaultEnemyBaseDamageMultiplier; @@ -415,6 +415,9 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo) if (!bPlayerHasExtraTurn) { + FProperty* IsBossProperty = FindFieldChecked(EnemyActor->GetClass(), "IsBoss"); + const FBoolProperty* IsBossBoolProperty = CastFieldChecked(IsBossProperty); + if (IsBossBoolProperty->GetPropertyValue_InContainer(EnemyActor) && EnemyHealth <= nullptr) return; SwitchTurn(); } else