mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 02:41:49 +00:00
Merge branch 'extreme-speed' into 'master'
Make speed stat more extreme See merge request KartKrew/Kart!355
This commit is contained in:
commit
9257c373ff
3 changed files with 41 additions and 36 deletions
40
src/k_bot.c
40
src/k_bot.c
|
|
@ -422,11 +422,16 @@ fixed_t K_BotTopSpeedRubberband(player_t *player)
|
||||||
{
|
{
|
||||||
fixed_t rubberband = K_BotRubberband(player);
|
fixed_t rubberband = K_BotRubberband(player);
|
||||||
|
|
||||||
if (rubberband < FRACUNIT)
|
if (rubberband <= FRACUNIT)
|
||||||
{
|
{
|
||||||
// Never go below your regular top speed
|
// Never go below your regular top speed
|
||||||
rubberband = FRACUNIT;
|
rubberband = FRACUNIT;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Max at +25% for level 9 bots
|
||||||
|
rubberband = FRACUNIT + ((rubberband - FRACUNIT) / 4);
|
||||||
|
}
|
||||||
|
|
||||||
// Only allow you to go faster than your regular top speed if you're facing the right direction
|
// Only allow you to go faster than your regular top speed if you're facing the right direction
|
||||||
if (rubberband > FRACUNIT && player->mo != NULL && player->nextwaypoint != NULL)
|
if (rubberband > FRACUNIT && player->mo != NULL && player->nextwaypoint != NULL)
|
||||||
|
|
@ -474,22 +479,39 @@ fixed_t K_BotTopSpeedRubberband(player_t *player)
|
||||||
fixed_t K_BotFrictionRubberband(player_t *player, fixed_t frict)
|
fixed_t K_BotFrictionRubberband(player_t *player, fixed_t frict)
|
||||||
{
|
{
|
||||||
fixed_t rubberband = K_BotRubberband(player) - FRACUNIT;
|
fixed_t rubberband = K_BotRubberband(player) - FRACUNIT;
|
||||||
fixed_t newfrict;
|
fixed_t origFrict, newFrict;
|
||||||
|
|
||||||
if (rubberband <= 0)
|
if (rubberband <= 0)
|
||||||
{
|
{
|
||||||
// Never get stronger than normal friction
|
// Never get weaker than normal friction
|
||||||
return frict;
|
return frict;
|
||||||
}
|
}
|
||||||
|
|
||||||
newfrict = FixedDiv(frict, FRACUNIT + (rubberband / 2));
|
origFrict = FixedDiv(ORIG_FRICTION, FRACUNIT + (rubberband / 2));
|
||||||
|
|
||||||
if (newfrict < 0)
|
if (frict == ORIG_FRICTION)
|
||||||
newfrict = 0;
|
{
|
||||||
if (newfrict > FRACUNIT)
|
newFrict = origFrict;
|
||||||
newfrict = FRACUNIT;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Do some mumbo jumbo to make our friction value
|
||||||
|
// relative to what it WOULD be for ORIG_FRICTION.
|
||||||
|
// (I hate multiplicative friction :/)
|
||||||
|
|
||||||
return newfrict;
|
fixed_t offset = ORIG_FRICTION - frict;
|
||||||
|
fixed_t ratio = FixedDiv(frict, ORIG_FRICTION);
|
||||||
|
|
||||||
|
offset = FixedDiv(offset, ratio);
|
||||||
|
newFrict = frict + offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newFrict < 0)
|
||||||
|
newFrict = 0;
|
||||||
|
if (newFrict > FRACUNIT)
|
||||||
|
newFrict = FRACUNIT;
|
||||||
|
|
||||||
|
return newFrict;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
|
|
|
||||||
34
src/k_kart.c
34
src/k_kart.c
|
|
@ -2155,7 +2155,8 @@ static void K_GetKartBoostPower(player_t *player)
|
||||||
|
|
||||||
if (player->kartstuff[k_draftpower] > 0) // Drafting
|
if (player->kartstuff[k_draftpower] > 0) // Drafting
|
||||||
{
|
{
|
||||||
fixed_t draftspeed = ((3*FRACUNIT)/10) + ((player->kartspeed-1) * (FRACUNIT/50)); // min is 30%, max is 46%
|
// 30% - 44%, each point of speed adds 1.75%
|
||||||
|
fixed_t draftspeed = ((3*FRACUNIT)/10) + ((player->kartspeed-1) * ((7*FRACUNIT)/400));
|
||||||
speedboost += FixedMul(draftspeed, player->kartstuff[k_draftpower]); // (Drafting suffers no boost stack penalty.)
|
speedboost += FixedMul(draftspeed, player->kartstuff[k_draftpower]); // (Drafting suffers no boost stack penalty.)
|
||||||
numboosts++;
|
numboosts++;
|
||||||
}
|
}
|
||||||
|
|
@ -2183,10 +2184,10 @@ fixed_t K_GetKartSpeedFromStat(UINT8 kartspeed)
|
||||||
{
|
{
|
||||||
const fixed_t xspd = (3*FRACUNIT)/64;
|
const fixed_t xspd = (3*FRACUNIT)/64;
|
||||||
fixed_t g_cc = K_GetKartGameSpeedScalar(gamespeed) + xspd;
|
fixed_t g_cc = K_GetKartGameSpeedScalar(gamespeed) + xspd;
|
||||||
fixed_t k_speed = 150;
|
fixed_t k_speed = 148;
|
||||||
fixed_t finalspeed;
|
fixed_t finalspeed;
|
||||||
|
|
||||||
k_speed += kartspeed*3; // 153 - 177
|
k_speed += kartspeed*4; // 152 - 184
|
||||||
|
|
||||||
finalspeed = FixedMul(k_speed<<14, g_cc);
|
finalspeed = FixedMul(k_speed<<14, g_cc);
|
||||||
return finalspeed;
|
return finalspeed;
|
||||||
|
|
@ -2204,17 +2205,10 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
|
||||||
finalspeed = FixedMul(finalspeed, FRACUNIT + (sphereAdd * player->spheres));
|
finalspeed = FixedMul(finalspeed, FRACUNIT + (sphereAdd * player->spheres));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (K_PlayerUsesBotMovement(player))
|
if (K_PlayerUsesBotMovement(player) && player->botvars.rival == true)
|
||||||
{
|
{
|
||||||
// Give top speed a buff for bots, since it's a fairly weak stat without drifting
|
// +10% top speed for the rival
|
||||||
fixed_t speedmul = ((player->kartspeed-1) * FRACUNIT / 8) / 10; // +10% for speed 9
|
finalspeed = FixedMul(finalspeed, 11*FRACUNIT/10);
|
||||||
|
|
||||||
if (player->botvars.rival == true)
|
|
||||||
{
|
|
||||||
speedmul += FRACUNIT/10; // +10% for rival
|
|
||||||
}
|
|
||||||
|
|
||||||
finalspeed = FixedMul(finalspeed, FRACUNIT + speedmul);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->mo && !P_MobjWasRemoved(player->mo))
|
if (player->mo && !P_MobjWasRemoved(player->mo))
|
||||||
|
|
@ -2235,10 +2229,9 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
|
||||||
|
|
||||||
fixed_t K_GetKartAccel(player_t *player)
|
fixed_t K_GetKartAccel(player_t *player)
|
||||||
{
|
{
|
||||||
fixed_t k_accel = 32; // 36;
|
fixed_t k_accel = 121;
|
||||||
|
|
||||||
//k_accel += 3 * (9 - player->kartspeed); // 36 - 60
|
k_accel += 17 * (9 - player->kartspeed); // 121 - 257
|
||||||
k_accel += 4 * (9 - player->kartspeed); // 32 - 64
|
|
||||||
|
|
||||||
if (player->spheres > 0)
|
if (player->spheres > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -2246,14 +2239,7 @@ fixed_t K_GetKartAccel(player_t *player)
|
||||||
k_accel = FixedMul(k_accel, FRACUNIT + (sphereAdd * player->spheres));
|
k_accel = FixedMul(k_accel, FRACUNIT + (sphereAdd * player->spheres));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (K_PlayerUsesBotMovement(player))
|
return FixedMul(k_accel, (FRACUNIT + player->kartstuff[k_accelboost]) / 4);
|
||||||
{
|
|
||||||
// Rubberbanding acceleration is waekened since it makes hits feel more meaningful
|
|
||||||
fixed_t rubberband = K_BotRubberband(player) - FRACUNIT;
|
|
||||||
k_accel = FixedMul(k_accel, FRACUNIT + (rubberband/2));
|
|
||||||
}
|
|
||||||
|
|
||||||
return FixedMul(k_accel, FRACUNIT+player->kartstuff[k_accelboost]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT16 K_GetKartFlashing(player_t *player)
|
UINT16 K_GetKartFlashing(player_t *player)
|
||||||
|
|
|
||||||
|
|
@ -718,9 +718,6 @@ void P_TouchStarPost(mobj_t *post, player_t *player, boolean snaptopost)
|
||||||
|
|
||||||
(void)snaptopost;
|
(void)snaptopost;
|
||||||
|
|
||||||
if (player->bot)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Player must have touched all previous starposts
|
// Player must have touched all previous starposts
|
||||||
if (post->health - player->starpostnum > 1)
|
if (post->health - player->starpostnum > 1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue