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

#include <MortarProSplitProjectile.h>

+ Inheritance diagram for AMortarProSplitProjectile:
+ Collaboration diagram for AMortarProSplitProjectile:

Public Member Functions

 AMortarProSplitProjectile ()
 
void BPBeforeProjectileSplit ()
 
float GetChildProjectileSpacing () const
 
float GetPercentTimeToSplitProjectile () const
 
void GetSplitProjectileActor (TSubclassOf< class AActor > &Class) const
 
int32 GetSplitProjectilesCount () const
 
float GetTargetDetectionSphereTraceRadius () const
 
void SetAfterSpawnParam (const FMortarProAfterSpawnParam &AfterSpawnParam) override
 
void SetChildProjectileSpacing (const float &Spacing)
 
void SetPercentTimeToSplitProjectile (const float &Delay)
 
void SetSplitProjectileActor (const TSubclassOf< class AActor > &Class)
 
void SetSplitProjectilesCount (const int32 &Count)
 
void SetTargetDetectionSphereTraceRadius (const float &Radius)
 
- Public Member Functions inherited from AMortarProPhysicalProjectile
 AMortarProPhysicalProjectile ()
 
bool GetDynamicDeactivateSpan () const
 
float GetInitialHomingTargetDelayPercent () const
 
void GetMinMaxHomingAcceleration (double &OutMinAcceleration, double &OutMaxAcceleration) const
 
float GetProjectileSpeed ()
 
virtual void SetAfterSpawnParam (const FMortarProAfterSpawnParam &AfterSpawnParam) override
 
void SetDynamicDeactivateSpan (const bool &bIsDynamic)
 
void SetInitialHomingTargetDelayPercent (const float &DelayPercent)
 
void SetMinMaxHomingAcceleration (const double &MinAcceleration, const double &MaxAcceleration)
 
- Public Member Functions inherited from AMortarProBaseProjectile
void BPOnImpactEvent ()
 
virtual float GetProjectileSpeed ()
 
virtual void SetAfterSpawnParam (const FMortarProAfterSpawnParam &AfterSpawnParam)
 
- Public Member Functions inherited from AMortarProPoolableActor
 AMortarProPoolableActor ()
 
virtual void DeActivateActor ()
 
virtual void ReActivateActor ()
 
virtual void SetDeactivateSpan (const float &Time)
 

Protected Member Functions

virtual void ClearTimers () override
 
virtual void InitializeBeforeSpawnParam () override
 
- Protected Member Functions inherited from AMortarProPhysicalProjectile
virtual void BeginPlay () override
 
virtual void ClearTimers () override
 
virtual void EnableComponents (const bool &bEnable) override
 
virtual void InitializeBeforeSpawnParam () override
 
virtual void OnHit (UPrimitiveComponent *HitComponent, AActor *OtherActor, UPrimitiveComponent *OtherComponent, FVector NormalImpulse, const FHitResult &Hit)
 
virtual void RegisterEventsAndCallBacks ()
 
- Protected Member Functions inherited from AMortarProBaseProjectile
float GetDamageAsPerSurface (const EPhysicalSurface &SurfaceType)
 
virtual void InitializeBeforeSpawnParam () override
 
void PlayImpactSoundAndParticleEffectForSurface (const EPhysicalSurface &SurfaceType, const FVector &Location)
 
- Protected Member Functions inherited from AMortarProPoolableActor
virtual void BeginPlay () override
 
virtual void ClearTimers ()
 
virtual void EnableComponents (const bool &bEnable)
 
virtual void EndPlay (const EEndPlayReason::Type EndPlayReason) override
 
virtual void InitializeBeforeSpawnParam ()
 
virtual void StartTimers ()
 

Protected Attributes

uint32 bDrawSpawnDebugSphere: 1
 
uint32 bDrawTargetDebugSphere: 1
 
float ChildProjectileSpacing = 50.0f
 
FVector ChildProjectileSpacingAxis = FVector(1, 0, 0)
 
float DrawSpawnDebugSphereDuration = 1.f
 
float DrawTargetDebugSphereDuration = 3.f
 
float PercentTimeToSplitProjectile = 50.0f
 
TSubclassOf< class AActor > SplitProjectileClass
 
int32 SplitProjectilesCount = 3
 
float TargetDetectionSphereTraceRadius = 500.f
 
- Protected Attributes inherited from AMortarProPhysicalProjectile
float AvgProjectileSpeed = 0.f
 
uint32 bAlreadyHit: 1
 
uint32 bDynamicDeactivateSpan: 1
 
float BufferDeactivateSpan = 2.f
 
UStaticMeshComponent * CollisionMesh = nullptr
 
