5#include "CoreMinimal.h"
13#include "Deployable.generated.h"
18class UAfflictionComponent;
48 GENERATED_UCLASS_BODY()
51 virtual void EndPlay(
const EEndPlayReason::Type EndPlayReason)
override;
52 UFUNCTION(BlueprintCallable)
54 virtual void MatchEnded()
override;
57 UFUNCTION(BlueprintCallable, Category = Deployable)
59 UFUNCTION(BlueprintCallable, Category = Deployable)
60 bool IsDeploying()
const {
return !IsDeployed(); }
64 virtual float GetHealth()
const override;
65 virtual float GetMaxHealth()
const override;
68 virtual float GetTimeSinceLastDamage()
const override;
69 virtual bool IsArmored()
const override {
return bArmored; }
70 virtual bool IsDead()
const override;
71 virtual void SetMaxHealth(
const float NewMaxHealth)
override;
72 virtual void SetHealth(
const float NewHealth)
override;
73 virtual bool CanBeLockedOn(
const AActor* LockInstigator)
const override;
74 virtual bool CanBeRepaired(
const AActor* RepairInstigator)
const override;
78 virtual ESpotReply CanBeSpotted(
const AActor* SpotInstigator,
ESpotType SpotType)
const override;
80 virtual TSoftObjectPtr<UTexture2D>
GetMapIcon()
const override {
return DeployableMapIcon; }
81 virtual TSoftObjectPtr<UTexture2D>
GetRadarIcon()
const override {
return DeployableRadarIcon; }
82 virtual TSoftObjectPtr<UTexture2D>
GetHudIcon()
const override {
return DeployableHudIcon; }
85 virtual const FText&
GetObjectName()
const {
return GetDeployableName(); };
86 virtual const FString GetOwnerName()
const;
87 virtual const FText& GetObjectDescription()
const;
89 UFUNCTION(BlueprintCallable, Category = Deployable)
90 const FText& GetDeployableName()
const {
return DeployableName; }
92 UFUNCTION(BlueprintCallable, Category = Deployable)
93 TAssetPtr<UTexture2D> GetDeployableIcon()
const {
return DeployableIcon; }
94 UFUNCTION(BlueprintCallable, Category = Deployable)
96 UFUNCTION(BlueprintCallable, Category = Deployable)
97 float GetLifeTimeDurationStartTime()
const {
return LifeTimeDurationStartTime;}
98 UFUNCTION(BlueprintCallable,BlueprintPure, Category = Deployable)
99 float GetTimeUntilDeploy()
const {
return FMath::Max(0.f, GetWorld()->GetTimerManager().GetTimerRemaining(DeployTimer)); }
101 FVector
GetSpottingTraceOffset()
const override {
return FVector(GetActorLocation().X, GetActorLocation().Y, GetActorLocation().Z + SpottingZOffset); }
103 void SetDeployableLifeTime(
const float NewLifeTime);
105 virtual void OnOwnerLeave()
override;
109 UFUNCTION(BlueprintCallable, Category = Deployable)
112 UFUNCTION(BlueprintCallable)
113 virtual void DeployStart(
bool bForce =
false);
114 UFUNCTION(BlueprintCallable)
115 virtual void DeactivateDeployable();
116 UFUNCTION(BlueprintCallable)
117 virtual void ActivateDeployable();
118 UFUNCTION(BlueprintCallable)
119 virtual void ClearDeployable();
121 virtual void DeployComplete();
122 virtual float TakeDamage(
float Damage,
struct FDamageEvent
const& DamageEvent, AController* EventInstigator, AActor* DamageCauser)
override;
123 virtual bool ShouldTakeDamage(
float Damage, FDamageEvent
const& DamageEvent, AController* EventInstigator, AActor* DamageCauser)
const;
124 virtual float InternalTakeRadialDamage(
float Damage, FRadialDamageEvent
const& RadialDamageEvent,
class AController* EventInstigator,
class AActor* DamageCauser)
override;
125 virtual void Died(
float Damage, FDamageEvent
const& DamageEvent, AController* EventInstigator, AActor* DamageCauser, APlayerState* InstigatorPlayerState);
128 UPROPERTY(BlueprintAssignable)
129 FDeploymentBeginSignature OnDeploymentBegin;
130 UPROPERTY(BlueprintAssignable)
131 FDeploymentCompleteSignature OnDeploymentComplete;
132 UPROPERTY(BlueprintAssignable)
133 FDeployableCompleteSignature OnDeployableComplete;
134 UPROPERTY(BlueprintAssignable)
135 FOnDeployableLifeTimeStartSignature OnDeployableLifeTimeStarted;
137 UFUNCTION(NetMulticast, Reliable)
138 void Multicast_Reliable_Died(
float Damage, FDamageEvent const& DamageEvent, AActor* DamageCauser, APlayerState* InstigatorPlayerState);
140 UFUNCTION(BlueprintImplementableEvent, Category = Deployable)
141 void InitializeForTeam(int32
Team);
143 UFUNCTION(BlueprintImplementableEvent, Category = Deployable)
144 void OnDeployableDied();
145 UFUNCTION(BlueprintImplementableEvent, Category = Deployable)
146 void OnDeployStart();
147 UFUNCTION(BlueprintImplementableEvent, Category = Deployable)
148 void OnDeployDeactivated();
149 UFUNCTION(BlueprintImplementableEvent, Category = Deployable)
150 void OnDeployReActivated();
151 UFUNCTION(BlueprintImplementableEvent, Category = Deployable)
152 void OnDeployComplete();
153 UFUNCTION(BlueprintCallable)
154 void SetDeployTransform(const FTransform& Transform);
155 UFUNCTION(BlueprintCallable)
159 void OnRep_StateChanged();
161 void OnRep_LifeTimeDurationStart();
163 virtual
void OnRep_Health(
float PreviousHealth);
165 virtual
void OnRep_DeployTransform();
170 virtual
void BeginPlay() override;
171 UPROPERTY(ReplicatedUsing = OnRep_StateChanged)
173 UPROPERTY(EditDefaultsOnly, Category = Afflictions)
174 UAfflictionComponent* AfflictionComponent = NULL;
176 UPROPERTY(EditDefaultsOnly, Category = Deployable)
177 bool bTargetable = true;
179 UPROPERTY(EditDefaultsOnly, Category = Deployable)
180 bool bArmored = true;
182 UPROPERTY(Replicated, EditDefaultsOnly, Category = Deployable)
183 float MaxHealth = 100.f;
185 UPROPERTY(ReplicatedUsing = OnRep_Health)
187 UPROPERTY(ReplicatedUsing = OnRep_LifeTimeDurationStart)
188 float LifeTimeDurationStartTime = 0.0f;
190 UPROPERTY(EditDefaultsOnly, Category = Deployable)
191 bool bBlocksExplosionDamage = false;
193 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = Deployable)
196 UPROPERTY(EditDefaultsOnly, Category = Deployable)
197 bool bAutoDeploy = false;
199 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = Deployable)
200 float DeployTime = 2.5f;
202 UPROPERTY(Replicated, EditDefaultsOnly, BlueprintReadOnly, Category = Deployable)
203 float DeployableLifeTime = 0.0f;
204 UPROPERTY(ReplicatedUsing = OnRep_DeployTransform)
205 FTransform DeployTransform;
207 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = Deployable)
208 bool bHealthDuringDeploy = true;
210 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = Deployable, meta = (EditCondition = "bHealthDuringDeploy"))
211 float DeployableStartingHealth = 1.0f;
212 UPROPERTY(Replicated)
213 float LastDamageTime = -MAX_FLT;
215 UPROPERTY(EditDefaultsOnly, Category = Deployable)
216 TAssetPtr<UTexture2D> DeployableIcon = NULL;
218 bool bIsDead = false;
220 UPROPERTY(EditDefaultsOnly, Category = Deployable)
221 float DiedEffectDuration = 2.0f;
223 UPROPERTY(EditDefaultsOnly, Category = Deployable)
224 FText DeployableName;
226 UPROPERTY(EditDefaultsOnly, Category = Deployable)
227 bool bDestroyImmediatelyOnDeath = true;
228 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Deployable|LockOn")
229 bool bCanBeLockedOn = false;
230 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Deployable|Repair")
231 bool bCanBeRepaired = false;
236 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Deployable|LockOn", meta = (EditCondition = "bCanBeLockedOn"))
237 float MaxLockOnRange = 15000.f;
242 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Deployable|LockOn", meta = (EditCondition = "bCanBeLockedOn"))
243 FVector2D LockOnScreenPercentage = FVector2D::ZeroVector;
246 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Deployable")
247 float SpottingZOffset = 0.0f;
250 UPROPERTY(EditDefaultsOnly, Category = "UI")
251 TSoftObjectPtr<UTexture2D> DeployableMapIcon = NULL;
253 UPROPERTY(EditDefaultsOnly, Category = "UI")
254 TSoftObjectPtr<UTexture2D> DeployableHudIcon = NULL;
256 UPROPERTY(EditDefaultsOnly, Category = "UI")
257 TSoftObjectPtr<UTexture2D> DeployableRadarIcon = NULL;
259 FTimerHandle DeployTimer;
260 FTimerHandle LifeTimerHandle;
262 int32 HealthInterpolatorID = INDEX_NONE;
263 float LastHealthInterpolatorValue = 0.f;
264 float HealthRegenRate = 0.0f;
268 FString AllyDeployableDestoryed = "VO_EquipementDestroyed_Ally";
EDeployableCategory
Definition: Deployable.h:32
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDeploymentBeginSignature, ADeployable *, Deployable)
EDeployableState
Definition: Deployable.h:22
ESpotType
Definition: SpottableInterface.h:18
ESpotReply
Definition: SpottableInterface.h:27
Definition: Deployable.h:47
virtual bool CanOwningWeaponInstanceFire() const
Definition: Deployable.h:55
virtual float GetLockOnMaxDistance() override
Definition: Deployable.h:75
virtual UAfflictionComponent * GetAfflictionComponent() const override
Definition: Deployable.h:126
virtual TSoftObjectPtr< UTexture2D > GetRadarIcon() const override
Definition: Deployable.h:81
FVector GetSpottingTraceOffset() const override
Definition: Deployable.h:101
virtual bool BlocksExplosions() const override
Definition: Deployable.h:66
virtual float GetRadarIconSize() const override
Definition: Deployable.h:83
virtual FVector2D GetLockOnScreenPercentage() override
Definition: Deployable.h:76
void SetHealthRegenRate(float NewRate) override
Definition: Deployable.h:77
virtual void OnOwnerDied() override
Definition: Deployable.h:106
virtual TSoftObjectPtr< UTexture2D > GetHudIcon() const override
Definition: Deployable.h:82
virtual TSoftObjectPtr< UTexture2D > GetMapIcon() const override
Definition: Deployable.h:80
virtual bool IsArmored() const override
Definition: Deployable.h:69
virtual float GetRadarIconOpacity() const override
Definition: Deployable.h:84
virtual AActor * GetTrackableInterfaceActor() override
Definition: Deployable.h:79
virtual const FText & GetObjectName() const
Definition: Deployable.h:85
Definition: ProjectXPlayerState.h:238
Definition: WeaponInstanceActor.h:16
Definition: HealthInterface.h:28
Definition: LockOnTargetInterface.h:27
Definition: ObjectInfoInterface.h:16
Definition: ReactsToMatchEvents.h:16
Definition: SpottableInterface.h:40
Definition: TrackableInterface.h:22
Definition: WeaponInstance.h:220