mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-05 00:12:16 +00:00
Calculate "hidden rank" from Special continues, don't bump real rank if hidden rank was lowered
This commit is contained in:
parent
a0c18f3d69
commit
94b2684a5e
1 changed files with 21 additions and 1 deletions
|
|
@ -552,6 +552,7 @@ void K_UpdateGPRank(gpRank_t *rankData)
|
||||||
gp_rank_e K_CalculateGPGrade(gpRank_t *rankData)
|
gp_rank_e K_CalculateGPGrade(gpRank_t *rankData)
|
||||||
{
|
{
|
||||||
INT32 retGrade = GRADE_E;
|
INT32 retGrade = GRADE_E;
|
||||||
|
INT32 hiddenGrade = GRADE_E; // Grade when applying Special continues
|
||||||
|
|
||||||
{
|
{
|
||||||
extern consvar_t cv_debugrank;
|
extern consvar_t cv_debugrank;
|
||||||
|
|
@ -562,6 +563,7 @@ gp_rank_e K_CalculateGPGrade(gpRank_t *rankData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fixed_t percent = K_CalculateGPPercent(rankData);
|
fixed_t percent = K_CalculateGPPercent(rankData);
|
||||||
|
|
||||||
static const fixed_t gradePercents[GRADE_A] = {
|
static const fixed_t gradePercents[GRADE_A] = {
|
||||||
|
|
@ -571,6 +573,24 @@ gp_rank_e K_CalculateGPGrade(gpRank_t *rankData)
|
||||||
17*FRACUNIT/20 // A: 85% or higher
|
17*FRACUNIT/20 // A: 85% or higher
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// If our last map was Special, check for "uncredited" continues to offset the rank bump.
|
||||||
|
fixed_t hiddenpercent = percent;
|
||||||
|
gpRank_level_t *lastgrade = &rankData->levels[rankData->numLevels - 1];
|
||||||
|
UINT32 id = lastgrade->id;
|
||||||
|
|
||||||
|
if (rankData->specialWon && (mapheaderinfo[id-1]->typeoflevel & G_TOLFlag(GT_SPECIAL)))
|
||||||
|
{
|
||||||
|
hiddenpercent -= FRACUNIT / RANK_CONTINUE_PENALTY_DIV * lastgrade->continues;
|
||||||
|
|
||||||
|
for (hiddenGrade = GRADE_E; hiddenGrade < GRADE_A; hiddenGrade++)
|
||||||
|
{
|
||||||
|
if (hiddenpercent < gradePercents[hiddenGrade])
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (retGrade = GRADE_E; retGrade < GRADE_A; retGrade++)
|
for (retGrade = GRADE_E; retGrade < GRADE_A; retGrade++)
|
||||||
{
|
{
|
||||||
if (percent < gradePercents[retGrade])
|
if (percent < gradePercents[retGrade])
|
||||||
|
|
@ -579,7 +599,7 @@ gp_rank_e K_CalculateGPGrade(gpRank_t *rankData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rankData->specialWon == true)
|
if (rankData->specialWon == true && hiddenGrade >= retGrade)
|
||||||
{
|
{
|
||||||
// Winning the Special Stage gives you
|
// Winning the Special Stage gives you
|
||||||
// a free grade increase.
|
// a free grade increase.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue