5#include "CoreMinimal.h"
6#include "Components/SceneComponent.h"
8#include "AfflictionOverlapComponent.generated.h"
10class UPrimitiveComponent;
11class UAfflictionInstance;
16UCLASS(ClassGroup = (
Custom), meta = (BlueprintSpawnableComponent), Blueprintable)
17class PROJECTX_API UAfflictionOverlapComponent :
public USceneComponent,
public ITeamInterface
19 GENERATED_UCLASS_BODY()
23 UFUNCTION(BlueprintCallable, Category = "Affliction Overlap Component")
24 virtual
void ToggleVolume(
bool bToggle);
26 UFUNCTION(BlueprintCallable, Category = "Affliction Overlap Component")
27 virtual
bool GetVolumeActiveState()
const {
return bIsOverlapActive; }
29 virtual int32
GetTeam()
const override {
return TeamOwner; }
31 virtual int32
SetTeam(int32 NewTeam)
override;
33 virtual void RefreshAfflictions();
34 virtual float GetVolumeRadius()
const;
38 UPROPERTY(EditAnywhere, ReplicatedUsing = OnRep_TeamOwner, Category =
"Affliction Overlap Component", meta = (AllowPrivateAccess =
true))
39 int32 TeamOwner = INDEX_NONE;
41 UPROPERTY(EditAnywhere, ReplicatedUsing = OnRep_IsOverlapActive, Category = "Affliction Overlap Component", meta = (AllowPrivateAccess = true))
42 bool bIsOverlapActive = true;
43 UPROPERTY(EditAnywhere, Category = "Affliction Overlap Component")
44 TSubclassOf<UAfflictionInstance> AfflictionToApplyFriendlies;
45 UPROPERTY(EditAnywhere, Category = "Affliction Overlap Component")
46 TSubclassOf<UAfflictionInstance> AfflictionToApplyNeutrals;
47 UPROPERTY(EditAnywhere, Category = "Affliction Overlap Component")
48 TSubclassOf<UAfflictionInstance> AfflictionToApplyEnemies;
50 UPROPERTY(EditAnywhere, Category = "Affliction Overlap Component", meta = (AllowPrivateAccess = true))
51 bool bTargetVehicleOccupants = false;
53 UPROPERTY(EditAnywhere, Category = "Affliction Overlap Component", meta = (AllowPrivateAccess = true, EditCondition = "bTargetVehicleOccupants"))
54 bool bAlsoApplyToVehicle = false;
56 TArray<UPrimitiveComponent*> TriggerVolumes;
58 TSet<TWeakObjectPtr<AActor>> OverlappingActors;
61 virtual
void BeginPlay() override;
62 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
63 virtual
void CollectInitialOverlaps();
64 virtual
void ActivateForActor(AActor* NewActor);
65 virtual
void DeactivateForActor(AActor* TargetActor);
67 virtual
void OnPendingCharacterPlayerStateReady(APlayerState* PlayerState,
AProjectXCharacter* Character);
70 void OnRep_TeamOwner();
72 void OnRep_IsOverlapActive();
74 void OnOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,
bool bFromSweep, const FHitResult& SweepResult);
76 void OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);
81 FActivationToggledSignature OnActivationToggledForActor;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FActivationToggledSignature, AActor *, TargetActor, bool, bToggle)
Definition: ProjectXCharacter.h:128
Definition: ProjectXVehicle.h:56
Definition: TeamInterface.h:26
virtual int32 GetTeam() const
Definition: TeamInterface.h:31
virtual int32 SetTeam(int32 NewTeam)
Definition: TeamInterface.h:33