Modular Turret C++ Plugin  Version 3
Turret C++ Unreal engine 4 plugin
AMortar Class Reference
+ Inheritance diagram for AMortar:
+ Collaboration diagram for AMortar:

Public Member Functions

void ActorDeathEvent ()
 
void ActorTeamChangeEvent ()
 
 AMortar ()
 
float GetDestroyMortarDelay () const
 
uint8 GetRespawnCount () const
 
bool IsUnlimitedRespawnable () const
 
void OnActorEndRespawnEvent ()
 
void OnActorStartRespawnEvent ()
 
void SetDestroyMortarDelay (const float &DestroyDelay)
 
void SetResourceManager (UMortarResourceManager *resourceManager)
 
void SetRespawnCount (const uint8 &Count)
 
void SetUnlimitedRespawn (const bool &UnlimitedRespawning)
 

Public Attributes

FMortarDeathEvent OnMortarDeath
 
FMortarPauseEvent OnMortarPause
 
FMortarResumeEvent OnMortarResume
 

Protected Member Functions

virtual void BeginPlay () override
 
virtual bool CanBeSeenFrom (const FVector &ObserverLocation, FVector &OutSeenLocation, int32 &NumberOfLoSChecksPerformed, float &OutSightStrength, const AActor *IgnoreActor) const
 
virtual float TakeDamage (float DamageAmount, struct FDamageEvent const &DamageEvent, class AController *EventInstigator, AActor *DamageCauser) override
 

Protected Attributes

class UWidgetComponent * HealthBar = nullptr
 
class UMortarAimingComponentMortarAimingComponent = nullptr
 
class UStaticMeshComponent * MortarBase = nullptr
 
class UMortarBarrelMortarGun = nullptr
 
class UMortarHealthComponentMortarHealthComponent = nullptr
 
class UPawnNoiseEmitterComponent * MortarNoiseEmitter = nullptr
 
class UMortarTeamComponentMortarTeamComponent = nullptr
 
class UMortarTurretMortarTurret = nullptr
 

Private Member Functions

void AfterMortarRespawn ()
 
void MortarDestroy ()
 
void OnTeamChangeDelegate ()
 
void StartMortarRespawn ()
 

Private Attributes

bool bUnlimitedRespawn = false
 
uint32 DestroyInProgress: 1
 
float DestroyMortarDelay = 5.f
 
class UMortarResourceManagerResourceManager
 
uint8 RespawnCount = 0
 
uint32 RespawnInProgress: 1
 
float RespawnShootingDelay = 2.f
 

Detailed Description

Main Actor Class for Mortar Project.This will contain three main components, Static Base Then Turret 3 Then Mortar Gun/Barrel

Constructor & Destructor Documentation

◆ AMortar()

AMortar::AMortar ( )

Member Function Documentation

◆ ActorDeathEvent()

void AMortar::ActorDeathEvent ( )

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

◆ ActorTeamChangeEvent()

void AMortar::ActorTeamChangeEvent ( )

Blue Print Event Called After Team Change

◆ AfterMortarRespawn()

void AMortar::AfterMortarRespawn ( )
private

Respawn Function Which after playing effect we want to resume firing

◆ BeginPlay()

virtual void AMortar::BeginPlay ( )
overrideprotectedvirtual

Called when the game starts or when spawned

◆ CanBeSeenFrom()

virtual bool AMortar::CanBeSeenFrom ( const FVector &  ObserverLocation,
FVector &  OutSeenLocation,
int32 &  NumberOfLoSChecksPerformed,
float &  OutSightStrength,
const AActor *  IgnoreActor 
) 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

◆ GetDestroyMortarDelay()

float AMortar::GetDestroyMortarDelay ( ) 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 AMortar::GetRespawnCount ( ) const

Getter function to tell How Many Times Spawning Is Allowed.

Returns
unsigned bytes variable containing lives left

◆ IsUnlimitedRespawnable()

