Minimum gradingfactor in Master

This commit is contained in:
Antonio Martinez 2025-06-16 15:50:34 -04:00
parent 2a36838b54
commit f418b5841a
5 changed files with 19 additions and 10 deletions

View file

@ -582,7 +582,7 @@ fixed_t K_BotMapModifier(void)
{
constexpr INT32 complexity_scale = 10000;
fixed_t modifier_max = (9 * FRACUNIT / 10) - FRACUNIT;
fixed_t modifier_min = (3 * FRACUNIT / 10) - FRACUNIT;
fixed_t modifier_min = (5 * FRACUNIT / 10) - FRACUNIT;
const fixed_t complexity_value = std::clamp<fixed_t>(
FixedDiv(K_GetTrackComplexity(), complexity_scale),
@ -685,8 +685,7 @@ fixed_t K_BotRubberband(const player_t *player)
if (player->gradingfactor < FRACUNIT && !(player->botvars.rival))
{
UINT8 levelreduce = 3; // How much to drop the "effective level" of bots that are consistently behind
fixed_t effgradingfactor = std::max(FRACUNIT/2, player->gradingfactor);
expreduce = Easing_Linear((effgradingfactor - FRACUNIT/2) * 2, levelreduce*FRACUNIT, 0);
expreduce = Easing_Linear((K_EffectiveGradingFactor(player) - MINGRADINGFACTOR) * 2, levelreduce*FRACUNIT, 0);
}
fixed_t difficultyEase = (((player->botvars.difficulty - 1) * FRACUNIT) - expreduce) / (MAXBOTDIFFICULTY - 1);

View file

@ -4037,8 +4037,8 @@ static boolean K_drawKartLaps(void)
// WHAT IS THIS?
// WHAT ARE YOU FUCKING TALKING ABOUT?
V_DrawMappedPatch(fr, fy, V_HUDTRANS|V_SLIDEIN|splitflags, kp_exp[1], R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MUSTARD, GTC_CACHE));
auto transflag = K_GetTransFlagFromFixed(stplyr->gradingfactor);
skincolornum_t overlaycolor = stplyr->gradingfactor < FRACUNIT ? SKINCOLOR_RUBY : SKINCOLOR_ULTRAMARINE ;
auto transflag = K_GetTransFlagFromFixed(K_EffectiveGradingFactor(stplyr));
skincolornum_t overlaycolor = K_EffectiveGradingFactor(stplyr) < FRACUNIT ? SKINCOLOR_RUBY : SKINCOLOR_ULTRAMARINE ;
auto colormap = R_GetTranslationColormap(TC_RAINBOW, overlaycolor, GTC_CACHE);
V_DrawMappedPatch(fr, fy, transflag|V_SLIDEIN|splitflags, kp_exp[1], colormap);
@ -4054,8 +4054,8 @@ static boolean K_drawKartLaps(void)
V_DrawMappedPatch(LAPS_X+bump, LAPS_Y, V_HUDTRANS|V_SLIDEIN|splitflags, kp_exp[0], R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MUSTARD, GTC_CACHE));
auto transflag = K_GetTransFlagFromFixed(stplyr->gradingfactor);
skincolornum_t overlaycolor = stplyr->gradingfactor < FRACUNIT ? SKINCOLOR_RUBY : SKINCOLOR_ULTRAMARINE ;
auto transflag = K_GetTransFlagFromFixed(K_EffectiveGradingFactor(stplyr));
skincolornum_t overlaycolor = K_EffectiveGradingFactor(stplyr) < FRACUNIT ? SKINCOLOR_RUBY : SKINCOLOR_ULTRAMARINE ;
auto colormap = R_GetTranslationColormap(TC_RAINBOW, overlaycolor, GTC_CACHE);
V_DrawMappedPatch(LAPS_X+bump, LAPS_Y, transflag|V_SLIDEIN|splitflags, kp_exp[0], colormap);

View file

@ -124,6 +124,13 @@ boolean K_InRaceDuel(void)
return (inDuel && (gametyperules & GTR_CIRCUIT) && !(mapheaderinfo[gamemap-1]->levelflags & LF_SECTIONRACE)) && !specialstageinfo.valid;
}
fixed_t K_EffectiveGradingFactor(const player_t *player)
{
if (grandprixinfo.gp && grandprixinfo.masterbots && !K_PlayerUsesBotMovement(player))
return MINGRADINGFACTOR;
return max(MINGRADINGFACTOR, player->gradingfactor);
}
player_t *K_DuelOpponent(player_t *player)
{
if (!K_InRaceDuel())
@ -13567,7 +13574,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
else
{
UINT32 behind = K_GetItemRouletteDistance(player, player->itemRoulette.playing);
behind = FixedMul(behind, max(player->gradingfactor, FRACUNIT/2));
behind = FixedMul(behind, K_EffectiveGradingFactor(player));
UINT32 behindMulti = behind / 500;
behindMulti = min(behindMulti, 60);
award = award * (behindMulti + 10) / 10;

View file

@ -114,6 +114,9 @@ boolean K_DuelItemAlwaysSpawns(mapthing_t *mt);
boolean K_InRaceDuel(void);
player_t *K_DuelOpponent(player_t *player);
fixed_t K_EffectiveGradingFactor(const player_t *player);
#define MINGRADINGFACTOR (FRACUNIT/2)
void K_TimerReset(void);
void K_TimerInit(void);

View file

@ -1132,7 +1132,7 @@ static boolean K_ShouldPlayerAllowItem(kartitems_t item, const player_t *player)
return false;
// GIGA power items reserved only for players who were doing great and died.
if (player->gradingfactor < K_RequiredXPForItem(item))
if (K_EffectiveGradingFactor(player) < K_RequiredXPForItem(item))
return false;
return !K_IsItemFirstOnly(item);
@ -1399,7 +1399,7 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet
if ((gametyperules & GTR_CIRCUIT) && !K_Cooperative())
{
roulette->dist = FixedMul(roulette->preexpdist, max(player->gradingfactor, FRACUNIT/2));
roulette->dist = FixedMul(roulette->preexpdist, K_EffectiveGradingFactor(player));
}
// ===============================================================================