Simulator::cSpaceToolData class

Base classes

class cSpaceInventoryItem
Represents an item of the space player inventory. This include space tools and cargo.

Public types

enum SpaceToolFlags { kFlagHitOrientsToTerrain = 0x1, kFlagBeamPassThrough = 0x2, kFlagIsHoming = 0x4, kFlagDestroysFloraAndFauna = 0x8, kFlagPicksFlora = 0x10, kFlagUsesAmmo = 0x20, kFlagDisableOnHomeWorld = 0x40, kFlagDisableOnSaveGames = 0x80, kFlagPassTroughAll = 0x100, kFlagDamagesFriendlies = 0x200, kFlagPreventsPlanetExit = 0x400, kFlagProjectileLobAngle = 0x800, kFlagDoActionPostEffect = 0x1000, kFlagOnlyOnPlayerColonies = 0x2000, kFlagOnlyOnNPCColonies = 0x4000, kFlagUseOnActivate = 0x8000, kFlagCanPlayerLockOn = 0x10000, kFlagDisableOn201Ruins = 0x20000, kFlagProjectilePassThrough = 0x40000, kFlagIsSuperWeapon = 0x80000 }

Public static variables

static const uint32_t TYPE

Public static functions

static auto ShowEventLog(cSpaceToolData* pTool, uint32_t eventLogID, bool show = true) -> uint32_t

Public functions

auto AddAmmo(int amount) -> void
Adds a certain quantity to the current ammount of ammo of the tool, ensuring it is not greater than the mMaxAmmoCount property.
auto ConsumeAmmo(int amount = -1) -> void
Removes a certain quantity of ammo.
auto GetMinRange() const -> float
auto GetMaxRange() const -> float
auto IsTargetAir() const -> bool
auto GetStrategy() const -> cToolStrategy*

Public variables

int mCurrentAmmoCount
bool mbIsInUse
cGonzagoTimer mRechargeTimer
cGonzagoTimer mAutoFireTimer
cGonzagoTimer mChargeTimer
cGonzagoTimer mMissCheckTimer
ObjectPtr field_108
ObjectPtr field_10C
ObjectPtr field_110
cSpatialObjectPtr mpToolOwner
cSpatialObjectPtr mpToolTarget
int mTargetDamagePointId
cDefaultAoEAreaPtr mpArea
cDefaultBeamProjectilePtr mpBeam
int field_128
ObjectPtr mpAppTarget
char padding_130
bool mbInterruptedByDamage
int field_140
float mDamageMultiplier
float mRangeMultiplier
float mProjectileScale
bool feld_150
float field_154
float field_158
float field_15C
float field_160
float field_164
float field_168
int field_16C
int field_170
SpaceToolFlags mFlags
int mStrategy
Strategy class to use for custom behavior beyond normal tool usage.
uint32_t mType
Weapon, terraforming, special, other (a grouping for the tool in the various UI buckets)
uint32_t mWeaponSubType
Projectile, etc.
uint32_t mProjectileType
Artillery, pulse.
uint32_t mProjectileMotion
uint32_t mContext
Defines where the tool can be used (always, planet, space, passive).
ResourceKey mUpgradeFile
The file which serves as an upgrade to this tool.
int mAmmoUsedPerShot
The amount of ammo each shot consumes.
int mMaxAmmoCount
The maximum ammo for the tool.
int mUseCost
The cost to use the tool once.
float mEnergyCost
Energy required per use.
float mDamageArea
The world unit radius in which the tool will destroy game objects.
float mDetectableRange
The range at which cities can detect the usage of weaponry.
float mMinDamage
Minimum damage the tool will cause if it registers for damage.
float mMaxDamage
Maximum damage the tool will cause if it registers for damage.
float mMaxProjectileScale
Maximum projectile scaling for this tool.
float mRechargeRate
The time (in seconds) that it takes the tool to recharge before it can be used again.
float mAutoFireRate
The time (in seconds) between repeat firings of a weapon (-1 means never)
float mMinRange
Min range for a tool to be fireable (-1 means no range constraint)
float mMaxRange
Max range over which a tool can fire (-1 means no range constraint)
float mDamageRadius
Damage radius (only used by Area of Effect weapons)
float mChargeRate
The time (in seconds) for the weapon to fully charge before firing.
float mProjectileSpeed
Projectile speed.
float mProjectileAcceleration
Projectile acceleration.
float mProjectileTurnRate
How fast it can turn, used by turret defense missiles.
float mProjectileMaxAltitude
Altitude at which it explodes.
float mProjectileMinAltitude
Lowest altitude the projectile can explode at.
float mProjectileDetonationDistance
Distance from target, inside of which it explodes.
float mProjectileTimeOut
Time in seconds before the projectile will explode naturally.
float mProjectileEccentricity
float mRelationshipDelta
How much relationship changes when this tool hits.
float mGalacticRelationshipDelta
How much all empires' relationship changes when this tool hits.
float mGalacticRelationshipRadius
int mCulturalRewardCount
How many charges rewarded to the player on civ transition.
int mMilitaryRewardCount
How many charges rewarded to the player on civ transition.
int mEconomicRewardCount
How many charges rewarded to the player on civ transition.
int mMeaningOfLifeRewardCount
How many charges rewarded to player when they discover the meaning of life (enter the galactic core)
float mProjectileLobAngle
Degree angle up from horizontal that the projectile will be lobbed from.
uint32_t mHitPlayerEffectID
Effect component for hitting the player.
uint32_t mBeamEffectID
Effect component for beam style weapons.
uint32_t mHitGroundEffectID
Effect component for beam style weapons.
uint32_t mHitWaterEffectID
Effect component for beam style weapons.
uint32_t mHitCombatantEffectID
Effect component for beam style weapons.
uint32_t mMuzzleEffectID
Effect that is emitted from the shooter.
uint32_t mProjectileEffectID
Effect that plays as the projectile flies through the air.
uint32_t mTargetEffectID
Effect that is pinned to the terrain for the duration of a deep space projectile's life.
float mProjectileExplosionExpansionRate
Rate at which a projectile's explosion spreads (use a high number for instantaneous)
uint32_t mPlacedModelKey
uint32_t mMinimapSlotsToggleEffectID
Hash of slots, map, or none.
uint32_t mTerraformingIconID
int mTerrainColorIndex
int mWaterColorIndex
int mAtmosphereColorIndex
SpaceToolTarget mTargetFlags
LocalizedString mTargetFlagsFailMessage
float mHitGroundAtmosphereVelocity
Velocity added to atmosphere terraforming element when the tool is used on the ground.
float mHitGroundWaterVelocity
Velocity added to water terraforming element when the tool is used on the ground.
float mHitGroundTemperatureVelocity
Velocity added to temperature terraforming element when the tool is used on the ground.
float mHitWaterAtmosphereVelocity
Velocity added to atmosphere terraforming element when the tool is used on the water.
float mHitWaterWaterVelocity
Velocity added to water terraforming element when the tool is used on the water.
float mHitWaterTemperatureVelocity
Velocity added to temperature terraforming element when the tool is used on the water.
float mHitCombatantAtmosphereVelocity
Vlocity added to atmosphere terraforming element when the tool is used on a combatant.
float mHitCombatantWaterVelocity
Velocity added to water terraforming element when the tool is used on a combatant.
float mHitCombatantTemperatureVelocity
Velocity added to temperature terraforming element when the tool is used on a combatant.
float mHitAirAtmosphereVelocity
Velocity added to atmosphere terraforming element when the tool that detonates in air.
float mHitAirWaterVelocity
Velocity added to water terraforming element when the tool is used on detonates in air.
float mHitAirTemperatureVelocity
Velocity added to temperature terraforming element when the tool is used on detonates in air.
int field_29C

Enum documentation

enum Simulator::cSpaceToolData::SpaceToolFlags

Enumerators
kFlagHitOrientsToTerrain

If the beam takes the surface orientation on hit or uses the beam.

kFlagBeamPassThrough

If the beam effect passes through any combatants to hit the terrain or water.

kFlagIsHoming

kFlagDestroysFloraAndFauna

Does this tool destroy flora and fauna?

kFlagPicksFlora

Does this tool need to interact with creature trees?

kFlagUsesAmmo

Flag if the tool requires the use of ammo.

kFlagDisableOnHomeWorld

Disable this tool on the users homeworld.

kFlagDisableOnSaveGames

Disable this tool when visiting savegame worlds.

kFlagPassTroughAll

If the projectile ignores all collisions.

kFlagDamagesFriendlies

If the projectile damages friendlies.

kFlagPreventsPlanetExit

kFlagProjectileLobAngle

kFlagDoActionPostEffect

If the tool waits for the hit effect to resolve.

kFlagOnlyOnPlayerColonies

kFlagOnlyOnNPCColonies

kFlagUseOnActivate

When this tool is selected in the interface, it will be automatically used and deselected.

kFlagCanPlayerLockOn

kFlagDisableOn201Ruins

Disable this tool when visiting 201 world.

kFlagProjectilePassThrough

If the projectile effect passes through any combatants to hit the terrain or water.

kFlagIsSuperWeapon

Function documentation

void Simulator::cSpaceToolData::AddAmmo(int amount)

Adds a certain quantity to the current ammount of ammo of the tool, ensuring it is not greater than the mMaxAmmoCount property.

Parameters
amount

void Simulator::cSpaceToolData::ConsumeAmmo(int amount = -1)

Removes a certain quantity of ammo.

Parameters
amount The amount of ammo to remove or -1.

By default the removed ammo is taken from the property mAmmoUsedPerShot, but it can also be specified manually.