Bot bump slowdown refinements

This commit is contained in:
Antonio Martinez 2025-05-13 01:22:21 -04:00
parent 3076e73c59
commit e19473e322
5 changed files with 20 additions and 15 deletions

View file

@ -803,11 +803,13 @@ fixed_t K_UpdateRubberband(player_t *player)
fixed_t dest = K_BotRubberband(player);
fixed_t ret = player->botvars.rubberband;
// Ease into the new value.
ret += (dest - player->botvars.rubberband) / 8;
UINT8 ease_soften = 8;
if (player->bumpslow)
ret = FRACUNIT/2; // Magic number!
if (player->bumpslow && dest > ret)
ease_soften *= 10;
// Ease into the new value.
ret += (dest - player->botvars.rubberband) / ease_soften;
return ret;
}

View file

@ -9438,7 +9438,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->trickboost)
player->trickboost--;
if (player->bumpslow)
if (player->bumpslow && player->incontrol)
player->bumpslow--;
if (player->flamedash)
@ -10227,14 +10227,6 @@ void K_KartResetPlayerColor(player_t *player)
goto base;
}
if (player->bumpslow)
{
player->mo->colorized = true;
player->mo->color = SKINCOLOR_RED;
fullbright = true;
goto finalise;
}
if (player->eggmanexplode) // You're gonna diiiiie
{
const INT32 flashtime = 4<<(player->eggmanexplode/TICRATE);
@ -15460,4 +15452,13 @@ UINT32 K_GetNumGradingPoints(void)
return numlaps * (1 + Obj_GetCheckpointCount());
}
void K_BotHitPenalty(player_t *player)
{
if (K_PlayerUsesBotMovement(player))
{
player->botvars.rubberband = max(player->botvars.rubberband/2, FRACUNIT/2);
player->bumpslow = TICRATE*2;
}
}
//}

View file

@ -312,6 +312,8 @@ UINT16 K_GetDisplayEXP(player_t *player);
UINT32 K_GetNumGradingPoints(void);
void K_BotHitPenalty(player_t *player);
#ifdef __cplusplus
} // extern "C"
#endif

View file

@ -3193,6 +3193,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (source && source != player->mo && source->player)
{
K_SpawnAmps(source->player, K_PvPAmpReward((type == DMG_WHUMBLE) ? 30 : 20, source->player, player), target);
K_BotHitPenalty(player);
// Extend the invincibility if the hit was a direct hit.
if (inflictor == source && source->player->invincibilitytimer &&

View file

@ -4117,8 +4117,7 @@ static void P_BouncePlayerMove(mobj_t *mo, TryMoveResult_t *result)
if (mo->player)
mo->player->bumpUnstuck += 5;
if (K_PlayerUsesBotMovement(mo->player))
mo->player->bumpslow = TICRATE*2;
K_BotHitPenalty(mo->player);
// Combo avoidance!
if (mo->player && P_PlayerInPain(mo->player) && gametyperules & GTR_BUMPERS && mo->health == 1)