Updated Combat to Include Camera Shake on Shoot & Wall Break

This commit is contained in:
Philip W 2023-04-27 05:13:41 +01:00
parent 19fcc0c063
commit 9fd372ed9d
7 changed files with 23 additions and 8 deletions

BIN
Content/Blueprints/Combat_UI/CMS_Shoot.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Blueprints/Combat_UI/CMS_WallBreak.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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<UStaticMeshComponent>(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)

View File

@ -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<UStaticMeshComponent>(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;

View File

@ -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
}
}
}