Bugfix Force Look Pitch Not Correctly Set

This commit is contained in:
Philip W 2023-04-28 03:59:03 +01:00
parent 9ecbd9c52d
commit 38ffd4f339
4 changed files with 11 additions and 9 deletions

BIN
Content/BlueprintAI/AI/AIBruh.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

BIN
Content/Levels/Build.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -10,6 +10,7 @@
#include "Components/TextBlock.h" #include "Components/TextBlock.h"
#include "Components/ProgressBar.h" #include "Components/ProgressBar.h"
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
#include "Kismet/KismetMathLibrary.h"
#include "Misc/OutputDeviceNull.h" #include "Misc/OutputDeviceNull.h"
#include "the_twilight_abyss/PlayerTemp/TempCharacter.h" #include "the_twilight_abyss/PlayerTemp/TempCharacter.h"
@ -56,7 +57,8 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, bool bWasShot)
FVector Direction = Enemy->GetActorLocation() - PlayerActor->GetActorLocation(); FVector Direction = Enemy->GetActorLocation() - PlayerActor->GetActorLocation();
Direction.Normalize(); Direction.Normalize();
FRotator LookAtRotation = FRotationMatrix::MakeFromX(Direction).Rotator(); FRotator LookAtRotation = FRotationMatrix::MakeFromX(Direction).Rotator();
LookAtRotation.Pitch = -9.0f; const FRotator NewRotation = UKismetMathLibrary::FindLookAtRotation(Cast<UCameraComponent>(PlayerActor->FindComponentByClass<UCameraComponent>())->GetComponentLocation(), Cast<USkeletalMeshComponent>(EnemyActor->FindComponentByClass<USkeletalMeshComponent>())->GetComponentLocation());
LookAtRotation.Pitch = NewRotation.Pitch - PlayerActor->GetActorRotation().Pitch;
PlayerController->SetControlRotation(LookAtRotation); PlayerController->SetControlRotation(LookAtRotation);
if (EnemyBlackboard->GetValueAsBool("IsInCombat")) return; if (EnemyBlackboard->GetValueAsBool("IsInCombat")) return;
@ -87,14 +89,14 @@ void ATurnBaseCombatV2::CombatCheck(bool bWasShot)
EisResource = 10; EisResource = 10;
AzosResource = 10; AzosResource = 10;
IroquoidResource = 10; IroquoidResource = 10;
ChainDamageMultiplier = 1.0f; ChainDamageMultiplier = 1.0f;
BaseDamageMultiplier = 1.0f; BaseDamageMultiplier = 1.0f;
DamageMultiplierTextBlock->SetText(FText::FromString("")); DamageMultiplierTextBlock->SetText(FText::FromString(""));
FProperty* ReactionSpeedProperty = EnemyActor->GetClass()->FindPropertyByName(FName("ReactionSpeed")); FProperty* ReactionSpeedProperty = EnemyActor->GetClass()->FindPropertyByName(FName("ReactionSpeed"));
float* EnemyReactionSpeedPtr = ReactionSpeedProperty->ContainerPtrToValuePtr<float>(EnemyActor); float* EnemyReactionSpeedPtr = ReactionSpeedProperty->ContainerPtrToValuePtr<float>(EnemyActor);
CurrentComboString = ""; CurrentComboString = "";
UpdateComboString(CurrentComboString); UpdateComboString(CurrentComboString);
RevertActionPoints(); RevertActionPoints();
@ -103,7 +105,7 @@ void ATurnBaseCombatV2::CombatCheck(bool bWasShot)
UpdateProgressBars(); UpdateProgressBars();
ClearBattleLog(); ClearBattleLog();
EnableButtons(); EnableButtons();
if (EnemyBlackboard->GetValueAsBool("Sight") && !bWasShot) if (EnemyBlackboard->GetValueAsBool("Sight") && !bWasShot)
{ {
//bEnemyHasExtraTurn = true; //bEnemyHasExtraTurn = true;