bool AMortar::IsUnlimitedRespawnable ( ) const

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

Returns
Bool variable true if unlimited spawning false otherwise

◆ MortarDestroy()

void AMortar::MortarDestroy ( )
private

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

◆ OnActorEndRespawnEvent()

void AMortar::OnActorEndRespawnEvent ( )

Event Called Before Respawning of Actor has been completed.

◆ OnActorStartRespawnEvent()

void AMortar::OnActorStartRespawnEvent ( )

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

◆ OnTeamChangeDelegate()

void AMortar::OnTeamChangeDelegate ( )
private

Delegate For On Team Change Event

◆ SetDestroyMortarDelay()

void AMortar::SetDestroyMortarDelay ( const float &  DestroyDelay)

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

Parameters
[in]DestroyDelayTime After Which to Destroy

◆ SetResourceManager()

void AMortar::SetResourceManager ( UMortarResourceManager resourceManager)

New Function This function is sets the subsystem for resourceManagement

Parameters
[in]resourceManagerTakes a Class Name of ResourceManager

◆ SetRespawnCount()

void AMortar::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

◆ SetUnlimitedRespawn()

void AMortar::SetUnlimitedRespawn ( const bool &  UnlimitedRespawning)

Function to Set Unlimited Spawning

Parameters
[in]UnlimitedRespawningTrue to Enable Unlimited Spawning False otherwise

◆ StartMortarRespawn()

void AMortar::StartMortarRespawn ( )
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 AMortar::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

◆ bUnlimitedRespawn

bool AMortar::bUnlimitedRespawn = false
private

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

◆ DestroyInProgress

uint32 AMortar::DestroyInProgress
private

Destruction In Progress

◆ DestroyMortarDelay

float AMortar::DestroyMortarDelay = 5.f
private

Time after which Mortar will be deleted

◆ HealthBar

class UWidgetComponent* AMortar::HealthBar = nullptr
protected

Health Bar Widget to be Configured in BP

◆ MortarAimingComponent

class UMortarAimingComponent* AMortar::MortarAimingComponent = nullptr
protected

Aiming Component Which Will handle all the aiming and shooting

◆ MortarBase

class UStaticMeshComponent* AMortar::MortarBase = nullptr
protected

Base Structure Mesh of the Mortar This is immovable object

◆ MortarGun

class UMortarBarrel* AMortar::MortarGun = nullptr
protected

Gun Moves Up and Down

◆ MortarHealthComponent

class UMortarHealthComponent* AMortar::MortarHealthComponent = nullptr
protected

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

◆ MortarNoiseEmitter

class UPawnNoiseEmitterComponent* AMortar::MortarNoiseEmitter = nullptr
protected

Noise Emitter For Pawn Hearing Sensing

◆ MortarTeamComponent

class UMortarTeamComponent* AMortar::MortarTeamComponent = nullptr
protected

Generic Team Component Telling which actor belongs to which team

◆ MortarTurret

class UMortarTurret* AMortar::MortarTurret = nullptr
protected

Static Mesh that moves Right to Left

◆ OnMortarDeath

FMortarDeathEvent AMortar::OnMortarDeath

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

◆ OnMortarPause

FMortarPauseEvent AMortar::OnMortarPause

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

◆ OnMortarResume

FMortarResumeEvent AMortar::OnMortarResume

Resume Event that will be broadcasted after AI respawns

◆ ResourceManager

class UMortarResourceManager* AMortar::ResourceManager
private

Reference FOr REsource Manager. This needs to be set once only by anyone Used only for reference we wont be doing anything with this

◆ RespawnCount

uint8 AMortar::RespawnCount = 0
private

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

◆ RespawnInProgress

uint32 AMortar::RespawnInProgress
private

Respawning In Progress

◆ RespawnShootingDelay

float AMortar::RespawnShootingDelay = 2.f
private

Time after which Mortar will be deleted


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