mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-05 09:46:40 +00:00
Horizontal/diagonal springs use all object's speed, instead of only players
This commit is contained in:
parent
16bd11f53f
commit
5738071100
1 changed files with 9 additions and 4 deletions
13
src/p_map.c
13
src/p_map.c
|
|
@ -195,6 +195,12 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
{
|
||||
angle_t finalAngle = spring->angle;
|
||||
fixed_t finalSpeed = horizspeed;
|
||||
fixed_t objectSpeed;
|
||||
|
||||
if (object->player)
|
||||
objectSpeed = object->player->speed;
|
||||
else
|
||||
objectSpeed = R_PointToDist2(0, 0, savemomx, savemomy);
|
||||
|
||||
// Reflect your momentum angle against the surface of horizontal springs.
|
||||
// This makes it a bit more interesting & unique than just being a speed boost in a pre-defined direction
|
||||
|
|
@ -220,7 +226,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
if ((spring->angle - momang) > ANGLE_90)
|
||||
angoffset = ANGLE_180 - angoffset;
|
||||
|
||||
angoffset /= 4; // Reduce amount so it feels more natural
|
||||
angoffset /= 6; // Reduce amount so it feels more natural
|
||||
|
||||
if (subtract)
|
||||
angoffset = (signed)(spring->angle) - angoffset;
|
||||
|
|
@ -232,12 +238,11 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
|
||||
// Scale to gamespeed
|
||||
finalSpeed = FixedMul(finalSpeed, K_GetKartGameSpeedScalar(gamespeed));
|
||||
// Horizontal speed is used as a minimum thrust, not a direct replacement
|
||||
finalSpeed = max(objectSpeed, finalSpeed);
|
||||
|
||||
if (object->player)
|
||||
{
|
||||
// Horizontal speed is a minimum
|
||||
finalSpeed = max(object->player->speed, finalSpeed);
|
||||
|
||||
// Less friction when hitting horizontal springs
|
||||
if (!vertispeed)
|
||||
object->player->kartstuff[k_tiregrease] = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue