mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix the case where GP coop would cause no Capsules + possibly DUELs in eventmode
Also reduces some of the dead time before Break The Capsules begins by cutting out the majority of POSITION!! and hiding the one measly bulb that would otherwise appear
This commit is contained in:
parent
54a1ac9944
commit
e7f111c25a
4 changed files with 34 additions and 62 deletions
|
|
@ -810,29 +810,13 @@ void K_SpawnPlayerBattleBumpers(player_t *p)
|
|||
}
|
||||
}
|
||||
|
||||
void K_BattleInit(void)
|
||||
void K_BattleInit(boolean singleplayercontext)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if ((gametyperules & GTR_CAPSULES) && !battlecapsules && !bossinfo.boss)
|
||||
if ((gametyperules & GTR_CAPSULES) && singleplayercontext && !battlecapsules && !bossinfo.boss)
|
||||
{
|
||||
mapthing_t *mt;
|
||||
if (modeattacking != ATTACKING_CAPSULES)
|
||||
{
|
||||
UINT8 n = 0;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
continue;
|
||||
n++;
|
||||
}
|
||||
|
||||
if (n > 1)
|
||||
goto aftercapsules;
|
||||
}
|
||||
|
||||
mt = mapthings;
|
||||
mapthing_t *mt = mapthings;
|
||||
for (i = 0; i < nummapthings; i++, mt++)
|
||||
{
|
||||
if (mt->type == mobjinfo[MT_BATTLECAPSULE].doomednum)
|
||||
|
|
@ -841,7 +825,6 @@ void K_BattleInit(void)
|
|||
|
||||
battlecapsules = true;
|
||||
}
|
||||
aftercapsules:
|
||||
|
||||
if (gametyperules & GTR_BUMPERS)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,6 +29,6 @@ void K_RunPaperItemSpawners(void);
|
|||
void K_RunBattleOvertime(void);
|
||||
void K_SetupMovingCapsule(mapthing_t *mt, mobj_t *mobj);
|
||||
void K_SpawnPlayerBattleBumpers(player_t *p);
|
||||
void K_BattleInit(void);
|
||||
void K_BattleInit(boolean singleplayercontext);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3814,7 +3814,7 @@ static void K_drawKartStartCountdown(void)
|
|||
}
|
||||
else if (leveltime >= introtime && leveltime < starttime-(3*TICRATE))
|
||||
{
|
||||
if (bossinfo.boss == false)
|
||||
if (numbulbs > 1)
|
||||
K_drawKartStartBulbs();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
69
src/k_kart.c
69
src/k_kart.c
|
|
@ -97,13 +97,15 @@ void K_TimerReset(void)
|
|||
{
|
||||
starttime = introtime = 3;
|
||||
numbulbs = 1;
|
||||
inDuel = false;
|
||||
inDuel = rainbowstartavailable = false;
|
||||
}
|
||||
|
||||
void K_TimerInit(void)
|
||||
{
|
||||
UINT8 i;
|
||||
UINT8 numPlayers = 0;//, numspec = 0;
|
||||
UINT8 numPlayers = 0;
|
||||
boolean singleplayercontext = ((modeattacking != ATTACKING_NONE)
|
||||
|| (grandprixinfo.gp == true && grandprixinfo.eventmode != GPEVENT_NONE));
|
||||
|
||||
if (specialStage.active == true)
|
||||
{
|
||||
|
|
@ -111,58 +113,45 @@ void K_TimerInit(void)
|
|||
}
|
||||
else if (bossinfo.boss == false)
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (!singleplayercontext)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
continue;
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
numPlayers++;
|
||||
}
|
||||
|
||||
if (players[i].spectator == true)
|
||||
if (numPlayers < 2)
|
||||
{
|
||||
//numspec++;
|
||||
continue;
|
||||
singleplayercontext = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
numbulbs = 5;
|
||||
rainbowstartavailable = true;
|
||||
|
||||
numPlayers++;
|
||||
}
|
||||
// 1v1 activates DUEL rules!
|
||||
inDuel = (numPlayers == 2);
|
||||
|
||||
// 1v1 activates DUEL rules!
|
||||
inDuel = (numPlayers == 2);
|
||||
|
||||
if (numPlayers >= 2)
|
||||
{
|
||||
rainbowstartavailable = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
rainbowstartavailable = false;
|
||||
}
|
||||
|
||||
// No intro in Record Attack / 1v1
|
||||
// Leave unset for the value in K_TimerReset
|
||||
if (numPlayers > 2)
|
||||
{
|
||||
introtime = (108) + 5; // 108 for rotation, + 5 for white fade
|
||||
}
|
||||
|
||||
numbulbs = 5;
|
||||
|
||||
if (numPlayers > 2)
|
||||
{
|
||||
numbulbs += (numPlayers-2);
|
||||
if (!inDuel)
|
||||
{
|
||||
introtime = (108) + 5; // 108 for rotation, + 5 for white fade
|
||||
numbulbs += (numPlayers-2); // Extra POSITION!! time
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
starttime = (introtime + (3*TICRATE)) + ((2*TICRATE) + (numbulbs * bulbtime)); // Start countdown time, + buffer time
|
||||
}
|
||||
|
||||
// NOW you can try to spawn in the Battle capsules, if there's not enough players for a match
|
||||
K_BattleInit();
|
||||
|
||||
timelimitintics = extratimeintics = secretextratime = 0;
|
||||
if ((gametyperules & GTR_TIMELIMIT) && !bossinfo.boss)
|
||||
{
|
||||
if (!K_CanChangeRules())
|
||||
if (singleplayercontext)
|
||||
{
|
||||
if (grandprixinfo.gp)
|
||||
{
|
||||
|
|
@ -182,12 +171,12 @@ void K_TimerInit(void)
|
|||
}
|
||||
}
|
||||
|
||||
K_BattleInit(singleplayercontext);
|
||||
|
||||
if (inDuel == true)
|
||||
{
|
||||
K_SpawnDuelOnlyItems();
|
||||
}
|
||||
|
||||
//CONS_Printf("numbulbs set to %d (%d players, %d spectators) on tic %d\n", numbulbs, numPlayers, numspec, leveltime);
|
||||
}
|
||||
|
||||
UINT32 K_GetPlayerDontDrawFlag(player_t *player)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue