12#ifndef WSFWEAPONEFFECTS_HPP
13#define WSFWEAPONEFFECTS_HPP
15#include "wsf_mil_export.h"
85 virtual void ProcessEffectExplicit(
double aSimTime);
86 virtual void ProcessEffectImplicit(
double aSimTime);
87 virtual void Terminate(
double aSimTime);
125 Result GetTotalResult()
const {
return (mTargetResult > mIncidentalResult) ? mTargetResult : mIncidentalResult; }
174 virtual double GetCEP()
const {
return mCEP; }
178 void SetCEP(
double aValue) { mCEP = aValue; }
194 unsigned int KilledPlatformCount()
const {
return static_cast<unsigned int>(mKilledPlatformIndices.size()); }
197 bool IsKilledPlatform(
size_t aPlatformIndex)
const;
217 double& aMissileSpeed,
218 double& aTargetSpeed);
266 unsigned int mInvincibleIndex;
289 double mDamageRadius;
292 std::vector<size_t> mKilledPlatformIndices;
293 Result mTargetResult;
294 Result mIncidentalResult;
299 UtScript* mOnTargetDamagedPtr;
300 UtScript* mOnTargetKilledPtr;
ut::script::Data UtScriptData
Definition WsfScriptContext.hpp:47
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Contains the 'categories' to which an object belongs.
Definition WsfCategoryList.hpp:34
WsfObject()
This is the constructor for the WsfObject class.
Definition WsfObject.cpp:88
virtual bool ProcessInput(UtInput &aInput)
Definition WsfObject.cpp:140
Definition WsfPkTable.hpp:78
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfScriptContext.hpp:71
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfWeaponEffects.hpp:48
virtual void CalcInterceptPk(double aSimTime, WsfPlatform *aTargetPtr)
Definition WsfWeaponEffects.cpp:640
virtual void ApplyEffectTo(double aSimTime, WsfPlatform *aOtherPlatformPtr)
Definition WsfWeaponEffects.cpp:549
const WsfWeaponEngagement * GetEngagement() const
Return the Engagement that this effect was instantiated to support.
Definition WsfWeaponEffects.hpp:231
static WsfStringId GetWeaponEffectsType(WsfPlatform &aPlatform)
Return the weapon effects type for the associated platform.
Definition WsfWeaponEffects.cpp:45
void SetPkDegrade(double aPkDegrade)
Definition WsfWeaponEffects.hpp:182
double GetDamageRadius() const
Return the maximum lethal damage radius for this effect.
Definition WsfWeaponEffects.hpp:162
virtual void CalcPkParameters(WsfPlatform *aTargetPtr, double &aAzimuth, double &aElevation, double &aMissileSpeed, double &aTargetSpeed)
Definition WsfWeaponEffects.cpp:886
static const char * cTYPE_KIND
Definition WsfWeaponEffects.hpp:52
void SetLaunchPk(double aValue)
Definition WsfWeaponEffects.hpp:241
Result
Definition WsfWeaponEffects.hpp:63
@ cDAMAGED
Did apply some incremental damage to the intended platform (a 'hit').
Definition WsfWeaponEffects.hpp:66
@ cMISSED
Did not result in any damage to the intended target platform (a 'miss').
Definition WsfWeaponEffects.hpp:65
@ cKILLED
Did result in total damage (kill) to the intended platform (a 'hit').
Definition WsfWeaponEffects.hpp:67
@ cINVALID
The effect has not yet been exercised in the engagement (no detonation yet).
Definition WsfWeaponEffects.hpp:64
virtual void ApplyEffectIncrement(double aSimTime, WsfPlatform *aOtherPlatformPtr, double aDamageAmount)
Definition WsfWeaponEffects.cpp:482
static const double cMORTALLY_WOUNDED
Definition WsfWeaponEffects.hpp:58
virtual void CalcPkDegradation(double aSimTime, WsfPlatform *aTargetPtr)
Definition WsfWeaponEffects.cpp:632
bool UseInterceptPk() const
Definition WsfWeaponEffects.hpp:141
bool mUseLaunchPk
Definition WsfWeaponEffects.hpp:277
void SetInterceptPk(double aValue)
Definition WsfWeaponEffects.hpp:245
UtScriptContext * GetScriptAccessibleContext() const override
Definition WsfWeaponEffects.hpp:81
void SetPkDrawn(double aValue)
Set the Pk value used in the intended target hit assessment.
Definition WsfWeaponEffects.hpp:248
WsfWeaponEffects & operator=(const WsfWeaponEffects &aRhs)
virtual bool IsVulnerable(WsfPlatform *aOtherPlatformPtr)
Definition WsfWeaponEffects.cpp:670
bool mDebugEnabled
Definition WsfWeaponEffects.hpp:273
void SetParentDamageAllowed(bool aParentDamageAllowed)
Definition WsfWeaponEffects.hpp:109
virtual void CalcLaunchPk(double aSimTime)
Definition WsfWeaponEffects.cpp:608
double GetPkConstraint() const
Definition WsfWeaponEffects.hpp:150
void SetDamageRadius(double aDamageRadius)
Set the maximum lethal damage radius for this effect.
Definition WsfWeaponEffects.hpp:159
void SetCEP(double aValue)
Definition WsfWeaponEffects.hpp:178
void SetUseInterceptPk()
Indicate that you wish to use the Intercept Pk value (in lieu of the Launch Pk value).
Definition WsfWeaponEffects.hpp:237
bool UseLaunchPk() const
Definition WsfWeaponEffects.hpp:135
void SetInvincibleIndex(unsigned int aPlatformID)
Set the ID of a platform which shall not be damaged. (Usually the launching entity....
Definition WsfWeaponEffects.hpp:153
bool DebugEnabled() const
Returns 'true' if debugging is enabled for this instance.
Definition WsfWeaponEffects.hpp:188
Result GetTotalResult() const
Definition WsfWeaponEffects.hpp:125
unsigned int GetInvincibleIndex() const
Get the ID of a platform which will not be damaged.
Definition WsfWeaponEffects.hpp:156
double GetPkDegrade() const
Return the current Pk degrade factor.
Definition WsfWeaponEffects.hpp:144
virtual void ApplyDamageResultToOtherPlatform(double aSimTime, WsfPlatform *aOtherPlatformPtr, double aDamage, Result aResult)
Definition WsfWeaponEffects.cpp:428
Result GetIncidentalResult() const
Definition WsfWeaponEffects.hpp:121
size_t KilledPlatform(size_t aIndex)
Method returns an index of one of the platforms killed during this engagement.
Definition WsfWeaponEffects.hpp:255
void SetDebugEnabled(bool aDebugEnabled)
Enable or disable debugging for this instance.
Definition WsfWeaponEffects.hpp:191
bool GetParentDamageAllowed() const
Definition WsfWeaponEffects.hpp:107
virtual double GetCEP() const
Access the value for engagement Circular Error Probable (CEP).
Definition WsfWeaponEffects.hpp:174
virtual bool Initialize(double aSimTime, const WsfWeaponEngagement *aEngagementPtr)
Definition WsfWeaponEffects.cpp:150
bool IsIntendedTargetValid()
This protected method assures that a specified target index does exist.
Definition WsfWeaponEffects.cpp:645
WsfScriptContext * GetScriptContext() const
Definition WsfWeaponEffects.hpp:261
Result GetTargetResult() const
Definition WsfWeaponEffects.hpp:117
bool mDefeated
Definition WsfWeaponEffects.hpp:274
double GetLaunchPk() const
Get the Launch Pk.
Definition WsfWeaponEffects.hpp:165
static const double cUNHARMED
Value indicating no damage to a player, the weapon had no effect.
Definition WsfWeaponEffects.hpp:54
double DrawUniformPk()
Draw a uniform value for Pk determination.
Definition WsfWeaponEffects.cpp:653
void AddToKilledPlatforms(unsigned int aKilledIndex)
Definition WsfWeaponEffects.cpp:585
bool DrawEndgamePk()
Force a pk draw for an external platform target.
Definition WsfWeaponEffects.hpp:171
virtual double GetPkDrawn() const
Access the Pk value drawn for the (intended) target hit assessment.
Definition WsfWeaponEffects.hpp:185
const WsfWeaponEngagement * GetEngagementPtr() const
Definition WsfWeaponEffects.hpp:257
WsfPk::Table * GetPkTable()
Definition WsfWeaponEffects.hpp:199
unsigned int KilledPlatformCount() const
Method returns the count of platforms killed during this engagement.
Definition WsfWeaponEffects.hpp:194
WsfWeaponEffects * Clone() const override=0
virtual bool PreInitialize()
Definition WsfWeaponEffects.cpp:125
void SetUseLaunchPk()
Indicate that you wish to use the Launch Pk value (in lieu of the Intercept Pk value).
Definition WsfWeaponEffects.hpp:234
bool mRemoveWeaponPlatform
Definition WsfWeaponEffects.hpp:278
bool mDrawEndgamePk
Definition WsfWeaponEffects.hpp:279
void ProcessEffectCommon(double aSimTime, WsfPlatform *aRefPlatformPtr)
Definition WsfWeaponEffects.cpp:698
bool mParentDamageAllowed
Definition WsfWeaponEffects.hpp:276
WsfWeaponEffects(WsfScenario &aScenario)
Definition WsfWeaponEffects.cpp:51
bool mIncidentalDamageAllowed
Definition WsfWeaponEffects.hpp:275
void Defeat()
Definition WsfWeaponEffects.hpp:92
bool GetIncidentalDamageAllowed() const
Definition WsfWeaponEffects.hpp:97
double GetInterceptPk() const
Get the Intercept Pk.
Definition WsfWeaponEffects.hpp:168
void SetIncidentalDamageAllowed(bool aIncidentalDamageAllowed)
Definition WsfWeaponEffects.hpp:99
bool Defeated() const
Return a flag to indicate that this effect has been annulled by outside influences.
Definition WsfWeaponEffects.hpp:228
unsigned short mFlags
Definition WsfWeaponEffects.hpp:281
WsfScenario & GetScenario()
Definition WsfWeaponEffects.hpp:201
Definition WsfWeaponEngagement.hpp:43
Definition WsfWeapon.hpp:63