![]() |
Mortar Pro Plugin
Version 2
Modular Turret Plugin
|
#include <MortarProPawn.h>
Public Member Functions | |
AMortarProPawn () | |
void | BPAfterDeathEvent () |
void | BPOnEndRespawnEvent () |
void | BPOnStartRespawnEvent () |
float | GetAfterRespawnResumeControlDelay () const |
float | GetDestroyDelay () const |
uint8 | GetRespawnCount () const |
float | GetRespawnDelay () const |
bool | IsUnlimitedRespawnable () const |
void | SetAfterRespawnResumeControlDelay (const float &Delay) |
void | SetDestroyDelay (const float &Delay) |
void | SetPoolSubsystem (UMortarProPoolSubsystem *resourceManager) |
void | SetRespawnCount (const uint8 &Count) |
void | SetRespawnDelay (const float &Delay) |
void | SetUnlimitedRespawn (const bool &UnlimitedRespawning) |
Public Attributes | |
uint32 | bDrawDebugTargetsText: 1 |
FMortarProBeginDestroyFromWorld | BeginDestroyFromWorld |
FMortarProBeginPause | BeginPause |
FMortarProBeginResume | BeginResume |
Protected Member Functions | |
virtual void | BeginPlay () override |
virtual bool | CanBeSeenFrom (const FVector &ObserverLocation, FVector &OutSeenLocation, int32 &NumberOfLoSChecksPerformed, float &OutSightStrength, const AActor *IgnoreActor, const bool *bWasVisible=nullptr, int32 *UserData=nullptr) const |
virtual float | TakeDamage (float DamageAmount, struct FDamageEvent const &DamageEvent, class AController *EventInstigator, AActor *DamageCauser) override |
Protected Attributes | |
UMortarProAimingComponent * | AimingComponent = nullptr |
class UStaticMeshComponent * | BaseMesh = nullptr |
class UMortarProBarrelMeshComponent * | GunMesh = nullptr |
class UWidgetComponent * | HealthBar = nullptr |
class UMortarProHealthComponent * | MortarHealthComponent = nullptr |
class UMortarProTargetPointComponent * | MortarTargetComponent = nullptr |
class UPawnNoiseEmitterComponent * | NoiseEmitter = nullptr |
class UMortarProTeamComponent * | TeamComponent = nullptr |
class UMortarProTurretMeshComponent * | TurretMesh = nullptr |
Private Member Functions | |
void | AfterRespawn () |
void | StartDestroy () |
void | StartRespawn () |
Private Attributes | |
float | AfterRespawnResumeControlDelay = 2.f |
uint32 | bUnlimitedRespawn: 1 |
uint32 | DestroyInProgress: 1 |
class UMortarProPoolSubsystem * | PoolSubsystem |
uint8 | RespawnCount = 0 |
float | RespawnDelay = 6.f |
uint32 | RespawnInProgress: 1 |
Main Actor Class for Mortar Project which can be used in level. This will contain three main mesh components, Static Base Then Turret and Then Mortar Gun/Barrel. Projectiles are spawned from Gun/barrel
AMortarProPawn::AMortarProPawn | ( | ) |
|
private |
Respawn Function Which after playing effect we want to resume firing
|
overrideprotectedvirtual |
Called when the game starts or when spawned
void AMortarProPawn::BPAfterDeathEvent | ( | ) |
Event Called After each Death. Blueprint event only Can Add Animation sound etc
void AMortarProPawn::BPOnEndRespawnEvent | ( | ) |
Event Called Before Respawning of Actor has been completed.
void AMortarProPawn::BPOnStartRespawnEvent | ( | ) |
Event Called Before Respawning of Actor after Death. Blueprint event only Can Add sounds,effets
|
protectedvirtual |
Function to Override to allow seeing from Mortar Gun i.e Barrel More Info
float AMortarProPawn::GetAfterRespawnResumeControlDelay | ( | ) | const |
Time after Respawn which Mortar Control will be given back so that it can proceed with shooting
float AMortarProPawn::GetDestroyDelay | ( | ) | const |
Getter Function To get Delay after which Mortar will be dstroyed after spawning limit has been exhausted
uint8 AMortarProPawn::GetRespawnCount | ( | ) | const |
Getter function to tell How Many Times Spawning Is Allowed.
float AMortarProPawn::GetRespawnDelay | ( | ) | const |
Getter Function To get Delay time to respawn after death
bool AMortarProPawn::IsUnlimitedRespawnable | ( | ) | const |
Function to Get whether the Mortar has infinite life( To infinity and beyond :) )
void AMortarProPawn::SetAfterRespawnResumeControlDelay | ( | const float & | Delay | ) |
Time after Respawn which Mortar Control will be given back so that it can proceed with shooting
[in] | Delay | Time after which control will be given back to mortar in float |
void AMortarProPawn::SetDestroyDelay | ( | const float & | Delay | ) |
Function to Set Time After which Mortar actor will be destroyed from world
[in] | Delay | Time After Which to Destroy |
void AMortarProPawn::SetPoolSubsystem | ( | UMortarProPoolSubsystem * | resourceManager | ) |
This function sets the subsystem for Pooling
[in] | resourceManager | Takes a Class Name of Pool Subsystem |
void AMortarProPawn::SetRespawnCount | ( | const uint8 & | Count | ) |
Function to How Many Times Spawning Is Allowed.Won't have any effect if Unlimited Spawning is on
[in] | Count | Total Times to Spawn |
void AMortarProPawn::SetRespawnDelay | ( | const float & | Delay | ) |
Function to Set Time to respawn After Mortar death
[in] | Delay | Time to respawn after death in flaot |
void AMortarProPawn::SetUnlimitedRespawn | ( | const bool & | UnlimitedRespawning | ) |
Function to Set Unlimited Spawning
[in] | UnlimitedRespawning | True to Enable Unlimited Spawning False otherwise |
|
private |
Destroy Function Which will be called after death This will be called after the Destroy delay
|
private |
Respawn Function Which will be called after death.Here Mainly we want to play respawn effects and sound This will be called after the respawn delay
|
overrideprotectedvirtual |
Function to afflict damage This will be called whenever the actor Receives damage
[in] | DamageAmount | Damage Amount |
[in] | DamageEvent | Data package that fully describes the damage received. |
[in] | EventInstigator | The Controller responsible for the damage. |
[in] | DamageCauser | Damage Causer Here In our example it will be Projectile Actor |
|
private |
Time after Respawn which Mortar Control will be given back so that it can proceed with shooting
|
protected |
Aiming Component Which Will handle all the aiming and shooting
|
protected |
Base Structure Mesh of the Mortar This is immovable object
uint32 AMortarProPawn::bDrawDebugTargetsText |
Flag to Enable Debug Drawing of Text which is drawn at position of Valid Targets
FMortarProBeginDestroyFromWorld AMortarProPawn::BeginDestroyFromWorld |
Destroy Event That Will be Broadcasted as soon as Health Reaches 0 and Respawning Limit has been reached
FMortarProBeginPause AMortarProPawn::BeginPause |
Pause Event that will be broadcasted as soon as Health Reaches 0 like disabling AI camera etc
FMortarProBeginResume AMortarProPawn::BeginResume |
Resume Event that will be broadcasted after AI respawns
|
private |
Allow Unlimited Respawning of Mortar Actor.Each Time Mortar Dies then it will respawn after the mentioned delay with default attributes
|
private |
Destruction In Progress
|
protected |
Gun Moves Up and Down
|
protected |
Health Bar Widget to be Configured in BP
|
protected |
Generic Health Component That will handle all the health related things.Can Be added to any actor
|
protected |
Target Component which we will use to shoot at
|
protected |
Noise Emitter For Pawn Hearing Sensing
|
private |
Reference FOr Pool Manager. This needs to be set once only by anyone Used only for reference we wont be doing anything with this
|
private |
How Many Times Respawning is Allowed. Only Works if Unlimited Respawning if Off
|
private |
Time after which Mortar will be deleted from world that is when respawn limit has been exhausted float DestroyDelay = 5.f;
/**- Time after which Mortar will be respawned
|
private |
Respawning In Progress
|
protected |
Generic Team Component Telling which actor belongs to which team
|
protected |
Static Mesh that moves Right to Left