diff --git a/src/cvars.cpp b/src/cvars.cpp index ccdca7299..d6c82dc3d 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -792,6 +792,7 @@ consvar_t cv_votetime = UnsavedNetVar("votetime", "20").min_max(10, 3600); // consvar_t cv_4thgear = OnlineCheat("4thgear", "Off").values(CV_OnOff).flags(CV_NOSHOWHELP).description("Surpassing your limits!"); +consvar_t cv_levelskull = OnlineCheat("levelskull", "Off").values(CV_OnOff).flags(CV_NOSHOWHELP).description("What Storm Rig looked like 2 months before 2.0"); consvar_t cv_barriertime = OnlineCheat("barriertime", "30").values(CV_Natural).description("How long it takes for the Barrier to shrink in Battle Overtime"); consvar_t cv_battlespawn = OnlineCheat("battlespawn", "0").values(CV_Unsigned).description("Spawn every player at the same spawnpoint in Battle (0 = random spawns)"); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 4e4f1a8cd..5a1a79255 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -101,6 +101,7 @@ extern consvar_t cv_debugrank; extern consvar_t cv_battletest; extern consvar_t cv_bighead; +extern consvar_t cv_levelskull; extern consvar_t cv_shittysigns; extern consvar_t cv_tastelesstaunts; extern consvar_t cv_4thgear; diff --git a/src/k_bot.cpp b/src/k_bot.cpp index 6ee701c62..c99083165 100644 --- a/src/k_bot.cpp +++ b/src/k_bot.cpp @@ -126,6 +126,9 @@ void K_SetBot(UINT8 newplayernum, UINT8 skinnum, UINT8 difficulty, botStyle_e st players[newplayernum].botvars.style = style; players[newplayernum].lives = 9; + if (cv_levelskull.value) + players[newplayernum].botvars.difficulty = MAXBOTDIFFICULTY; + // The bot may immediately become a spectator AT THE START of a GP. // For each subsequent round of GP, K_UpdateGrandPrixBots will handle this. players[newplayernum].spectator = grandprixinfo.gp && grandprixinfo.initalize && K_BotDefaultSpectator(); @@ -601,7 +604,7 @@ static UINT32 K_BotRubberbandDistance(const player_t *player) UINT8 pos = 1; UINT8 i; - if (player->botvars.rival) + if (player->botvars.rival || cv_levelskull.value) { // The rival should always try to be the front runner for the race. return 0; @@ -661,7 +664,10 @@ fixed_t K_BotRubberband(const player_t *player) return FRACUNIT; } - const fixed_t difficultyEase = ((player->botvars.difficulty - 1) * FRACUNIT) / (MAXBOTDIFFICULTY - 1); + fixed_t difficultyEase = ((player->botvars.difficulty - 1) * FRACUNIT) / (MAXBOTDIFFICULTY - 1); + + if (cv_levelskull.value) + difficultyEase = FRACUNIT; // Lv. 1: x0.65 avg // Lv. MAX: x1.05 avg diff --git a/src/k_botitem.cpp b/src/k_botitem.cpp index 056c0d4aa..da6aa762d 100644 --- a/src/k_botitem.cpp +++ b/src/k_botitem.cpp @@ -295,7 +295,7 @@ static boolean K_RivalBotAggression(const player_t *bot, const player_t *target) return false; } - if (bot->botvars.rival == false) + if (bot->botvars.rival == false && !cv_levelskull.value) { // Not the rival, we aren't self-aware. return false; diff --git a/src/k_hud.cpp b/src/k_hud.cpp index 7168e376f..d59452728 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -3964,7 +3964,7 @@ playertagtype_t K_WhichPlayerTag(player_t *p) } else if (p->bot) { - if (p->botvars.rival == true) + if (p->botvars.rival == true || cv_levelskull.value) { return PLAYERTAG_RIVAL; } diff --git a/src/k_kart.c b/src/k_kart.c index 323f459d6..9c71770ba 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1490,7 +1490,7 @@ static boolean K_TryDraft(player_t *player, mobj_t *dest, fixed_t minDist, fixed fixed_t add = (FRACUNIT/200) + ((9 - player->kartspeed) * ((3*FRACUNIT)/1600));; player->draftpower += add; - if (player->bot && player->botvars.rival) + if (player->bot && (player->botvars.rival || cv_levelskull.value)) { // Double speed for the rival! player->draftpower += add; @@ -3402,7 +3402,7 @@ static fixed_t K_RingDurationBoost(const player_t *player) ret += add; - if (player->botvars.rival == true) + if (player->botvars.rival == true || cv_levelskull.value) { // x2.0 for Rival ret *= 2; @@ -3697,7 +3697,7 @@ fixed_t K_GetKartSpeed(const player_t *player, boolean doboostpower, boolean dor fixed_t add = ((player->botvars.difficulty-1) * FixedMul(FRACUNIT / 10, modifier)) / (DIFFICULTBOT-1); finalspeed = FixedMul(finalspeed, FRACUNIT + add); - if (player->bot && player->botvars.rival) + if (player->bot && (player->botvars.rival || cv_levelskull.value)) { // +10% top speed for the rival finalspeed = FixedMul(finalspeed, 11*FRACUNIT/10); diff --git a/src/k_roulette.c b/src/k_roulette.c index 0ff171c6e..bd96c8287 100644 --- a/src/k_roulette.c +++ b/src/k_roulette.c @@ -511,7 +511,7 @@ UINT32 K_GetItemRouletteDistance(const player_t *player, UINT8 numPlayers) pdis = K_UndoMapScaling(pdis); pdis = K_ScaleItemDistance(pdis, numPlayers); - if (player->bot && player->botvars.rival) + if (player->bot && (player->botvars.rival || cv_levelskull.value)) { // Rival has better odds :) pdis = FixedMul(pdis, FRANTIC_ITEM_SCALE); @@ -700,7 +700,7 @@ INT32 K_KartGetItemOdds(const player_t *player, itemroulette_t *const roulette, if (player != NULL) { bot = player->bot; - conditions.rival = (bot == true && player->botvars.rival == true); + conditions.rival = (bot == true && (player->botvars.rival || cv_levelskull.value)); position = player->position; } diff --git a/src/m_pw.cpp b/src/m_pw.cpp index d080439ef..192a7947e 100644 --- a/src/m_pw.cpp +++ b/src/m_pw.cpp @@ -238,6 +238,20 @@ void f_4thgear() } } +void f_levelskull() +{ + CV_SetValue(&cv_levelskull, !cv_levelskull.value); + if (cv_levelskull.value) + { + M_StartMessage("It's over for humans!", "CPU difficulty raised to ""\x85""TRUE MAXIMUM!""\x80""\nThis isn't even remotely fair!", NULL, MM_NOTHING, NULL, NULL); + S_StartSound(NULL, sfx_gshdf); + } + else + { + S_StartSound(NULL, sfx_kc46); + } +} + void f_colors() { UINT16 i; @@ -763,4 +777,5 @@ void M_PasswordInit(void) passwords.emplace_back(f_encore, "i5u5sIsMs5eITy+LzAXvKm6D9OzOVKhUqSy1mTTV/oUxJX6RPsk8OcyLbNaey9Vc6wXOhz+2+mTXILkIRzvXqA=="); passwords.emplace_back(f_difficulty, "MKjOtEFLkgXf21uiECdBTU6XtbkuFWaGh7i8znKo7JrXXEDrCBJmGwINvPg0T3TLn0zlscLvmC5nve7I+NTrnA=="); passwords.emplace_back(f_keys, "jgsD6UJ2Xa10QcS2ZDJwcvpd4iia3AXIG8wDDSsHX7kFH5jEXnym45yaNZG9hIKEvBMpVONKR0YTA6JBAQRCvg=="); + passwords.emplace_back(f_levelskull, "hpQP2tC+TGVQojDcYaC4236+QZZR8Tj/OQb1dAkjnMNpc0/AAdRAIQSveLqd7xW2Dw62Fc3noEkeYTHQkPa+WQ=="); }