mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'spring-grease-tweaks' into 'master'
Spring grease tweaks See merge request KartKrew/Kart!457
This commit is contained in:
commit
b239974675
4 changed files with 21 additions and 24 deletions
|
|
@ -390,7 +390,7 @@ typedef struct player_s
|
||||||
fixed_t offroad; // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
|
fixed_t offroad; // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
|
||||||
UINT8 waterskip; // Water skipping counter
|
UINT8 waterskip; // Water skipping counter
|
||||||
|
|
||||||
UINT16 tiregrease; // Reduced friction timer after hitting a horizontal spring
|
UINT16 tiregrease; // Reduced friction timer after hitting a spring
|
||||||
UINT16 springstars; // Spawn stars around a player when they hit a spring
|
UINT16 springstars; // Spawn stars around a player when they hit a spring
|
||||||
UINT16 springcolor; // Color of spring stars
|
UINT16 springcolor; // Color of spring stars
|
||||||
UINT8 dashpadcooldown; // Separate the vanilla SA-style dash pads from using flashing
|
UINT8 dashpadcooldown; // Separate the vanilla SA-style dash pads from using flashing
|
||||||
|
|
|
||||||
|
|
@ -8343,7 +8343,7 @@ void K_AdjustPlayerFriction(player_t *player)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reduce friction after hitting a horizontal spring
|
// Reduce friction after hitting a spring
|
||||||
if (player->tiregrease)
|
if (player->tiregrease)
|
||||||
{
|
{
|
||||||
player->mo->friction += ((FRACUNIT - prevfriction) / greasetics) * player->tiregrease;
|
player->mo->friction += ((FRACUNIT - prevfriction) / greasetics) * player->tiregrease;
|
||||||
|
|
|
||||||
38
src/p_map.c
38
src/p_map.c
|
|
@ -345,28 +345,6 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (object->player)
|
|
||||||
{
|
|
||||||
// Less friction when hitting horizontal springs
|
|
||||||
if (!vertispeed)
|
|
||||||
{
|
|
||||||
if (!object->player->tiregrease)
|
|
||||||
{
|
|
||||||
UINT8 i;
|
|
||||||
for (i = 0; i < 2; i++)
|
|
||||||
{
|
|
||||||
mobj_t *grease;
|
|
||||||
grease = P_SpawnMobj(object->x, object->y, object->z, MT_TIREGREASE);
|
|
||||||
P_SetTarget(&grease->target, object);
|
|
||||||
grease->angle = K_MomentumAngle(object);
|
|
||||||
grease->extravalue1 = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object->player->tiregrease = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Horizontal speed is used as a minimum thrust, not a direct replacement
|
// Horizontal speed is used as a minimum thrust, not a direct replacement
|
||||||
finalSpeed = max(objectSpeed, finalSpeed);
|
finalSpeed = max(objectSpeed, finalSpeed);
|
||||||
|
|
||||||
|
|
@ -389,6 +367,22 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
||||||
|
|
||||||
object->player->springstars = max(vertispeed, horizspeed) / FRACUNIT / 2;
|
object->player->springstars = max(vertispeed, horizspeed) / FRACUNIT / 2;
|
||||||
object->player->springcolor = starcolor;
|
object->player->springcolor = starcolor;
|
||||||
|
|
||||||
|
// Less friction when hitting springs
|
||||||
|
if (!object->player->tiregrease)
|
||||||
|
{
|
||||||
|
UINT8 i;
|
||||||
|
for (i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
mobj_t *grease;
|
||||||
|
grease = P_SpawnMobj(object->x, object->y, object->z, MT_TIREGREASE);
|
||||||
|
P_SetTarget(&grease->target, object);
|
||||||
|
grease->angle = K_MomentumAngle(object);
|
||||||
|
grease->extravalue1 = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
object->player->tiregrease = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -6889,6 +6889,9 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
||||||
z);
|
z);
|
||||||
mobj->angle = ang;
|
mobj->angle = ang;
|
||||||
|
|
||||||
|
if (!P_IsObjectOnGround(mobj->target))
|
||||||
|
mobj->renderflags |= RF_DONTDRAW;
|
||||||
|
|
||||||
if (leveltime & 1)
|
if (leveltime & 1)
|
||||||
mobj->renderflags |= RF_DONTDRAW;
|
mobj->renderflags |= RF_DONTDRAW;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue