LEAP Documentation 40220
Documentation for the LEAP project
DeployableMine.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2018. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "Engine/EngineTypes.h"
8#include "DeployableMine.generated.h"
9
10class UProjectileMovementComponent;
11class USphereComponent;
12class UAfflictionInstance;
13
14UCLASS()
15class PROJECTX_API ADeployableMine : public ADeployable
16{
17 GENERATED_UCLASS_BODY()
18
20public:
21 UFUNCTION(BlueprintCallable)
22 float GetLaunchTime() const { return LaunchTime; }
23 UFUNCTION(BlueprintCallable)
24 float GetLaunchHeight() const { return TriggeredLaunchHeight; }
25 UFUNCTION(BlueprintCallable)
26 float GetTriggerDelayTime() const { return TriggerDelay; }
27 UFUNCTION(BlueprintCallable)
28 float GetMotionSensorSize() const { return MotionSensorRadius; }
29 UFUNCTION(BlueprintCallable)
30 float GetExplosionRadius() const { return ExplosionRadius; }
31
32protected:
33 bool CheckForMovingEnemies();
34
35 virtual void Died(float Damage, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser, APlayerState* InstigatorPlayerState) override;
36 virtual void Tick(float DeltaTime) override;
37 void TriggerExplosion(bool bUseTimer);
38
39 UFUNCTION()
40 void OnMineBounce(const FHitResult& ImpactResult, const FVector& ImpactVelocity);
41 UFUNCTION()
42 void OnMineStopMoving(const FHitResult& ImpactResult);
43 UFUNCTION(BlueprintImplementableEvent)
44 void OnExplosion();
45 UFUNCTION(BlueprintImplementableEvent)
46 void OnMineTriggered();
47 UFUNCTION(BlueprintImplementableEvent)
48 void OnMineArmed(const FHitResult& ImpactResult);
49
50 UFUNCTION()
51 virtual void Explosion();
52 UFUNCTION()
53 void OnOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult);
54 UFUNCTION(NetMulticast,Unreliable)
55 void Multicast_Explosion_PlayExplosionEffects_UnReliable();
56 UFUNCTION(NetMulticast, Unreliable)
57 void Multicast_MineTriggered_PlayTriggerEffects_Unrealiable();
58
59 /*Movement Component for the deployable when thrown*/
60 UPROPERTY(EditDefaultsOnly)
61 UProjectileMovementComponent* ProjectileMovementComponent;
62
63 /*Root Collision*/
64 UPROPERTY(EditDefaultsOnly)
65 USphereComponent* Sphere;
66
67 /*Damage Type to apply on explosion*/
68 UPROPERTY(EditDefaultsOnly)
69 TSubclassOf<UDamageType> DamageType;
70 /* Size of MotionSensor Area*/
71 UPROPERTY(EditDefaultsOnly)
72 float MotionSensorRadius = 3000.0f;
73 /* Size of MotionSensor Area*/
74 UPROPERTY(EditDefaultsOnly)
75 float LaunchTime = 3.0f;
76 /* Size of MotionSensor Area*/
77 UPROPERTY(EditDefaultsOnly)
78 float TriggerDelay = 3.0f;
79
80 /*Maximum Damage from the explosion*/
81 UPROPERTY(EditDefaultsOnly)
82 float ExplosionDamageMax = 75.0f;
83 /*Minimum Damage from the explosion*/
84 UPROPERTY(EditDefaultsOnly)
85 float ExplosionDamageMin = 1.0f;
86 /*How Much damage is reduced at edge of explosion*/
87 UPROPERTY(EditDefaultsOnly)
88 float DamageFallOff = 0.8f;
89 /* Size of the Explosion*/
90 UPROPERTY(EditDefaultsOnly)
91 float ExplosionRadius = 1000.0f;
92 /*How Much damage is reduced at edge of explosion*/
93 UPROPERTY(EditDefaultsOnly)
94 float TriggeredLaunchHeight = 3000.0f;
95 /*affliction applied if in range for dmg*/
96 UPROPERTY(EditDefaultsOnly)
97 TSubclassOf<UAfflictionInstance> ProximityWarningAfflictionClass;
98 /* Collision Profiles that trigger bounces*/
99 UPROPERTY(EditDefaultsOnly, meta = (Bitmask, BitmaskEnum = "ECollisionChannel"))
100 TArray<TEnumAsByte<ECollisionChannel>> AllowableBounceProfiles;
101
102 int32 ExplosionInterpolaterID;
103 FTimerHandle ExplosionDelayTimer;
104 bool bExplosionTriggered;
105 FVector SurfaceNormal;
106};
Definition: Deployable.h:47
Definition: DeployableMine.h:16