A_AddFlags
From DoomWiki.org
A_AddFlags(flags, flags2) is a monster function that is part of the MBF21 specification. It allows flags to be added to an actor in-game; the opposite of A_RemoveFlags. The function has two parameters, using the values provided in the "Args1" and "Args2" fields as arguments.
The first argument specifies the non-MBF21 flag(s) to be added to the calling actor, using the decimal value of the flag (e.g., 8 to add NOSECTOR, 16 to add NOBLOCKMAP), while the second argument does the same for MBF21-specific flags (e.g., 8 to add NORADIUSDMG, 32 to add HIGHERMPROB). If more than one flag of either type is to be added, the sum of the values has to be input instead (e.g., 40 to input NORADIUSDMG and HIGHERMPROB in the "Args2" field). Adding flags that are already set will have no effect.
Example[edit]
The following is an example of how to set the A_AddFlags
code pointer in a DeHackEd file using BEX syntax:
Frame 569 Args1 = 0 Args2 = 40 [CODEPTR] FRAME 569 = AddFlags
Or using DECOHack syntax:
state 569 { BOS2 H 2 A_AddFlags(0, NORADIUSDMG+HIGHERMPROB) }
The above example uses A_AddFlags
to add the NORADIUSDMG and HIGHERMPROB flags to the Hell knight when triggering its pain state, giving it immunity to blast damage as well as a higher chance to use its ranged attack.
External links[edit]
- A_AddFlags in the DSDA-Doom source code, hosted on GitHub.
- MBF21 specification, hosted on GitHub.