WSF
WsfWeaponEffects Class Referenceabstract

#include <WsfWeaponEffects.hpp>

Inheritance diagram for WsfWeaponEffects:
Collaboration diagram for WsfWeaponEffects:

Public Types

enum  Result { cINVALID , cMISSED , cDAMAGED , cKILLED }
Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.

Public Member Functions

 WsfWeaponEffects (WsfScenario &aScenario)
 ~WsfWeaponEffects () override
WsfWeaponEffectsClone () const override=0
virtual bool PreInitialize ()
bool ProcessInput (UtInput &aInput) override
virtual bool Initialize (double aSimTime, const WsfWeaponEngagement *aEngagementPtr)
UtScriptContext * GetScriptAccessibleContext () const override
Result GetTargetResult () const
Result GetIncidentalResult () const
Result GetTotalResult () const
bool UseLaunchPk () const
bool UseInterceptPk () const
double GetPkDegrade () const
 Return the current Pk degrade factor.
double GetPkConstraint () const
void SetInvincibleIndex (unsigned int aPlatformID)
 Set the ID of a platform which shall not be damaged. (Usually the launching entity.).
unsigned int GetInvincibleIndex () const
 Get the ID of a platform which will not be damaged.
void SetDamageRadius (double aDamageRadius)
 Set the maximum lethal damage radius for this effect.
double GetDamageRadius () const
 Return the maximum lethal damage radius for this effect.
double GetLaunchPk () const
 Get the Launch Pk.
double GetInterceptPk () const
 Get the Intercept Pk.
bool DrawEndgamePk ()
 Force a pk draw for an external platform target.
virtual double GetCEP () const
 Access the value for engagement Circular Error Probable (CEP).
void SetCEP (double aValue)
void SetPkDegrade (double aPkDegrade)
virtual double GetPkDrawn () const
 Access the Pk value drawn for the (intended) target hit assessment.
bool DebugEnabled () const
 Returns 'true' if debugging is enabled for this instance.
void SetDebugEnabled (bool aDebugEnabled)
 Enable or disable debugging for this instance.
unsigned int KilledPlatformCount () const
 Method returns the count of platforms killed during this engagement.
bool IsKilledPlatform (size_t aPlatformIndex) const
 Returns 'true' if the specified WSF platform index has been killed during this engagement.
WsfPk::TableGetPkTable ()
WsfScenarioGetScenario ()
Public Member Functions inherited from WsfObject
 WsfObject ()
 This is the constructor for the WsfObject class.
 ~WsfObject () override
 This is the destructor for the WsfObject class.
const char * GetScriptClassName () const override
const std::string & GetType () const
WsfStringId GetTypeId () const
 Get the string ID of the 'type' of the object.
void SetType (WsfStringId aType)
const std::string & GetBaseType () const
WsfStringId GetBaseTypeId () const
const TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (const WsfObject &aRhs)
 Assignment operator.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)

Static Public Member Functions

static WsfStringId GetWeaponEffectsType (WsfPlatform &aPlatform)
 Return the weapon effects type for the associated platform.
static std::string GetResultString (WsfWeaponEffects::Result aResult)

Static Public Attributes

static const char * cTYPE_KIND = "weapon_effect"
static const double cUNHARMED = 0.0
 Value indicating no damage to a player, the weapon had no effect.
static const double cMORTALLY_WOUNDED = 1.0

Protected Member Functions

 WsfWeaponEffects (const WsfWeaponEffects &aSrc)
 Copy Constructor for Clone().
WsfWeaponEffectsoperator= (const WsfWeaponEffects &aRhs)
virtual void ApplyEffectIncrement (double aSimTime, WsfPlatform *aOtherPlatformPtr, double aDamageAmount)
virtual void ApplyEffectTo (double aSimTime, WsfPlatform *aOtherPlatformPtr)
virtual void ApplyDamageResultToOtherPlatform (double aSimTime, WsfPlatform *aOtherPlatformPtr, double aDamage, Result aResult)
virtual void CalcLaunchPk (double aSimTime)
virtual void CalcPkDegradation (double aSimTime, WsfPlatform *aTargetPtr)
virtual void CalcInterceptPk (double aSimTime, WsfPlatform *aTargetPtr)
virtual void CalcPkParameters (WsfPlatform *aTargetPtr, double &aAzimuth, double &aElevation, double &aMissileSpeed, double &aTargetSpeed)
bool IsIntendedTargetValid ()
 This protected method assures that a specified target index does exist.
