Non-damaging UFO-player collision

- UFO is always solid.
- Adds a height check if the player is no boosting.
- Stumbles if the player is within a 60 degree cone of the
  direction the UFO is moving. (Only applies if not
  boosting.)
This commit is contained in:
James R 2023-03-12 23:42:14 -07:00
parent 073b787a82
commit b405e88ec3

View file

@ -728,9 +728,31 @@ void Obj_PlayerUFOCollide(mobj_t *ufo, mobj_t *other)
{
// Bump and deal damage.
Obj_SpecialUFODamage(ufo, other, other, DMG_STEAL);
K_KartBouncing(other, ufo);
other->player->sneakertimer = 0;
}
else
{
const angle_t moveAngle = K_MomentumAngle(ufo);
const angle_t clipAngle = R_PointToAngle2(ufo->x, ufo->y, other->x, other->y);
if (other->z > ufo->z + ufo->height)
{
return; // overhead
}
if (other->z + other->height < ufo->z)
{
return; // underneath
}
if (AngleDelta(moveAngle, clipAngle) < ANG60)
{
// in front
K_StumblePlayer(other->player);
}
}
K_KartBouncing(other, ufo);
}
void Obj_UFOPieceThink(mobj_t *piece)