35 virtual ETeamAttitude::Type GetTeamAttitudeTowards(
const AActor&
Other)
const override;
36 virtual void SetGenericTeamId(
const FGenericTeamId& NewTeamID)
override;
43 UFUNCTION(BlueprintCallable, Category=
"Defence")
44 bool GetActive()
const {
return bActive;};
45 UFUNCTION(BlueprintCallable, Category=
"Defence")
46 void SetActive(const
bool bValue);
47 UFUNCTION(BlueprintNativeEvent, Category="
Defence")
48 void OnActivated(const
bool bValue);
49 virtual
void OnActivated_Implementation(const
bool bValue);
53 virtual
void BeginPlay() override;
54 virtual
void GetActorEyesViewPoint(FVector& OutLocation, FRotator& OutRotation) const override;
57 UPROPERTY(EditAnywhere, BlueprintReadOnly)
58 FGenericTeamId TeamID;
59 UFUNCTION(BlueprintCallable, Category="
Defence")
60 int32 GetTeamID()
const{
return (TeamID == FGenericTeamId::NoTeam) ? INDEX_NONE : (int32)TeamID;};
64 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"Defence")
66 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Defence")
69 UFUNCTION(BlueprintCallable, Category = "
Custom ALS")
70 virtual
ECharacterType GetCharacterType()
const override {
return CharacterType;};
71 UFUNCTION(BlueprintCallable, Category =
"Custom ALS")
72 virtual
EFactionType GetCharacterFaction()
const override {
return OwnerFaction;};
74 UFUNCTION(BlueprintCallable, Category =
"Custom ALS")
75 virtual
bool GetIsDead()
const override {
return bDead;};
79 UFUNCTION(BlueprintCallable, Category =
"Custom ALS")
80 virtual
void SetCharacterVehicleMode(const
EVehicleMode Mode) override;
86 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "
Defence")
87 FRotator StartRotation = FRotator::ZeroRotator;
88 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "
Defence")
89 FRotator TargetRotation = FRotator::ZeroRotator;
92 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category= "
Defence|
Alert")
93 float AlertUpdateFrequency = 0.2f;
95 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category= "
Defence|
Alert")
96 float AlertLevelIncrease = 0.1f;
98 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category= "
Defence|
Alert")
99 float AlertLevelDecrease = 0.1f;
102 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category= "
Defence|
Alert")
103 float AlertLevelThreshold = 100.0f;
105 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "
Defence|
Alert")
106 float AlertLevel = 0.0f;
108 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "
Defence|
Alert")
112 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "
Defence|Target")
113 float VisibilityCheckFrequency = 2.0f;
115 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category= "
Defence|Target")
116 bool bInstantResetOnLostTarget = false;
118 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category= "
Defence|Target")
119 float LostTargetResetTime = 2.0f;
121 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "
Defence|Status")
123 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category= "
Defence|State")
124 bool bAutoActivate = true;
138 UFUNCTION(BlueprintImplementableEvent, Category="
Defence")
139 void OnNewTargetSeen(APawn* Pawn);
141 UFUNCTION(BlueprintImplementableEvent, Category="
Defence")
142 void OnTargetSeen(APawn* Pawn);
143 UFUNCTION(BlueprintImplementableEvent, Category="
Defence")
144 void OnHostileSeen();
145 UFUNCTION(BlueprintImplementableEvent, Category="
Defence")
146 void OnHostileSeenUpdate();
147 UFUNCTION(BlueprintImplementableEvent, Category="
Defence")
149 UFUNCTION(BlueprintImplementableEvent, Category="
Defence")
150 void OnLostAllTargets();
151 UFUNCTION(BlueprintImplementableEvent, Category="
Defence")
152 void OnAlertChange(const
float CurrentAlertLevel, const
float MaxAlertLevel);
154 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "
Defence|Visual")
155 UHealthComponentBase* HealthComponent;
156 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "
Defence|Visual")
163 virtual
bool GetIsCharacter()
const override {
return true;};
168 virtual
void PointDamageTaken(AActor* DamagedActor,
float Damage, class AController* InstigatedBy, FVector HitLocation, class UPrimitiveComponent* HitComponent, FName BoneName, FVector ShotFromDirection, const class UDamageType* DamageType, AActor* DamageCauser);
170 virtual
void OnDeath(AActor* OwningActor,
EDeathType DeathType, AActor* DeathCauser, AController* DeathInstigator);
173 UFUNCTION(BlueprintCallable, Category="
Defence")
174 bool CanStillSeePawn(APawn* Pawn) const;
176 UFUNCTION(BlueprintCallable, Category="
Defence")
177 bool IsPawnAlive(APawn* Pawn) const;
179 UFUNCTION(BlueprintCallable, Category="
Defence")
180 bool GetCurrentTarget(APawn*& Pawn) const;
182 UFUNCTION(BlueprintCallable, Category="
Defence")
183 TArray<APawn*>& GetTargets() {
return Targets;};
186 UFUNCTION(BlueprintCallable, Category=
"Defence")
187 float GetDistanceToPawn(const APawn* Pawn) const;
190 UFUNCTION(BlueprintCallable, Category="
Defence")
191 float GetTotalDistanceScoreToAllTargets() const;
193 UFUNCTION(BlueprintCallable, Category="
Defence")
194 virtual FRotator GetRotationToTarget(const FVector& StartLocation);
197 virtual
void TargetSeen(APawn* Pawn);
198 virtual
void NewTargetSeen(APawn* Pawn);
200 virtual
void EnemySeen();
201 virtual
void LostAllTargets();
202 virtual
void RotateToTarget();
205 UPROPERTY(VisibleAnywhere, Category= "
Defence|State")
206 bool bActive = false;
209 virtual
void OnSeePawn(APawn* Pawn);
211 virtual
void OnHearPawn(APawn* Pawn, const FVector&
Location,
float Volume);
214 void CheckVisibilityOfTargets();
215 void IncreaseAlert();
216 void DecreaseAlert();
218 void CheckEnemySeen();
221 int32 CurrentTarget = -1;
224 TArray<APawn*> Targets;
226 FTimerHandle IncreaseAlertTimerHandle;
227 FTimerHandle DecreaseAlertTimerHandle;
229 FTimerHandle EnemySeenTimerHandle;
230 FTimerHandle CheckVisibilityTimerHandle;
231 FTimerHandle LostTargetTimerHandle;