Item dist scales with low player count instead of just odds, you can change some cvars during start countdown

This commit is contained in:
TehRealSalt 2018-07-22 18:15:11 -04:00
parent 0711e21ffd
commit 2f5baa6199
3 changed files with 49 additions and 16 deletions

View File

@ -5208,24 +5208,53 @@ static void BaseNumLaps_OnChange(void)
static void KartFrantic_OnChange(void) static void KartFrantic_OnChange(void)
{ {
if ((boolean)cv_kartfrantic.value != franticitems && gamestate == GS_LEVEL) if ((boolean)cv_kartfrantic.value != franticitems && gamestate == GS_LEVEL && leveltime > starttime)
CONS_Printf(M_GetText("Frantic items will be turned %s next round.\n"), cv_kartfrantic.value ? M_GetText("on") : M_GetText("off")); CONS_Printf(M_GetText("Frantic items will be turned %s next round.\n"), cv_kartfrantic.value ? M_GetText("on") : M_GetText("off"));
else
{
CONS_Printf(M_GetText("Frantic items has been turned %s.\n"), cv_kartfrantic.value ? M_GetText("on") : M_GetText("off"));
franticitems = (boolean)cv_kartfrantic.value;
}
} }
static void KartSpeed_OnChange(void) static void KartSpeed_OnChange(void)
{ {
if ((UINT8)cv_kartspeed.value != gamespeed && G_RaceGametype() && gamestate == GS_LEVEL) if (G_RaceGametype())
CONS_Printf(M_GetText("Game speed will be changed to \"%s\" next round.\n"), cv_kartspeed.string); {
if ((UINT8)cv_kartspeed.value != gamespeed && gamestate == GS_LEVEL && leveltime > starttime)
CONS_Printf(M_GetText("Game speed will be changed to \"%s\" next round.\n"), cv_kartspeed.string);
else
{
CONS_Printf(M_GetText("Game speed has been changed to \"%s\".\n"), cv_kartspeed.string);
gamespeed = (UINT8)cv_kartspeed.value;
}
}
} }
static void KartMirror_OnChange(void) static void KartMirror_OnChange(void)
{ {
if ((boolean)cv_kartmirror.value != mirrormode && G_RaceGametype() && gamestate == GS_LEVEL) if (G_RaceGametype())
CONS_Printf(M_GetText("Mirror Mode will be turned %s next round.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off")); {
if ((boolean)cv_kartmirror.value != mirrormode && gamestate == GS_LEVEL /*&& leveltime > starttime*/)
CONS_Printf(M_GetText("Mirrored tracks will be turned %s next round.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off"));
else
{
CONS_Printf(M_GetText("Mirrored tracks has been turned %s.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off"));
mirrormode = (boolean)cv_kartmirror.value;
}
}
} }
static void KartComeback_OnChange(void) static void KartComeback_OnChange(void)
{ {
if ((boolean)cv_kartcomeback.value != comeback && G_BattleGametype() && gamestate == GS_LEVEL) if (G_BattleGametype())
CONS_Printf(M_GetText("Karma Comeback will be turned %s next round.\n"), cv_kartcomeback.value ? M_GetText("on") : M_GetText("off")); {
if ((boolean)cv_kartcomeback.value != comeback && gamestate == GS_LEVEL && leveltime > starttime)
CONS_Printf(M_GetText("Karma Comeback will be turned %s next round.\n"), cv_kartcomeback.value ? M_GetText("on") : M_GetText("off"));
else
{
CONS_Printf(M_GetText("Karma Comeback has been turned %s.\n"), cv_kartcomeback.value ? M_GetText("on") : M_GetText("off"));
comeback = (boolean)cv_kartcomeback.value;
}
}
} }

View File

@ -607,6 +607,8 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed)
players[first].mo->z - players[second].mo->z) / mapheaderinfo[gamemap-1]->mobj_scale; players[first].mo->z - players[second].mo->z) / mapheaderinfo[gamemap-1]->mobj_scale;
if (franticitems) if (franticitems)
secondist = (15*secondist/14); secondist = (15*secondist/14);
if (pingame < 6 && !G_BattleGametype())
secondist = ((28+(6-pingame))*secondist/28);
} }
// POWERITEMODDS handles all of the "frantic item" related functionality, for all of our powerful items. // POWERITEMODDS handles all of the "frantic item" related functionality, for all of our powerful items.
@ -618,8 +620,8 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed)
#define POWERITEMODDS(odds) \ #define POWERITEMODDS(odds) \
if (franticitems) \ if (franticitems) \
odds *= 2; \ odds *= 2; \
if (pingame < 5 && !G_BattleGametype()) \ if (pingame < 6 && !G_BattleGametype()) \
odds = FixedMul(odds*FRACUNIT, FRACUNIT+min((5-pingame)*(FRACUNIT/34), FRACUNIT))/FRACUNIT; \ odds = FixedMul(odds*FRACUNIT, FRACUNIT+min((6-pingame)*(FRACUNIT/25), FRACUNIT))/FRACUNIT; \
if (mashed > 0) \ if (mashed > 0) \
odds = FixedDiv(odds*FRACUNIT, mashed+FRACUNIT)/FRACUNIT \ odds = FixedDiv(odds*FRACUNIT, mashed+FRACUNIT)/FRACUNIT \
@ -853,6 +855,8 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
if (franticitems) // Frantic items make the distances between everyone artifically higher, for crazier items if (franticitems) // Frantic items make the distances between everyone artifically higher, for crazier items
pdis = (15*pdis/14); pdis = (15*pdis/14);
if (pingame < 6 && !G_BattleGametype())
pdis = ((28+(6-pingame))*pdis/28);
if (pingame == 1 && oddsvalid[0]) // Record Attack, or just alone if (pingame == 1 && oddsvalid[0]) // Record Attack, or just alone
useodds = 0; useodds = 0;
@ -4043,8 +4047,8 @@ void K_CheckBumpers(void)
winnerscoreadd -= players[i].marescore; winnerscoreadd -= players[i].marescore;
} }
/*if (numingame <= 1) if (numingame <= 1)
return;*/ return;
if (winnernum > -1 && playeringame[winnernum]) if (winnernum > -1 && playeringame[winnernum])
{ {

View File

@ -2997,15 +2997,15 @@ boolean P_SetupLevel(boolean skipprecip)
else else
{ {
if (G_BattleGametype()) if (G_BattleGametype())
{
gamespeed = 0; gamespeed = 0;
else
gamespeed = (UINT8)cv_kartspeed.value;
if (G_BattleGametype())
mirrormode = false; mirrormode = false;
}
else else
{
gamespeed = (UINT8)cv_kartspeed.value;
mirrormode = (boolean)cv_kartmirror.value; mirrormode = (boolean)cv_kartmirror.value;
}
franticitems = (boolean)cv_kartfrantic.value; franticitems = (boolean)cv_kartfrantic.value;
comeback = (boolean)cv_kartcomeback.value; comeback = (boolean)cv_kartcomeback.value;
} }