SpecialBounceHit
Jump to navigation
Jump to search
virtual int SpecialBounceHit(Actor bounceMobj, Line bounceLine, readonly<SecPlane> bouncePlane)
Usage
Called by bouncing projectiles when they hit an actor, a line or a plane. This function will only be called if one of the bouncing flags is set (either directly or through the BounceType property):
- BOUNCEONACTORS: trigger the function by colliding with an actor
- BOUNCEONWALLS: trigger the function by colliding with lines
- BOUNCEONFLOORS: trigger the function by colliding with floor planes
- BOUNCEONCEILINGS: trigger the function by colliding with ceiling planes
Parameters
- Actor bounceMobj
- The actor the projectile collided with. Requires the BOUNCEONACTORS flag.
- Line bounceLine
- The line the projectiled collided with. Requires the BOUNCEONWALLS flag.
- SecPlane bouncePlane
- The plane the projectiled collided with. Requires BOUNCEONFLOORS for floors and BOUNCEONCEILINGS for ceilings.
Return values
Note: the MHIT* constants were added in GZDoom 4.12.0. Prior to that, numbers had to be used directly.
- -1
- MHIT_DEFAULT
- (Default) The projectile utilizes its default bouncing behavior in accordance with its BounceFactor/WallBounceFactor
- 0
- MHIT_DESTROY
- For actors and lines: the projectile explodes (enters its Death sequence).
- For planes: the projectile slides along the plane instead of bouncing.
- 1
- MHIT_PASS
- For actors: the projectile explodes (enters its Death sequence).
- For planes and lines: the projectile slides along the plane/line instead of bouncing.
Examples
This version of DoomImpBall is affected by gravity and will slide along the floor instead of exploding or bouncing:
class BowlingBall : DoomImpBall
{
Default
{
+BOUNCEONFLOORS
-NOGRAVITY
}
override int SpecialBounceHit(Actor bounceMobj, Line bounceLine, readonly<SecPlane> bouncePlane)
{
return MHIT_PASS;
}
}