Grip Attachment now lowers recoil for all weapons
This commit is contained in:
parent
50605f7d8e
commit
f14122caed
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_GunCameraShake.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_GunCameraShake.uasset
(Stored with Git LFS)
Binary file not shown.
@ -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>
|
@ -200,7 +200,7 @@ void ABaseWeaponClass::Fire()
|
||||
GetWorld()->LineTraceSingleByObjectType(outHit, traceStart, traceEnd, ObjectQueryParams, collisionParams);
|
||||
WeaponFired.Broadcast();
|
||||
playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);
|
||||
endlessVendettaChar->PawnNoiseEmitterComp->MakeNoise(endlessVendettaChar, 1, traceStart);
|
||||
endlessVendettaChar->PawnNoiseEmitterComp->MakeNoise(endlessVendettaChar, 1, traceStart); //LITERALLY CHANGE THIS FOR SUPPRESSOR AND IT SHOULD WORK LOL
|
||||
currentAmmoCount -= 1;
|
||||
GenerateRecoilVector();
|
||||
ClickDetectionTimer();
|
||||
|
@ -202,6 +202,11 @@ public:
|
||||
UPROPERTY(BlueprintAssignable, Category = "Weapons")
|
||||
FWeaponFired WeaponFired;
|
||||
|
||||
float originalMinMultiplier;
|
||||
float originalMagnitude;
|
||||
float originalMaxAngleLeft;
|
||||
float originalMaxAngleRight;
|
||||
|
||||
protected:
|
||||
UArrowComponent* GunStartArrow;
|
||||
bool bStopShooting = false;
|
||||
@ -209,8 +214,5 @@ protected:
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
int tempWeaponDamage;
|
||||
|
||||
float originalMagnitude;
|
||||
float originalMaxAngleLeft;
|
||||
float originalMaxAngleRight;
|
||||
float originalMinMultiplier;
|
||||
|
||||
};
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
#include "GripAttachmentClass.h"
|
||||
|
||||
#include "EndlessVendetta/WeaponSystem/BaseWeaponClass.h"
|
||||
|
||||
|
||||
// Sets default values for this component's properties
|
||||
UGripAttachmentClass::UGripAttachmentClass()
|
||||
@ -19,9 +21,17 @@ UGripAttachmentClass::UGripAttachmentClass()
|
||||
void UGripAttachmentClass::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
// ...
|
||||
|
||||
BaseWeaponClassRef = Cast<ABaseWeaponClass>(this->GetAttachParentActor());
|
||||
if(IsValid(BaseWeaponClassRef))
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("GripAttachmentClass called"));
|
||||
BaseWeaponClassRef->howMnyShotsTillRclStop = 2;
|
||||
BaseWeaponClassRef->originalMinMultiplier /= 2;
|
||||
BaseWeaponClassRef->originalMagnitude /= 2;
|
||||
BaseWeaponClassRef->originalMaxAngleLeft /= 2;
|
||||
BaseWeaponClassRef->originalMaxAngleRight /= 2;
|
||||
BaseWeaponClassRef->WeaponScopedFire();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -29,5 +39,6 @@ void UGripAttachmentClass::BeginPlay()
|
||||
void UGripAttachmentClass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,4 +23,7 @@ protected:
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
class ABaseWeaponClass* BaseWeaponClassRef;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user