LEAP Documentation 40220
Documentation for the LEAP project
DeployableScoutingDrone.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2018. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "DeployableScoutingDrone.generated.h"
8
9class USpottingComponent;
10class UProjectileMovementComponent;
11
12UCLASS()
13class PROJECTX_API ADeployableScoutingDrone : public ADeployable
14{
15 GENERATED_BODY()
16public:
17 virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
18
19protected:
20 virtual void BeginPlay() override;
21
22 UFUNCTION()
23 void OnDroneMovementStopped(const FHitResult& ImpactResult);
24 UFUNCTION()
25 void OnDroneSpotted();
26 UFUNCTION()
27 void OnDroneEnd();
28 void OnDroneScanningStop();
29
30 UFUNCTION(BlueprintImplementableEvent, Category= "Spot Events")
31 void K2_StartScan();
32 UFUNCTION(BlueprintImplementableEvent, Category = "Spot Events")
33 void K2_StopScan();
34
35protected:
36 /* Time the drone stops when it has spotted someone to simulate a scan */
37 UPROPERTY(EditDefaultsOnly, Category= "Scouting Drone")
38 float ScanningTime = 1.f;
39 UPROPERTY(EditDefaultsOnly, Category = "Scouting Drone", meta = (EditCondition = "bScanWhenTargetMet"))
40 float TimeBeforeDyingOnTargetMet = 4.f;
41
42 /* Should the drone perform a final scan when reaching its destination? */
43 UPROPERTY(EditDefaultsOnly, Category = "Scouting Drone")
44 bool bScanWhenTargetMet = true;
45 /* The range of the final spherical scan */
46 UPROPERTY(EditDefaultsOnly, Category = "Scouting Drone", meta = (EditCondition = "bScanWhenTargetMet"))
47 float FinalScanRange = 10000.f;
48 /* Should the final scan reveal ? */
49 UPROPERTY(EditDefaultsOnly, Category = "Scouting Drone", meta = (EditCondition = "bScanWhenTargetMet"))
50 bool bFinalScanRevealsInvisibleTargets = true;
51 UPROPERTY(EditDefaultsOnly, Category = "Scouting Drone", meta = (EditCondition = "bScanWhenTargetMet"))
52 bool bFinalScanIgnoresObstacles = true;
53
54private:
55 USpottingComponent* SpottingComponent = nullptr;
56 UProjectileMovementComponent* ProjectileMovementComponent = nullptr;
57
58 FVector DroneVelocityAtSpot = FVector::ZeroVector;
59 FTimerHandle ScanningTimer;
60};
Definition: Deployable.h:47
Definition: DeployableScoutingDrone.h:14