void AddToKilledPlatforms (unsigned int aKilledIndex)
double DrawUniformPk ()
 Draw a uniform value for Pk determination.
virtual bool IsVulnerable (WsfPlatform *aOtherPlatformPtr)
void ProcessEffectCommon (double aSimTime, WsfPlatform *aRefPlatformPtr)
bool Defeated () const
 Return a flag to indicate that this effect has been annulled by outside influences.
const WsfWeaponEngagementGetEngagement () const
 Return the Engagement that this effect was instantiated to support.
void SetUseLaunchPk ()
 Indicate that you wish to use the Launch Pk value (in lieu of the Intercept Pk value).
void SetUseInterceptPk ()
 Indicate that you wish to use the Intercept Pk value (in lieu of the Launch Pk value).
void SetLaunchPk (double aValue)
void SetInterceptPk (double aValue)
void SetPkDrawn (double aValue)
 Set the Pk value used in the intended target hit assessment.
void SetIncidentalResult (const WsfWeaponEffects::Result &aResult)
void SetTargetResult (const WsfWeaponEffects::Result &aResult)
void SetResult (const WsfWeaponEffects::Result &aResult, bool aIsIntended)
size_t KilledPlatform (size_t aIndex)
 Method returns an index of one of the platforms killed during this engagement.
const WsfWeaponEngagementGetEngagementPtr () const
WsfSimulationGetSimulation () const
WsfScriptContextGetScriptContext () const
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

The primary function of this object..

virtual void ProcessEffectExplicit (double aSimTime)
virtual void ProcessEffectImplicit (double aSimTime)
virtual void Terminate (double aSimTime)
void Defeat ()
bool GetIncidentalDamageAllowed () const
void SetIncidentalDamageAllowed (bool aIncidentalDamageAllowed)
bool GetParentDamageAllowed () const
void SetParentDamageAllowed (bool aParentDamageAllowed)

Detailed Description

A base class for all types of weapon effect determinations. Produces some effect on other platforms during a weapon engagement. Note that there are two key methods of the class: ProcessEffectExplicit() and ProcessEffectImplicit(), for explicit and implicit weapons, respectively. The base class is abstract, specialized to use a fixed Pk draw against the target, and will need overridden. Allowance is made for derived classes to (optionally) do a Launch Probability of Kill (Pk) (CalcLaunchPk()) estimation at the time of weapon launch, an Intercept Pk (CalcInterceptPk()) at time of intercept, and to set/use a Circular Error Probable (CEP) value. A virtual Pk "degrade" option, CalcPkDegradation() is also available, for events during flyout that may reduce the possibility of a successful intercept, as well as Defeat(), an externally available trigger to force no terminal target effect. The two Pk values may be input constants, or dependent variables of the engagement conditions and geometry.

Member Enumeration Documentation

◆ Result

Resulting effect on a platform. Note that this enumeration applies separately to both the intended target for the engagement, as well as incidentally damaged players (if permitted).

Enumerator
cINVALID 

The effect has not yet been exercised in the engagement (no detonation yet).

cMISSED 

Did not result in any damage to the intended target platform (a 'miss').

cDAMAGED 

Did apply some incremental damage to the intended platform (a 'hit').

cKILLED 

Did result in total damage (kill) to the intended platform (a 'hit').

Constructor & Destructor Documentation

◆ WsfWeaponEffects() [1/2]

◆ ~WsfWeaponEffects()

WsfWeaponEffects::~WsfWeaponEffects ( )
override

◆ WsfWeaponEffects() [2/2]

WsfWeaponEffects::WsfWeaponEffects ( const WsfWeaponEffects & aSrc)
protected

Copy Constructor for Clone().

References mFlags, WsfObject::WsfObject(), and WsfWeaponEffects().

Member Function Documentation

◆ AddToKilledPlatforms()

void WsfWeaponEffects::AddToKilledPlatforms ( unsigned int aKilledIndex)
protected

Referenced by operator=().

◆ ApplyDamageResultToOtherPlatform()

void WsfWeaponEffects::ApplyDamageResultToOtherPlatform ( double aSimTime,
WsfPlatform * aOtherPlatformPtr,
double aDamage,
Result aResult )
protectedvirtual

This method isolates the actual application of damage to the other platform. By default, the input damage is applied to the target platform, and if the 'aResult' parameter is "cKILLED", the platform is marked for removal if it is local to the simulation. However, if "on_target_damaged" or "on_target_destroyed" scripts are defined, the user-defined behavior will be executed instead of the standard behavior for that result. This means that damage will not be applied and platforms will not be removed, except through script calls.

Parameters
aSimTimeThe current simulation time.
aOtherPlatformPtrThe platform on which the damage is applied.
aDamageThe damage result to be applied to the target platform.
aResultThe general result (cDAMAGED or cKILLED) to be applied to the target platform.

References cDAMAGED, cKILLED, WsfPlatform::GetIndex(), WsfPlatform::IsExternallyControlled(), and WsfPlatform::SetDamageFactor().

Referenced by ApplyEffectIncrement(), and operator=().

◆ ApplyEffectIncrement()

void WsfWeaponEffects::ApplyEffectIncrement ( double aSimTime,
WsfPlatform * aOtherPlatformPtr,
double aDamageAmount )
protectedvirtual

Virtual method to apply an incremental amount of damage to a platform. Should be called internally by ApplyEffectTo() after it has determined a specified amount of damage. Depending upon damage done to the platform, may change the internal Result value to cMISSED, cDAMAGED, or cKILLED. Will inform necessary WsfObservers of target hit or miss.

Parameters
aSimTimeCurrent simulated time value.
aOtherPlatformPtrPlatform under consideration for damage.
aDamageAmountA value from cUNHARMED to cMORTALLY_WOUNDED, indicating damage level.

Reimplemented in WsfHEL_Lethality.

References ApplyDamageResultToOtherPlatform(), cDAMAGED, cKILLED, cMISSED, cMORTALLY_WOUNDED, cUNHARMED, WsfPlatform::GetDamageFactor(), WsfPlatform::GetIndex(), GetSimulation(), WsfPlatform::IsExternallyControlled(), WsfPlatform::IsIndestructible(), SetResult(), WsfObserver::WeaponHit(), and WsfObserver::WeaponMissed().

Referenced by WsfHEL_Lethality::ApplyEffectIncrement(), WsfMobilityAndFirepowerLethality::ApplyEffectTo(), WsfSphericalLethality::ApplyEffectTo(), ApplyEffectTo(), and operator=().

◆ ApplyEffectTo()

void WsfWeaponEffects::ApplyEffectTo ( double aSimTime,
WsfPlatform * aOtherPlatformPtr )
protectedvirtual

Virtual method to apply an amount of damage to an affected target platform. The platform should have already passed a IsVulnerable() check prior to this call. This base implementation considers whether the targeted WsfPlatform IsIndestructible() or not. If so, no Pk is drawn, but an ever decreasing amount of damage is applied to the platform, based upon the set Pk constraint. If the platform is destructible, a draw is taken against either the Launch or Intercept Pk value and any applied Pk degradation, and the damage result is boolean (zero damage, or death).

Parameters
aSimTimeCurrent simulated time.
aOtherPlatformPtrPlatform to (potentially) apply damage to.

Reimplemented in WsfHEL_Lethality, WsfMobilityAndFirepowerLethality, and WsfSphericalLethality.

References ApplyEffectIncrement(), cMORTALLY_WOUNDED, cUNHARMED, DebugEnabled(), DrawUniformPk(), WsfPlatform::GetDamageFactor(), GetPkConstraint(), WsfPlatform::IsIndestructible(), and mDrawEndgamePk.

Referenced by WsfMobilityAndFirepowerLethality::ApplyEffectTo(), operator=(), and ProcessEffectCommon().

◆ CalcInterceptPk()

void WsfWeaponEffects::CalcInterceptPk ( double aSimTime,
WsfPlatform * aTargetPtr )
protectedvirtual

Method to calculate the Intercept Pk, in response to engagement conditions at intercept. Will be called at the beginning of ProcessEffectExplicit().

Parameters
aSimTimesimulated time for the weapon effect.
aTargetPtrTarget under consideration for damage.

