From 38ffd4f33950a1f6dfacd32cc2c852e089774d16 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Fri, 28 Apr 2023 03:59:03 +0100 Subject: [PATCH] Bugfix Force Look Pitch Not Correctly Set --- Content/BlueprintAI/AI/AIBruh.uasset | 4 ++-- Content/Blueprints/Combat_UI/CombatCharacter.uasset | 4 ++-- Content/Levels/Build.umap | 2 +- .../TurnBasedCombatV2/TurnBaseCombatV2.cpp | 10 ++++++---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Content/BlueprintAI/AI/AIBruh.uasset b/Content/BlueprintAI/AI/AIBruh.uasset index b2f12a4..76dd09b 100644 --- a/Content/BlueprintAI/AI/AIBruh.uasset +++ b/Content/BlueprintAI/AI/AIBruh.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:56040367e8248290b1d058fe961f8a676ff22e2455de7469e84d9f2ede960476 -size 100408 +oid sha256:75d30bedf300db8a7c00ff9308dfc923b1be37ea1347267ef4c33ce816af5da3 +size 100575 diff --git a/Content/Blueprints/Combat_UI/CombatCharacter.uasset b/Content/Blueprints/Combat_UI/CombatCharacter.uasset index 5e5fb42..475e82d 100644 --- a/Content/Blueprints/Combat_UI/CombatCharacter.uasset +++ b/Content/Blueprints/Combat_UI/CombatCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:03e8bd4b7be18b121bff5df6c1f758d4322e78b21a7f5a6f8c9f842690b095aa -size 158030 +oid sha256:7d3d3c4b6af61858a637820f41944fff55d0091fccd573ed0dda5b6d9d5ee1a0 +size 158954 diff --git a/Content/Levels/Build.umap b/Content/Levels/Build.umap index ff27586..b35a727 100644 --- a/Content/Levels/Build.umap +++ b/Content/Levels/Build.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5198c462a0d128c6563652c330f9d9b3a3ae8e9a46065d5019e4eb0491a3f564 +oid sha256:ef7435ba7bfeca25fb2d326365c6f7a8ef7b32178afe2ae5dd01afe2516b196c size 3486173 diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index c2f9917..26f93fc 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -10,6 +10,7 @@ #include "Components/TextBlock.h" #include "Components/ProgressBar.h" #include "Kismet/GameplayStatics.h" +#include "Kismet/KismetMathLibrary.h" #include "Misc/OutputDeviceNull.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(); Direction.Normalize(); FRotator LookAtRotation = FRotationMatrix::MakeFromX(Direction).Rotator(); - LookAtRotation.Pitch = -9.0f; + const FRotator NewRotation = UKismetMathLibrary::FindLookAtRotation(Cast(PlayerActor->FindComponentByClass())->GetComponentLocation(), Cast(EnemyActor->FindComponentByClass())->GetComponentLocation()); + LookAtRotation.Pitch = NewRotation.Pitch - PlayerActor->GetActorRotation().Pitch; PlayerController->SetControlRotation(LookAtRotation); if (EnemyBlackboard->GetValueAsBool("IsInCombat")) return; @@ -87,14 +89,14 @@ void ATurnBaseCombatV2::CombatCheck(bool bWasShot) EisResource = 10; AzosResource = 10; IroquoidResource = 10; - + ChainDamageMultiplier = 1.0f; BaseDamageMultiplier = 1.0f; DamageMultiplierTextBlock->SetText(FText::FromString("")); FProperty* ReactionSpeedProperty = EnemyActor->GetClass()->FindPropertyByName(FName("ReactionSpeed")); float* EnemyReactionSpeedPtr = ReactionSpeedProperty->ContainerPtrToValuePtr(EnemyActor); - + CurrentComboString = ""; UpdateComboString(CurrentComboString); RevertActionPoints(); @@ -103,7 +105,7 @@ void ATurnBaseCombatV2::CombatCheck(bool bWasShot) UpdateProgressBars(); ClearBattleLog(); EnableButtons(); - + if (EnemyBlackboard->GetValueAsBool("Sight") && !bWasShot) { //bEnemyHasExtraTurn = true;