Space Plunder
Loading...
Searching...
No Matches
ShipPawn.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"
6#include "GenericTeamAgentInterface.h"
8#include "Data/AIDataTypes.h"
10#include "ShipPawn.generated.h"
11
12class AAIController;
13class UCharacterHealthComponent;
14class UCameraComponent;
15class USpringArmComponent;
16class UCapsuleComponent;
20UCLASS()
21class CUSTOMALS_API AShipPawn : public AInteractablePawn, public IGenericTeamAgentInterface, public ICharacterInterface
22{
23 GENERATED_BODY()
24
25
26public:
27
28 AShipPawn();
29
30 //~ Generic Team Interface
31 virtual ETeamAttitude::Type GetTeamAttitudeTowards(const AActor& Other) const override;
32 virtual void SetGenericTeamId(const FGenericTeamId& NewTeamID) override;
33 virtual FGenericTeamId GetGenericTeamId() const override{return TeamID;};
34 //~ Generic Team Interface
35
36 UFUNCTION(BlueprintCallable, Category="Defence")
37 bool GetIsPiloted() const {return Pilot != nullptr;};
38 UFUNCTION(BlueprintCallable, Category="Defence")
39 int32 GetPassengers() const {return Passengers.Num();};
40
41protected:
42 virtual void BeginPlay() override;
43 virtual void PossessedBy(AController* NewController) override;
44
45 virtual void OnInteract(AActor* Caller, const int32 SelectedInteraction) override;
46
47 virtual void PilotShip(AActor* Caller);
48 virtual void EnterShip(AActor* Caller);
49
50 virtual void SetCallerInShip(AActor* Caller, AAIController* AIController);
51
52
53 UFUNCTION(BlueprintImplementableEvent, Category = "Custom ALS")
54 void OnPilotEntered(AActor* NewPilot);
55 UFUNCTION(BlueprintImplementableEvent, Category = "Custom ALS")
56 void OnPilotExited(AActor* NewPilot);
57 UFUNCTION(BlueprintCallable, Category = "Custom ALS")
58 virtual void PilotExitShip();
59 UFUNCTION(BlueprintCallable, Category = "Custom ALS")
60 virtual void PilotEnterShip();
61
62 UFUNCTION(BlueprintImplementableEvent, Category = "Custom ALS")
63 void OnPassengerEntered(AActor* NewPassenger);
64 UFUNCTION(BlueprintImplementableEvent, Category = "Custom ALS")
65 void OnPassengerExited(AActor* NewPassenger);
66
67 UFUNCTION(BlueprintCallable, Category = "Custom ALS")
68 virtual void PassengerEnterShip(const int32 NewPassenger);
69 UFUNCTION(BlueprintCallable, Category = "Custom ALS")
70 virtual void PassengerExitShip(const int32 ExitPassenger);
71
72 UFUNCTION(BlueprintCallable, Category = "Custom ALS")
73 void OpenDoor();
74 UFUNCTION(BlueprintCallable, Category = "Custom ALS")
75 void CloseDoor();
76
77 UFUNCTION(BlueprintImplementableEvent, Category = "Custom ALS")
78 void OnOpenDoor();
79 UFUNCTION(BlueprintImplementableEvent, Category = "Custom ALS")
80 void OnCloseDoor();
81
82 //~ Generic Team Interface
83 UPROPERTY(EditAnywhere, BlueprintReadOnly)
84 FGenericTeamId TeamID;
85 UFUNCTION(BlueprintCallable, Category="Defence")
86 int32 GetTeamID() const{return (TeamID == FGenericTeamId::NoTeam) ? INDEX_NONE : (int32)TeamID;};
87 //~ Generic Team Interface
88
89 //~ Character Interface
90 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Defence")
92 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Defence")
94
95 UFUNCTION(BlueprintCallable, Category = "Custom ALS")
96 virtual ECharacterType GetCharacterType() const override {return CharacterType;};
97 UFUNCTION(BlueprintCallable, Category = "Custom ALS")
98 virtual EFactionType GetCharacterFaction() const override {return OwnerFaction;};
99
100
101 UFUNCTION(BlueprintCallable, Category = "Custom ALS")
102 virtual bool GetIsDead() const override {return bDead;};
103 //@TODO Check if this is needed - Add ICustomCharacter
104 // UFUNCTION(BlueprintCallable, Category = "Custom ALS")
105 // virtual USkeletalMeshComponent* GetCharacterMesh() const override{return nullptr;};
106 UFUNCTION(BlueprintCallable, Category = "Custom ALS")
107 virtual void SetCharacterVehicleMode(const EVehicleMode Mode) override{return;};
108
109 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Ship")
110 bool bDead = false;
111 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Ship")
112 bool bOpenDoor = false;
113
114 //~ Character Interface
115
116
117 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Ship")
118 UCapsuleComponent* CapsuleComponent;
119 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Ship")
120 UStaticMeshComponent* MeshComponent;
121 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Ship")
122 USpringArmComponent* SpringArm;
123 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Ship")
124 UCameraComponent* CameraComponent;
125 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Ship")
126 USceneComponent* ExitLocation;
127 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Ship")
128 USceneComponent* PilotLocation;
129
130 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Ship")
131 UCharacterHealthComponent* HealthComponent;
132
133 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Ship")
134 float ExplosionDamage = 500000.0f;
135 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Ship")
136 bool bCanAIPilot = false;
137 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Ship")
138 bool bAttachWhenEnter = false;
139 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Ship")
140 bool bStopAILogicWhenEnter = false;
141
142 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Ship")
143 AActor* Pilot = nullptr;
144 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Ship")
145 TArray<AActor*> Passengers;
147 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ship")
148 int32 MaxPassengers = 3;
149
150
151 UFUNCTION()
152 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);
153 UFUNCTION()
154 virtual void OnDeath(AActor* OwningActor, EDeathType DeathType, AActor* DeathCauser, AController* DeathInstigator);
155
156private:
157
158
159};
ECharacterType
Definition AIDataTypes.h:73
EFactionType
Definition AIDataTypes.h:103
EDeathType
Definition BaseData.h:53
EVehicleMode
Definition BaseData.h:124
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition InteractablePawn.h:17
Definition ShipPawn.h:22
virtual FGenericTeamId GetGenericTeamId() const override
Definition ShipPawn.h:33
Definition CharacterInterface.h:20