349 lines
13 KiB
C++
Executable file
349 lines
13 KiB
C++
Executable file
#pragma once
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/NoExportTypes.h"
|
|
#include "UObject/NoExportTypes.h"
|
|
#include "Curves/CurveFloat.h"
|
|
#include "AmmoDrivenGenericEventDelegate.h"
|
|
#include "AmountChangedSignatureDelegate.h"
|
|
#include "AnimatedItem.h"
|
|
#include "DelegateDelegate.h"
|
|
#include "EAmmoWeaponState.h"
|
|
#include "ItemAnimationItem.h"
|
|
#include "RecoilSettings.h"
|
|
#include "RejoinListener.h"
|
|
#include "TracerData.h"
|
|
#include "Upgradable.h"
|
|
#include "UpgradableGear.h"
|
|
#include "WeaponFireOwner.h"
|
|
#include "AmmoDrivenWeapon.generated.h"
|
|
|
|
class APlayerCharacter;
|
|
class UAmmoDriveWeaponAggregator;
|
|
class UAnimMontage;
|
|
class UAudioComponent;
|
|
class UDialogDataAsset;
|
|
class UFXSystemAsset;
|
|
class UForceFeedbackEffect;
|
|
class UItemUpgrade;
|
|
class ULightComponent;
|
|
class USoundCue;
|
|
class UWeaponFireComponent;
|
|
|
|
UCLASS(Abstract, Blueprintable)
|
|
class AAmmoDrivenWeapon : public AAnimatedItem, public IWeaponFireOwner, public IUpgradable, public IUpgradableGear, public IRejoinListener {
|
|
GENERATED_BODY()
|
|
public:
|
|
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FAmountChangedSignature OnClipCountChanged;
|
|
|
|
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FDelegate OnTryReloadEvent;
|
|
|
|
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FDelegate OnReloadingEvent;
|
|
|
|
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FDelegate OnShotFiredEvent;
|
|
|
|
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FAmmoDrivenGenericEvent OnStoppedUsingEvent;
|
|
|
|
protected:
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Instanced, meta=(AllowPrivateAccess=true))
|
|
UWeaponFireComponent* WeaponFire;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Instanced, meta=(AllowPrivateAccess=true))
|
|
UAmmoDriveWeaponAggregator* Aggregator;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool LoopFireAnimation;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float LoopFireAnimationBlendoutTime;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UAnimMontage* FP_FireAnimation;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UAnimMontage* TP_FireAnimation;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, meta=(AllowPrivateAccess=true))
|
|
UAnimMontage* FP_ReloadAnimation;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FItemAnimationItem OverheatAnimation;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
TArray<FItemAnimationItem> GunslingAnimations;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, meta=(AllowPrivateAccess=true))
|
|
UAnimMontage* TP_ReloadAnimation;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UAnimMontage* WPN_Fire;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UAnimMontage* WPN_FireLastBullet;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, meta=(AllowPrivateAccess=true))
|
|
UAnimMontage* WPN_Reload;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UAnimMontage* WPN_Reload_TP;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UFXSystemAsset* MuzzleParticles;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UFXSystemAsset* TPMuzzleParticles;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool UseTriggeredMuzzleParticles;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FTracerData Tracer;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UFXSystemAsset* CasingParticles;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool UseTriggeredCasingParticleSystem;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Instanced, Transient, meta=(AllowPrivateAccess=true))
|
|
ULightComponent* MuzzleFlashLight;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FRuntimeFloatCurve MuzzleFlashLightCurve;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
USoundCue* FireSound;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
USoundCue* RicochetSound;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UFXSystemAsset* RicochetParticle;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float FireSoundDelayToTail;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
USoundCue* FireSoundTail;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool IsFireSoundTail2D;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UForceFeedbackEffect* FireForceFeedbackEffect;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Export, Transient, meta=(AllowPrivateAccess=true))
|
|
TWeakObjectPtr<UAudioComponent> FireSoundInstance;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float FireSoundFadeDuration;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
USoundCue* ReloadSound;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
int32 BulletsRemainingForNearEmptySound;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool PlayEmptySoundsIn3D;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
USoundCue* NearEmptySound;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
USoundCue* WeaponEmptySound;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UDialogDataAsset* ShoutShotFired;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UDialogDataAsset* ShoutOutOfAmmo;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
UDialogDataAsset* ShoutReloading;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
int32 MaxAmmo;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
int32 ClipSize;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
int32 ShotCost;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float RateOfFire;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
int32 BurstCount;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float BurstCycleTime;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float ReloadDuration;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, meta=(AllowPrivateAccess=true))
|
|
int32 AmmoCount;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
|
|
int32 ClipCount;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float FireInputBufferTime;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, meta=(AllowPrivateAccess=true))
|
|
float AutoReloadDuration;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
USoundCue* AutoReloadCompleteCue;
|
|
|
|
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FAmmoDrivenGenericEvent OnItemAutoReloaded;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float SupplyStatusWeight;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, meta=(AllowPrivateAccess=true))
|
|
float CycleTimeLeft;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool UseCustomReloadDelay;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float CustomReloadDelay;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, meta=(AllowPrivateAccess=true))
|
|
float ReloadTimeLeft;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool AutomaticReload;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool CanReload;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float HoldToFirePercentOfFireRatePenalty;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FRecoilSettings RecoilSettings;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool ApplyRecoilAtEndOfBurst;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
float EndOfBurstRecoilMultiplier;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool HasAutomaticFire;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, ReplicatedUsing=OnRep_IsFiring, meta=(AllowPrivateAccess=true))
|
|
bool IsFiring;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, meta=(AllowPrivateAccess=true))
|
|
EAmmoWeaponState WeaponState;
|
|
|
|
public:
|
|
AAmmoDrivenWeapon();
|
|
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
|
void Upgraded_Blueprint_Implementation(const TArray<UItemUpgrade*>& upgrades);
|
|
|
|
protected:
|
|
UFUNCTION(BlueprintCallable)
|
|
void UpdateHoldToFire();
|
|
|
|
UFUNCTION(BlueprintCallable, Reliable, Server)
|
|
void Server_StopReload(float BlendOutTime);
|
|
|
|
UFUNCTION(BlueprintCallable, Reliable, Server)
|
|
void Server_ReloadWeapon();
|
|
|
|
UFUNCTION(BlueprintCallable, Server, Unreliable)
|
|
void Server_PlayBurstFire(uint8 shotCount);
|
|
|
|
UFUNCTION(BlueprintCallable, Reliable, Server)
|
|
void Server_Gunsling(uint8 Index);
|
|
|
|
public:
|
|
UFUNCTION(BlueprintCallable)
|
|
void ResupplyAmmo(int32 Amount);
|
|
|
|
protected:
|
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
|
void RecieveFiredWeapon();
|
|
|
|
public:
|
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
|
void Receive_ReloadEnd();
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
|
void Receive_ReloadBegin();
|
|
|
|
protected:
|
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
|
void Receive_IsFiringChanged(bool NewValue);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void OnWeaponFireEnded();
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void OnWeaponFired(const FVector& Location);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void OnRicochet(const FVector& Origin, const FVector& Location, const FVector& Normal);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void OnRep_IsFiring();
|
|
|
|
public:
|
|
UFUNCTION(BlueprintCallable, BlueprintPure)
|
|
bool IsClipFull() const;
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void InstantlyReload();
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
|
void CustomEvent1(const UItemUpgrade* Event);
|
|
|
|
protected:
|
|
UFUNCTION(BlueprintCallable, Client, Reliable)
|
|
void Client_RefillAmmo(float percentage);
|
|
|
|
UFUNCTION(BlueprintCallable, NetMulticast, Unreliable)
|
|
void All_StopReload(float BlendOutTime);
|
|
|
|
UFUNCTION(BlueprintCallable, NetMulticast, Unreliable)
|
|
void All_StartReload();
|
|
|
|
UFUNCTION(BlueprintCallable, NetMulticast, Unreliable)
|
|
void All_PlayBurstFire(uint8 shotCount);
|
|
|
|
UFUNCTION(BlueprintCallable, NetMulticast, Unreliable)
|
|
void All_Gunsling(uint8 Index);
|
|
|
|
|
|
// Fix for true pure virtual functions not being implemented
|
|
public:
|
|
UFUNCTION(BlueprintCallable)
|
|
APlayerCharacter* GetPlayerCharacter() const override PURE_VIRTUAL(GetPlayerCharacter, return NULL;);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
FQuat GetMuzzleQuat() const override PURE_VIRTUAL(GetMuzzleQuat, return FQuat{};);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
FVector GetMuzzleLocation() const override PURE_VIRTUAL(GetMuzzleLocation, return FVector{};);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
bool GetIsLocallyControlled() const override PURE_VIRTUAL(GetIsLocallyControlled, return false;);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
bool GetIsFirstPerson() const override PURE_VIRTUAL(GetIsFirstPerson, return false;);
|
|
|
|
};
|
|
|