Explosive Items
Jump to navigation
Jump to search
Items can explode in some circumstances:
Inside Cargo
Whenever a block is destroyed and it had items in its inventory, depending on what those items are it can spawn an actual explosion.
Items that contribute to the explosion:
Componenttype with theExplosivesSubtypeId.- All
AmmoMagazinetypes.- Note: because <ExplosiveDamageMultiplier> is not checked, it means even ones with 0 will trigger at least a visual explosion.
A Temporary Container with those items will also cause an explosion when destroyed, but only from these damage types:
Fire- not used by vanilla code.Rocket- direct impact from missile-type ammo.Bullet- used by all projectile-type ammo.Thruster- used by all thrusters' flame damage.Explosion- used by all explosions.
All of these can also be used by mods to deal damage in whatever contexts they want.
The explosion
- Damage is calculated from total item volume, each multiplied by its own <ExplosiveDamageMultiplier>, then the total added multiplied by GameDef.<ExplosionDamagePerLiter> and limited up to Game def's <ExplosionDamageMax>.
- Range is calculated using Game def's <ExplosionAmmoVolumeMin> and <ExplosionAmmoVolumeMax> as a ratio for the min & max radius:
- For blocks: Game def's <ExplosionRadiusMin> and <ExplosionRadiusMax>
- For containers: hardcoded 0.5m and 100m.
- Particle effect and sound are given the same value based on content volume:
Explosion_AmmunitionTinyfor less than 125 liters.Explosion_AmmunitionSmallfor less than 16,000 liters.Explosion_AmmunitionMediumfor less than 100,000 liters.Explosion_AmmunitionLargefor anything higher.
More details: Explosions
Floating item
Loose items being damaged will also explode:
- Items with
ExplosivesSubtypeId, except forOreandIngottypes. - All
AmmoMagazinetypes.
The explosion
- Hardcoded 800 damage
- Range is calculated from the amount of items divided by 100, capped between 0.5m and 100m.
- Uses
Explosion_Warhead_15particle effect - Uses item's <DestroySound> for the sound effect.
More details: Explosions