Space Plunder
Loading...
Searching...
No Matches
CompanionComponent.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
9#include "CompanionComponent.generated.h"
10
11
12UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent) )
13class AITOOLKIT_API UCompanionComponent : public UCharacterComponent
14{
15 GENERATED_BODY()
16
17public:
18 UCompanionComponent();
19
20 virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
21
22 UFUNCTION(BlueprintCallable, Category="Companions")
23 void SetupBlackboard();
24
25 //~ Companion Interface Functions //
26 UFUNCTION(BlueprintCallable, Category="Companions")
27 virtual void SetMaster(AActor* Master);
28 UFUNCTION(BlueprintCallable, Category="Companions")
29 virtual void Follow();
30 UFUNCTION(BlueprintCallable, Category="Companions")
31 virtual void Pickup(AActor* TargetActor);
32 UFUNCTION(BlueprintCallable, Category="Companions")
33 virtual void Interact(AActor* TargetActor);
34 UFUNCTION(BlueprintCallable, Category="Companions")
35 virtual void StartCombat(AActor* TargetEnemy);
36 UFUNCTION(BlueprintCallable, Category="Companions")
37 virtual void Wait(const FVector& TargetLocation);
38 UFUNCTION(BlueprintCallable, Category="Companions")
39 virtual void GrabObject();
40 // UFUNCTION(BlueprintCallable, Category="Companions")
41 // virtual void Attack();
42
43 //~ Companion Interface Functions //
44
45 UFUNCTION(BlueprintCallable, Category="Companions")
46 virtual void ObjectInteractedWith(const bool bSuccess);
47
49 UFUNCTION(BlueprintCallable, Category="Companions")
50 virtual bool GetIsReadyToCommand() const {return bReadyToCommand;};
51
52
53 //- AI Interface //
54
55protected:
56 virtual void BeginPlay() override;
57
58
59 UFUNCTION(BlueprintCallable, Category="Companions")
60 void UpdateCompanionState(const ECompanionState NewState);
61
62
63 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Companions")
64 UAnimMontage* AttackAnimMontage = nullptr;
65 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Companions")
66 UAnimMontage* GrabAnimMontage = nullptr;
67
68 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Companions")
69 ECompanionState CompanionState = ECompanionState::Default;
70
71 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Companions")
72 bool bReadyToCommand = false;
73
74 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Companion|General")
75 bool bHasMaster = false;
76 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Companion|General")
77 bool bUseGrabAnimation = false;
78 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Companion|General")
79 bool bUseAttackAnimation = false;
80
81 //- todo //
82 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Companion|General")
83 float FollowDistance = 20.0f;
84 //- Used to tag object available to pickup by companion - change to interface //
85 // UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Companions")
86 // FName ComponentPickupTag;
87
88 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Companion|Status")
89 FName GrabObjectSocketName;
90
91private:
92 void OnGrabObject();
93
94
95 UPROPERTY(VisibleAnywhere, Category="Companion|Status")
96 UBlackboardComponent* BlackboardComponent = nullptr;
97 UPROPERTY(VisibleAnywhere, Category="Companion|Status")
98 AActor* ObjectToGrab = nullptr;
99 UPROPERTY(VisibleAnywhere, Category="Companion|Status")
100 AActor* CurrentTargetActor = nullptr;
101 UPROPERTY(VisibleAnywhere, Category="Companion|Status")
102 AActor* MasterActor = nullptr;
103
104
105 FTimerHandle GrabTimerHandle;
106
107
108};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
ECompanionState
Definition CompanionDataTypes.h:15
Represents a character component that can be added to an actor.