Merge remote-tracking branch 'refs/remotes/origin/sal-misc'

This commit is contained in:
TehRealSalt 2018-03-04 18:58:34 -05:00
commit ccc6a03d17
17 changed files with 249 additions and 170 deletions

View File

@ -2473,9 +2473,9 @@ static void CL_RemovePlayer(INT32 playernum)
if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
P_CheckSurvivors();
else if (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)
K_CheckBalloons(); // SRB2Kart
else if (gametype == GT_RACE || gametype == GT_COMPETITION)
else if (G_BattleGametype()) // SRB2Kart
K_CheckBalloons();
else if (G_RaceGametype())
P_CheckRacers();
}

View File

@ -2003,8 +2003,16 @@ void D_PickVote(void)
key = M_RandomKey(numvotes);
WRITESINT8(p, temppicks[key]);
WRITESINT8(p, templevels[key]);
if (numvotes > 0)
{
WRITESINT8(p, temppicks[key]);
WRITESINT8(p, templevels[key]);
}
else
{
WRITESINT8(p, -1);
WRITESINT8(p, 0);
}
SendNetXCmd(XD_PICKVOTE, &buf, 2);
}
@ -3221,7 +3229,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
// In tag, check to see if you still have a game.
if (G_TagGametype())
P_CheckSurvivors();
else if (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)
else if (G_BattleGametype())
K_CheckBalloons(); // SRB2Kart
}
@ -4106,7 +4114,7 @@ static void PointLimit_OnChange(void)
static void NumLaps_OnChange(void)
{
// Just don't be verbose
if (gametype == GT_RACE)
if (G_RaceGametype())
CONS_Printf(M_GetText("Number of laps set to %d\n"), cv_numlaps.value);
}
@ -5186,23 +5194,23 @@ static void Command_ShowTime_f(void)
static void KartFrantic_OnChange(void)
{
if (cv_kartfrantic.value != franticitems && gamestate == GS_LEVEL)
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"));
}
static void KartSpeed_OnChange(void)
{
if (cv_kartspeed.value != gamespeed && gametype == GT_RACE && gamestate == GS_LEVEL)
if (cv_kartspeed.value != gamespeed && G_RaceGametype() && gamestate == GS_LEVEL)
CONS_Printf(M_GetText("Game speed will be changed to \"%s\" next round.\n"), cv_kartspeed.string);
}
static void KartMirror_OnChange(void)
{
if (cv_kartmirror.value != mirrormode && gametype == GT_RACE && gamestate == GS_LEVEL)
if (cv_kartmirror.value != mirrormode && G_RaceGametype() && gamestate == GS_LEVEL)
CONS_Printf(M_GetText("Mirror Mode will be turned %s next round.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off"));
}
static void KartComeback_OnChange(void)
{
if (cv_kartcomeback.value != comeback && gametype == GT_MATCH && gamestate == GS_LEVEL)
if (cv_kartcomeback.value != comeback && G_BattleGametype() && gamestate == GS_LEVEL)
CONS_Printf(M_GetText("Karma Comeback will be turned %s next round.\n"), cv_kartcomeback.value ? M_GetText("on") : M_GetText("off"));
}

View File

@ -2764,7 +2764,8 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
{
if (numcoopstarts)
{
INT32 i, pos = 0;
UINT8 i;
UINT8 pos = 0;
// SRB2Kart: figure out player spawn pos from points
if (!playeringame[playernum] || players[playernum].spectator)
@ -2772,34 +2773,47 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
for (i = 0; i < MAXPLAYERS; i++)
{
if (i == playernum)
continue;
if (!playeringame[i] || players[i].spectator)
continue;
if (players[i].score > players[playernum].score)
pos++;
if (i != 0)
if (i == playernum)
continue;
if (players[i].score < players[playernum].score)
{
INT32 j;
for (j = 0; j < i; j++) // I don't like loops in loops, but is needed to resolve ties :<
UINT8 j;
UINT8 num = 0;
for (j = 0; j < MAXPLAYERS; j++) // I hate similar loops inside loops... :<
{
if (i == j)
continue;
if (!playeringame[j] || players[j].spectator)
continue;
if (players[i].score == players[j].score)
pos++;
if (j == playernum)
continue;
if (j == i)
continue;
if (players[j].score == players[i].score)
num++;
}
if (num > 1) // found dupes
pos++;
}
else
{
if (players[i].score > players[playernum].score || i < playernum)
pos++;
}
}
if (G_CheckSpot(playernum, playerstarts[pos % numcoopstarts]))
return playerstarts[pos % numcoopstarts];
// Your spot isn't available? Go for the old behavior
// if there's 6 players in a map with 3 player starts, this spawns them 1/2/3/1/2/3.
if (G_CheckSpot(playernum, playerstarts[playernum % numcoopstarts]))
return playerstarts[playernum % numcoopstarts];
// Your spot isn't available? Find whatever you can get first.
for (i = 0; i < numcoopstarts; i++)
{
if (G_CheckSpot(playernum, playerstarts[i]))
return playerstarts[i];
}
// SRB2Kart: We have solid players, so this behavior is less ideal.
// Don't bother checking to see if the player 1 start is open.
@ -3085,11 +3099,11 @@ boolean G_BattleGametype(void)
//
// G_RaceGametype
//
// Returns true in racing gamemodes, previously was G_PlatformGametype.
// Returns true in Race gamemodes, previously was G_PlatformGametype.
//
boolean G_RaceGametype(void)
{
return (gametype == GT_RACE); //(gametype == GT_COOP || gametype == GT_RACE || gametype == GT_COMPETITION);
return (gametype == GT_RACE);
}
//
@ -3299,7 +3313,7 @@ static void G_DoCompleted(void)
I_Error("Followed map %d to invalid map %d\n", prevmap + 1, nextmap + 1);
// wrap around in race
if (nextmap >= 1100-1 && nextmap <= 1102-1 && (gametype == GT_RACE || gametype == GT_COMPETITION))
if (nextmap >= 1100-1 && nextmap <= 1102-1 && G_RaceGametype())
nextmap = (INT16)(spstage_start-1);
if (gametype == GT_COOP && token)
@ -3394,8 +3408,8 @@ static void G_DoWorldDone(void)
{
if (server)
{
if (gametype == GT_RACE) // SRB2kart
// don't reset player between maps
if (G_RaceGametype())
// SRB2kart: don't reset player between maps
D_MapChange(nextmap+1, gametype, ultimatemode, false, 0, false, false);
else
// resetplayer in match/tag/CTF for more equality

View File

@ -1394,7 +1394,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
V_DrawSmallScaledPatch(x-32, y-4, 0, tagico);
}
if (gametype == GT_RACE)
if (G_RaceGametype())
{
if (circuitmap)
{
@ -1564,7 +1564,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
}
// All data drawn with thin string for space.
if (gametype == GT_RACE)
if (G_RaceGametype())
{
if (circuitmap)
{
@ -1708,7 +1708,7 @@ static void HU_DrawRankings(void)
V_DrawCenteredString(192, 16, 0, va("%u", redscore));
}
if (gametype != GT_RACE && gametype != GT_COMPETITION && gametype != GT_COOP)
if (!G_RaceGametype())
{
if (cv_timelimit.value && timelimitintics > 0)
{
@ -1768,7 +1768,7 @@ static void HU_DrawRankings(void)
tab[i].num = -1;
tab[i].name = 0;
if (gametype == GT_RACE && !circuitmap)
if (G_RaceGametype() && !circuitmap)
tab[i].count = INT32_MAX;
}
@ -1781,7 +1781,7 @@ static void HU_DrawRankings(void)
{
if (playeringame[i] && !players[i].spectator)
{
if (gametype == GT_RACE)
if (G_RaceGametype())
{
if (circuitmap)
{

View File

@ -514,7 +514,7 @@ static INT32 K_KartGetItemOdds(INT32 pos, INT32 itemnum)
{
INT32 newodds;
if (gametype == GT_MATCH)
if (G_BattleGametype())
newodds = K_KartItemOddsBalloons[itemnum-1][pos];
else
newodds = K_KartItemOddsDistance_Retro[itemnum-1][pos];
@ -587,14 +587,14 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd)
&& players[i].kartstuff[k_position] < player->kartstuff[k_position])
pdis += P_AproxDistance(P_AproxDistance(players[i].mo->x - player->mo->x,
players[i].mo->y - player->mo->y),
players[i].mo->z - player->mo->z) / FRACUNIT
players[i].mo->z - player->mo->z) / mapheaderinfo[gamemap-1]->mobj_scale
* (pingame - players[i].kartstuff[k_position])
/ ((pingame - 1) * (pingame + 1) / 3);
}
player->kartstuff[k_itemclose] = 0; // Reset the item window closer.
if (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF) // Battle Mode
if (G_BattleGametype()) // Battle Mode
{
useodds = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average
if (useodds > 4)
@ -1088,7 +1088,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->kartstuff[k_lapanimation])
player->kartstuff[k_lapanimation]--;
if (gametype != GT_RACE && (player->exiting || player->kartstuff[k_comebacktimer]))
if (G_BattleGametype() && (player->exiting || player->kartstuff[k_comebacktimer]))
{
if (player->exiting)
{
@ -1298,7 +1298,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
break;
}
if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
kartspeed = 1;
k_speed += kartspeed*3; // 153 - 177
@ -1315,7 +1315,7 @@ fixed_t K_GetKartAccel(player_t *player)
fixed_t k_accel = 32; // 36;
UINT8 kartspeed = player->kartspeed;
if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
kartspeed = 1;
//k_accel += 3 * (9 - kartspeed); // 36 - 60
@ -1327,7 +1327,7 @@ fixed_t K_GetKartAccel(player_t *player)
UINT16 K_GetKartFlashing(void)
{
UINT16 tics = flashingtics;
if (gametype != GT_RACE)
if (G_BattleGametype())
{
tics *= 2;
//tics += (3*TICRATE/8) * (player->kartspeed-1);
@ -1376,7 +1376,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source)
if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || (player->kartstuff[k_spinouttimer] > 0 && player->kartstuff[k_spinout] > 0)
|| player->kartstuff[k_startimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_bootimer] > 0
|| (gametype != GT_RACE && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
|| (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
return;
if (source && source != player->mo && source->player && !source->player->kartstuff[k_sounds])
@ -1388,7 +1388,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source)
player->kartstuff[k_mushroomtimer] = 0;
player->kartstuff[k_driftboost] = 0;
if (gametype != GT_RACE)
if (G_BattleGametype())
{
if (source && source->player && player != source->player)
P_AddPlayerScore(source->player, 1);
@ -1440,13 +1440,13 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_startimer] > 0
|| player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_bootimer] > 0
|| (gametype != GT_RACE && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
|| (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
return;
player->kartstuff[k_mushroomtimer] = 0;
player->kartstuff[k_driftboost] = 0;
if (gametype != GT_RACE)
if (G_BattleGametype())
{
if (source && source->player && player != source->player)
P_AddPlayerScore(source->player, 1);
@ -1484,16 +1484,16 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || (player->kartstuff[k_spinouttimer] > 0 && player->kartstuff[k_spinout] > 0)
|| player->kartstuff[k_startimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_bootimer] > 0
|| (gametype != GT_RACE && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
|| (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
return;
player->mo->momz = 18*FRACUNIT;
player->mo->momz = 18*(mapheaderinfo[gamemap-1]->mobj_scale);
player->mo->momx = player->mo->momy = 0;
player->kartstuff[k_mushroomtimer] = 0;
player->kartstuff[k_driftboost] = 0;
if (gametype != GT_RACE)
if (G_BattleGametype())
{
if (source && source->player && player != source->player)
{
@ -1549,7 +1549,7 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force)
fixed_t newx, newy;
mobj_t *newmo;
if (gametype == GT_RACE)
if (!G_BattleGametype())
return;
if (player->health <= 0 || victim->health <= 0)
@ -1847,6 +1847,11 @@ void K_SpawnDriftTrail(player_t *player)
I_Assert(player->mo != NULL);
I_Assert(!P_MobjWasRemoved(player->mo));
if (!P_IsObjectOnGround(player->mo)
|| player->kartstuff[k_bootimer] != 0
|| (G_BattleGametype() && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]))
return;
if (player->mo->eflags & MFE_VERTICALFLIP)
ground = player->mo->ceilingz - FixedMul(mobjinfo[MT_MUSHROOMTRAIL].height, player->mo->scale);
else
@ -1859,9 +1864,6 @@ void K_SpawnDriftTrail(player_t *player)
for (i = 0; i < 2; i++)
{
if (player->kartstuff[k_bootimer] != 0 || (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]))
continue;
newx = player->mo->x + P_ReturnThrustX(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(24*FRACUNIT, player->mo->scale));
newy = player->mo->y + P_ReturnThrustY(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(24*FRACUNIT, player->mo->scale));
#ifdef ESLOPE
@ -1997,9 +1999,9 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
INT32 HEIGHT;
if (dir == 2)
HEIGHT = 40*FRACUNIT + player->mo->momz;
HEIGHT = 40*(mapheaderinfo[gamemap-1]->mobj_scale) + player->mo->momz;
else
HEIGHT = 30*FRACUNIT + player->mo->momz;
HEIGHT = 30*(mapheaderinfo[gamemap-1]->mobj_scale) + player->mo->momz;
mo->momx = player->mo->momx + FixedMul(FINECOSINE(fa), PROJSPEED);
mo->momy = player->mo->momy + FixedMul(FINESINE(fa), PROJSPEED);
@ -2083,8 +2085,8 @@ static void K_DoBooSteal(player_t *player)
&& player != &players[i] && !players[i].exiting && !players[i].spectator // Player in-game
// Can steal from this player
&& ((gametype == GT_RACE && players[i].kartstuff[k_position] < player->kartstuff[k_position])
|| (gametype != GT_RACE && players[i].kartstuff[k_balloon] > 0))
&& ((G_RaceGametype() && players[i].kartstuff[k_position] < player->kartstuff[k_position])
|| (G_BattleGametype() && players[i].kartstuff[k_balloon] > 0))
// Has an item
&& (players[i].kartstuff[k_magnet]
@ -2113,7 +2115,7 @@ static void K_DoBooSteal(player_t *player)
prandom = P_RandomFixed();
if ((gametype == GT_RACE && player->kartstuff[k_position] == 1) || numplayers == 0) // No-one can be stolen from? Get longer invisibility for nothing
if ((G_RaceGametype() && player->kartstuff[k_position] == 1) || numplayers == 0) // No-one can be stolen from? Get longer invisibility for nothing
{
player->kartstuff[k_bootimer] = bootime;
player->kartstuff[k_bootaketimer] = boostealtime;
@ -2420,7 +2422,7 @@ static void K_KartDrift(player_t *player, boolean onground)
UINT8 kartspeed = player->kartspeed;
fixed_t dsone, dstwo;
if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
kartspeed = 1;
// IF YOU CHANGE THESE: MAKE SURE YOU UPDATE THE SAME VALUES IN p_mobjc, "case MT_DRIFT:"
@ -2556,7 +2558,7 @@ static void K_KartUpdatePosition(player_t *player)
if (!playeringame[i] || players[i].spectator || !players[i].mo)
continue;
if (gametype == GT_RACE)
if (G_RaceGametype())
{
if ((((players[i].starpostnum) + (numstarposts + 1) * players[i].laps) >
((player->starpostnum) + (numstarposts + 1) * player->laps)))
@ -2632,7 +2634,7 @@ static void K_KartUpdatePosition(player_t *player)
}
}
}
else if (gametype == GT_MATCH)
else if (G_BattleGametype())
{
if (player->exiting)
return;
@ -2761,7 +2763,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
// Race Spectator
if (netgame && player->jointime < 1
&& gametype == GT_RACE && countdown)
&& G_RaceGametype() && countdown)
{
player->spectator = true;
player->powers[pw_nocontrol] = 5;
@ -2839,7 +2841,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->kartstuff[k_startimer] = itemtime; // Activate it
K_PlayTauntSound(player->mo);
player->kartstuff[k_star] = 0;
if (gametype != GT_RACE)
if (G_BattleGametype())
player->kartstuff[k_poweritemtimer] = 10*TICRATE;
player->kartstuff[k_itemclose] = 10;
player->pflags |= PF_ATTACKDOWN;
@ -3156,7 +3158,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
S_StartSound(player->mo, sfx_mario3);
player->pflags |= PF_ATTACKDOWN;
player->kartstuff[k_megashroom] = 0;
if (gametype != GT_RACE)
if (G_BattleGametype())
player->kartstuff[k_poweritemtimer] = 10*TICRATE;
player->kartstuff[k_itemclose] = 10;
}
@ -3219,7 +3221,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (player->kartstuff[k_growshrinktimer] == 26)
S_StartSound(player->mo, sfx_mario8);
if ((gametype != GT_RACE)
if ((G_BattleGametype())
&& (player->kartstuff[k_star] || player->kartstuff[k_megashroom]
|| player->kartstuff[k_startimer] || player->kartstuff[k_growshrinktimer] > 0))
player->kartstuff[k_poweritemtimer] = 10*TICRATE;
@ -3251,7 +3253,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->mo->flags2 &= ~MF2_DONTDRAW;
}
if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0) // dead in match? you da bomb
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) // dead in match? you da bomb
{
K_StripItems(player);
player->mo->flags2 |= MF2_SHADOW;
@ -3279,7 +3281,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
else
player->mo->tracer->flags2 &= ~MF2_DONTDRAW;
}
else if (gametype == GT_RACE || player->kartstuff[k_balloon] > 0)
else if (G_RaceGametype() || player->kartstuff[k_balloon] > 0)
{
player->mo->flags2 &= ~MF2_SHADOW;
if (player->mo->tracer && player->mo->tracer->state == &states[S_PLAYERBOMB])
@ -3295,7 +3297,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->mo->friction += 4608;
if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392)
player->mo->friction += 1608;
if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
{
player->mo->friction += 1228;
@ -3387,7 +3389,7 @@ void K_CheckBalloons(void)
if (!multiplayer)
return;
if (gametype != GT_MATCH)
if (!G_BattleGametype())
return;
if (gameaction == ga_completed)
@ -4338,7 +4340,7 @@ static void K_drawKartPositionFaces(void)
if (rankplayer[i] != myplayer)
{
V_DrawSmallTranslucentPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin]);
if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] > 0)
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++)
{
@ -4350,7 +4352,7 @@ static void K_drawKartPositionFaces(void)
else
{
V_DrawSmallScaledPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin]);
if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] > 0)
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++)
{
@ -4375,7 +4377,7 @@ static void K_drawKartPositionFaces(void)
if (rankplayer[i] != myplayer)
{
V_DrawSmallTranslucentMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin], colormap);
if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] > 0)
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++)
{
@ -4387,7 +4389,7 @@ static void K_drawKartPositionFaces(void)
else
{
V_DrawSmallMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin], colormap);
if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] > 0)
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++)
{
@ -4410,14 +4412,14 @@ static void K_drawKartPositionFaces(void)
if (rankplayer[i] != myplayer)
{
if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] <= 0)
V_DrawSmallTranslucentPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknoballoons);
else
V_DrawSmallTranslucentPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, localpatch);
}
else
{
if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] <= 0)
V_DrawSmallScaledPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknoballoons);
else
V_DrawSmallScaledPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, localpatch);
@ -4557,9 +4559,11 @@ static void K_drawKartPlayerCheck(void)
for (i = 0; i < MAXPLAYERS; i++)
{
if (&players[i] == stplyr)
if (!playeringame[i] || players[i].spectator)
continue;
if (!(players[i].mo))
if (!players[i].mo)
continue;
if (&players[i] == stplyr)
continue;
if ((players[i].kartstuff[k_startimer] <= 0) && (leveltime & 2))
@ -4966,7 +4970,7 @@ void K_drawKartHUD(void)
K_initKartHUD();
// Draw full screen stuff that turns off the rest of the HUD
if ((gametype != GT_RACE)
if ((G_BattleGametype())
&& (stplyr->exiting
|| (stplyr->kartstuff[k_balloon] <= 0
&& stplyr->kartstuff[k_comebacktimer]
@ -5027,7 +5031,7 @@ void K_drawKartHUD(void)
if (!stplyr->spectator) // Bottom of the screen elements, don't need in spectate mode
{
if (gametype == GT_RACE) // Race-only elements
if (G_RaceGametype()) // Race-only elements
{
// Draw the lap counter
K_drawKartLaps();
@ -5045,7 +5049,7 @@ void K_drawKartHUD(void)
K_DrawKartPositionNum(stplyr->kartstuff[k_position]);
}
}
else if (gametype == GT_MATCH) // Battle-only
else if (G_BattleGametype()) // Battle-only
{
// Draw the hits left!
K_drawKartBalloonsOrKarma();

View File

@ -74,19 +74,32 @@ typedef struct
static UINT8 cheatf_warp(void)
{
if (modifiedgame)
return 0;
UINT8 i;
boolean success = false;
/*if (modifiedgame)
return 0;*/
if (menuactive && currentMenu != &MainDef)
return 0; // Only on the main menu!
S_StartSound(0, sfx_itemup);
// Temporarily unlock EVERYTHING.
for (i = 0; i < MAXUNLOCKABLES; i++)
{
if (!unlockables[i].conditionset)
continue;
if (!unlockables[i].unlocked)
{
unlockables[i].unlocked = true;
success = true;
}
}
// Temporarily unlock stuff.
G_SetGameModified(false);
unlockables[1].unlocked = true; // credits
unlockables[2].unlocked = true; // sound test
//unlockables[16].unlocked = true; // level select
if (success)
{
G_SetGameModified(false);
S_StartSound(0, sfx_kc42);
}
// Refresh secrets menu existing.
M_ClearMenus(true);
@ -135,14 +148,19 @@ static UINT8 cheatf_devmode(void)
static cheatseq_t cheat_warp = {
0, cheatf_warp,
{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff }
//{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff }
{ SCRAMBLE('b'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), 0xff }
};
static cheatseq_t cheat_warp_joy = {
0, cheatf_warp,
{ SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
/*{ SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW),
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
SCRAMBLE(KEY_ENTER), 0xff }*/
{ SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_RIGHTARROW),
SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_LEFTARROW),
SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_RIGHTARROW),
SCRAMBLE(KEY_ENTER), 0xff }
};

View File

@ -117,8 +117,6 @@ unlockable_t unlockables[MAXUNLOCKABLES] =
/* 02 */ {"Chaotic Kart Cup", "Collect 15 Emblems", 0, 2, SECRET_NONE, 0, false, false, 0},
/* 03 */ {"Record Attack", "", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0},
/* 04 */ {"Play Credits", "", 10, -1, SECRET_CREDITS, 0, true, true, 0},
/* 05 */ {"Sound Test", "", 20, -1, SECRET_SOUNDTEST, 0, true, true, 0},
};
// Default number of emblems and extra emblems

View File

@ -207,8 +207,8 @@ menu_t MessageDef;
menu_t SPauseDef;
// Sky Room
static void M_CustomLevelSelect(INT32 choice);
static void M_CustomWarp(INT32 choice);
//static void M_CustomLevelSelect(INT32 choice);
//static void M_CustomWarp(INT32 choice);
FUNCNORETURN static ATTRNORETURN void M_UltimateCheat(INT32 choice);
static void M_LoadGameLevelSelect(INT32 choice);
static void M_GetAllEmeralds(INT32 choice);
@ -231,7 +231,7 @@ static void M_ConfirmSpectate(INT32 choice);
static void M_ConfirmEnterGame(INT32 choice);
static void M_ConfirmTeamScramble(INT32 choice);
static void M_ConfirmTeamChange(INT32 choice);
static void M_SecretsMenu(INT32 choice);
//static void M_SecretsMenu(INT32 choice);
static void M_SetupChoosePlayer(INT32 choice);
static void M_QuitSRB2(INT32 choice);
menu_t SP_MainDef, MP_MainDef, OP_MainDef;
@ -475,11 +475,11 @@ static consvar_t cv_dummystaff = {"dummystaff", "0", CV_HIDEN|CV_CALL, dummystaf
// ---------
static menuitem_t MainMenu[] =
{
{IT_CALL |IT_STRING, NULL, "Secrets", M_SecretsMenu, 84},
{IT_CALL |IT_STRING, NULL, "1 Player", M_SinglePlayerMenu, 92},
{IT_SUBMENU|IT_STRING, NULL, "Multiplayer", &MP_MainDef, 100},
{IT_CALL |IT_STRING, NULL, "Options", M_Options, 108},
{IT_CALL |IT_STRING, NULL, "Quit Game", M_QuitSRB2, 116},
{IT_SUBMENU|IT_STRING, NULL, "Extras", &SR_UnlockChecklistDef, 84},
{IT_CALL |IT_STRING, NULL, "1 Player", M_SinglePlayerMenu, 92},
{IT_SUBMENU|IT_STRING, NULL, "Multiplayer", &MP_MainDef, 100},
{IT_CALL |IT_STRING, NULL, "Options", M_Options, 108},
{IT_CALL |IT_STRING, NULL, "Quit Game", M_QuitSRB2, 116},
};
typedef enum
@ -688,7 +688,7 @@ static menuitem_t SR_LevelSelectMenu[] =
static menuitem_t SR_UnlockChecklistMenu[] =
{
{IT_SUBMENU | IT_STRING, NULL, "NEXT", &SR_MainDef, 192},
{IT_SUBMENU | IT_STRING, NULL, "NEXT", &MainDef, 192},
};
static menuitem_t SR_EmblemHintMenu[] =
@ -1040,6 +1040,9 @@ static menuitem_t OP_MainMenu[] =
{IT_SUBMENU | IT_STRING, NULL, "Game Options...", &OP_GameOptionsDef, 70},
{IT_SUBMENU | IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 80},
{IT_CALL | IT_STRING, NULL, "Play Credits", M_Credits, 100},
{IT_KEYHANDLER | IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 110},
};
static menuitem_t OP_ControlsMenu[] =
@ -1575,7 +1578,7 @@ menu_t SR_UnlockChecklistDef =
{
NULL,
1,
&SR_MainDef,
&MainDef, //&SR_MainDef
SR_UnlockChecklistMenu,
M_DrawChecklist,
280, 185,
@ -1789,7 +1792,18 @@ menu_t MP_PlayerSetupDef =
};
// Options
menu_t OP_MainDef = DEFAULTMENUSTYLE("M_OPTTTL", OP_MainMenu, &MainDef, 60, 30);
menu_t OP_MainDef =
{
"M_OPTTTL",
sizeof (OP_MainMenu)/sizeof (menuitem_t),
&MainDef,
OP_MainMenu,
M_DrawSkyRoom,
60, 30,
0,
NULL
};
menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30);
//menu_t OP_ControlListDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlListMenu, &OP_ControlsDef, 60, 30);
menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlsDef);
@ -2692,7 +2706,7 @@ void M_StartControlPanel(void)
if (!Playing())
{
// Secret menu!
MainMenu[secrets].status = (M_AnySecretUnlocked()) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
//MainMenu[secrets].status = (M_AnySecretUnlocked()) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
currentMenu = &MainDef;
itemOn = singleplr;
@ -4403,7 +4417,7 @@ static void M_HandleSoundTest(INT32 choice)
}
// Entering secrets menu
static void M_SecretsMenu(INT32 choice)
/*static void M_SecretsMenu(INT32 choice)
{
INT32 i, j, ul;
UINT8 done[MAXUNLOCKABLES];
@ -4478,7 +4492,7 @@ static void M_SecretsMenu(INT32 choice)
}
M_SetupNextMenu(&SR_MainDef);
}
}*/
// ==================
// NEW GAME FUNCTIONS
@ -4496,14 +4510,14 @@ static void M_NewGame(void)
M_SetupChoosePlayer(0);
}
static void M_CustomWarp(INT32 choice)
/*static void M_CustomWarp(INT32 choice)
{
INT32 ul = skyRoomMenuTranslations[choice-1];
startmap = (INT16)(unlockables[ul].variable);
M_SetupChoosePlayer(0);
}
}*/
static void M_Credits(INT32 choice)
{
@ -4513,7 +4527,7 @@ static void M_Credits(INT32 choice)
F_StartCredits();
}
static void M_CustomLevelSelect(INT32 choice)
/*static void M_CustomLevelSelect(INT32 choice)
{
INT32 ul = skyRoomMenuTranslations[choice-1];
@ -4528,7 +4542,7 @@ static void M_CustomLevelSelect(INT32 choice)
M_PrepareLevelSelect();
M_SetupNextMenu(&SR_LevelSelectDef);
}
}*/
// ==================
// SINGLE PLAYER MENU

View File

@ -3926,7 +3926,7 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing)
return true;
if (thing->player && (thing->player->kartstuff[k_bootimer]
|| (gametype == GT_MATCH && thing->player && thing->player->kartstuff[k_balloon] <= 0 && thing->player->kartstuff[k_comebacktimer])))
|| (G_BattleGametype() && thing->player && thing->player->kartstuff[k_balloon] <= 0 && thing->player->kartstuff[k_comebacktimer])))
return true;
if ((gametype == GT_CTF || gametype == GT_TEAMMATCH)
@ -8143,7 +8143,7 @@ void A_ItemPop(mobj_t *actor)
remains->flags2 &= ~MF2_AMBUSH;
if (gametype != GT_RACE)
if (G_BattleGametype())
numgotboxes++;
P_RemoveMobj(actor);
@ -8213,14 +8213,14 @@ void A_RedShellChase(mobj_t *actor)
&& actor->target->player->ctfteam == player->ctfteam)
continue;
if (gametype == GT_RACE) // Only in races, in match and CTF you should go after any nearby players
if (G_RaceGametype()) // Only in races, in match and CTF you should go after any nearby players
{
// USER TARGET
if (actor->target->player->kartstuff[k_position] != (player->kartstuff[k_position] + 1)) // Red Shells only go after the person directly ahead of you -Sryder
continue;
}
if (gametype != GT_RACE)
if (G_BattleGametype())
{
if (player->kartstuff[k_balloon] <= 0)
continue;
@ -8231,7 +8231,7 @@ void A_RedShellChase(mobj_t *actor)
}
}
if ((gametype == GT_RACE) || (gametype != GT_RACE // If in match etc. only home in when you get close enough, in race etc. home in all the time
if ((G_RaceGametype()) || (G_BattleGametype() // If in match etc. only home in when you get close enough, in race etc. home in all the time
&& P_AproxDistance(P_AproxDistance(player->mo->x-actor->x,
player->mo->y-actor->y), player->mo->z-actor->z) < RING_DIST
&& player->kartstuff[k_balloon] > 0))
@ -8242,7 +8242,7 @@ void A_RedShellChase(mobj_t *actor)
// done looking
if (actor->lastlook == stop)
{
if (gametype == GT_RACE)
if (G_RaceGametype())
actor->lastlook = -2;
return;
}
@ -8289,7 +8289,7 @@ void A_BobombExplode(mobj_t *actor)
if (mo2 == actor || mo2->type == MT_BOMBEXPLOSIONSOUND) // Don't explode yourself! Endless loop!
continue;
if (gametype == GT_MATCH && actor->target && actor->target->player && actor->target->player->kartstuff[k_balloon] <= 0 && mo2 == actor->target)
if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_balloon] <= 0 && mo2 == actor->target)
continue;
if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > actor->info->painchance)