ECollisionEnabled::Type CollisionMeshCollision
 
float DeactivateDelayAfterDamage = 0.1f
 
class URadialForceComponent * ExplosionForce = nullptr
 
float InitialHomingTargetDelayPercent = 0.0f
 
double MaxHomingAcceleration = 0
 
double MinHomingAcceleration = 0
 
class UNiagaraSystem * NiagaraLaunchBlast = nullptr
 
class UNiagaraComponent * NiagaraTrail = nullptr
 
class UMortarProProjectileMovementProjectileMovement = nullptr
 
class UMortarProSignificanceComponentSignificanceComponent {nullptr}
 
class UCurveFloat * VariableSpeedCurve { nullptr }
 
- Protected Attributes inherited from AMortarProBaseProjectile
TMap< TEnumAsByte< EPhysicalSurface >, float > DamageAsPerSurface
 
FMortarProAfterSpawnParam MortarAfterSpawnParam
 
TMap< TEnumAsByte< EPhysicalSurface >, class UNiagaraSystem * > NiagaraSurfaceImpact
 
TMap< TEnumAsByte< EPhysicalSurface >, class USoundBase * > SurfaceImpactSound
 
- Protected Attributes inherited from AMortarProPoolableActor
uint32 bIsActorActivated: 1
 

Private Member Functions

bool IsInLineOfSight (const AActor *Target)
 
void SpawnProjectile (AActor *TargetActor, int32 ChildNo)
 
void SplitProjectilesTimer ()
 

Private Attributes

FTimerHandle SplitProjectilesTimerHandler
 
float TimeToSplitProjectile = 0.f
 

Additional Inherited Members

- Public Attributes inherited from AMortarProPhysicalProjectile
TMap< EMortarProSignificanceValue, float > SignifianceValue
 
- Public Attributes inherited from AMortarProPoolableActor
FMortarProActorActivated BeginActivation
 
FMortarProActorDeactivated BeginDeactivation
 
float DeactivateSpan = 10.f
 

Detailed Description

Projectile class for physical actors which splits into multiple projectile. Inherits all behavior from AMortarProPhysicalProjectile.

Constructor & Destructor Documentation

◆ AMortarProSplitProjectile()

AMortarProSplitProjectile::AMortarProSplitProjectile ( )

Member Function Documentation

◆ BPBeforeProjectileSplit()

void AMortarProSplitProjectile::BPBeforeProjectileSplit ( )

Function called Just Before Splitting a projectile into children. Can be handled in Bluueprint

◆ ClearTimers()

virtual void AMortarProSplitProjectile::ClearTimers ( )
overrideprotectedvirtual

Clears All Timers of the projectile. Also Called on deactivation

Reimplemented from AMortarProPhysicalProjectile.

◆ GetChildProjectileSpacing()

float AMortarProSplitProjectile::GetChildProjectileSpacing ( ) const

Getter Function To get Spacing BEtween each child projectile

Returns
Spacing between each child as float

◆ GetPercentTimeToSplitProjectile()

float AMortarProSplitProjectile::GetPercentTimeToSplitProjectile ( ) const

Getter Function To get Delay Percentage after which current projectile will be split

Returns
Time percentage denoting delay after projectile will split in float. if 100 percent delay means the projectile will split when it has reached 100 percent of the target if 50 then is in middle when the projectiles will be split

◆ GetSplitProjectileActor()

void AMortarProSplitProjectile::GetSplitProjectileActor ( TSubclassOf< class AActor > &  Class) const

Getter Function To get Class of split projectile

Parameters
[out]Classdenoting class of projectile that will be spawned

◆ GetSplitProjectilesCount()

int32 AMortarProSplitProjectile::GetSplitProjectilesCount ( ) const

Getter Function To get Set Split Count telling how many projectiles will get spawned from current

Returns
Total count of actors in integer

◆ GetTargetDetectionSphereTraceRadius()

float AMortarProSplitProjectile::GetTargetDetectionSphereTraceRadius ( ) const

Getter Function To get Radius of sphere for detection of target

Returns
Sphere Radius in float

◆ InitializeBeforeSpawnParam()

virtual void AMortarProSplitProjectile::InitializeBeforeSpawnParam ( )
overrideprotectedvirtual

Initializes All local Parameter before spawning. This is also called when reactivating actor for reusability

Reimplemented from AMortarProPhysicalProjectile.

◆ IsInLineOfSight()

bool AMortarProSplitProjectile::IsInLineOfSight ( const AActor *  Target)
private

◆ SetAfterSpawnParam()

