A_SoAExplode

From ZDoom Wiki
Jump to navigation Jump to search

A_SoAExplode
(no parameters)


This is used when a suit of armor explodes.

This function spawns ten armor chunks and places them each in a different state, from Spawn+0 to Spawn+9. Each armor chunk is spawned at a random position relative to the suit of armor, up to 8 map units away from the armor's center point on both horizontal axes and at any point of the armor's height on the vertical axis. They are given an upward vertical velocity between 5 and 12, and a horizontal velocity of up to 4 in either direction on both horizontal axes.

If the calling actor has a first argument (arg0) that corresponds to a valid spawn number, the object will be spawned in the armor's position. A check is made not to spawn the corresponding actor if it has the ISMONSTER flag and the "nomonster" rule is active, either through a DM flag or a command line parameter.

In UDMF, instead of setting arg0 to a spawn number value, you can use the arg0str property to give an actor class name.

It finally plays the calling actor's DeathSound on the BODY channel and then destroys the calling actor entirely.

This codepointer is restricted to ZSuitOfArmor and derived classes.