You get 1ups for carrying rings to the goal

This commit is contained in:
Sally Coolatta 2020-06-03 16:34:23 -04:00
parent 30df376d04
commit fac8f7f538
3 changed files with 22 additions and 4 deletions

View file

@ -4642,6 +4642,8 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
if (resetplayer && !(multiplayer && demo.playback)) // SRB2Kart
{
players[i].lives = 3;
players[i].xtralife = 0;
players[i].totalring = 0;
players[i].score = 0;
}
}

View file

@ -2421,6 +2421,8 @@ static void P_LevelInitStuff(void)
if (grandprixinfo.roundnum == 0)
{
players[i].lives = 3;
players[i].xtralife = 0;
players[i].totalring = 0;
}
players[i].realtime = racecountdown = exitcountdown = 0;
@ -2429,7 +2431,7 @@ static void P_LevelInitStuff(void)
players[i].lostlife = false;
players[i].gotcontinue = false;
players[i].xtralife = players[i].deadtimer = players[i].numboxes = players[i].totalring = players[i].laps = 0;
players[i].deadtimer = players[i].numboxes = players[i].totalring = players[i].laps = 0;
players[i].health = 1;
players[i].aiming = 0;
players[i].pflags &= ~PF_TIMEOVER;

View file

@ -949,7 +949,6 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings)
return;
player->kartstuff[k_rings] += num_rings;
//player->totalring += num_rings; // Used for GP lives later
if (player->kartstuff[k_rings] > 20)
player->kartstuff[k_rings] = 20; // Caps at 20 rings, sorry!
@ -967,8 +966,8 @@ void P_GivePlayerLives(player_t *player, INT32 numlives)
{
player->lives += numlives;
if (player->lives > 99)
player->lives = 99;
if (player->lives > 9)
player->lives = 9;
else if (player->lives < 1)
player->lives = 1;
}
@ -1748,8 +1747,23 @@ void P_DoPlayerExit(player_t *player)
}
else if (!losing)
{
const UINT8 lifethreshold = 20;
UINT8 extra = 0;
// YOU WIN
grandprixinfo.wonround = true;
// Increase your total rings
player->totalring += RINGTOTAL(player);
extra = player->totalring / lifethreshold;
if (extra > player->xtralife)
{
P_GivePlayerLives(player, extra - player->xtralife);
S_StartSound(NULL, sfx_cdfm73);
player->xtralife = extra;
}
}
}