mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-10 16:52:16 +00:00
M_GetNextAchievedUnlock: Skip over adding Chao Keys if you've already unlocked everything
I considered restricting it even further to "unlock every minor unlock that can be unlocked by a Chao Key", but decided that if you haven't "completed the game" yet, you should still be periodically reminded of it.
This commit is contained in:
parent
da1e865e8b
commit
bf5aa4b5d8
3 changed files with 21 additions and 6 deletions
21
src/m_cond.c
21
src/m_cond.c
|
|
@ -1780,32 +1780,47 @@ boolean M_UpdateUnlockablesAndExtraEmblems(boolean loud, boolean doall)
|
|||
return false;
|
||||
}
|
||||
|
||||
UINT16 M_GetNextAchievedUnlock(void)
|
||||
UINT16 M_GetNextAchievedUnlock(boolean canskipchaokeys)
|
||||
{
|
||||
UINT16 i;
|
||||
|
||||
// Go through unlockables
|
||||
for (i = 0; i < MAXUNLOCKABLES; ++i)
|
||||
{
|
||||
if (gamedata->unlocked[i] || !unlockables[i].conditionset)
|
||||
if (!unlockables[i].conditionset)
|
||||
{
|
||||
// Not worthy of consideration
|
||||
continue;
|
||||
}
|
||||
|
||||
if (gamedata->unlocked[i] == true)
|
||||
{
|
||||
// Already unlocked, no need to engage
|
||||
continue;
|
||||
}
|
||||
|
||||
if (gamedata->unlockpending[i] == false)
|
||||
{
|
||||
// Not unlocked AND not pending, which means chao keys can be used on something
|
||||
canskipchaokeys = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
if (gamedata->keyspending != 0)
|
||||
if (canskipchaokeys == true)
|
||||
{
|
||||
// Okay, we're skipping chao keys - let's just insta-digest them.
|
||||
gamedata->chaokeys += gamedata->keyspending;
|
||||
gamedata->pendingkeyroundoffset =
|
||||
(gamedata->pendingkeyroundoffset + gamedata->pendingkeyrounds)
|
||||
% GDCONVERT_ROUNDSTOKEY;
|
||||
|
||||
gamedata->keyspending = 0;
|
||||
gamedata->pendingkeyrounds = 0;
|
||||
}
|
||||
else if (gamedata->keyspending != 0)
|
||||
{
|
||||
return PENDING_CHAOKEYS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ boolean M_CheckCondition(condition_t *cn, player_t *player);
|
|||
boolean M_UpdateUnlockablesAndExtraEmblems(boolean loud, boolean doall);
|
||||
|
||||
#define PENDING_CHAOKEYS (UINT16_MAX-1)
|
||||
UINT16 M_GetNextAchievedUnlock(void);
|
||||
UINT16 M_GetNextAchievedUnlock(boolean canskipchaokeys);
|
||||
|
||||
UINT16 M_CheckLevelEmblems(void);
|
||||
UINT16 M_CompletionEmblems(void);
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
|||
|
||||
M_UpdateUnlockablesAndExtraEmblems(false, true);
|
||||
|
||||
newunlock = M_GetNextAchievedUnlock();
|
||||
newunlock = M_GetNextAchievedUnlock(true);
|
||||
|
||||
if ((challengesmenu.pending = (newunlock != MAXUNLOCKABLES)))
|
||||
{
|
||||
|
|
@ -457,7 +457,7 @@ void M_ChallengesTick(void)
|
|||
{
|
||||
// The menu apparatus is requesting a new unlock.
|
||||
challengesmenu.requestnew = false;
|
||||
if ((newunlock = M_GetNextAchievedUnlock()) != MAXUNLOCKABLES)
|
||||
if ((newunlock = M_GetNextAchievedUnlock(false)) != MAXUNLOCKABLES)
|
||||
{
|
||||
// We got one!
|
||||
M_ChallengesAutoFocus(newunlock, false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue