mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-31 12:13:16 +00:00
Greased horizontals
This commit is contained in:
parent
d4d03f907b
commit
d3f1b4f82c
7 changed files with 54 additions and 27 deletions
|
|
@ -327,6 +327,7 @@ typedef enum
|
|||
k_jawztargetdelay, // Delay for Jawz target switching, to make it less twitchy
|
||||
k_spectatewait, // How long have you been waiting as a spectator
|
||||
k_growcancel, // Hold the item button down to cancel Grow
|
||||
k_tiregrease, // Reduced friction timer after hitting a horizontal spring
|
||||
|
||||
NUMKARTSTUFF
|
||||
} kartstufftype_t;
|
||||
|
|
|
|||
|
|
@ -8481,7 +8481,8 @@ static const char *const KARTSTUFF_LIST[] = {
|
|||
"GETSPARKS",
|
||||
"JAWZTARGETDELAY",
|
||||
"SPECTATEWAIT",
|
||||
"GROWCANCEL"
|
||||
"GROWCANCEL",
|
||||
"TIREGREASE"
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -435,6 +435,7 @@ extern INT32 sneakertime;
|
|||
extern INT32 itemtime;
|
||||
extern INT32 comebacktime;
|
||||
extern INT32 bumptime;
|
||||
extern INT32 greasetics;
|
||||
extern INT32 wipeoutslowtime;
|
||||
extern INT32 wantedreduce;
|
||||
extern INT32 wantedfrequency;
|
||||
|
|
|
|||
|
|
@ -216,6 +216,7 @@ INT32 sneakertime = TICRATE + (TICRATE/3);
|
|||
INT32 itemtime = 8*TICRATE;
|
||||
INT32 comebacktime = 10*TICRATE;
|
||||
INT32 bumptime = 6;
|
||||
INT32 greasetics = 2*TICRATE;
|
||||
INT32 wipeoutslowtime = 20;
|
||||
INT32 wantedreduce = 5*TICRATE;
|
||||
INT32 wantedfrequency = 10*TICRATE;
|
||||
|
|
|
|||
|
|
@ -6245,7 +6245,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
56*FRACUNIT, // height
|
||||
0, // display offset
|
||||
0, // mass
|
||||
36*FRACUNIT, // damage
|
||||
40*FRACUNIT, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
|
||||
S_YHORIZ2 // raisestate
|
||||
|
|
@ -6272,7 +6272,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
56*FRACUNIT, // height
|
||||
0, // display offset
|
||||
0, // mass
|
||||
72*FRACUNIT, // damage
|
||||
80*FRACUNIT, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
|
||||
S_RHORIZ2 // raisestate
|
||||
|
|
@ -6299,7 +6299,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
56*FRACUNIT, // height
|
||||
0, // display offset
|
||||
0, // mass
|
||||
18*FRACUNIT, // damage
|
||||
20*FRACUNIT, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
|
||||
S_BHORIZ2 // raisestate
|
||||
|
|
|
|||
33
src/k_kart.c
33
src/k_kart.c
|
|
@ -5260,6 +5260,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->kartstuff[k_justbumped])
|
||||
player->kartstuff[k_justbumped]--;
|
||||
|
||||
if (player->kartstuff[k_tiregrease])
|
||||
player->kartstuff[k_tiregrease]--;
|
||||
|
||||
// This doesn't go in HUD update because it has potential gameplay ramifications
|
||||
if (player->karthud[khud_itemblink] && player->karthud[khud_itemblink]-- <= 0)
|
||||
{
|
||||
|
|
@ -6479,6 +6482,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
|
||||
if (onground)
|
||||
{
|
||||
fixed_t prevfriction = player->mo->friction;
|
||||
|
||||
// Reduce friction after hitting a horizontal spring
|
||||
if (player->kartstuff[k_tiregrease])
|
||||
player->mo->friction += ((FRACUNIT - prevfriction) / greasetics) * player->kartstuff[k_tiregrease];
|
||||
|
||||
// Friction
|
||||
if (!player->kartstuff[k_offroad])
|
||||
{
|
||||
|
|
@ -6491,9 +6500,20 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
|
||||
// Karma ice physics
|
||||
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
|
||||
{
|
||||
player->mo->friction += 1228;
|
||||
|
||||
// Wipeout slowdown
|
||||
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow])
|
||||
{
|
||||
if (player->kartstuff[k_offroad])
|
||||
player->mo->friction -= 4912;
|
||||
if (player->kartstuff[k_wipeoutslow] == 1)
|
||||
player->mo->friction -= 9824;
|
||||
}
|
||||
|
||||
// Friction was changed, so we must recalculate a bunch of stuff
|
||||
if (player->mo->friction != prevfriction)
|
||||
{
|
||||
if (player->mo->friction > FRACUNIT)
|
||||
player->mo->friction = FRACUNIT;
|
||||
if (player->mo->friction < 0)
|
||||
|
|
@ -6504,20 +6524,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
if (player->mo->movefactor < FRACUNIT)
|
||||
player->mo->movefactor = 19*player->mo->movefactor - 18*FRACUNIT;
|
||||
else
|
||||
player->mo->movefactor = FRACUNIT; //player->mo->movefactor = ((player->mo->friction - 0xDB34)*(0xA))/0x80;
|
||||
player->mo->movefactor = FRACUNIT;
|
||||
|
||||
if (player->mo->movefactor < 32)
|
||||
player->mo->movefactor = 32;
|
||||
}
|
||||
|
||||
// Wipeout slowdown
|
||||
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow])
|
||||
{
|
||||
if (player->kartstuff[k_offroad])
|
||||
player->mo->friction -= 4912;
|
||||
if (player->kartstuff[k_wipeoutslow] == 1)
|
||||
player->mo->friction -= 9824;
|
||||
}
|
||||
}
|
||||
|
||||
K_KartDrift(player, onground);
|
||||
|
|
|
|||
36
src/p_map.c
36
src/p_map.c
|
|
@ -158,7 +158,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
object->z = spring->z + spring->height + 1;
|
||||
else if (vertispeed < 0)
|
||||
object->z = spring->z - object->height - 1;
|
||||
#ifdef TELEPORTJANK
|
||||
//#ifdef TELEPORTJANK
|
||||
else
|
||||
{
|
||||
fixed_t offx, offy;
|
||||
|
|
@ -184,26 +184,35 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
// Set position!
|
||||
P_TryMove(object, spring->x + offx, spring->y + offy, true);
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
if (vertispeed)
|
||||
{
|
||||
// Vertical springs
|
||||
object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(vscale, spring->scale)));
|
||||
|
||||
if (horizspeed)
|
||||
{
|
||||
if (!object->player)
|
||||
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(hscale, spring->scale))));
|
||||
else
|
||||
// Diagonal springs
|
||||
if (horizspeed)
|
||||
{
|
||||
fixed_t finalSpeed = FixedDiv(horizspeed, hscale);
|
||||
fixed_t pSpeed = object->player->speed;
|
||||
if (!object->player)
|
||||
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(hscale, spring->scale))));
|
||||
else
|
||||
{
|
||||
fixed_t finalSpeed = FixedDiv(horizspeed, hscale);
|
||||
fixed_t pSpeed = object->player->speed;
|
||||
|
||||
if (pSpeed > finalSpeed)
|
||||
finalSpeed = pSpeed;
|
||||
if (pSpeed > finalSpeed)
|
||||
finalSpeed = pSpeed;
|
||||
|
||||
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(hscale, spring->scale))));
|
||||
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(hscale, spring->scale))));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (horizspeed)
|
||||
{
|
||||
// Horizontal springs
|
||||
P_Thrust(object, spring->angle, FixedMul(FixedDiv(horizspeed, hscale), FixedSqrt(FixedMul(hscale, spring->scale))));
|
||||
}
|
||||
|
||||
// Re-solidify
|
||||
spring->flags |= (spring->info->flags & (MF_SPECIAL|MF_SOLID));
|
||||
|
|
@ -238,6 +247,9 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
localangle[3] = spring->angle;
|
||||
}
|
||||
}
|
||||
|
||||
if (!vertispeed) // Less friction when hitting horizontal springs
|
||||
object->player->kartstuff[k_tiregrease] = greasetics;
|
||||
}
|
||||
|
||||
P_ResetPlayer(object->player);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue