Mortar Pro Plugin  Version 2
Modular Turret Plugin
All Classes Namespaces Functions Variables Enumerations Enumerator Pages
AMortarProPawn Class Reference

#include <MortarProPawn.h>

+ Inheritance diagram for AMortarProPawn:
+ Collaboration diagram for AMortarProPawn:

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

UMortarProAimingComponentAimingComponent = nullptr
 
class UStaticMeshComponent * BaseMesh = nullptr
 
class UMortarProBarrelMeshComponentGunMesh = nullptr
 
class UWidgetComponent * HealthBar = nullptr
 
class UMortarProHealthComponentMortarHealthComponent = nullptr
 
class UMortarProTargetPointComponentMortarTargetComponent = nullptr
 
class UPawnNoiseEmitterComponent * NoiseEmitter = nullptr
 
class UMortarProTeamComponentTeamComponent = nullptr
 
class UMortarProTurretMeshComponentTurretMesh = nullptr
 

Private Member Functions

void AfterRespawn ()
 
void StartDestroy ()
 
void StartRespawn ()
 

Private Attributes

float AfterRespawnResumeControlDelay = 2.f
 
uint32 bUnlimitedRespawn: 1
 
uint32 DestroyInProgress: 1
 
class UMortarProPoolSubsystemPoolSubsystem
 
uint8 RespawnCount = 0
 
float RespawnDelay = 6.f
 
uint32 RespawnInProgress: 1
 

Detailed Description

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

Constructor & Destructor Documentation

◆ AMortarProPawn()

AMortarProPawn::AMortarProPawn ( )

Member Function Documentation

◆ AfterRespawn()

void AMortarProPawn::AfterRespawn ( )
private

Respawn Function Which after playing effect we want to resume firing

◆ BeginPlay()

virtual void AMortarProPawn::BeginPlay ( )
overrideprotectedvirtual

Called when the game starts or when spawned

◆ BPAfterDeathEvent()

void AMortarProPawn::BPAfterDeathEvent ( )

Event Called After each Death. Blueprint event only Can Add Animation sound etc

◆ BPOnEndRespawnEvent()

void AMortarProPawn::BPOnEndRespawnEvent ( )

Event Called Before Respawning of Actor has been completed.

◆ BPOnStartRespawnEvent()

void AMortarProPawn::BPOnStartRespawnEvent ( )

Event Called Before Respawning of Actor after Death. Blueprint event only Can Add sounds,effets

◆ CanBeSeenFrom()

virtual bool AMortarProPawn::CanBeSeenFrom ( const FVector &  ObserverLocation,
FVector &  OutSeenLocation,
int32 &  NumberOfLoSChecksPerformed,
float &  OutSightStrength,
const AActor *  IgnoreActor,
const bool *  bWasVisible = nullptr,
int32 *  UserData = nullptr 
) const
protectedvirtual

Function to Override to allow seeing from Mortar Gun i.e Barrel More Info

See also
https://docs.unrealengine.com/en-US/API/Runtime/AIModule/Perception/IAISightTargetInterface/CanBeSeenFrom/index.html

◆ GetAfterRespawnResumeControlDelay()

float AMortarProPawn::GetAfterRespawnResumeControlDelay ( ) const

Time after Respawn which Mortar Control will be given back so that it can proceed with shooting

◆ GetDestroyDelay()

float AMortarProPawn::GetDestroyDelay ( ) const

Getter Function To get Delay after which Mortar will be dstroyed after spawning limit has been exhausted

Returns
Time Delay in float

◆ GetRespawnCount()

uint8 AMortarProPawn::GetRespawnCount ( ) const

Getter function to tell How Many Times Spawning Is Allowed.

Returns
unsigned bytes variable containing lives left

◆ GetRespawnDelay()

float AMortarProPawn::GetRespawnDelay ( ) const

Getter Function To get Delay time to respawn after death

Returns
Time Delay in float

◆ IsUnlimitedRespawnable()

bool AMortarProPawn::IsUnlimitedRespawnable ( ) const

Function to Get whether the Mortar has infinite life( To infinity and beyond :) )

Returns
Bool variable true if unlimited spawning false otherwise

◆ SetAfterRespawnResumeControlDelay()

void AMortarProPawn::SetAfterRespawnResumeControlDelay ( const float &  Delay)

Time after Respawn which Mortar Control will be given back so that it can proceed with shooting

Parameters
[in]DelayTime after which control will be given back to mortar in float

◆ SetDestroyDelay()

void AMortarProPawn::SetDestroyDelay ( const float &  Delay)

Function to Set Time After which Mortar actor will be destroyed from world

Parameters
[in]DelayTime After Which to Destroy

◆ SetPoolSubsystem()

void AMortarProPawn::SetPoolSubsystem ( UMortarProPoolSubsystem resourceManager)

This function sets the subsystem for Pooling

Parameters
[in]resourceManagerTakes a Class Name of Pool Subsystem

◆ SetRespawnCount()

void AMortarProPawn::SetRespawnCount ( const uint8 &  Count)

Function to How Many Times Spawning Is Allowed.Won't have any effect if Unlimited Spawning is on

Parameters
[in]CountTotal Times to Spawn

◆ SetRespawnDelay()

void AMortarProPawn::SetRespawnDelay ( const float &  Delay)

Function to Set Time to respawn After Mortar death

Parameters
[in]DelayTime to respawn after death in flaot

◆ SetUnlimitedRespawn()

void AMortarProPawn::SetUnlimitedRespawn ( const bool &  UnlimitedRespawning)

Function to Set Unlimited Spawning

Parameters
[in]UnlimitedRespawningTrue to Enable Unlimited Spawning False otherwise

◆ StartDestroy()

void AMortarProPawn::StartDestroy ( )
private

Destroy Function Which will be called after death This will be called after the Destroy delay

◆ StartRespawn()

void AMortarProPawn::StartRespawn ( )
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

◆ TakeDamage()

virtual float AMortarProPawn::TakeDamage ( float  DamageAmount,
struct FDamageEvent const &  DamageEvent,
class AController *  EventInstigator,
AActor *  DamageCauser 
)
overrideprotectedvirtual

Function to afflict damage This will be called whenever the actor Receives damage

Parameters
[in]DamageAmountDamage Amount
[in]DamageEventData package that fully describes the damage received.
[in]EventInstigatorThe Controller responsible for the damage.
[in]DamageCauserDamage Causer Here In our example it will be Projectile Actor

Member Data Documentation

◆ AfterRespawnResumeControlDelay

float AMortarProPawn::AfterRespawnResumeControlDelay = 2.f
private

Time after Respawn which Mortar Control will be given back so that it can proceed with shooting

◆ AimingComponent

UMortarProAimingComponent* AMortarProPawn::AimingComponent = nullptr
protected

Aiming Component Which Will handle all the aiming and shooting

◆ BaseMesh

class UStaticMeshComponent* AMortarProPawn::BaseMesh = nullptr
protected

Base Structure Mesh of the Mortar This is immovable object

◆ bDrawDebugTargetsText

uint32 AMortarProPawn::bDrawDebugTargetsText

Flag to Enable Debug Drawing of Text which is drawn at position of Valid Targets

◆ BeginDestroyFromWorld

FMortarProBeginDestroyFromWorld AMortarProPawn::BeginDestroyFromWorld

Destroy Event That Will be Broadcasted as soon as Health Reaches 0 and Respawning Limit has been reached

◆ BeginPause

FMortarProBeginPause AMortarProPawn::BeginPause

Pause Event that will be broadcasted as soon as Health Reaches 0 like disabling AI camera etc

◆ BeginResume

FMortarProBeginResume AMortarProPawn::BeginResume

Resume Event that will be broadcasted after AI respawns

◆ bUnlimitedRespawn

uint32 AMortarProPawn::bUnlimitedRespawn
private

Allow Unlimited Respawning of Mortar Actor.Each Time Mortar Dies then it will respawn after the mentioned delay with default attributes

◆ DestroyInProgress

uint32 AMortarProPawn::DestroyInProgress
private

Destruction In Progress

◆ GunMesh

class UMortarProBarrelMeshComponent* AMortarProPawn::GunMesh = nullptr
protected

Gun Moves Up and Down

◆ HealthBar

class UWidgetComponent* AMortarProPawn::HealthBar = nullptr
protected

Health Bar Widget to be Configured in BP

◆ MortarHealthComponent

class UMortarProHealthComponent* AMortarProPawn::MortarHealthComponent = nullptr
protected

Generic Health Component That will handle all the health related things.Can Be added to any actor

◆ MortarTargetComponent

class UMortarProTargetPointComponent* AMortarProPawn::MortarTargetComponent = nullptr
protected

Target Component which we will use to shoot at

◆ NoiseEmitter

class UPawnNoiseEmitterComponent* AMortarProPawn::NoiseEmitter = nullptr
protected

Noise Emitter For Pawn Hearing Sensing

◆ PoolSubsystem

class UMortarProPoolSubsystem* AMortarProPawn::PoolSubsystem
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

◆ RespawnCount

uint8 AMortarProPawn::RespawnCount = 0
private

How Many Times Respawning is Allowed. Only Works if Unlimited Respawning if Off

◆ RespawnDelay

float AMortarProPawn::RespawnDelay = 6.f
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

◆ RespawnInProgress

uint32 AMortarProPawn::RespawnInProgress
private

Respawning In Progress

◆ TeamComponent

class UMortarProTeamComponent* AMortarProPawn::TeamComponent = nullptr
protected

Generic Team Component Telling which actor belongs to which team

◆ TurretMesh

class UMortarProTurretMeshComponent* AMortarProPawn::TurretMesh = nullptr
protected

Static Mesh that moves Right to Left


The documentation for this class was generated from the following file: