Skip to content

Explosion

Damage with no source: no turret, no bullet — something simply exploded at a point on the map

tick 0
Jump -> 30
if
Explosion1
teamxyradiusdamageairgroundpierceeffect
Set2
=
Fetch3
typeresultteamindexextra
Stop4
@counter0number
blownnullnull
enemiesnullnull
explosion @sharded 10 5 3 200 1 1 0 0

Once — and the enemy dagger on tile 10 5 is gone: enemies drops from two to one. The second, standing aside, is intact — the radius did not reach it.

Field What is in it
first whose explosion it is: it will not touch its own
second and third the point in tiles
fourth the radius in tiles
fifth the damage
sixth and seventh whether to hit air and ground
eighth whether to pierce: hit everybody through, or only the first
ninth whether to show a flash

The first field is not “who to hit” but whose explosion this is. Everybody not on that team suffers.

explosion @sharded 10 5 3 200 1 1 0 0 # your explosion, hits enemies
explosion @crux 10 5 3 200 1 1 0 0 # the enemy's, hits you

It is easy to mix up, and the mistake is a quiet one: the program dutifully explodes and the target stands there untouched — the explosion simply turned out to be “its own”.

An explosion is a scripting tool, needed where damage has to happen for no reason:

  • traps and mines on a map: the player stepped into a forbidden zone — explosion;
  • events: a meteorite, a collapse, sabotage;
  • punishment for breaking a script’s rule — for building in a forbidden area, for instance;
  • finishing off: the script wants the wave to end right now.
query circle unit @crux 10 5 3 0
sensor amount @queries @size
jump 0 equal amount 0
explosion @sharded 10 5 3 200 1 1 0 0

Unofficial fan project, not affiliated with Anuke. Mindustry sprites, fonts and translations © Anuke, used under GPL-3.0; Fira Code under OFL-1.1. Site code is GPL-3.0.