View File

@ -158,7 +158,7 @@ boolean P_CanPickupItem(player_t *player, boolean weapon)
//if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] <= flashingtics)
// return false;
if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0) // No balloons in Match
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) // No balloons in Match
return false;
if (player->kartstuff[k_magnettimer]) // You should probably collect stuff when you're attracting it :V
@ -418,7 +418,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{
case MT_RANDOMITEM: // SRB2kart
case MT_FLINGRANDOMITEM:
if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
{
if (player->kartstuff[k_comebackmode] == 0 && !player->kartstuff[k_comebacktimer])
{
@ -433,7 +433,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (!P_CanPickupItem(player, false) && special->tracer != toucher)
return;
if (gametype != GT_RACE && special->tracer && special->tracer->player)
if (G_BattleGametype() && special->tracer && special->tracer->player)
{
special->tracer->player->kartstuff[k_comebackmode] = 0;
@ -2294,7 +2294,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
}
}
}
else if (gametype == GT_MATCH)
else if (G_BattleGametype())
{
K_CheckBalloons();
}
@ -2576,7 +2576,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source)
player->flyangle += 180; // Shuffle's BETTERNIGHTSMOVEMENT?
player->flyangle %= 360;
if (gametype == GT_RACE || gametype == GT_COMPETITION)
if (G_RaceGametype())
player->drillmeter -= 5*20;
else
{
@ -2750,7 +2750,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
player->pflags &= ~(PF_CARRIED|PF_SLIDING|PF_ITEMHANG|PF_MACESPIN|PF_ROPEHANG|PF_NIGHTSMODE);
// Burst weapons and emeralds in Match/CTF only
if (source && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF))
if (source && (G_BattleGametype()))
{
P_PlayerRingBurst(player, player->health - 1);
P_PlayerEmeraldBurst(player, false);
@ -2794,7 +2794,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
HU_DoCEcho(va("%s\\is no longer super.\\\\\\\\", player_names[player-players]));
}*/
if (gametype != GT_RACE)
if (G_BattleGametype())
{
if (player->kartstuff[k_balloon] > 0)
{
@ -3190,7 +3190,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// Sudden-Death mode
if (source && source->type == MT_PLAYER)
{
if ((gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF) && cv_suddendeath.value
if ((G_BattleGametype()) && cv_suddendeath.value
&& !player->powers[pw_flashing] && !player->powers[pw_invulnerability])
damage = 10000;
}

View File

@ -383,7 +383,7 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails)
|| (gametype == GT_MATCH)
|| (G_GametypeHasTeams() && tails->ctfteam != sonic->ctfteam))
sonic->pflags &= ~PF_CARRIED; */
if (tails->spectator || sonic->spectator || gametype == GT_RACE) // SRB2kart
if (tails->spectator || sonic->spectator || G_RaceGametype()) // SRB2kart
sonic->pflags &= ~PF_CARRIED;
else
{
@ -1652,18 +1652,18 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->player->kartstuff[k_growshrinktimer] || thing->player->kartstuff[k_squishedtimer]
|| thing->player->kartstuff[k_bootimer] || thing->player->kartstuff[k_spinouttimer]
|| thing->player->kartstuff[k_startimer] || thing->player->kartstuff[k_justbumped]
|| (gametype != GT_RACE && (thing->player->kartstuff[k_balloon] <= 0
|| (G_BattleGametype() && (thing->player->kartstuff[k_balloon] <= 0
&& (thing->player->kartstuff[k_comebacktimer] || thing->player->kartstuff[k_comebackmode] == 1)))
|| tmthing->player->kartstuff[k_growshrinktimer] || tmthing->player->kartstuff[k_squishedtimer]
|| tmthing->player->kartstuff[k_bootimer] || tmthing->player->kartstuff[k_spinouttimer]
|| tmthing->player->kartstuff[k_startimer] || tmthing->player->kartstuff[k_justbumped]
|| (gametype != GT_RACE && (tmthing->player->kartstuff[k_balloon] <= 0
|| (G_BattleGametype() && (tmthing->player->kartstuff[k_balloon] <= 0
&& (tmthing->player->kartstuff[k_comebacktimer] || tmthing->player->kartstuff[k_comebackmode] == 1))))
{
return true;
}
if (gametype != GT_RACE)
if (G_BattleGametype())
{
if ((thing->player->kartstuff[k_balloon] <= 0 && thing->player->kartstuff[k_comebackmode] == 0)
|| (tmthing->player->kartstuff[k_balloon] <= 0 && tmthing->player->kartstuff[k_comebackmode] == 0))
@ -1686,7 +1686,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
{
K_KartBouncing(tmthing, thing, true, false);
if (gametype != GT_RACE && tmthing->player->kartstuff[k_feather] & 2)
if (G_BattleGametype() && tmthing->player->kartstuff[k_feather] & 2)
{
K_StealBalloon(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing);
@ -1695,7 +1695,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
else if (P_IsObjectOnGround(tmthing) && thing->momz < 0)
{
K_KartBouncing(thing, tmthing, true, false);
if (gametype != GT_RACE && thing->player->kartstuff[k_feather] & 2)
if (G_BattleGametype() && thing->player->kartstuff[k_feather] & 2)
{
K_StealBalloon(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing);
@ -1704,7 +1704,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
else
K_KartBouncing(tmthing, thing, false, false);
if (gametype != GT_RACE)
if (G_BattleGametype())
{
if (thing->player->kartstuff[k_mushroomtimer] && !(tmthing->player->kartstuff[k_mushroomtimer]))
{

View File

@ -6525,7 +6525,7 @@ void P_MobjThinker(mobj_t *mobj)
INT32 HEIGHT;
fixed_t radius;
if (gametype != GT_RACE && mobj->target->player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && mobj->target->player->kartstuff[k_balloon] <= 0)
kartspeed = 1;
dsone = 26*4 + kartspeed*2 + (9 - mobj->target->player->kartweight);
@ -6845,7 +6845,7 @@ void P_MobjThinker(mobj_t *mobj)
fixed_t scale = mobj->target->scale;
mobj->color = mobj->target->color;
if (!netgame || gametype == GT_RACE
if (!netgame || G_RaceGametype()
|| mobj->target->player == &players[displayplayer]
|| mobj->target->player->kartstuff[k_balloon] <= 0
|| (mobj->target->player->mo->flags2 & MF2_DONTDRAW))
@ -7082,7 +7082,7 @@ void P_MobjThinker(mobj_t *mobj)
{
x = mobj->target->x;
y = mobj->target->y;
z = mobj->target->z + 80*FRACUNIT;
z = mobj->target->z + 80*(mapheaderinfo[gamemap-1]->mobj_scale);
}
P_TeleportMove(mobj, x, y, z);
break;
@ -7799,10 +7799,12 @@ void P_MobjThinker(mobj_t *mobj)
{
finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4);
}
finalspeed = FixedMul(finalspeed, mapheaderinfo[gamemap-1]->mobj_scale);
P_InstaThrust(mobj, mobj->angle, finalspeed);
}
else
{
finalspeed = FixedMul(finalspeed, mapheaderinfo[gamemap-1]->mobj_scale);
P_InstaThrust(mobj, mobj->angle, finalspeed);
}
@ -7844,7 +7846,10 @@ void P_MobjThinker(mobj_t *mobj)
distbarrier = FixedMul(distbarrier, FRACUNIT+FRACUNIT/4);
}
if (gametype == GT_RACE && mobj->tracer)
distbarrier = FixedMul(distbarrier, mapheaderinfo[gamemap-1]->mobj_scale);
topspeed = FixedMul(topspeed, mapheaderinfo[gamemap-1]->mobj_scale);
if (G_RaceGametype() && mobj->tracer)
{
distaway = P_AproxDistance(mobj->tracer->x - mobj->x, mobj->tracer->y - mobj->y);
if (distaway < distbarrier)
@ -7857,7 +7862,7 @@ void P_MobjThinker(mobj_t *mobj)
}
}
if (gametype != GT_RACE)
if (G_BattleGametype())
{
mobj->friction -= 1228;
if (mobj->friction > FRACUNIT)
@ -9310,7 +9315,7 @@ void P_RespawnSpecials(void)
mobj_t *mo = NULL;
mapthing_t *mthing = NULL;
if (gametype != GT_RACE) // Battle Mode vers
if (G_BattleGametype()) // Battle Mode vers
{
P_RespawnBattleSpecials();
return;
@ -9600,7 +9605,7 @@ void P_SpawnPlayer(INT32 playernum)
overheadarrow->flags2 |= MF2_DONTDRAW;
P_SetScale(overheadarrow, mobj->destscale);
if (gametype != GT_RACE)
if (G_BattleGametype())
{
/*INT32 i;
INT32 pcount = 0;
@ -10005,7 +10010,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
if (!cv_powerstones.value)
return;
if (!(gametype == GT_MATCH || gametype == GT_CTF))
if (!G_BattleGametype())
return;
runemeraldmanager = true;

View File

@ -2871,7 +2871,7 @@ boolean P_SetupLevel(boolean skipprecip)
CONS_Printf(M_GetText("No player currently available to become IT. Awaiting available players.\n"));
}
else if (gametype == GT_RACE && server && cv_usemapnumlaps.value)
else if (G_RaceGametype() && server && cv_usemapnumlaps.value)
CV_StealthSetValue(&cv_numlaps, mapheaderinfo[gamemap - 1]->numlaps);
// ===========
@ -2978,12 +2978,12 @@ boolean P_SetupLevel(boolean skipprecip)
// SRB2Kart: map load variables
if (modeattacking)
gamespeed = 2;
else if (gametype == GT_MATCH)
else if (G_BattleGametype())
gamespeed = 0;
else
gamespeed = cv_kartspeed.value;
if (gametype == GT_MATCH)
if (G_BattleGametype())
mirrormode = false;
else
mirrormode = cv_kartmirror.value;

View File

@ -4133,10 +4133,10 @@ DoneSection2:
case 10: // Finish Line
// SRB2kart - 150117
if (gametype == GT_RACE && (player->starpostcount >= numstarposts/2 || player->exiting))
if (G_RaceGametype() && (player->starpostcount >= numstarposts/2 || player->exiting))
player->kartstuff[k_starpostwp] = player->kartstuff[k_waypoint] = 0;
//
if (gametype == GT_RACE && !player->exiting)
if (G_RaceGametype() && !player->exiting)
{
if (player->starpostcount >= numstarposts/2) // srb2kart: must have touched *enough* starposts (was originally "(player->starpostnum == numstarposts)")
{
@ -5617,7 +5617,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
switch(GETSECSPECIAL(sector->special, 4))
{
case 10: // Circuit finish line
if (gametype == GT_RACE)
if (G_RaceGametype())
circuitmap = true;
break;
}
@ -6378,7 +6378,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
break;
case 308: // Race-only linedef executor. Triggers once.
if (gametype != GT_RACE && gametype != GT_COMPETITION)
if (!G_RaceGametype())
lines[i].special = 0;
break;

View File

@ -350,7 +350,7 @@ UINT8 P_FindLowestMare(void)
mobj_t *mo2;
UINT8 mare = UINT8_MAX;
if (gametype == GT_RACE || gametype == GT_COMPETITION)
if (G_RaceGametype())
return 0;
// scan the thinkers
@ -685,7 +685,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
P_RestoreMusic(player);
P_SetMobjState(player->mo->tracer, S_SUPERTRANS1);
if (gametype == GT_RACE || gametype == GT_COMPETITION)
if (G_RaceGametype())
{
if (player->drillmeter < 48*20)
player->drillmeter = 48*20;
@ -1653,7 +1653,7 @@ void P_DoPlayerExit(player_t *player)
&& (!player->spectator && ((!modifiedgame || savemoddata) && !demoplayback)))
legitimateexit = true;
if (gametype == GT_RACE || gametype == GT_COMPETITION) // If in Race Mode, allow
if (G_RaceGametype()) // If in Race Mode, allow
{
// SRB2kart 120217
if (!countdown && !(netgame || multiplayer))
@ -1696,7 +1696,7 @@ void P_DoPlayerExit(player_t *player)
if (P_CheckRacers())
player->exiting = (14*TICRATE)/5 + 1;
}
else if (gametype != GT_RACE)
else if (G_BattleGametype())
player->exiting = 8*TICRATE + 1; // Battle Mode exiting
else
player->exiting = (14*TICRATE)/5 + 2; // Accidental death safeguard???
@ -5794,7 +5794,7 @@ static void P_NiGHTSMovement(player_t *player)
&& !player->exiting)
player->nightstime--;
}
else if (gametype != GT_RACE && gametype != GT_COMPETITION
else if (!G_RaceGametype()
&& !(player->mo->tracer->state >= &states[S_SUPERTRANS1] && player->mo->tracer->state <= &states[S_SUPERTRANS9])
&& !(player->capsule && player->capsule->reactiontime)
&& !player->exiting)
@ -5947,7 +5947,7 @@ static void P_NiGHTSMovement(player_t *player)
{
player->mo->momx = player->mo->momy = 0;
if (gametype != GT_RACE && gametype != GT_COMPETITION)
if (!G_RaceGametype())
P_SetObjectMomZ(player->mo, 30*FRACUNIT, false);
player->mo->tracer->angle += ANGLE_11hh;
@ -8111,7 +8111,7 @@ static void P_DeathThink(player_t *player)
}
}
if ((gametype == GT_RACE || gametype == GT_COMPETITION || (gametype == GT_COOP && (multiplayer || netgame))) && (player->lives <= 0))
if ((G_RaceGametype() || (gametype == GT_COOP && (multiplayer || netgame))) && (player->lives <= 0))
{
// Return to level music
if (netgame)
@ -9251,7 +9251,7 @@ void P_PlayerThink(player_t *player)
I_Error("player %s is in PST_REBORN\n", sizeu1(playeri));
#endif
if (gametype == GT_RACE || gametype == GT_COMPETITION)
if (G_RaceGametype())
{
INT32 i;
@ -9304,7 +9304,7 @@ void P_PlayerThink(player_t *player)
// If it is set, start subtracting
// Don't allow it to go back to 0
if (player->exiting > 1 && (player->exiting < 3*TICRATE || gametype != GT_RACE)) // SRB2kart - "&& player->exiting > 1"
if (player->exiting > 1 && (player->exiting < 3*TICRATE || !G_RaceGametype())) // SRB2kart - "&& player->exiting > 1"
player->exiting--;
if (player->exiting && countdown2)
@ -9667,7 +9667,7 @@ void P_PlayerThink(player_t *player)
|| (splitscreen > 1 && player == &players[thirddisplayplayer])
|| (splitscreen > 2 && player == &players[fourthdisplayplayer]))
&& player->kartstuff[k_bootimer] == 0 && player->kartstuff[k_growshrinktimer] <= 0
&& (player->kartstuff[k_comebacktimer] == 0 || (gametype == GT_RACE || player->kartstuff[k_balloon] > 0)))
&& (player->kartstuff[k_comebacktimer] == 0 || (G_RaceGametype() || player->kartstuff[k_balloon] > 0)))
{
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < K_GetKartFlashing() && (leveltime & 1))
player->mo->flags2 |= MF2_DONTDRAW;

View File

@ -583,7 +583,7 @@ typedef enum
sfx_kc2c,
sfx_kc2d,
sfx_kc2e,
sfx_kc2f,
sfx_kc2f, // Pogo Spring
sfx_kc30,
sfx_kc31,
sfx_kc32,
@ -593,7 +593,7 @@ typedef enum
sfx_kc36,
sfx_kc37,
sfx_kc38,
sfx_kc39,
sfx_kc39, // Voting roulette
sfx_kc3a,
sfx_kc3b,
sfx_kc3c,
@ -602,15 +602,15 @@ typedef enum
sfx_kc3f,
sfx_kc40,
sfx_kc41,
sfx_kc42,
sfx_kc42, // Unlock everything cheat
sfx_kc43,
sfx_kc44,
sfx_kc45,
sfx_kc46,
sfx_kc47,
sfx_kc48,
sfx_kc48, // Vote picked
sfx_kc49,
sfx_kc4a,
sfx_kc4a, // Voting beep
sfx_kc4b,
sfx_kc4c,
sfx_kc4d,
@ -625,8 +625,8 @@ typedef enum
sfx_kc56,
sfx_kc57,
sfx_kc58,
sfx_kc59,
sfx_kc5a,
sfx_kc59, // Shrink
sfx_kc5a, // Grow
sfx_kc5b,
sfx_kc5c,
sfx_kc5d,

View File

@ -2510,11 +2510,19 @@ static void Y_UnloadVoteData(void)
//
void Y_SetupVoteFinish(SINT8 pick, SINT8 level)
{
if (pick == -1) // No other votes? We gotta get out of here, then!
{
timer = 0;
Y_UnloadVoteData();
Y_FollowIntermission();
return;
}
if (pickedvote == -1)
{
INT32 i;
SINT8 votecompare = -1;
boolean allsame = true;
INT32 endtype = 0;
voteclient.rsynctime = 0;
@ -2523,16 +2531,26 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level)
if ((playeringame[i] && !players[i].spectator) && votes[i] == -1 && !splitscreen)
votes[i] = 3;
if (votes[i] == -1)
if (votes[i] == -1 || endtype > 1) // Don't need to go on
continue;
if (votecompare == -1)
{
votecompare = votes[i];
endtype = 1;
}
else if (votes[i] != votecompare)
allsame = false;
endtype = 2;
}
if (allsame)
if (endtype == 0) // Might as well put this here, too.
{
timer = 0;
Y_UnloadVoteData();
Y_FollowIntermission();
return;
}
else if (endtype == 1) // Only one unique vote, so just end it immediately.
{
voteendtic = votetic + (5*TICRATE);
S_StartSound(NULL, sfx_kc48);