A_JumpIfHealthBelow
From DoomWiki.org
A_JumpIfHealthBelow(state, health) is a monster function that is part of the MBF21 specification. It jumps the calling actor to a specified state if its health falls below a specific value. It has two parameters, using the values in the Args fields as arguments.
The first argument determines the state that the calling actor will jump to, using the index number of the frame. The second argument sets the lowest amount of health which will not trigger a jump. Therefore, a jump only occurs if the health of the actor is below the number specified as the second argument.
Example[edit]
The following is an example of how to set the A_JumpIfHealthBelow code pointer in a DeHackEd file using BEX syntax:
Frame 1234 Args1 = 420 Args2 = 69 [CODEPTR] FRAME 1234 = JumpIfHealthBelow
Or using DECOHack syntax:
state 1234
{
TNT1 A 1 A_JumpIfHealthBelow(420, 69)
}
In the above example A_JumpIfHealthBelow will jump the calling actor to state 420 if its health is no higher than 68 hit points.
External links[edit]
- A_JumpIfHealthBelow in the DSDA-Doom source code, hosted on GitHub.
- MBF21 specification, hosted on GitHub.