Reimplemented in WsfCarltonLethality, WsfExoAtmosphericLethality, WsfExplicitWeaponEffects, WsfGraduatedLethality, WsfHEL_Lethality, WsfMobilityAndFirepowerLethality, and WsfTabulatedLethality.

Referenced by operator=(), and ProcessEffectCommon().

◆ CalcLaunchPk()

void WsfWeaponEffects::CalcLaunchPk ( double aSimTime)
protectedvirtual

Method to calculate the Launch Pk, in response to engagement conditions during launch. Will be called during Initialize().

Parameters
aSimTimesimulated time for the weapon effect.

Reimplemented in WsfEngageLaunchPkTableLethality.

References CalcPkParameters(), GetEngagement(), WsfWeaponEngagement::GetTargetPlatform(), and WsfObject::GetTypeId().

Referenced by Initialize(), and operator=().

◆ CalcPkDegradation()

void WsfWeaponEffects::CalcPkDegradation ( double aSimTime,
WsfPlatform * aTargetPtr )
protectedvirtual

Virtual method to degrade the selected Pk by some factor, in response to adverse engagement conditions. The base class implementation is null, but derived implementations may choose to degrade the (launch OR intercept) Pk for each individual target considered.

Parameters
aSimTimesimulated time for the weapon effect.
aTargetPtrTarget under consideration for damage.

Referenced by operator=(), and ProcessEffectCommon().

◆ CalcPkParameters()

void WsfWeaponEffects::CalcPkParameters ( WsfPlatform * aTargetPtr,
double & aAzimuth,
double & aElevation,
double & aMissileSpeed,
double & aTargetSpeed )
protectedvirtual

Capture the geometry values needed to do a Pk table lookup.

Parameters
aTargetPtrPointer to the target to be evaluated for geometry.
aAzimuthMissile-body-relative azimuth to the target.
aElevationMissile-body-relative elevation to the target.
aMissileSpeedMissile speed.
aTargetSpeedTarget speed.

Reimplemented in WsfExplicitWeaponEffects.

References GetEngagement(), WsfWeaponEngagement::GetFiringPlatform(), and WsfWeaponEngagement::GetTargetPlatform().

Referenced by CalcLaunchPk(), and operator=().

◆ Clone()

WsfWeaponEffects * WsfWeaponEffects::Clone ( ) const
overridepure virtual

◆ DebugEnabled()

◆ Defeat()

void WsfWeaponEffects::Defeat ( )
inline

Force no terminal effect. Purpose is to be externally called when a catastrophic event during weapon flyout negates any future target effect (i.e. seeker gimbal limit, etc.).

References mDefeated.

◆ Defeated()

bool WsfWeaponEffects::Defeated ( ) const
inlineprotected

Return a flag to indicate that this effect has been annulled by outside influences.

References mDefeated.

Referenced by WsfMobilityAndFirepowerLethality::ApplyEffectTo(), WsfExoAtmosphericLethality::CalcInterceptPk(), ProcessEffectExplicit(), and ProcessEffectImplicit().

◆ DrawEndgamePk()

bool WsfWeaponEffects::DrawEndgamePk ( )
inline

Force a pk draw for an external platform target.

References mDrawEndgamePk.

◆ DrawUniformPk()

double WsfWeaponEffects::DrawUniformPk ( )
protected

◆ GetCEP()

virtual double WsfWeaponEffects::GetCEP ( ) const
inlinevirtual

Access the value for engagement Circular Error Probable (CEP).

Referenced by WsfTabulatedLethality::CalcInterceptPk(), wsf::event::utils::PrintWE_Termination(), and wsf::event::utilsCSV::PrintWE_Termination().

◆ GetDamageRadius()

double WsfWeaponEffects::GetDamageRadius ( ) const
inline

Return the maximum lethal damage radius for this effect.

Referenced by WsfLaserWeapon::BeginShot(), wsf::event::utils::GetAdditionalDE_Info(), and wsf::event::utilsCSV::GetAdditionalDE_Info().

◆ GetEngagement()

◆ GetEngagementPtr()

const WsfWeaponEngagement * WsfWeaponEffects::GetEngagementPtr ( ) const
inlineprotected

◆ GetIncidentalDamageAllowed()

bool WsfWeaponEffects::GetIncidentalDamageAllowed ( ) const
inline

Returns 'true' if the effect is allowed to extend beyond the intended target to damage other platforms.

References mIncidentalDamageAllowed.

Referenced by WsfEngageLaunchPkTableLethality::Initialize(), and UT_DEFINE_SCRIPT_METHOD().

◆ GetIncidentalResult()

Result WsfWeaponEffects::GetIncidentalResult ( ) const
inline

Returns the current result of the effect on the incidental (unintended) targets. The value may change during an engagement.

◆ GetInterceptPk()

◆ GetInvincibleIndex()

unsigned int WsfWeaponEffects::GetInvincibleIndex ( ) const
inline

Get the ID of a platform which will not be damaged.

◆ GetLaunchPk()

double WsfWeaponEffects::GetLaunchPk ( ) const
inline

◆ GetParentDamageAllowed()

bool WsfWeaponEffects::GetParentDamageAllowed ( ) const
inline

Can this weapon effect do damage to the parent? Not thread safe

References mParentDamageAllowed.

◆ GetPkConstraint()

double WsfWeaponEffects::GetPkConstraint ( ) const
inline

Method returns the current value of Pk to be used at intercept time to determine weapon miss or kill. This will return either the Launch Pk or Intercept PK, depending upon the results of UseLaunchPk() or UseInterceptPk() methods.

Note
The particular implementation may not in fact use ANY Pk value.

References mUseLaunchPk.

Referenced by WsfMobilityAndFirepowerLethality::ApplyEffectTo(), ApplyEffectTo(), wsf::event::utils::PrintWE_Termination(), wsf::event::utilsCSV::PrintWE_Termination(), and UT_DEFINE_SCRIPT_METHOD().

◆ GetPkDegrade()

double WsfWeaponEffects::GetPkDegrade ( ) const
inline

◆ GetPkDrawn()

virtual double WsfWeaponEffects::GetPkDrawn ( ) const
inlinevirtual

◆ GetPkTable()

WsfPk::Table * WsfWeaponEffects::GetPkTable ( )
inline

◆ GetResultString()

std::string WsfWeaponEffects::GetResultString ( WsfWeaponEffects::Result aResult)
static

Uses the result enum value to return the result as a string cINVALID case defaults to "UNKNOWN" to match event output

References cDAMAGED, cKILLED, and cMISSED.

Referenced by wsf::event::utils::PrintWE_Termination(), wsf::event::utilsCSV::PrintWE_Termination(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().

◆ GetScenario()

WsfScenario & WsfWeaponEffects::GetScenario ( )
inline

Referenced by PreInitialize(), and ProcessInput().

◆ GetScriptAccessibleContext()

UtScriptContext * WsfWeaponEffects::GetScriptAccessibleContext ( ) const
inlineoverride

◆ GetScriptContext()

WsfScriptContext * WsfWeaponEffects::GetScriptContext ( ) const
inlineprotected

Referenced by ProcessInput(), and WsfWeaponEffects().

◆ GetSimulation()

◆ GetTargetResult()

Result WsfWeaponEffects::GetTargetResult ( ) const
inline

Current resulting effect on the intended target. The value may change during an engagement.

◆ GetTotalResult()

Result WsfWeaponEffects::GetTotalResult ( ) const
inline

Returns the current result of the total effect on the target environment. The value may change during an engagement.

◆ GetWeaponEffectsType()

WsfStringId WsfWeaponEffects::GetWeaponEffectsType ( WsfPlatform & aPlatform)
static

Return the weapon effects type for the associated platform.

References WsfWeaponPlatformExtension::GetWeaponEffectsType().

Referenced by WsfExplicitWeapon::FireP(), WsfWeaponFuse::PrivateDetonate(), and WsfDisFire::Process().

◆ Initialize()

bool WsfWeaponEffects::Initialize ( double aSimTime,
const WsfWeaponEngagement * aEngagementPtr )
virtual

Initializes the effect at the time of weapon firing. May be used to set the anticipated launch Pk or CEP for the engagement, if needed. Calls virtual CalcLaunchPk()

Parameters
aSimTimesimulated time at the beginning of the engagement.
aEngagementPtrThe engagement that owns and controls this effect.
Returns
'true' if the weapon effect was initialized successfully.

Reimplemented in WsfEngageLaunchPkTableLethality, WsfExoAtmosphericLethality, WsfHEL_Lethality, WsfMobilityAndFirepowerLethality, and WsfTabulatedLethality.

References CalcLaunchPk(), GetSimulation(), mUseLaunchPk, and ok.

Referenced by Clone(), WsfEngageLaunchPkTableLethality::Initialize(), WsfExoAtmosphericLethality::Initialize(), WsfHEL_Lethality::Initialize(), WsfMobilityAndFirepowerLethality::Initialize(), and WsfTabulatedLethality::Initialize().

◆ IsIntendedTargetValid()

bool WsfWeaponEffects::IsIntendedTargetValid ( )
protected

This protected method assures that a specified target index does exist.

Referenced by operator=(), and ProcessEffectCommon().

◆ IsKilledPlatform()

bool WsfWeaponEffects::IsKilledPlatform ( size_t aPlatformIndex) const

Returns 'true' if the specified WSF platform index has been killed during this engagement.

Referenced by ProcessEffectImplicit().

◆ IsVulnerable()

bool WsfWeaponEffects::IsVulnerable ( WsfPlatform * aOtherPlatformPtr)
protectedvirtual

Virtual method returning a boolean to indicate whether a target platform should be subjected to this weapon effect. The base class implementation enforces the 'allow_incidental_damage' flag to be honored, as well as a weapon not targeting itself, a specified "invincible" platform, or a target belonging to a specified category. Derived implementations may ignore these restrictions, or impose greater ones on top of the basic ones.

Parameters
aOtherPlatformPtrTarget under consideration.
Returns
A flag indicating 'prosecute' or 'do not prosecute'.

Reimplemented in WsfExplicitWeaponEffects, and WsfHEL_Lethality.

References cMORTALLY_WOUNDED, WsfPlatform::GetCategories(), WsfPlatform::GetDamageFactor(), GetEngagement(), WsfWeaponEngagement::GetFiringPlatform(), WsfPlatform::GetIndex(), WsfWeaponEngagement::GetWeaponPlatform(), WsfCategoryList::Intersects(), WsfPlatform::IsDeleted(), WsfPlatform::IsExternalShadow(), and mParentDamageAllowed.

Referenced by WsfExplicitWeaponEffects::IsVulnerable(), WsfHEL_Lethality::IsVulnerable(), operator=(), and ProcessEffectCommon().

◆ KilledPlatform()

size_t WsfWeaponEffects::KilledPlatform ( size_t aIndex)
inlineprotected

Method returns an index of one of the platforms killed during this engagement.

◆ KilledPlatformCount()

unsigned int WsfWeaponEffects::KilledPlatformCount ( ) const
inline

Method returns the count of platforms killed during this engagement.

◆ operator=()

◆ PreInitialize()

◆ ProcessEffectCommon()

void WsfWeaponEffects::ProcessEffectCommon ( double aSimTime,
WsfPlatform * aRefPlatformPtr )
protected

Common driver code for base class explicit and implicit processing.

Parameters
aSimTimesimulated time for the weapon effect.
aRefPlatformPtrThe 'reference' platform. This will be the weapon platform (missile, bomb, etc.) for an explicit weapon and the firing platform for an implicit weapon.

References ApplyEffectTo(), CalcInterceptPk(), CalcPkDegradation(), cMISSED, WsfScriptContext::ExecuteScript(), WsfScriptContext::FindScript(), WsfSimulation::GetPlatformCount(), WsfSimulation::GetPlatformEntry(), WsfPlatform::GetScriptContext(), GetSimulation(), IsIntendedTargetValid(), IsVulnerable(), mIncidentalDamageAllowed, UseInterceptPk(), WsfScriptContext::ValidateScript(), and WsfObserver::WeaponMissed().

Referenced by operator=(), ProcessEffectExplicit(), and ProcessEffectImplicit().

◆ ProcessEffectExplicit()

void WsfWeaponEffects::ProcessEffectExplicit ( double aSimTime)
virtual

Method for explicit weapon effects.

The effect is delivered by an intermediate platform (e.g., a bomb) not residing on the platform that initiated the engagement. This method applies the ApplyEffectTo()lethality transfer function from the weapon platform to all target platform(s) in the simulation which are within lethal range.

Calling heirarchy as follows:

Parameters
aSimTimesimulated time for the weapon effect.

References Defeated(), GetEngagement(), WsfPlatform::GetIndex(), GetSimulation(), WsfWeaponEngagement::GetWeaponPlatform(), and ProcessEffectCommon().

◆ ProcessEffectImplicit()

void WsfWeaponEffects::ProcessEffectImplicit ( double aSimTime)
virtual

Method for implicit effects. The effect is delivered directly by the WsfWeapon that initiated the engagement (e.g., a directed energy device).

Calling hierarchy as follows:

Parameters
aSimTimesimulated time for the weapon effect.

References Defeated(), IsKilledPlatform(), and ProcessEffectCommon().

◆ ProcessInput()

◆ SetCEP()

void WsfWeaponEffects::SetCEP ( double aValue)
inline

Set the value for engagement Circular Error Probable (CEP). (May not be used by all WsfEffects classes.)

Referenced by ProcessInput().

◆ SetDamageRadius()

void WsfWeaponEffects::SetDamageRadius ( double aDamageRadius)
inline

Set the maximum lethal damage radius for this effect.

Referenced by WsfHEL_Lethality::ApplyEffectTo(), and WsfHEL_Lethality::Initialize().

◆ SetDebugEnabled()

void WsfWeaponEffects::SetDebugEnabled ( bool aDebugEnabled)
inline

Enable or disable debugging for this instance.

References mDebugEnabled.

◆ SetIncidentalDamageAllowed()

void WsfWeaponEffects::SetIncidentalDamageAllowed ( bool aIncidentalDamageAllowed)
inline

◆ SetIncidentalResult()

void WsfWeaponEffects::SetIncidentalResult ( const WsfWeaponEffects::Result & aResult)
protected

Set the enumerated end result effect upon unintended target(s). One detonation may have an effect upon more than one target platform. This method assures capturing the most damaging result, and will save result cKILLED, ignoring a later cDAMAGED or cMISSED.

Parameters
aResultinternally reported effect to save as final.

Referenced by SetResult().

◆ SetInterceptPk()

◆ SetInvincibleIndex()

void WsfWeaponEffects::SetInvincibleIndex ( unsigned int aPlatformID)
inline

Set the ID of a platform which shall not be damaged. (Usually the launching entity.).

◆ SetLaunchPk()

void WsfWeaponEffects::SetLaunchPk ( double aValue)
inlineprotected

Set the (assumedly fixed) Launch Pk value.

Note
Some derived-class virtual methods (if used) are free to overwrite this value.

Referenced by WsfEngageLaunchPkTableLethality::CalcLaunchPk(), and ProcessInput().

◆ SetParentDamageAllowed()

void WsfWeaponEffects::SetParentDamageAllowed ( bool aParentDamageAllowed)
inline

References mParentDamageAllowed.

◆ SetPkDegrade()

void WsfWeaponEffects::SetPkDegrade ( double aPkDegrade)
inline

Set the fraction by which the un-degraded Pk value should be multiplied to get the effective Pk.

Parameters
aPkDegradeThe multiplier [0..1] to be applied to the un-degraded Pk to get the effective Pk.

Referenced by UT_DEFINE_SCRIPT_METHOD().

◆ SetPkDrawn()

void WsfWeaponEffects::SetPkDrawn ( double aValue)
inlineprotected

Set the Pk value used in the intended target hit assessment.

Referenced by DrawUniformPk().

◆ SetResult()

void WsfWeaponEffects::SetResult ( const WsfWeaponEffects::Result & aResult,
bool aIsIntended )
protected

Set the enumerated end result effect upon affected platform(s).

Parameters
aResultinternally reported effect to save as final.
aIsIntended'true' if aResult was to the intended target.

References cINVALID, cMISSED, mDefeated, SetIncidentalResult(), and SetTargetResult().

Referenced by ApplyEffectIncrement().

◆ SetTargetResult()

void WsfWeaponEffects::SetTargetResult ( const WsfWeaponEffects::Result & aResult)
protected

Set the most grave enumerated end result upon the intended target. One employment of a weapon may have more than one effect upon a target platform, especially an implicit directed energy weapon, if the beam were to impinge repeatedly on the target. This method assures capturing the most damaging result, and will save result cKILLED, ignoring a later cMISSED.

Parameters
aResultthe reported effect to save as a final result.

Referenced by SetResult().

◆ SetUseInterceptPk()

◆ SetUseLaunchPk()

void WsfWeaponEffects::SetUseLaunchPk ( )
inlineprotected

Indicate that you wish to use the Launch Pk value (in lieu of the Intercept Pk value).

References mUseLaunchPk.

Referenced by ProcessInput(), and WsfEngageLaunchPkTableLethality::WsfEngageLaunchPkTableLethality().

◆ Terminate()

void WsfWeaponEffects::Terminate ( double aSimTime)
virtual

Method to complete the effect at the end of a weapon engagement. The first action is to inform the WsfObservers of WsfWeaponEngagement termination. For an explicit engagement, the next action is to remove the weapon platform from the simulation. For both implicit and explicit engagements, killed players are then removed.

Parameters
aSimTimeCurrent simulated time value.

Reimplemented in WsfExoAtmosphericLethality.

References WsfMilInterface::Find(), GetEngagement(), WsfSimulation::GetPlatformByIndex(), GetSimulation(), WsfWeaponEngagement::GetWeaponPlatform(), WsfPlatform::IsExternallyControlled(), WsfPlatform::IsIndestructible(), WsfMilInterface::KillPlatform(), mRemoveWeaponPlatform, WsfPlatform::SetDamageFactor(), and WsfObserver::WeaponTerminated().

Referenced by WsfExoAtmosphericLethality::Terminate().

◆ UseInterceptPk()

bool WsfWeaponEffects::UseInterceptPk ( ) const
inline

Method returns a boolean to indicate that the current value for Intercept Pk (in lieu of Launch Pk) will be the target of comparison for a uniform draw at intercept time.

Note
The particular implementation may not in fact use the Intercept Pk.

References mUseLaunchPk.

Referenced by wsf::event::utils::PrintWE_Termination(), wsf::event::utilsCSV::PrintWE_Termination(), and ProcessEffectCommon().

◆ UseLaunchPk()

bool WsfWeaponEffects::UseLaunchPk ( ) const
inline

Method returns a boolean to indicate that the current value for Launch Pk (in lieu of Intercept Pk) will be the target of comparison for a uniform draw at intercept time.

Note
The particular implementation may not in fact use the Launch Pk.

References mUseLaunchPk.

Referenced by wsf::event::utils::PrintWE_Termination(), and wsf::event::utilsCSV::PrintWE_Termination().

Member Data Documentation

◆ cMORTALLY_WOUNDED

const double WsfWeaponEffects::cMORTALLY_WOUNDED = 1.0
static

Value indicating total damage to a player (eventually causing him to be removed from the simulation).

Referenced by ApplyEffectIncrement(), WsfHEL_Lethality::ApplyEffectTo(), WsfMobilityAndFirepowerLethality::ApplyEffectTo(), ApplyEffectTo(), and IsVulnerable().

◆ cTYPE_KIND

const char * WsfWeaponEffects::cTYPE_KIND = "weapon_effect"
static

◆ cUNHARMED

const double WsfWeaponEffects::cUNHARMED = 0.0
static

Value indicating no damage to a player, the weapon had no effect.

Referenced by ApplyEffectIncrement(), WsfHEL_Lethality::ApplyEffectTo(), WsfMobilityAndFirepowerLethality::ApplyEffectTo(), and ApplyEffectTo().

◆ mDebugEnabled

bool WsfWeaponEffects::mDebugEnabled

◆ mDefeated

bool WsfWeaponEffects::mDefeated

◆ mDrawEndgamePk

bool WsfWeaponEffects::mDrawEndgamePk

◆ mFlags

unsigned short WsfWeaponEffects::mFlags

◆ mIncidentalDamageAllowed

bool WsfWeaponEffects::mIncidentalDamageAllowed

◆ mParentDamageAllowed

bool WsfWeaponEffects::mParentDamageAllowed

◆ mRemoveWeaponPlatform

bool WsfWeaponEffects::mRemoveWeaponPlatform

◆ mUseLaunchPk


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved