DRG-Femboy-Voice/Source/FSD/Public/PawnAlertComponent.h
2025-04-15 12:39:31 -07:00

45 lines
1.3 KiB
C++
Executable file

#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "DamageData.h"
#include "DelegateDelegate.h"
#include "PawnAlertComponent.generated.h"
class APawn;
UCLASS(Blueprintable, ClassGroup=Custom, meta=(BlueprintSpawnableComponent))
class UPawnAlertComponent : public UActorComponent {
GENERATED_BODY()
public:
UPROPERTY(BlueprintAssignable, BlueprintAuthorityOnly, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
FDelegate OnAlertedFromDamage;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
bool AutoAlertAI;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
bool ShouldAlertNearby;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float AlertRadius;
UPawnAlertComponent();
UFUNCTION(BlueprintCallable)
void StopAutoAlerting();
protected:
UFUNCTION(BlueprintCallable)
void OnPawnSeen(APawn* Pawn);
UFUNCTION(BlueprintCallable)
void OnHit(float Damage, const FDamageData& DamageData, bool anyHealthLost);
UFUNCTION(BlueprintCallable)
void OnAlerted();
public:
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable)
void AleartNearby();
};