Merge branch 'weapon-tweaks-and-fixes' into dev

This commit is contained in:
MH261677 2024-03-02 23:16:00 +00:00
commit c7d5427f0e
9 changed files with 26 additions and 15 deletions

View File

@ -1,2 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">C:\Users\Rafal\AppData\Local\JetBrains\Rider2023.3\resharper-host\temp\Rider\vAny\CoverageData\_EndlessVendetta.-1253833435\Snapshot\snapshot.utdcvr</s:String></wpf:ResourceDictionary>

View File

@ -251,6 +251,7 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent*
void AEndlessVendettaCharacter::Interact() void AEndlessVendettaCharacter::Interact()
{ {
if (bIsReloading) return;
UE_LOG(LogTemp, Warning, TEXT("Interaction Has Been Called")); UE_LOG(LogTemp, Warning, TEXT("Interaction Has Been Called"));
if (InPauseMenu) return; if (InPauseMenu) return;
if (bIsInDialogue) if (bIsInDialogue)
@ -336,6 +337,7 @@ float AEndlessVendettaCharacter::TakeDamage(const float DamageAmount, FDamageEve
void AEndlessVendettaCharacter::ToggleRecon() void AEndlessVendettaCharacter::ToggleRecon()
{ {
if (bIsReloading) return;
if (PlayerOnShip || InPauseMenu) return; if (PlayerOnShip || InPauseMenu) return;
if (!GadgetManager->IsValidReconGadget()) return; if (!GadgetManager->IsValidReconGadget()) return;
@ -359,6 +361,7 @@ void AEndlessVendettaCharacter::ToggleRecon()
void AEndlessVendettaCharacter::ToggleCombat() void AEndlessVendettaCharacter::ToggleCombat()
{ {
if (bIsReloading) return;
if (PlayerOnShip || InPauseMenu) return; if (PlayerOnShip || InPauseMenu) return;
if (!GadgetManager->IsValidCombatGadget()) return; if (!GadgetManager->IsValidCombatGadget()) return;
@ -384,6 +387,7 @@ void AEndlessVendettaCharacter::ToggleCombat()
//When 1 is pressed it calls EquipPrimary //When 1 is pressed it calls EquipPrimary
void AEndlessVendettaCharacter::EquipPrimary() void AEndlessVendettaCharacter::EquipPrimary()
{ {
if (bIsReloading) return;
if (PlayerOnShip || InPauseMenu) return; if (PlayerOnShip || InPauseMenu) return;
if (!IsValid(PrimaryWeaponClass)) return; if (!IsValid(PrimaryWeaponClass)) return;
FActorSpawnParameters spawnParams; FActorSpawnParameters spawnParams;
@ -444,6 +448,7 @@ void AEndlessVendettaCharacter::EquipPrimary()
void AEndlessVendettaCharacter::EquipSecondary() void AEndlessVendettaCharacter::EquipSecondary()
{ {
if (bIsReloading) return;
if (!IsValid(SecondaryWeaponClass)) return; if (!IsValid(SecondaryWeaponClass)) return;
if (PlayerOnShip || InPauseMenu) return; if (PlayerOnShip || InPauseMenu) return;
FActorSpawnParameters spawnParams; FActorSpawnParameters spawnParams;
@ -498,6 +503,7 @@ void AEndlessVendettaCharacter::EquipSecondary()
void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit) void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit)
{ {
if (bIsReloading) return;
FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true); FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true);
FDetachmentTransformRules DetatchRules(EDetachmentRule::KeepWorld, false); FDetachmentTransformRules DetatchRules(EDetachmentRule::KeepWorld, false);
FActorSpawnParameters spawnParams; FActorSpawnParameters spawnParams;
@ -571,6 +577,7 @@ void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit)
//Calls the fire function in the baseWeaponClass //Calls the fire function in the baseWeaponClass
void AEndlessVendettaCharacter::FireCaller() void AEndlessVendettaCharacter::FireCaller()
{ {
if (bIsReloading) return;
if (InPauseMenu) return; if (InPauseMenu) return;
if (IsValid(PrimaryWeapon) && !bIsReloading) if (IsValid(PrimaryWeapon) && !bIsReloading)
{ {
@ -596,6 +603,7 @@ void AEndlessVendettaCharacter::StopFire()
void AEndlessVendettaCharacter::GunRightClick() void AEndlessVendettaCharacter::GunRightClick()
{ {
if (bIsReloading) return;
if (InPauseMenu) return; if (InPauseMenu) return;
if (IsValid(PrimaryWeapon) && !bIsScoped) if (IsValid(PrimaryWeapon) && !bIsScoped)
{ {
@ -615,6 +623,7 @@ void AEndlessVendettaCharacter::GunRightClick()
void AEndlessVendettaCharacter::StopGunRightClick() void AEndlessVendettaCharacter::StopGunRightClick()
{ {
if (bIsReloading) return;
if (IsValid(PrimaryWeapon)) if (IsValid(PrimaryWeapon))
{ {
bIsScoped = false; bIsScoped = false;

View File

@ -37,7 +37,11 @@ void AShotgunClass::Fire()
FVector newStartTrace = UKismetMathLibrary::RandomPointInBoundingBox(traceStart, ShotgunBulletSpread); FVector newStartTrace = UKismetMathLibrary::RandomPointInBoundingBox(traceStart, ShotgunBulletSpread);
traceEnd = newStartTrace + (GunStartArrow->GetForwardVector() * BulletDistance); traceEnd = newStartTrace + (GunStartArrow->GetForwardVector() * BulletDistance);
GetWorld()->LineTraceSingleByChannel(outHit, newStartTrace, traceEnd, ECC_Visibility, collisionParams); GetWorld()->LineTraceSingleByChannel(outHit, newStartTrace, traceEnd, ECC_Visibility, collisionParams);
DrawDebugLine(this->GetWorld(), newStartTrace, traceEnd, FColor::Black , false, 0.2f, 0U, 0.2f); DrawDebugLine(this->GetWorld(), newStartTrace, traceEnd, FColor::Yellow , false, 500.2f, 0U, 0.2f);
if (outHit.bBlockingHit)
{
GEngine->AddOnScreenDebugMessage(-1, 20.f, FColor::Orange, FString(TEXT("SHOTGUN HIT")));
}
} }
currentAmmoCount --; currentAmmoCount --;
playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1); playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);