mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'exp-edgecases' into 'master'
EXP edge cases Closes #1458 See merge request kart-krew-dev/ring-racers-internal!2455
This commit is contained in:
commit
3a23f49024
5 changed files with 52 additions and 12 deletions
|
|
@ -3116,17 +3116,19 @@ static void K_drawKartTeamScores(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void K_drawKartLaps(void)
|
||||
static boolean K_drawKartLaps(void)
|
||||
{
|
||||
INT32 splitflags = V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_SPLITSCREEN;
|
||||
INT32 bump = 0;
|
||||
boolean drewsticker = false;
|
||||
|
||||
UINT16 displayEXP = K_GetDisplayEXP(stplyr);
|
||||
|
||||
// Jesus Christ.
|
||||
// I do not understand the way this system of offsets is laid out at all,
|
||||
// so it's probably going to be pretty bad to maintain. Sorry.
|
||||
|
||||
if (numlaps != 1)
|
||||
if (numlaps != 1 && displayEXP != UINT16_MAX)
|
||||
{
|
||||
if (r_splitscreen > 1)
|
||||
bump = 27;
|
||||
|
|
@ -3196,10 +3198,12 @@ static void K_drawKartLaps(void)
|
|||
}
|
||||
}
|
||||
|
||||
UINT16 displayEXP = std::clamp(FixedMul(std::max(stplyr->exp, FRACUNIT/2), (500/K_GetNumGradingPoints())*stplyr->gradingpointnum), 0, 999);
|
||||
|
||||
// EXP
|
||||
if (r_splitscreen > 1)
|
||||
if (displayEXP == UINT16_MAX)
|
||||
{
|
||||
;
|
||||
}
|
||||
else if (r_splitscreen > 1)
|
||||
{
|
||||
INT32 fx = 0, fy = 0, fr = 0;
|
||||
INT32 flipflag = 0;
|
||||
|
|
@ -3263,6 +3267,8 @@ static void K_drawKartLaps(void)
|
|||
Draw row = Draw(LAPS_X+23+bump, LAPS_Y+3).flags(V_HUDTRANS|V_SLIDEIN|splitflags).font(Draw::Font::kThinTimer);
|
||||
row.text("{:03}", displayEXP);
|
||||
}
|
||||
|
||||
return drewsticker;
|
||||
}
|
||||
|
||||
#define RINGANIM_FLIPFRAME (RINGANIM_NUMFRAMES/2)
|
||||
|
|
|
|||
26
src/k_kart.c
26
src/k_kart.c
|
|
@ -15237,8 +15237,34 @@ fixed_t K_GetExpAdjustment(player_t *player)
|
|||
return result;
|
||||
}
|
||||
|
||||
UINT16 K_GetDisplayEXP(player_t *player)
|
||||
{
|
||||
UINT32 numgradingpoints = K_GetNumGradingPoints();
|
||||
|
||||
if (!numgradingpoints)
|
||||
return UINT16_MAX;
|
||||
|
||||
fixed_t result = max(player->exp, FRACUNIT/2);
|
||||
result = FixedMul(result, (500/numgradingpoints)*player->gradingpointnum);
|
||||
|
||||
// bro where is. bro where is std::clamp
|
||||
if (result < 0)
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
else if (result > 999)
|
||||
{
|
||||
result = 999;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
UINT32 K_GetNumGradingPoints(void)
|
||||
{
|
||||
if (K_Cooperative())
|
||||
return 0;
|
||||
|
||||
return numlaps * (1 + Obj_GetCheckpointCount());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -298,6 +298,8 @@ boolean K_PlayerCanUseItem(player_t *player);
|
|||
|
||||
fixed_t K_GetExpAdjustment(player_t *player);
|
||||
|
||||
UINT16 K_GetDisplayEXP(player_t *player);
|
||||
|
||||
UINT32 K_GetNumGradingPoints(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -1380,8 +1380,10 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet
|
|||
roulette->preexpdist = K_GetItemRouletteDistance(player, roulette->playing);
|
||||
roulette->dist = roulette->preexpdist;
|
||||
|
||||
if (gametyperules & GTR_CIRCUIT)
|
||||
if ((gametyperules & GTR_CIRCUIT) && !K_Cooperative())
|
||||
{
|
||||
roulette->dist = FixedMul(roulette->preexpdist, max(player->exp, FRACUNIT/2));
|
||||
}
|
||||
|
||||
// ===============================================================================
|
||||
// Dynamic Roulette. Oh boy!
|
||||
|
|
|
|||
|
|
@ -243,10 +243,9 @@ INT32 level_tally_t::CalculateGrade(void)
|
|||
case TALLY_BONUS_LAP:
|
||||
{
|
||||
// Use a special curve for this.
|
||||
// The difference between 0 and 1 lap points is an important difference in skill,
|
||||
// while the difference between 5 and 6 is not very notable.
|
||||
const fixed_t frac = std::min(FRACUNIT, (laps * FRACUNIT) / std::max(1, static_cast<int>(totalLaps)));
|
||||
ours += Easing_OutSine(frac, 0, bonusWeights[i]);
|
||||
// Low Exp amounts are guaranteed, higher than half is where skill expression starts
|
||||
const fixed_t frac = std::min(FRACUNIT, (laps * FRACUNIT) / std::max(1, static_cast<int>(totalLaps + 80))); // Magic number here is to ensure A ranks only go to those that can maintain positive EXP
|
||||
ours += Easing_InCubic(frac, 0, bonusWeights[i]);
|
||||
break;
|
||||
}
|
||||
case TALLY_BONUS_PRISON:
|
||||
|
|
@ -343,8 +342,13 @@ void level_tally_t::Init(player_t *player)
|
|||
|
||||
if ((gametypes[gt]->rules & GTR_CIRCUIT) == GTR_CIRCUIT)
|
||||
{
|
||||
laps = std::clamp(FixedMul(std::max(stplyr->exp, FRACUNIT/2), (500/K_GetNumGradingPoints())*player->gradingpointnum), 0, 999);
|
||||
totalLaps = 500;
|
||||
UINT16 displayEXP = K_GetDisplayEXP(player);
|
||||
|
||||
if (displayEXP != UINT16_MAX)
|
||||
{
|
||||
laps = displayEXP;
|
||||
totalLaps = 500;
|
||||
}
|
||||
}
|
||||
|
||||
if (battleprisons)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue