Attempt to implement damage flash for enemy ships

This commit is contained in:
2025-04-17 08:42:39 +05:30
parent 322f1ac061
commit 577205fc12
5 changed files with 80 additions and 3 deletions

View File

@@ -109,6 +109,20 @@ protected:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
float FlankingFrequency = 0.6f; // Increased chance of flanking (was 0.4f)
UPROPERTY()
UMaterialInterface* OriginalMaterial;
UPROPERTY()
UMaterialInstanceDynamic* DynamicMaterialInstance;
UPROPERTY(EditAnywhere, Category = "Effects")
FLinearColor DamageFlashColor = FLinearColor(1.0f, 0.0f, 0.0f, 1.0f);
UPROPERTY(EditAnywhere, Category = "Effects")
float DamageFlashDuration = 0.1f;
FTimerHandle DamageFlashTimerHandle;
public:
virtual void Tick(float DeltaTime) override;
@@ -164,4 +178,8 @@ private:
float LastFlankUpdateTime;
FVector CurrentFlankTarget;
bool bInitializedFlank;
void InitializeDynamicMaterial();
void ApplyDamageFlash();
void ResetDamageFlash();
};