mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Two one liners related to angles, so doin' em in a single branch.
* If a spring has vertical speed AND horizontal speed, always set the player's angle when touching it. * If you have less than 32 rings and spill them, they now get launched away from the player's motion, rather than in the direction of the camera.
This commit is contained in:
parent
1f30c27c79
commit
cbf73014a5
2 changed files with 8 additions and 3 deletions
|
|
@ -3652,7 +3652,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
|
|||
{
|
||||
INT32 i;
|
||||
mobj_t *mo;
|
||||
angle_t fa;
|
||||
angle_t fa, va;
|
||||
fixed_t ns;
|
||||
fixed_t z;
|
||||
boolean nightsreplace = ((maptol & TOL_NIGHTS) && !G_IsSpecialStage(gamemap));
|
||||
|
|
@ -3674,6 +3674,11 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
|
|||
// Spill weapons first
|
||||
P_PlayerWeaponPanelOrAmmoBurst(player);
|
||||
|
||||
if (abs(player->mo->momx) > player->mo->scale || abs(player->mo->momy) > player->mo->scale)
|
||||
va = R_PointToAngle2(player->mo->momx, player->mo->momy, 0, 0)>>ANGLETOFINESHIFT;
|
||||
else
|
||||
va = player->mo->angle>>ANGLETOFINESHIFT;
|
||||
|
||||
for (i = 0; i < num_rings; i++)
|
||||
{
|
||||
INT32 objType = mobjinfo[MT_RING].reactiontime;
|
||||
|
|
@ -3695,7 +3700,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
|
|||
P_SetScale(mo, player->mo->scale);
|
||||
|
||||
// Angle offset by player angle, then slightly offset by amount of rings
|
||||
fa = ((i*FINEANGLES/16) + (player->mo->angle>>ANGLETOFINESHIFT) - ((num_rings-1)*FINEANGLES/32)) & FINEMASK;
|
||||
fa = ((i*FINEANGLES/16) + va - ((num_rings-1)*FINEANGLES/32)) & FINEMASK;
|
||||
|
||||
// Make rings spill out around the player in 16 directions like SA, but spill like Sonic 2.
|
||||
// Technically a non-SA way of spilling rings. They just so happen to be a little similar.
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
if (horizspeed)
|
||||
{
|
||||
object->player->drawangle = spring->angle;
|
||||
if (object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0)
|
||||
if (vertispeed || (object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0))
|
||||
{
|
||||
object->angle = spring->angle;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue