Explosion interactions

From Noita Wiki
Jump to navigation Jump to search

explosion_radius and c.explosion_radius

Each projectile added by a spell defines its' explosion_radius, if unset, this defaults to 20 for that projectile.

Each new shot state's c.explosion_radius value starts from 0.

c.explosion_radius is modified during evaluation of the shot state, e.g. Explosive Projectile adds 15 to it, Divide By 10 reduces it by 40 (but won't reduce it below 0). The order of these modifications matters.

  • List of spells that modify c.explosion_radius:
Spell Value Spell Value
Explosive Projectile
+15
Divide By 2
-5*
Remove Explosion
-30
Divide By 3
-10*
Concentrated Explosion
-30
Divide By 4
-20*
Light Shot
-10*
Divide By 10
-40*
Chain Shot
-5*

* - these spells will subsequently set c.explosion_radius to 0 if it's < 0

When the shot state executes, if the final value of the shot state's c.explosion_radius is > 0, it will be added to each projectile's explosion_radius


Explosion damage scaling based on radius

If the final c.explosion_radius is > 0, then it enables explosion damage scaling based on radius

  • It specifically needs to be a positive value in the final shot state. If another spell reduces it and it becomes negative, then regardless of the projectile's base explosion radius there is gonna be no scaling.

Explosions will deal damage based on the projectile's explosion_radius.

  • Some modifiers may override the explosion radius. For example, Concentrated Explosion attaches a script that sets projectiles' explosion_radius values to 5, effectively disabling any scaling. The script's effect only applies after 2 frames, so if a projectile lives for more than that, then no amount of Explosive Projectile will make it reach a sufficient radius to fall into any of the scaling ranges.

There are 4 radius ranges. If the explosion radius value falls within a certain range, the explosion will deal at least that much damage.

  • If the sum of damage_explosion_add + base damage from <config_explosion> is > Minimum damage from scaling, it will use that sum as damage. Otherwise damage from scaling will be the only damage that counts.
  • 32 is the first explosion radius threshold. If explosion radius < 32, there is no scaling and therefore any base explosion damage as well as any additional explosion damage matter.
  • After 211 explosion radius the damage stays on 600 (center) and 500 (outer area), but the radius of the center as well as the outer area increase with more explosion radius.
Radius range (px) Minimum damage from scaling
32-63 325
64-127 375
128-210 500
211-10015+ 600 / 500 (center / outer area)


Glass Cannon / Living on the Edge / Berserkium all apply their radius increase after the damage radius calculation. I.e., a projectile with 1 Glass Cannon, 32 explosion radius and enabled explosion damage scaling based on radius will only deal 325 * 5 = 1625 explosion damage in 32 * 5 = 160 radius.

on_death_explode

on_death_explode="1" - if set to 1 does explosion with <config_explosion>

[default = 0]

If c.explosion_radius > 0, on_death_explode is set to 1

damage_mortals

damage_mortals="0" - if set to 0, the explosion won't be able to damage any entities or the world (only affects the explosion, not the projectile itself)

[default = 1]

List of projectiles with damage_mortals="0"

* - All spells marked like that can't be deleted using Explosive Detonator

Note

  • Summon Rock
    • Uses damage_mortals="0" in the ExplodeOnDamageComponent, but has damage_mortals="1" in it's ProjectileComponent, so it's explosions can still damage stuff if destroyed by ED, Fizzle, LifetimeComponent or some matter eating spell

explosion_dont_damage_shooter

explosion_dont_damage_shooter="1" - if explodes naturally the explosion won't damage you (isn't affected by friendly_fire="1")

[default = 0]

Exceptions

Projectile was destroyed in a specific way and didn't recognize you as a shooter

Projectile has its <config_explosion> in a different component

  • Lightning Bolt and Ball Lightning have <config_explosion> in LightningComponent
    • EP still applies to <config_explosion> in ProjectileComponent, but the explosion from LightningComponent will force ProjectileComponent explosion to take effect and will make it damage you.

Projectile doesn't have explosion_dont_damage_shooter="1" so it defaults to 0

Projectile has projectile_type="MATERIAL_PARTICLE" - a variable responsible for a script that kills material spells

on_lifetime_out_explode

on_lifetime_out_explode="0" - won't explode on running out of lifetime, instead creates an explosion if projectile is forcefully removed

[default = 0]

Force explosion by destroying projectile in a different way

* - All examples marked like that will create a trick explosion (trick kill)

Things that can forcefully remove the projectile but don't create an explosion:


  • Spells to - all the spells in this list will override <config_explosion> in a way where the projectile dies and no explosion happens
  • Nolla - Nolla setting lifetime to 1 will be of higher priority than it setting LifetimeComponent to 1 so LifetimeComponent isn't gonna be the one to kill the projectile

Test examples

* - created explosion will damage you

* - created explosion is safe

* - created explosion can not damage entities / world

Explosive Detonator example

ED creates an explosion if:

  • * killed by another Explosive Detonator or Fizzle
  • * killed by LifetimeComponent

ED doesn't create an explosion if:

  • runs out of lifetime
  • collides with an entity / world

Freezing Gaze example

FG creates an explosion if:

  • * killed by Explosive Detonator or Fizzle
  • * killed by LifetimeComponent
  • * collides with the world

FG doesn't create an explosion if:

  • runs out of lifetime
  • collides with an entity

Long-Distance Cast example

LDC creates an explosion if:

  • * killed by Explosive Detonator or Fizzle
  • * killed by LifetimeComponent
  • * runs out of lifetime

LDC doesn't create an explosion if:

  • collides with an entity / world   

Energy Sphere example

ES creates an explosion if:

  • * killed by Explosive Detonator or Fizzle
  • * killed by LifetimeComponent
  • * collides with the world or an entity
  • * reaches minimum velocity

ES doesn't create an explosion if:

  • runs out of lifetime