void AMortarProSplitProjectile::SetAfterSpawnParam ( const FMortarProAfterSpawnParam AfterSpawnParam)
overridevirtual

Initializes Projectile params

Parameters
[in]AfterSpawnParamParameters to set after spawning
See also
FMortarProAfterSpawnParam

Reimplemented from AMortarProPhysicalProjectile.

◆ SetChildProjectileSpacing()

void AMortarProSplitProjectile::SetChildProjectileSpacing ( const float &  Spacing)

Function to Set Spacing between each children

Parameters
[in]SpacingSpacing between each child projectile

◆ SetPercentTimeToSplitProjectile()

void AMortarProSplitProjectile::SetPercentTimeToSplitProjectile ( const float &  Delay)

Function to Set Delay after which current projectile will be split

Parameters
[in]DelayTime after which to split current Projectile

◆ SetSplitProjectileActor()

void AMortarProSplitProjectile::SetSplitProjectileActor ( const TSubclassOf< class AActor > &  Class)

Function to Set Class of split projectile

Parameters
[in]Classclass of split projectile

◆ SetSplitProjectilesCount()

void AMortarProSplitProjectile::SetSplitProjectilesCount ( const int32 &  Count)

Function to Set Split Count. It tells how many particles it will split into. excluding itself

Parameters
[in]CountNumber of Extra Projectiles that will be spawned

◆ SetTargetDetectionSphereTraceRadius()

void AMortarProSplitProjectile::SetTargetDetectionSphereTraceRadius ( const float &  Radius)

Function to set Radius of sphere that will be casted to detect targets

Parameters
[in]RadiusSphere Radius in float that will be used for detection

◆ SpawnProjectile()

void AMortarProSplitProjectile::SpawnProjectile ( AActor *  TargetActor,
int32  ChildNo 
)
private

Timer Function For Spawning Projectile param[in] TargetActor Target to hit param[in] ChildNo Child Projectile number spawned starting from 0. Each Child Projectile will be spawned with an offset defined by ChildProjectileSpacing

◆ SplitProjectilesTimer()

void AMortarProSplitProjectile::SplitProjectilesTimer ( )
private

Function TO call to spawn sub child.We will do a sphere trace by sight To Detect Other Targets

Member Data Documentation

◆ bDrawSpawnDebugSphere

uint32 AMortarProSplitProjectile::bDrawSpawnDebugSphere
protected

Whether To Draw Debug Sphere where child projectiles will be spawned

◆ bDrawTargetDebugSphere

uint32 AMortarProSplitProjectile::bDrawTargetDebugSphere
protected

Whether To Draw Debug Sphere at other targets while tracing new targets when splitting

◆ ChildProjectileSpacing

float AMortarProSplitProjectile::ChildProjectileSpacing = 50.0f
protected

Maximum SPacing Between Child Projectiles

◆ ChildProjectileSpacingAxis

FVector AMortarProSplitProjectile::ChildProjectileSpacingAxis = FVector(1, 0, 0)
protected

Axis of Child Spacing. By Default The Child projectiles will get spawnwed in x direction behind the parent projectile

◆ DrawSpawnDebugSphereDuration

float AMortarProSplitProjectile::DrawSpawnDebugSphereDuration = 1.f
protected

Duration of Draw sphere for child projectiles that will be spawned.

◆ DrawTargetDebugSphereDuration

float AMortarProSplitProjectile::DrawTargetDebugSphereDuration = 3.f
protected

Duration of Draw sphere for target debug Sphere

◆ PercentTimeToSplitProjectile

float AMortarProSplitProjectile::PercentTimeToSplitProjectile = 50.0f
protected

Delay Percent after which extra projectile will be spawned. 100 percent delay means the projectile will split when it has reached 100 percent of the target 50 means if it has covered 50 percent of the distance and needs to cover 50 more then split the projectile

◆ SplitProjectileClass

TSubclassOf<class AActor> AMortarProSplitProjectile::SplitProjectileClass
protected

Type of Projectiles to spawn after split

◆ SplitProjectilesCount

int32 AMortarProSplitProjectile::SplitProjectilesCount = 3
protected

How many projectile to split into

◆ SplitProjectilesTimerHandler

FTimerHandle AMortarProSplitProjectile::SplitProjectilesTimerHandler
private

Handle for Splitting Projectile

◆ TargetDetectionSphereTraceRadius

float AMortarProSplitProjectile::TargetDetectionSphereTraceRadius = 500.f
protected

Radius of sphere that will be casted to detect targets

◆ TimeToSplitProjectile

float AMortarProSplitProjectile::TimeToSplitProjectile = 0.f
private

Time after which the projectiles will be split. This gets calculated on the basis of percetage provided


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