Bugfix Combat Initialisation Calculation Failure on Tutorial

This commit is contained in:
Philip W 2023-04-28 05:33:08 +01:00
parent 69dd199ad3
commit 99f88bb31c
4 changed files with 5 additions and 10 deletions

Binary file not shown.

View File

@ -8,7 +8,6 @@
#include "BehaviorTree/BlackboardComponent.h" #include "BehaviorTree/BlackboardComponent.h"
#include "Blueprint/UserWidget.h" #include "Blueprint/UserWidget.h"
#include "Camera/CameraComponent.h" #include "Camera/CameraComponent.h"
#include "Kismet/GameplayStatics.h"
#include "Misc/OutputDeviceNull.h" #include "Misc/OutputDeviceNull.h"
@ -61,11 +60,6 @@ void UHoldToInitCombat::TickComponent(float DeltaTime, ELevelTick TickType, FAct
{ {
CombatSystem->RedVignetteMaterialInstance->SetScalarParameterValue(FName("BlendWeight"), RedVignetteIntensity - DeltaTime * 2.0f); CombatSystem->RedVignetteMaterialInstance->SetScalarParameterValue(FName("BlendWeight"), RedVignetteIntensity - DeltaTime * 2.0f);
} }
if (bClickDown && TargetEnemy != nullptr)
{
Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState())->StartCombat(TargetEnemy);
}
} }
void UHoldToInitCombat::OnClickDown() void UHoldToInitCombat::OnClickDown()

View File

@ -72,6 +72,9 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, bool bWasShot)
{ {
DisableButtons(); DisableButtons();
CombatTutorialWidgetInstance->AddToViewport(); CombatTutorialWidgetInstance->AddToViewport();
FProperty* Property = FindFieldChecked<FProperty>(CombatTutorialWidgetInstance->GetClass(), "WasShot");
const FBoolProperty* WasShotProperty = CastFieldChecked<FBoolProperty>(Property);
WasShotProperty->SetPropertyValue_InContainer(CombatTutorialWidgetInstance, bWasShot);
HasSeenTutorial = true; HasSeenTutorial = true;
return; return;
} }

View File

@ -7,12 +7,10 @@
#include "Components/ProgressBar.h" #include "Components/ProgressBar.h"
#include "Components/TextBlock.h" #include "Components/TextBlock.h"
#include "StatusEffect.h" #include "StatusEffect.h"
#include "NiagaraComponent.h"
#include "NiagaraFunctionLibrary.h" #include "NiagaraFunctionLibrary.h"
#include "GameFramework/GameStateBase.h" #include "GameFramework/GameStateBase.h"
#include "Components/WidgetComponent.h" #include "Components/WidgetComponent.h"
#include "Engine/PostProcessVolume.h" #include "Engine/PostProcessVolume.h"
#include "StatusEffects/Thorns.h"
#include "TurnBaseCombatV2.generated.h" #include "TurnBaseCombatV2.generated.h"
class UNiagaraSystem; class UNiagaraSystem;