![]() |
Mortar Pro Plugin
Version 2
Modular Turret Plugin
|
#include <MortarProBurstAimingComponent.h>
Public Member Functions | |
void | BPWeaponFullyRecoveredFromHeating () |
float | GetCoolDownPercentage () const |
void | GetGunBurstProperties (FMortarProGunBurstProperties &Properties) const |
void | IncreaseBurstFiringRate (const int32 &NewBurstFireRate) |
bool | IsWeaponFullyHeated () const |
void | ReduceCoolDownDuration (const float &NewCoolDownDuration) |
void | ResetAimingRunTimeParameters () override |
void | SetGunBurstProperties (const FMortarProGunBurstProperties &NewProperties) |
void | StopComponent () override |
UMortarProBurstAimingComponent () | |
![]() | |
void | FireAt (const FVector &AimLocation, AActor *TargetActor, TArray< AActor * > SecondaryTargetsRef) |
void | GetAllFiringSocketsName (TArray< FName > &SocketsName) const |
EMortarProFiringState | GetCurrentState () const |
float | GetDirectionThresholdComparision () const |
void | GetFiringCountForAllSockets (TMap< FName, int32 > &PerSocketFireCount) const |
int32 | GetFiringCountForSocket (const FName &SocketName) const |
float | GetInitialIdleEventDelay () const |
void | GetProjectile (TMap< FName, FMortarProGunSocketProperties > &OutProjectiles) const |
float | GetShotsSpreadDegree () const |
bool | HasAmmo () const |
bool | HasUnlimitedAmmo () const |
void | InitializeAiming (class UMortarProTurretMeshComponent *TurretToSet, class UMortarProBarrelMeshComponent *BarrelToSet, AActor *Owner) |
bool | IsGunGravityEnabled () const |
bool | IsPredictTargetPositionEnabled () const |
virtual void | ResetAimingRunTimeParameters () |
void | SetDirectionThresholdComparision (const float &Threshold) |
void | SetFiringLeftForAllSockets (const TMap< FName, int32 > &PerSocketFireCount) |
void | SetFiringLeftForSocket (const FName &SocketName, const int32 &InFiringLeft) |
void | SetGunGravity (const bool &bGunGravity) |
void | SetIdle () |
void | SetInitialIdleEventDelay (const float &Delay) |
void | SetPredictTargetPosition (const bool &bEnable) |
void | SetProjectile (const TMap< FName, FMortarProGunSocketProperties > &ProjectileToSet) |
void | SetShotsSpreadDegree (const float &ShotsSpread) |
void | SetUnlimitedAmmo (const bool &bUnlimited) |
virtual void | StopComponent () |
UMortarProAimingComponent () | |
Public Attributes | |
FMortarProBeginBurstFiring | BeginBurstFiring |
FMortarProBeginWarmup | BeginBurstFiringWarmup |
FMortarProBeginCoolDown | BeginCoolDown |
FMortarProEndBurstFiring | EndBurstFiring |
FMortarProEndWarmup | EndBurstFiringWarmup |
FMortarProEndCoolDown | EndCoolDown |
![]() | |
FMortarProBeginAimingMovement | BeginAimingMovementTowardsTarget |
FMortarProBeginFire | BeginFire |
FMortarProBeginIdleState | BeginIdleState |
FMortarProEndAimingMovement | EndAimingMovementTowardsTarget |
FMortarProEndFiring | EndFiring |
FMortarProEndIdleState | EndIdleState |
Protected Member Functions | |
void | BeginPlay () override |
void | Fire () override |
void | FireProjectile () override |
void | SetBarrelState () override |
void | StopCoolDown () |
void | StopFiring () override |
void | TickComponent (float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override |
![]() | |
virtual void | BeginPlay () override |
virtual void | Fire () |
virtual void | FireProjectile () |
class UMortarProPoolSubsystem * | GetValidSubSystem () |
bool | IsMoving (const FVector &HitLocation) |
virtual void | SetBarrelState () |
virtual void | StopFiring () |
virtual void | TickComponent (float DeltaTime, ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override |
Private Member Functions | |
void | CoolDown () |
bool | PreFire () |
void | StartBurstFiring () |
void | StartCoolDown () |
Private Attributes | |
uint32 | bIsWeaponHeated: 1 |
uint32 | bOnEndBurstFiringWarmupEvent: 1 |
FMortarProGunBurstProperties | BurstProperties |
FTimerHandle | CoolDownProjectileTimer |
FTimerHandle | FireProjectileTimer |
FMortarProGunBurstProperties | OriginalBurstProperties |
int32 | TotalFireCountAllowedBeforeHeating = 0 |
int32 | TotalTimesBurstTimerToBeCalled = 1 |
int32 | TotalTimesCoolDownTimerToBeCalled = 1 |
Additional Inherited Members | |
![]() | |
uint32 | bAmmoLeft: 1 |
class UMortarProBarrelMeshComponent * | Barrel = nullptr |
uint32 | bEnableGunGravity: 1 |
uint32 | bEnablePredictTargetPosition: 1 |
uint32 | bUnlimitedAmmo: 1 |
FVector | CurrentAimDirection |
EMortarProFiringState | CurrentFiringState |
FVector | CurrentHitTargetLocation |
FVector | DefaultAimLocation |
FName | DefaultSocketName |
class USoundBase * | FireSound |
float | InitialIdleEventDelay = 4.f |
float | LastFireTime = 0 |
class AActor * | OwnerActor |
FString | OwnerName |
TMap< FName, FMortarProGunSocketProperties > | ProjectileSpawnSockets |
float | ShotsSpreadDegree = 2.f |
TWeakObjectPtr< AActor > | TargetActor |
class UMortarProTurretMeshComponent * | Turret = nullptr |
This class is responible for implementing Burst Behavior of gun Derives from MortarProAimingComponent. To use this component class of aimingcomponent in blueprit has to be changed to burst aiming. This class provides functionality like burst firing,weapon getting hot while firing
UMortarProBurstAimingComponent::UMortarProBurstAimingComponent | ( | ) |
|
overrideprotectedvirtual |
Function called on play.
Reimplemented from UMortarProAimingComponent.
void UMortarProBurstAimingComponent::BPWeaponFullyRecoveredFromHeating | ( | ) |
Event Called When Gun is fully recovered and is ready to fire
|
private |
CoolDown to happen after firing for round has been completed
|
overrideprotectedvirtual |
This method is called to fire a projectile from AI
Reimplemented from UMortarProAimingComponent.
|
overrideprotectedvirtual |
This Function is responsible for firing a projectile
Reimplemented from UMortarProAimingComponent.
float UMortarProBurstAimingComponent::GetCoolDownPercentage | ( | ) | const |
Gets Cooldown Percentage. 100 percentage means it is fully cooldown 0 means fully heated
void UMortarProBurstAimingComponent::GetGunBurstProperties | ( | FMortarProGunBurstProperties & | Properties | ) | const |
Gets Gun Burst Properties
[out] | Properties | Properties of Burst Firing |
void UMortarProBurstAimingComponent::IncreaseBurstFiringRate | ( | const int32 & | NewBurstFireRate | ) |
Increases BurstFiring Rate
[in] | NewBurstFireRate | Burst Rate at which Burst Firing timer will be called |
bool UMortarProBurstAimingComponent::IsWeaponFullyHeated | ( | ) | const |
Tells whether a weapon is fully heated
|
private |
Operations or Checks to perform before Firing
void UMortarProBurstAimingComponent::ReduceCoolDownDuration | ( | const float & | NewCoolDownDuration | ) |
Reduces Cooldown Duration
[in] | NewCoolDownDuration | Time in seconds for which the cooldown will happen |
|
overridevirtual |
Resets all Shooting runtime Parameters for Burst Shooting Modes. It will also stop firing and resets cooldown period
Reimplemented from UMortarProAimingComponent.
|
overrideprotectedvirtual |
Sets Barrel State like whether there is any ammo left,or gun is moving etc.
Reimplemented from UMortarProAimingComponent.
void UMortarProBurstAimingComponent::SetGunBurstProperties | ( | const FMortarProGunBurstProperties & | NewProperties | ) |
Sets Gun Burst Shooting Parameters
[in] | NewProperties | Properties to set for Burst firing mode |
|
private |
Starts Burst Firing in a timer
|
private |
Starts CoolDown in a timer
|
overridevirtual |
Stops Gun Firing and CoolDown
Reimplemented from UMortarProAimingComponent.
|
protected |
Stops Call Down immediately
|
overrideprotectedvirtual |
Stops Burst Firing immediately
Reimplemented from UMortarProAimingComponent.
|
overrideprotectedvirtual |
Function Called on Every Tick
Reimplemented from UMortarProAimingComponent.
FMortarProBeginBurstFiring UMortarProBurstAimingComponent::BeginBurstFiring |
This is a blueprint event called when Gun is about to start a burst fire after warmup
FMortarProBeginWarmup UMortarProBurstAimingComponent::BeginBurstFiringWarmup |
This is a blueprint event called when Gun is in warmup phase before firing a burst round
FMortarProBeginCoolDown UMortarProBurstAimingComponent::BeginCoolDown |
This is a blueprint event that is called as soon as cooldown starts which happens after burst firing has caused weapon heatings
|
private |
Flag telling if weapon has been heated
|
private |
Flag tells if Burst Firing Warmup event has been called
|
private |
This represents the properties that can be set for Burst gun firing
|
private |
Timer handle for Cooldown
FMortarProEndBurstFiring UMortarProBurstAimingComponent::EndBurstFiring |
This is a blueprint event called when Gun is ending a burst round
FMortarProEndWarmup UMortarProBurstAimingComponent::EndBurstFiringWarmup |
This is a blueprint event called when Gun is in warmup phase before firing a burst round
FMortarProEndCoolDown UMortarProBurstAimingComponent::EndCoolDown |
This is a blueprint event that is called as soon as cooldown ends. This can happen in two cases when weapon is fully recovered or if it is ready to go for shooting (this happens when weapon is not fully heated)
|
private |
Timer handle for Firing a projectile
|
private |
This stores the original Burst Properties. This is set in the constructor only once
|
private |
Stores Copy if Total Fire COunt before weapon will be heated
|
private |
Total Times CoolDown Timer has to be called
|
private |
Total Times CoolDown Timer has to be called