mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
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:
parent
073b787a82
commit
b405e88ec3
1 changed files with 24 additions and 2 deletions
|
|
@ -728,9 +728,31 @@ void Obj_PlayerUFOCollide(mobj_t *ufo, mobj_t *other)
|
||||||
{
|
{
|
||||||
// Bump and deal damage.
|
// Bump and deal damage.
|
||||||
Obj_SpecialUFODamage(ufo, other, other, DMG_STEAL);
|
Obj_SpecialUFODamage(ufo, other, other, DMG_STEAL);
|
||||||
K_KartBouncing(other, ufo);
|
|
||||||
other->player->sneakertimer = 0;
|
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)
|
void Obj_UFOPieceThink(mobj_t *piece)
|
||||||
|
|
@ -950,4 +972,4 @@ UINT32 K_GetSpecialUFODistance(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
return UINT32_MAX;
|
return UINT32_MAX;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue