A_JumpIfFlagsSet

From DoomWiki.org

A_JumpIfFlagsSet(state, flags, flags2) is a monster function that is part of the MBF21 specification. It allows an actor to jump to a certain state depending on if it has a certain flag set. It has three parameters, using the values in the Args fields as arguments.

The first argument specifies the state that the actor will jump to if the correct flags are set, using the number of the frame. The second 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 input NOSECTOR, 16 to input NOBLOCKMAP), while the third argument does the same for MBF21-specific flags (e.g., 8 to input NORADIUSDMG, 32 to input 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 Args3 field). If several flags are set, all of the flags will be required to be set on the actor for the jump to occur.

Example[edit]

The following is an example of how to set the A_JumpIfFlagsSet code pointer in a DeHackEd file using BEX syntax:

Frame 690
Args1 = 674
Args2 = 16384
Args3 = 8

[CODEPTR]
FRAME 690 = JumpIfFlagsSet

Or using DECOHack syntax:

state 690 
{
 CYBR G 10 A_JumpIfFlagsSet(674, FLOAT, NORADIUSDMG)
}

The above example uses A_JumpIfFlagsSet to make the cyberdemon go back into its spawn state after entering its pain state, if the FLOAT and NORADIUSDMG flags are set.

External links[edit]