# Difference between revisions of "Part Explosion"

When certain parts like the reactor are destroyed they explode and damage their surrounding. See the table below for what may be a complete list.

## Formula

The damage applied to each tile from the center of explosion is determined by the following equation:

$\left(1-{\frac {D}{R_{o}}}\right)^{D_{or}}*D_{ot}$ wherein :$D$ is the distance from the center of explosion, :$R_{o}$ is the RadiusVsOperational, :$D_{or}$ is the DamageVsOperationalFalloff, and :$D_{ot}$ is the DamageVsOperationalPerTile.

## Armor explosion reduction

Armor can reduce the damage effects of explosions by 75% such that only 25% would reach the parts behind it. For example the first armor layer would reduce the damage from a reactor explosion to 423. A second layer would reduce it to 73. As demonstrated here the explosion from a reactor which did major damage to half the ship. This can greatly reduce functionality and possibly start a chain reaction doing more damage. The armor took major damage but other tiles on its side where only moderately.

Borrowed from Reactor these tables demonstrate armor blocking / damage fall off in addition to the graph and screenshot to the right.

Upon death the reactor will deal 4000 damage to parts in a 6 tile radius, 2000 against structure in a 4 tile, and a 50% chance of fire in a 6 tile radius.

Explosion damage:

Explosion damage blocked by one 2x1 armor layer:

Explosion damage blocked by two 2x1 armor layers:

## Per-Component Damage Table

Below is a table of damage per component as of 0.15.1a (9/10/2019):

ammo_factory AmmoStorage 25000 4 5000 3
ammo_storage AmmoStorage 25000 4 5000 3
cannon_large AmmoPrereq 25000 4.5 5000 3.5
cannon_med AmmoPrereq 10000 4 2000 3
explosive_charge 25000 2.5
flak_cannon_large AmmoPrereq 25000 4.5 5000 3.5
ion_beam_prism BeamEmitter 45000 5 10000 3
mine_factory MineStorage 15000 6 5000 5
missile_factory_he MissileStorage 30000 6 10000 5
missile_factory_nuke MissileStorage 200000 1
missile_launcher_he 10000 5 3333 4
missile_launcher_mine MineStorage 15000 5
missile_launcher_nuke MissileStorage 200000 1
missile_storage MissileStorage 30000 5
missile_storage MissileStorage 200000 1
missile_storage MissileStorage 15000 5 5000 4
railgun_loader AmmoPrereq 25000,5000 4.5,3.5
reactor_small 90000 6 20000 4

PowerShell script to generate the above from the cosmoteer\data\ships\terran directory.

$reset = {$start,$edmg,$prereq = $null,$null,$null,$null
$edmgs=@() }$outputobject = {
[pscustomobject]@{
file=$file.BaseName prereq=. {if($prereq -ne $null) {$prereq.Trim()}}
edmgs=$edmgs start=$start.Trim()
}
}
$objs=foreach($file in (gci -Recurse -Include *.txt)){
$lines=gc$file
. $reset foreach($line in $lines){ switch -Regex ($line) {
"DestroyedEffects" {
if($start){ .$outputobject
. $reset }$start=$line } 'FactorHitEffectsWith\s*=\s*(.*)' {$prereq = $matches } 'ExplosiveDamage' { if($edmg) {
$edmgs+=$edmg
}
$edmg = [pscustomobject]@{ totaldmg=$null
radius=$null delay =$null
fire=$null ndmg =$null
operation=$null struct =$null
friend = $null } } 'TotalDamage\s*=\s*(\d+\.?\d*)' { if($edmg) {$edmg.totaldmg = [double]$matches }}
'Radius\s*=\s*(\d+\.?\d*)' { if($edmg) {$edmg.radius = [double]$matches }} 'Delay\s*=\s*(\d*\.?\d*)' { if($edmg) {$edmg.delay = [double]$matches }}
'FireChancePerNDamage\s*=\s*(\d+\.?\d*)' { if($edmg) {$edmg.fire = [double]$matches }} 'NDamage\s*=\s*(\d+\.?\d*)' { if($edmg) {$edmg.ndmg = [double]$matches }}
'OperationalHealth\s*=\s*(true|false)' { if($edmg) {$edmg.operation = [convert]::ToBoolean($matches) }} 'StructuralHealth\s*=\s*(true|false)' { if($edmg) {$edmg.struct = [convert]::ToBoolean($matches) }}
'Friendlies\s*=\s*(true|false)' { if($edmg) {$edmg.friend = [convert]::ToBoolean($matches) }} } } if($start){
if($edmg){$edmgs+=$edmg} .$outputobject
$start=$false
}
}

$withdmg=$objs |?{$_.edmgs} |?{$_.edmgs |?{$_.totaldmg}}$out=$withdmg | %{$struct=$_.edmgs|?{$_.struct}
$op =$_.edmgs|?{$_.operation} [pscustomobject]@{ name=$_.file
factor=$_.prereq structuredamage=($struct | select -ExpandProperty totaldmg) -join ","
structureradius=($struct | select -ExpandProperty radius) -join "," operationaldamage=($op | select -ExpandProperty totaldmg) -join ","
operationalradius=($op | select -ExpandProperty radius) -join "," } } #$header=$out | gm |?{$_.membertype -eq "NoteProperty"} | select -ExpandProperty name
$header=@("name","factor","operationaldamage","operationalradius","structuredamage","structureradius") @" {| class="wikitable sortable" |- !$($header -join " !! ")n "@ + (($out | %{
"|-"
"| $($l=$_;($header| %{ if(($l.$_)){$l.$_} else {''}}) -join " || ")"
}
) -join "n")+@"
n|}
"@ | clip
`