diff --git a/src/doomdef.h b/src/doomdef.h index 74657f886..bf78553b5 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -744,6 +744,11 @@ extern int // Amp scaling #define MAXAMPSCALINGDIST 18000 +// Exp +#define MINDISPLAYEXP 50 // The min value target +#define TARGETDISPLAYEXP 100 // The target value needed for A rank +#define MAXDISPLAYEXP 125 // The max value displayed by the hud and in the tally screen and GP results screen + #ifdef __cplusplus } // extern "C" #endif diff --git a/src/g_game.c b/src/g_game.c index 1a55d67f8..08199911a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4716,7 +4716,7 @@ static void G_DoCompleted(void) if (grandprixinfo.eventmode == GPEVENT_NONE) { - grandprixinfo.rank.winPoints += K_CalculateGPRankPoints(player->position, grandprixinfo.rank.totalPlayers); + grandprixinfo.rank.winPoints += K_CalculateGPRankPoints(player, grandprixinfo.rank.totalPlayers); grandprixinfo.rank.laps += player->lapPoints; } else if (grandprixinfo.eventmode == GPEVENT_SPECIAL) diff --git a/src/k_grandprix.cpp b/src/k_grandprix.cpp index df0194efb..e9e49f876 100644 --- a/src/k_grandprix.cpp +++ b/src/k_grandprix.cpp @@ -51,13 +51,14 @@ UINT8 K_BotStartingDifficulty(SINT8 value) } /*-------------------------------------------------- - INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers) + INT16 K_CalculateGPRankPoints(player_t* player, UINT8 numplayers) See header file for description. --------------------------------------------------*/ -INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers) +INT16 K_CalculateGPRankPoints(player_t* player, UINT8 numplayers) { INT16 points; + UINT8 position = player->position; if (position >= numplayers || position == 0) { @@ -65,7 +66,7 @@ INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers) return 0; } - points = numplayers - position; + points = K_GetDisplayEXP(player); // Give bonus to high-ranking players, depending on player count // This rounds out the point gain when you get 1st every race, @@ -79,16 +80,16 @@ INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers) case 0: case 1: case 2: // 1v1 break; // No bonus needed. case 3: case 4: // 3-4P - if (position == 1) { points += 1; } // 1st gets +1 extra point + if (position == 1) { points += 5; } // 1st gets +1 extra point break; case 5: case 6: // 5-6P - if (position == 1) { points += 3; } // 1st gets +3 extra points - else if (position == 2) { points += 1; } // 2nd gets +1 extra point + if (position == 1) { points += 10; } // 1st gets +3 extra points + // else if (position == 2) { points += 4; } // 2nd gets +1 extra point break; default: // Normal matches - if (position == 1) { points += 5; } // 1st gets +5 extra points - else if (position == 2) { points += 3; } // 2nd gets +3 extra points - else if (position == 3) { points += 1; } // 3rd gets +1 extra point + if (position == 1) { points += 10; } // 1st gets +5 extra points + // else if (position == 2) { points += 5; } // 2nd gets +3 extra points + // else if (position == 3) { points += 2; } // 3rd gets +1 extra point break; } diff --git a/src/k_grandprix.h b/src/k_grandprix.h index 01e7307e9..d0d9db451 100644 --- a/src/k_grandprix.h +++ b/src/k_grandprix.h @@ -60,7 +60,7 @@ UINT8 K_BotStartingDifficulty(SINT8 value); /*-------------------------------------------------- - INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers); + INT16 K_CalculateGPRankPoints(player_t* player, UINT8 numplayers); Calculates the number of points that a player would recieve if they won the round. @@ -73,7 +73,7 @@ UINT8 K_BotStartingDifficulty(SINT8 value); Number of points to give. --------------------------------------------------*/ -INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers); +INT16 K_CalculateGPRankPoints(player_t* player, UINT8 numplayers); /*-------------------------------------------------- diff --git a/src/k_kart.c b/src/k_kart.c index fc1b6a8f6..b03b4c9c8 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -15500,7 +15500,7 @@ UINT16 K_GetDisplayEXP(player_t *player) // target is where you should be if you're doing good and at a 1.0 mult fixed_t clampedexp = max(FRACUNIT/2, min(FRACUNIT*5/4, player->exp)); // clamp between 0.5 and 1.25 - fixed_t targetdisplayexp = (100*player->gradingpointnum/numgradingpoints)<gradingpointnum/numgradingpoints)<>FRACBITS; return displayexp; diff --git a/src/k_podium.cpp b/src/k_podium.cpp index 9d326d7aa..738c31f03 100644 --- a/src/k_podium.cpp +++ b/src/k_podium.cpp @@ -136,10 +136,8 @@ void podiumData_s::Init(void) rank.numLevels = 8; constexpr INT32 numRaces = 5; - for (INT32 i = 0; i < rank.numPlayers; i++) - { - rank.totalPoints += numRaces * K_CalculateGPRankPoints(i + 1, rank.totalPlayers); - } + + rank.totalPoints += numRaces * TARGETDISPLAYEXP; rank.totalRings = numRaces * rank.numPlayers * 20; // Randomized winnings @@ -685,7 +683,7 @@ void podiumData_s::Draw(void) { drawer_gametype .xy(0, 1) - .patch("K_SPTLAP"); + .patch("K_SPTEXP"); drawer_gametype .xy(22, 1) @@ -823,7 +821,7 @@ void podiumData_s::Draw(void) .text(va("%c%d", (rank.scorePrisons > 0 ? '+' : ' '), rank.scorePrisons)); drawer_totals_right - .patch("RANKLAPS"); + .patch("K_STEXP"); drawer_totals_right .xy(44.0, 0.0) diff --git a/src/k_rank.cpp b/src/k_rank.cpp index fcfe6985d..06be7defd 100644 --- a/src/k_rank.cpp +++ b/src/k_rank.cpp @@ -322,7 +322,7 @@ void gpRank_t::Init(void) // (Should this account for all coop players?) for (i = 0; i < numHumans; i++) { - totalPoints += grandprixinfo.cup->numlevels * K_CalculateGPRankPoints(i + 1, totalPlayers); + totalPoints += grandprixinfo.cup->numlevels * TARGETDISPLAYEXP; } totalRings = grandprixinfo.cup->numlevels * numHumans * 20; @@ -371,10 +371,7 @@ void gpRank_t::Rejigger(UINT16 removedmap, UINT16 removedgt, UINT16 addedmap, UI if ((removedgt == GT_RACE) != (addedgt == GT_RACE)) { - for (i = 0; i < numPlayers; i++) - { - deltaPoints += K_CalculateGPRankPoints(i + 1, totalPlayers); - } + deltaPoints += TARGETDISPLAYEXP; if (addedgt == GT_RACE) totalPoints += deltaPoints; @@ -512,7 +509,7 @@ void gpRank_t::Update(void) lvl->time = UINT32_MAX; - lvl->totalLapPoints = 100; + lvl->totalLapPoints = TARGETDISPLAYEXP; lvl->totalPrisons = maptargets; UINT8 i; diff --git a/src/y_inter.cpp b/src/y_inter.cpp index ac91947fe..bd7c8065f 100644 --- a/src/y_inter.cpp +++ b/src/y_inter.cpp @@ -50,6 +50,7 @@ #include "k_hud.h" // K_DrawMapThumbnail #include "k_battle.h" #include "k_boss.h" +#include "k_kart.h" #include "k_pwrlv.h" #include "k_grandprix.h" #include "k_serverstats.h" // SV_BumpMatchStats @@ -308,7 +309,7 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32)) if (data.pos[data.numplayers] < pointgetters && !(players[i].pflags & PF_NOCONTEST)) { - data.increase[i] = K_CalculateGPRankPoints(data.pos[data.numplayers], pointgetters); + data.increase[i] = K_GetDisplayEXP(&players[i]); } } @@ -2195,10 +2196,7 @@ static UINT32 Y_EstimatePodiumScore(player_t *const player, UINT8 numPlaying) UINT8 pos = Y_PlayersBestPossiblePosition(player); UINT32 ourScore = player->score; - if (pos < numPlaying) - { - ourScore += K_CalculateGPRankPoints(pos, numPlaying); - } + ourScore += K_GetDisplayEXP(player); return ourScore; }