A_JumpIf
From ZDoom Wiki
A_JumpIf (expression, int offset)
A_JumpIf (expression, str state)
| Warning: Using state labels as arguments without quotation marks has been deprecated and will no longer work. Make sure to enclose all your string arguments with quotation marks to ensure full compatibility with future ZDoom versions. Refer to the available example(s) for proper usage |
Jumps the specified amount of states forward if expression evaluates to true. The expression may include certain actor properties (occasionally called "keywords" in the forums) to compare values with. It is important to note that these keywords can also be used outside of A_JumpIf. For example, using momx, momy, and momz in A_SpawnItemEx to preserve momentum, or using args[] as arguments to a call of ACS_Execute.
- x
- y
- z
- angle — Actor's angle, in degrees
- momx - Actor's momentum along the absolute x axis
- momy
- momz
- pitch
- health
- alpha
- tid
- tidtohate — TID of the current target (see Thing_Hate et al.)
- ceilingz — See GetActorCeilingZ
- floorz — See GetActorFloorZ
- special — ID of the special currently assigned to this actor
- args[] — Arguments passed to the thing special
- Currently this is the only array property; args[0] through args[4] are valid.
- waterlevel — How "submerged" the actor is
- 0: Not submerged at all (e.g. standing on solid ground)
- 1: Less than half submerged ("ankle deep")
- 2: At least half submerged ("waist deep")
- 3: Entirely submerged (completely underwater)
Examples
Example of a projectile that "fizzles out" if it enters water:
actor FizzleBall : DoomImpBall { states { Spawn: BAL1 AB 4 bright BAL1 A 0 A_JumpIf(waterlevel == 2, 1) loop BAL1 A 0 A_PlaySound("Fizzle") FIZZ ABC 6 stop } }

