A_RadiusDamage
From DoomWiki.org
A_RadiusDamage(damage, radius) is a generic blast damage function that is part of the MBF21 specification. Unlike Doom's native A_Explode or MBF's A_Detonate, it decouples damage and radius, allowing them to be set independent from each other. The function has two parameters, using the values provided in the "Args" fields as arguments.
The first argument sets the damage at the center of the explosion, while the second defines the size of the radius of the explosion in map units. Neither parameter has a default value to fall back on, resulting in no explosion being created if valid arguments are not passed to the function. Unlike A_Explode and A_Detonate, A_RadiusDamage
is not hardcoded to play DSBAREXP alongside the explosion, with no sound being played instead. This allows for a custom explosion sound to be set through A_PlaySound or A_Scream.
Example[edit]
The following is an example of how to set the A_RadiusDamage
code pointer in a DeHackEd file using BEX syntax:
Frame 811 Args1 = 64 Args2 = 256 [CODEPTR] FRAME 811 = RadiusDamage
Or using DECOHack syntax:
state 811 { BEXP D 10 Bright A_RadiusDamage(64, 256) goto 812 }
The example above uses A_RadiusDamage
to replace A_Explode in the exploding barrel's death animation, doubling the blast radius while halving the maximum damage.
External links[edit]
- A_RadiusDamage in the DSDA-Doom source code.
- MBF21 specification, hosted on GitHub.