LEAP Documentation 40220
Documentation for the LEAP project
WeaponInstanceGroundPound.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 "WeaponInstanceGroundPound.generated.h"
8
9
10class UAfflictionInstance;
11
12UCLASS()
14{
15 GENERATED_UCLASS_BODY()
16
17public:
18 virtual bool Fire(uint8 Mode, float WorldTimeOverride = -1.f) override;
19 virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;
20 virtual FVector GetWeaponMovementDirection() const override;
21 virtual float GetDamage(const FHitResult& HitResult, float DamageModifer = 1.0f, const UWeaponComponent* WeaponComponent = NULL) const override { return MaxDamage; }
22protected:
23 virtual void DamageActor(const FHitResult& HitResult) override;
24 UFUNCTION()
25 virtual void LandedOnGround(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
26 UFUNCTION(Client, Reliable)
27 void Client_LandedOnGround(const FHitResult& Hit);
28 UFUNCTION(NetMulticast, Reliable)
29 void Multicast_PlayLandingEffects(const FHitResult& Hit);
30 UFUNCTION(NetMulticast, Unreliable)
31 void Multicast_PlayAttackEffect();
32 virtual void ToggleDesignatorMarker(bool bEnable) override;
33 virtual bool CanEquip() const override;
34 virtual bool CanUnEquip(bool bTestOnly = false) const;
35 virtual void EquipComplete() override;
36 virtual bool UnEquip(bool bForce = false) override;
37 virtual void OnWeaponDown() override;
38 virtual void FireComplete(uint8 Mode) override;
39 virtual bool GetTargetTransform(FTransform& Transform) const override;
40 virtual bool CanFire(EWeaponError& ErrorMessage, uint8 Mode = 0) const override;
41 virtual void OnChargeValueUpdated_Implementation(float Charge) override;
42
43 UFUNCTION(BlueprintPure)
44 bool IsMinimumHeightReached() const;
45 UFUNCTION(BlueprintPure)
46 float GetCurrentHeight() const;
47 void CancelAbility();
48
49 UFUNCTION(BlueprintImplementableEvent)
50 void OnLandedGround(const FHitResult& Hit);
51
52protected:
53 /* First person animation to play upon landing*/
54 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
55 UAnimMontage* DashCompleteAnimation1P = NULL;
56 /* Third person animation to play upon landing*/
57 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
58 UAnimMontage* DashCompleteAnimation3P = NULL;
59 /* First person animation to play upon landing*/
60 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
61 UAnimMontage* DashStartAnimation1P = NULL;
62 /* Third person animation to play upon landing*/
63 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
64 UAnimMontage* DashStartAnimation3P = NULL;
65 /* Stun effect that triggers when you use the ability*/
66 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
67 TSubclassOf<class UAfflictionInstance> GroundPoundAfflictionClass = NULL;
68 /* CTF affliction to remove if we have it */
69 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
70 TSubclassOf<class UAfflictionInstance> FlagAfflictionToRemove = NULL;
71
72 /* Minimum Height that is required to be off the ground*/
73 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Ground Pound")
74 float MinimumHeight = 1.f;
75 /* Maximum Range of the Ability*/
76 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Ground Pound")
77 float MaximumHeight = 1.f;
78 /* Maximum Angle from vertical that you can aim*/
79 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
80 float MaximumAngle = 100.0f;
81 /* How Long the ability will act for */
82 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
83 float MaxDuration = 0.0f;
84 /*How Long will the impact on the ground last for*/
85 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
86 float LandingDuration = 0.0f;
87 /* How far away (in centimeters) from the target landing spot you have to be in order to apply the maximum distance-based damage multiplier */
88 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Ground Pound")
89 float MaxDistanceForDamageMultiplication = 10000;
90 /* A curve to control the Ease of the damage multiplication based on the distance to the target landing spot, if no curve is provided (current distance / MaxDistanceForDamageMultiplication) will be used instead as a ratio to derive the damage multiplication*/
91 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Ground Pound")
92 UCurveFloat* DistanceBasedDamageMultiplierCurve = nullptr;
93 /*The Min damage an actor can receive if he's inside the area of effect */
94 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
95 float MinDamage = 50.0f;
96 /* The Max damage to apply when landing the ground pound to units close to the center*/
97 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
98 float MaxDamage = 200.0f;
99 /* Anyone inside this radius will receive the MaxDamage, Damage falloff starts to occur after this radius*/
100 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
101 float MaxDamageRadius = 200.f;
102 /* The radius of the ground pound "explosion" in CMs*/
103 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
104 float DamageRadius = 800.f;
105 /* The falloff applied to the damaged based on the distance from the MaxDamageRadius towards the DamageRadius*/
106 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
107 float DamageFallOff = 0.8f;
108 /* How much depenetration to apply from the hit point to prevent calculations to start from the ground*/
109 UPROPERTY(EditDefaultsOnly, Category = "Ground Pound")
110 float ImpactDepenetrationAmount = 50.f;
111
112 FTimerHandle MaxDurationTimerHandle;
113
114private:
115 float DistanceReached = 0.f;
116 FVector DesignatorSelectedLocation = FVector::ZeroVector;
117};
EWeaponError
Definition: WeaponComponent.h:15
Definition: WeaponInstanceGroundPound.h:14
virtual float GetDamage(const FHitResult &HitResult, float DamageModifer=1.0f, const UWeaponComponent *WeaponComponent=NULL) const override
Definition: WeaponInstanceGroundPound.h:21
Definition: WeaponInstanceMelee.h:41