Space Plunder
Loading...
Searching...
No Matches
ProjectileBase.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"
7#include "GameFramework/Actor.h"
9#include "ProjectileBase.generated.h"
10
11class UNiagaraComponent;
12
13UCLASS()
14class WEAPONSYSTEM_API AProjectileBase : public AActor, public IProjectile
15{
16 GENERATED_BODY()
17
18public:
20
21 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Projectile|Debugging")
22 bool bDebuggingMode = false;
23
24
25 virtual void DelayTrigger();
26
27 void SetMesh(UStaticMesh* StaticMesh) const;
28
29 virtual void SetProjectileStats(const struct FWeaponProjectileStats_T& Stats) override;
30 virtual void SetDefaultDamage(const float Damage) override;
31 virtual void SetActorsToIgnore(const TArray<AActor*>& ActorsToIgnore) override;
32 virtual void SetDebuggingMode(const bool bValue) override;
33 virtual void SetInstigator(AController* Controller) override;
34
35
36protected:
37 virtual void BeginPlay() override;
38
39 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Projectile|Components")
40 class UCapsuleComponent* CapsuleComponent;
41 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Projectile|Components")
42 class UStaticMeshComponent* StaticMeshComponent;
43 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Projectile|Components")
44 class UProjectileMovementComponent* ProjectileMovementComponent;
45 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Projectile|Components")
46 UNiagaraComponent* TrailEffects;
47
48 UFUNCTION()
49 virtual void OnProjectileStop(const FHitResult& HitResult);
50 UFUNCTION()
51 virtual void ProjectileDestroy();
52
53 UPROPERTY(Replicated, VisibleAnywhere, BlueprintReadOnly, Category="Projectile|General")
54 struct FWeaponProjectileStats_T ProjectileStats;
55
56 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Projectile|Effects")
57 UAudioComponent* ProjectileSound = nullptr;
58
59 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Projectile|Damage")
60 class UNiagaraSystem* ExplosionEffects;
61 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Projectile|Damage")
62 TSubclassOf<AActor> DestructionField;
63
64 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Projectile|Damage", meta= (ExposeOnSpawn=true))
65 TArray<AActor*> DamageActorsToIgnore;
66 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Projectile|Damage", meta= (ExposeOnSpawn=true))
67 AController* InstigatorController;
68 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Projectile|Homing", meta= (ExposeOnSpawn=true))
69 USceneComponent* HomingTarget;
70
71private:
72 void SpawnTrailEffects() const;
73 void SpawnProjectileSound();
74 void SetCapsuleSize() const;
75 void SpawnImpactEffects(const FVector& Location) const;
76 void SpawnImpactSound(const FVector& Location) const;
77 void RagdollActor(AActor* Actor) const;
78
79 void AttachToHitActor(AActor* Actor, const FName& BoneName);
80
81 //- Damage from WeaponData //
82 float DefaultDamage = 20.0f;
83
84 FHitResult StoredHitResult;
85
86 FTimerHandle ProjectileFTimerHandle;
87 FTimerHandle DelayTriggerTimerHandle;
88
89};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition ProjectileBase.h:15
Definition Projectile.h:20
Definition WeaponStructs.h:273