Space Plunder
Loading...
Searching...
No Matches
WeaponEffectsComponent.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
8#include "WeaponEffectsComponent.generated.h"
9
10DECLARE_LOG_CATEGORY_EXTERN(LogWeaponEffects, Display, All);
11
12
13UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent))
14class WEAPONSYSTEM_API UWeaponEffectsComponent : public UActorComponent
15{
16 GENERATED_BODY()
17
18public:
19 UWeaponEffectsComponent();
20
21 UFUNCTION(BlueprintCallable, Category="Weapon|Effects")
22 bool SetupEffectsComponent(APawn* OwningPawn, USceneComponent* WeaponMuzzle, const FString& WeaponID);
23 UFUNCTION(Server, Reliable, Category="Weapon|Effects")
24 void Server_SetupEffectsComponent(APawn* OwningPawn, USceneComponent* WeaponMuzzle, const FString& WeaponID);
25
26 UFUNCTION(BlueprintCallable, Category="Weapon|Effects|Sounds")
27 void PlayWeaponDryFire();
28 UFUNCTION(NetMulticast, Unreliable, BlueprintCallable, Category="Weapon|Effects|Sounds")
29 void Multicast_PlayWeaponDryFire(USoundBase* SoundToPlay);
30
31 UFUNCTION(BlueprintCallable, Category="Weapon|Effects|Sounds")
32 void WeaponFireNoiseEvent(const bool bSilencedWeapon = false);
33 UFUNCTION(NetMulticast, Unreliable, BlueprintCallable, Category="Weapon|Effects|Sounds")
34 void Multicast_WeaponFireNoiseEvent(USoundBase* SoundToPlay);
35
36 UFUNCTION(BlueprintCallable, Category="Weapon|Effects")
37 void WeaponDamageEvent(AActor* DamagedActor, const float DamageAmount, const FVector& EventLocation, const FVector& HitLocation, const FName& Tag = NAME_None);
38
39 UFUNCTION(BlueprintCallable, Category="Weapon|Effects|Sounds")
40 void ImpactNoiseEvent(const FVector& Location, APawn* Instigator, const bool bSilencedWeapon = false);
41
42 UFUNCTION(BlueprintCallable, Category="Weapon|Effects|VFX")
43 void MuzzleFlashEvent(const FVector& Offset);
44 UFUNCTION(NetMulticast, Unreliable, BlueprintCallable, Category="Weapon|Effects|VFX")
45 void Multicast_MuzzleFlashEvent(const FVector& Offset, class UNiagaraSystem* ParticleSystem);
46
47 UFUNCTION(BlueprintCallable, Category="Weapon|Effects|VFX")
48 void TracerEvent(const TArray<FVector>& HitLocations);
49 UFUNCTION(NetMulticast, BlueprintCallable, Unreliable, Category="Weapon|Effects|VFX")
50 void Multicast_TracerEvent(const TArray<FVector>& HitLocations, class UNiagaraSystem* ParticleSystem);
51
52 UFUNCTION(BlueprintCallable, Category="Weapon|Effects|VFX")
53 void ImpactEvent(const FHitResult& Hit);
54 UFUNCTION(NetMulticast, BlueprintCallable, Unreliable, Category="Weapon|Effects|VFX")
55 void Multicast_ImpactEvent(const FHitResult& Hit);
56
57
58 UFUNCTION(BlueprintCallable, Category="Weapon|Effects|Feedback")
59 void PlayFeedbackEffects(APlayerController* OwnerPlayerController, const EWeaponFireMode WeaponFireMode, const float Accuracy);
60
61
62 UFUNCTION(BlueprintCallable, Category="Weapon|Effects")
63 void GetWeaponEffectsFromID(const FString& WeaponID);
64
65
66protected:
67 virtual void BeginPlay() override;
68
69 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Weapon|Effects|Debugging")
70 bool bDebuggingMode = false;
71
72 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Weapon|Effects|VFX")
73 TSubclassOf<class AWeaponImpactEffectsSpawner> WeaponImpactSpawnerClass;
74
75 UPROPERTY(Replicated, VisibleAnywhere, BlueprintReadWrite, Category="Weapon|Effects")
76 USceneComponent* MuzzlePoint = nullptr;
77private:
78
79 UPROPERTY(VisibleAnywhere, Category="Weapon|Effects")
80 FWeaponEffects_T WeaponEffects;
81
82 void LogDebugMessage(const FString& Message, const bool bError = false) const;
83
84 bool bPlayerOwned = false;
85 UPROPERTY(VisibleAnywhere)
86 APawn* OwnerPawn = nullptr;
87
88
89};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
DECLARE_LOG_CATEGORY_EXTERN(LogWeaponEffects, Display, All)
EWeaponFireMode
Enum class representing the different fire modes for a weapon.
Definition WeaponStructs.h:99
Definition WeaponImpactEffectsSpawner.h:14
Definition WeaponStructs.h:386