gamedata->everseenspecial

Record whether you've ever successfully entered a special stage
Used for conditions which were previously checking for whether you'd completed a special stage - which I think is a bit too restrictive for someone figuring out what next to lab
This commit is contained in:
toaster 2023-03-10 22:43:06 +00:00
parent cbebfe5a62
commit b3aa2520bc
3 changed files with 14 additions and 2 deletions

View file

@ -3926,6 +3926,13 @@ static void G_GetNextMap(void)
grandprixinfo.eventmode = GPEVENT_SPECIAL;
nextmap = cupLevelNum;
newgametype = G_GuessGametypeByTOL(mapheaderinfo[cupLevelNum]->typeoflevel);
if (gamedata->everseenspecial == false)
{
gamedata->everseenspecial = true;
M_UpdateUnlockablesAndExtraEmblems(true);
G_SaveGameData(true);
}
}
}
}
@ -4583,6 +4590,7 @@ void G_LoadGameData(void)
gamedata->everloadedaddon = (boolean)READUINT8(save.p);
gamedata->eversavedreplay = (boolean)READUINT8(save.p);
gamedata->everseenspecial = (boolean)READUINT8(save.p);
}
else
{
@ -4796,7 +4804,8 @@ void G_SaveGameData(boolean dirty)
length = (4+1+4+4+
(4*GDGT_MAX)+
4+1+1+1+1+
1+1+1+4+
1+1+1+1+
4+
(MAXEMBLEMS+(MAXUNLOCKABLES*2)+MAXCONDITIONSETS)+
4+2);
@ -4846,6 +4855,7 @@ void G_SaveGameData(boolean dirty)
WRITEUINT8(save.p, gamedata->everloadedaddon); // 1
WRITEUINT8(save.p, gamedata->eversavedreplay); // 1
WRITEUINT8(save.p, gamedata->everseenspecial); // 1
WRITEUINT32(save.p, quickncasehash(timeattackfolder, 64));

View file

@ -527,6 +527,7 @@ void M_ClearStats(void)
gamedata->everloadedaddon = false;
gamedata->eversavedreplay = false;
gamedata->everseenspecial = false;
gamedata->crashflags = 0;
}
@ -1139,7 +1140,7 @@ static const char *M_GetConditionString(condition_t *cn)
case UCRP_PREFIX_BREAKTHECAPSULES:
return "BREAK THE CAPSULES:";
case UCRP_PREFIX_SEALEDSTAR:
if (gamedata->roundsplayed[GDGT_SPECIAL] == 0)
if (!gamedata->everseenspecial)
return NULL;
return "SEALED STARS:";

View file

@ -270,6 +270,7 @@ struct gamedata_t
// SPECIFIC SPECIAL EVENTS
boolean everloadedaddon;
boolean eversavedreplay;
boolean everseenspecial;
UINT8 crashflags;
};