LEAP Documentation 40220
Documentation for the LEAP project
LockOnTargetInterface.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"
6#include "ProjectX.h"
7#include "UObject/Interface.h"
8#include "LockOnTargetInterface.generated.h"
9
10class UWeaponInstance;
11class AProjectile;
12
13DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FPawnLockOnSignature, UWeaponInstance*, WeaponLocking);
14DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FPawnImminentMissileWarningSignature, AActor*, EventInstigator);
15DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FPawnIncomingProjectileSignature, AProjectile*, IncomingProjectile);
16
17UINTERFACE(meta = (CannotImplementInterfaceInBlueprint))
18class ULockOnTargetInterface : public UInterface
19{
20 GENERATED_UINTERFACE_BODY()
21};
22
26class PROJECTX_API ILockOnTargetInterface
27{
28 GENERATED_IINTERFACE_BODY()
29
30public:
31 FPawnLockOnSignature PawnInterfaceLockOn;
32 FPawnImminentMissileWarningSignature OnImminentMissileWarning;
33 FPawnIncomingProjectileSignature PawnInterfaceIncomingProjectile;
34
35 /* Returns true if this actor can be targeted by Lock-on weapons */
36 UFUNCTION(BlueprintCallable, Category = LockOnTargetInterface)
37 virtual bool CanBeLockedOn(const AActor* LockInstigator) const { return true; }
38 /* Returns true if this actor is generating a signature that the HomingProjectile can read. Counter-measures may inhibit this and invalidate incoming homing projectiles */
39 UFUNCTION(BlueprintCallable, Category = LockOnTargetInterface)
40 virtual bool CanHomingReadSignature(const AProjectile* HomingProjectile) const { return true; }
41 UFUNCTION(BlueprintCallable, Category = LockOnTargetInterface)
42 virtual void IssueImminentMissileWarning(bool bToggleWarning, AActor* WarningIntigator);
43
44 /*Returns the Screen percentage that this actor is required to have to be considered for Locking-onto.
45 If any of the axis values are bigger than GetLockOnScreenPercentage values this actor will be considered as a candidate
46 to be locked into. A value of FVector2D(0,0) will by default be ignored by weapons when deciding the locking-into actors */
47 UFUNCTION(BlueprintCallable, Category = LockOnTargetInterface)
48 virtual FVector2D GetLockOnScreenPercentage() {return FVector2D::ZeroVector;}
49
50 /*Returns the max distance this actor will be used when considered for locking-into. This means that if
51 we scan for a 20km target but this actor has a max distance of 100m if this actor is further away than
52 100m it won't be considered as a candidate actor during the target-finding.
53 A returned value of 0 is by default ignored by the systems */
54 UFUNCTION(BlueprintCallable, Category = LockOnTargetInterface)
55 virtual float GetLockOnMaxDistance(){ return .0f;}
56
57 /* Returns the delegate to bind events to when this actor is being scanned to be locked onto */
58 UFUNCTION(Category = "LockOnTargetInterface Events")
59 virtual FPawnLockOnSignature& GetLockOnTentativeStartDelegate() { return PawnInterfaceLockOn; }
60 /* Returns the delegate to bind events to when this actor stops being scanned to be locked onto */
61 UFUNCTION(Category = "LockOnTargetInterface Events")
62 virtual FPawnLockOnSignature& GetLockOnTentativeEndDelegate() { return PawnInterfaceLockOn; }
63 /* Returns the delegate to bind events to when this actor gets locked onto */
64 UFUNCTION(Category = "LockOnTargetInterface Events")
65 virtual FPawnLockOnSignature& GetLockOnStartDelegate() {return PawnInterfaceLockOn;}
66 /* Returns the delegate to bind events to when this actor stops being locked onto */
67 UFUNCTION(Category = "LockOnTargetInterface Events")
68 virtual FPawnLockOnSignature& GetLockOnEndDelegate() { return PawnInterfaceLockOn; }
69 /* Returns the delegate to bind events to when this actor gets locked onto */
70 UFUNCTION(Category = "LockOnTargetInterface Events")
71 virtual FPawnIncomingProjectileSignature& GetIncomingProjectileStartDelegate() { return PawnInterfaceIncomingProjectile; }
72 /* Returns the delegate to bind events to when this actor gets locked onto */
73 UFUNCTION(Category = "LockOnTargetInterface Events")
74 virtual FPawnIncomingProjectileSignature& GetIncomingProjectileEndDelegate() { return PawnInterfaceIncomingProjectile; }
75 UFUNCTION(Category = "LockOnTargetInterface Events")
76 virtual FPawnImminentMissileWarningSignature& GetImminentMissileWarningStartDelegate() { return OnImminentMissileWarning; }
77 UFUNCTION(Category = "LockOnTargetInterface Events")
78 virtual FPawnImminentMissileWarningSignature& GetImminentMissileWarningEndDelegate() { return OnImminentMissileWarning; }
79};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FPawnLockOnSignature, UWeaponInstance *, WeaponLocking)
Definition: Projectile.h:18
Definition: LockOnTargetInterface.h:27
FPawnImminentMissileWarningSignature OnImminentMissileWarning
Definition: LockOnTargetInterface.h:32
FPawnIncomingProjectileSignature PawnInterfaceIncomingProjectile
Definition: LockOnTargetInterface.h:33
FPawnLockOnSignature PawnInterfaceLockOn
Definition: LockOnTargetInterface.h:31
Definition: LockOnTargetInterface.h:19
Definition: WeaponInstance.h:220