mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Bot bump slowdown refinements
This commit is contained in:
parent
3076e73c59
commit
e19473e322
5 changed files with 20 additions and 15 deletions
|
|
@ -803,11 +803,13 @@ fixed_t K_UpdateRubberband(player_t *player)
|
||||||
fixed_t dest = K_BotRubberband(player);
|
fixed_t dest = K_BotRubberband(player);
|
||||||
fixed_t ret = player->botvars.rubberband;
|
fixed_t ret = player->botvars.rubberband;
|
||||||
|
|
||||||
// Ease into the new value.
|
UINT8 ease_soften = 8;
|
||||||
ret += (dest - player->botvars.rubberband) / 8;
|
|
||||||
|
|
||||||
if (player->bumpslow)
|
if (player->bumpslow && dest > ret)
|
||||||
ret = FRACUNIT/2; // Magic number!
|
ease_soften *= 10;
|
||||||
|
|
||||||
|
// Ease into the new value.
|
||||||
|
ret += (dest - player->botvars.rubberband) / ease_soften;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19
src/k_kart.c
19
src/k_kart.c
|
|
@ -9438,7 +9438,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
if (player->trickboost)
|
if (player->trickboost)
|
||||||
player->trickboost--;
|
player->trickboost--;
|
||||||
|
|
||||||
if (player->bumpslow)
|
if (player->bumpslow && player->incontrol)
|
||||||
player->bumpslow--;
|
player->bumpslow--;
|
||||||
|
|
||||||
if (player->flamedash)
|
if (player->flamedash)
|
||||||
|
|
@ -10227,14 +10227,6 @@ void K_KartResetPlayerColor(player_t *player)
|
||||||
goto base;
|
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
|
if (player->eggmanexplode) // You're gonna diiiiie
|
||||||
{
|
{
|
||||||
const INT32 flashtime = 4<<(player->eggmanexplode/TICRATE);
|
const INT32 flashtime = 4<<(player->eggmanexplode/TICRATE);
|
||||||
|
|
@ -15460,4 +15452,13 @@ UINT32 K_GetNumGradingPoints(void)
|
||||||
return numlaps * (1 + Obj_GetCheckpointCount());
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -312,6 +312,8 @@ UINT16 K_GetDisplayEXP(player_t *player);
|
||||||
|
|
||||||
UINT32 K_GetNumGradingPoints(void);
|
UINT32 K_GetNumGradingPoints(void);
|
||||||
|
|
||||||
|
void K_BotHitPenalty(player_t *player);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -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)
|
if (source && source != player->mo && source->player)
|
||||||
{
|
{
|
||||||
K_SpawnAmps(source->player, K_PvPAmpReward((type == DMG_WHUMBLE) ? 30 : 20, source->player, player), target);
|
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.
|
// Extend the invincibility if the hit was a direct hit.
|
||||||
if (inflictor == source && source->player->invincibilitytimer &&
|
if (inflictor == source && source->player->invincibilitytimer &&
|
||||||
|
|
|
||||||
|
|
@ -4117,8 +4117,7 @@ static void P_BouncePlayerMove(mobj_t *mo, TryMoveResult_t *result)
|
||||||
if (mo->player)
|
if (mo->player)
|
||||||
mo->player->bumpUnstuck += 5;
|
mo->player->bumpUnstuck += 5;
|
||||||
|
|
||||||
if (K_PlayerUsesBotMovement(mo->player))
|
K_BotHitPenalty(mo->player);
|
||||||
mo->player->bumpslow = TICRATE*2;
|
|
||||||
|
|
||||||
// Combo avoidance!
|
// Combo avoidance!
|
||||||
if (mo->player && P_PlayerInPain(mo->player) && gametyperules & GTR_BUMPERS && mo->health == 1)
|
if (mo->player && P_PlayerInPain(mo->player) && gametyperules & GTR_BUMPERS && mo->health == 1)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue