Difference between revisions of "Part Explosion"

From Cosmoteer Wiki
Jump to: navigation, search
(General cleanup of existing sections, Added per-component damage table scraped from the config via the attached script, shamelessly stole the tables from reactor as they demonstrate armor reduction well.)
 
Line 1: Line 1:
 
{{stub}}
 
{{stub}}
  
When certain parts like the [[Reactor|reactor]] are destroyed they explode and damage their surrounding.
+
When certain parts like the [[Reactor|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:
 
The damage applied to each tile from the center of explosion is determined by the following equation:
  
Line 8: Line 11:
 
wherein :<math>D</math> is the distance from the center of explosion, :<math>R_o</math> is the ''RadiusVsOperational'', :<math>D_{or}</math> is the ''DamageVsOperationalFalloff'', and :<math>D_{ot}</math> is the ''DamageVsOperationalPerTile''.
 
wherein :<math>D</math> is the distance from the center of explosion, :<math>R_o</math> is the ''RadiusVsOperational'', :<math>D_{or}</math> is the ''DamageVsOperationalFalloff'', and :<math>D_{ot}</math> is the ''DamageVsOperationalPerTile''.
  
[[file:Reactor explosion damage.gif|thumb|right]]
+
[[file:Reactor explosion damage.gif|thumb|right|Graph of damage falloff]]
 +
 
 +
== 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|reactor]] explosion to 423. A second layer would reduce it to 73.
 
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|reactor]] explosion to 423. A second layer would reduce it to 73.
  
[[file:Reactor_explosion_example.png|thumb|right]]
+
[[file:Reactor_explosion_example.png|thumb|right|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.]]
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:
 +
{{Reactor Explosion Area Damage}}
 +
 
 +
Explosion damage blocked by one 2x1 armor layer:
 +
{{Armor Layer Blocking Reactor Explosion Damage Table}}
 +
Explosion damage blocked by two 2x1 armor layers:
 +
{{Armor Layer x2 Blocking Reactor Explosion Damage Table}}
 +
 
 +
== Per-Component Damage Table ==
 +
 
 +
Below is a table of damage per component as of 0.15.1a (9/10/2019):
 +
 
 +
{| class="wikitable sortable mw-collapsible mw-collapsed"
 +
|-
 +
! name !! factor !! operationaldamage !! operationalradius !! structuredamage !! structureradius
 +
|-
 +
| 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.
 +
<div class="mw-collapsible mw-collapsed" style="float:left">
 +
<source lang="powershell">
 +
$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[1] }
 +
            '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[1] }}
 +
            'Radius\s*=\s*(\d+\.?\d*)' { if($edmg) {$edmg.radius = [double]$matches[1] }}
 +
            'Delay\s*=\s*(\d*\.?\d*)' { if($edmg) {$edmg.delay = [double]$matches[1] }}
 +
            'FireChancePerNDamage\s*=\s*(\d+\.?\d*)' { if($edmg) {$edmg.fire = [double]$matches[1] }}
 +
            'NDamage\s*=\s*(\d+\.?\d*)' { if($edmg) {$edmg.ndmg = [double]$matches[1] }}
 +
            'OperationalHealth\s*=\s*(true|false)' { if($edmg) {$edmg.operation = [convert]::ToBoolean($matches[1]) }}
 +
            'StructuralHealth\s*=\s*(true|false)' { if($edmg) {$edmg.struct = [convert]::ToBoolean($matches[1]) }}
 +
            'Friendlies\s*=\s*(true|false)' { if($edmg) {$edmg.friend = [convert]::ToBoolean($matches[1]) }}
 +
        }
 +
    }
 +
    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[0] | 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
 +
 
 +
</source>
 +
</div>
  
 
[[Category: Game Mechanics‏‎]]
 
[[Category: Game Mechanics‏‎]]

Latest revision as of 00:23, 10 September 2019


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:

wherein : is the distance from the center of explosion, : is the RadiusVsOperational, : is the DamageVsOperationalFalloff, and : is the DamageVsOperationalPerTile.

Graph of damage falloff

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):

name factor operationaldamage operationalradius structuredamage structureradius
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[1] }
            '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[1] }}
            'Radius\s*=\s*(\d+\.?\d*)' { if($edmg) {$edmg.radius = [double]$matches[1] }}
            'Delay\s*=\s*(\d*\.?\d*)' { if($edmg) {$edmg.delay = [double]$matches[1] }}
            'FireChancePerNDamage\s*=\s*(\d+\.?\d*)' { if($edmg) {$edmg.fire = [double]$matches[1] }}
            'NDamage\s*=\s*(\d+\.?\d*)' { if($edmg) {$edmg.ndmg = [double]$matches[1] }}
            'OperationalHealth\s*=\s*(true|false)' { if($edmg) {$edmg.operation = [convert]::ToBoolean($matches[1]) }}
            'StructuralHealth\s*=\s*(true|false)' { if($edmg) {$edmg.struct = [convert]::ToBoolean($matches[1]) }}
            'Friendlies\s*=\s*(true|false)' { if($edmg) {$edmg.friend = [convert]::ToBoolean($matches[1]) }}
        }
    }
    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[0] | 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