Added flags for angle handling on bounce

Allows for keeping the current angle on bounce or modifying the pitch.
This commit is contained in:
Boondorl 2025-01-24 14:07:33 -05:00 committed by Ricardo Luís Vaz Silva
commit e0394ef16a
4 changed files with 20 additions and 5 deletions

View file

@ -1824,7 +1824,8 @@ bool AActor::FloorBounceMissile (secplane_t &plane, bool is3DFloor)
if (BounceFlags & (BOUNCE_HereticType | BOUNCE_MBF))
{
Vel -= norm * dot;
AngleFromVel();
if (!(BounceFlags & BOUNCE_KeepAngle))
AngleFromVel();
if (!(BounceFlags & BOUNCE_MBF)) // Heretic projectiles die, MBF projectiles don't.
{
flags |= MF_INBOUNCE;
@ -1838,9 +1839,13 @@ bool AActor::FloorBounceMissile (secplane_t &plane, bool is3DFloor)
{
// The reflected velocity keeps only about 70% of its original speed
Vel = (Vel - norm * dot) * bouncefactor;
AngleFromVel();
if (!(BounceFlags & BOUNCE_KeepAngle))
AngleFromVel();
}
if (BounceFlags & BOUNCE_ModifyPitch)
Angles.Pitch = -VecToAngle(Vel.XY().Length(), Vel.Z);
PlayBounceSound(true, 1.0);
// Set bounce state