From 9fd372ed9d33bae8a21fe026ff60ba7abe928ae0 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Thu, 27 Apr 2023 05:13:41 +0100 Subject: [PATCH] Updated Combat to Include Camera Shake on Shoot & Wall Break --- Content/Blueprints/Combat_UI/CMS_Shoot.uasset | 3 +++ Content/Blueprints/Combat_UI/CMS_WallBreak.uasset | 3 +++ Content/Blueprints/Combat_UI/CombatCharacter.uasset | 4 ++-- Content/Levels/Testing/BreakableWall_BP.uasset | 4 ++-- .../TurnBasedCombatV2/HoldToInitCombat.cpp | 4 ++++ .../TurnBasedCombatV2/TurnBaseCombatV2.cpp | 4 ++++ Source/the_twilight_abyss/the_twilight_abyss.Build.cs | 9 +++++---- 7 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 Content/Blueprints/Combat_UI/CMS_Shoot.uasset create mode 100644 Content/Blueprints/Combat_UI/CMS_WallBreak.uasset diff --git a/Content/Blueprints/Combat_UI/CMS_Shoot.uasset b/Content/Blueprints/Combat_UI/CMS_Shoot.uasset new file mode 100644 index 0000000..3eaf085 --- /dev/null +++ b/Content/Blueprints/Combat_UI/CMS_Shoot.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c3b80326cc53c62ae9a4b78df19906c1222c2625b93489295b542030e0806bb +size 6801 diff --git a/Content/Blueprints/Combat_UI/CMS_WallBreak.uasset b/Content/Blueprints/Combat_UI/CMS_WallBreak.uasset new file mode 100644 index 0000000..814cac2 --- /dev/null +++ b/Content/Blueprints/Combat_UI/CMS_WallBreak.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f3b8e05793951695c9804d68284836fb4b1f4f62b6cbe39e13574adf43829af +size 6531 diff --git a/Content/Blueprints/Combat_UI/CombatCharacter.uasset b/Content/Blueprints/Combat_UI/CombatCharacter.uasset index 2163b9a..abf2202 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:346a3d21e4e538c02d2e4680bb718d4bf71254fe7c402325b5cae48599825fd9 -size 146427 +oid sha256:8716a81dbb2ed49fa3142483140ace8f6b59aa28de3f8d7bba096953e3e7a953 +size 158858 diff --git a/Content/Levels/Testing/BreakableWall_BP.uasset b/Content/Levels/Testing/BreakableWall_BP.uasset index 6506a2a..2640aa9 100644 --- a/Content/Levels/Testing/BreakableWall_BP.uasset +++ b/Content/Levels/Testing/BreakableWall_BP.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:32537f2eab4fb3e51d20c782bc2753ea89d616a4430ee5713b6fcc150c78457d -size 49404 +oid sha256:633056e1d85d7920d4ea920006474e6d5fe7493a4d481fc0002e554d75499b57 +size 71767 diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/HoldToInitCombat.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/HoldToInitCombat.cpp index 513d062..658ae62 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/HoldToInitCombat.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/HoldToInitCombat.cpp @@ -7,6 +7,7 @@ #include "TurnBaseCombatV2.h" #include "BehaviorTree/BlackboardComponent.h" #include "Blueprint/UserWidget.h" +#include "Misc/OutputDeviceNull.h" // Sets default values for this component's properties @@ -68,6 +69,9 @@ void UHoldToInitCombat::OnClickDown() const UStaticMeshComponent* GunComponent = Cast(PlayerActor->GetComponentsByTag(UPrimitiveComponent::StaticClass(), FName("Gun"))[0]); const FVector GunLocationOffset = GunComponent->GetSocketTransform("Muzzle").TransformPosition(FVector(-100, 0, 0)); UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), GunEffect, GunLocationOffset, PlayerActor->GetActorRotation()); + FOutputDeviceNull AR; + const FString Command = FString::Printf(TEXT("PlayCameraShakeShoot")); + this->GetOwner()->CallFunctionByNameWithArguments(*Command, AR, nullptr, true); } if (AActor* ClickHit = LookingAtEnemy(); ClickHit != nullptr) diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index 6b7104a..19b5a3b 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 "Misc/OutputDeviceNull.h" #include "the_twilight_abyss/PlayerTemp/TempCharacter.h" // Sets default values @@ -240,6 +241,9 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo) const UStaticMeshComponent* GunComponent = Cast(PlayerActor->GetComponentsByTag(UPrimitiveComponent::StaticClass(), FName("Gun"))[0]); const FVector GunLocationOffset = GunComponent->GetSocketTransform("Muzzle").TransformPosition(FVector(-100, 0, 0)); UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), GunEffect, GunLocationOffset, PlayerActor->GetActorRotation()); + FOutputDeviceNull AR; + const FString Command = FString::Printf(TEXT("PlayCameraShakeShoot")); + PlayerActor->CallFunctionByNameWithArguments(*Command, AR, nullptr, true); } if (ChainDamageMultiplier == 1) BaseDamageMultiplier = 1; diff --git a/Source/the_twilight_abyss/the_twilight_abyss.Build.cs b/Source/the_twilight_abyss/the_twilight_abyss.Build.cs index 9d9a118..a291359 100644 --- a/Source/the_twilight_abyss/the_twilight_abyss.Build.cs +++ b/Source/the_twilight_abyss/the_twilight_abyss.Build.cs @@ -7,17 +7,18 @@ public class the_twilight_abyss : ModuleRules public the_twilight_abyss(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG", "Niagara", "AIModule", "Json" }); + + PublicDependencyModuleNames.AddRange(new string[] + { "Core", "CoreUObject", "Engine", "InputCore", "UMG", "Niagara", "AIModule", "Json" }); PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore", "AdvancedWidgets" }); // Uncomment if you are using Slate UI // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); - + // Uncomment if you are using online features // PrivateDependencyModuleNames.Add("OnlineSubsystem"); // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true } -} +} \ No newline at end of file