mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
First pass at the "Game Truly Starting" apparatus
- Unlock Ring Cup to get the real Title Screen, demos and all. - Allows M_InterruptMenuWithChallenges.
This commit is contained in:
parent
a578f9b37c
commit
fcb696d1ad
5 changed files with 87 additions and 37 deletions
|
|
@ -3539,6 +3539,14 @@ void readmaincfg(MYFILE *f, boolean mainfile)
|
|||
Z_Free(tutorialchallengemap);
|
||||
tutorialchallengemap = Z_StrDup(word2);
|
||||
}
|
||||
else if (fastcmp(word, "GAMESTARTCHALLENGE"))
|
||||
{
|
||||
INT32 val = get_number(word2) - 1;
|
||||
if (val < 0 || val >= MAXUNLOCKABLES)
|
||||
gamestartchallenge = MAXUNLOCKABLES;
|
||||
else
|
||||
gamestartchallenge = (UINT16)val;
|
||||
}
|
||||
else if (fastcmp(word, "HIDETITLEPICS") || fastcmp(word, "TITLEPICSHIDE"))
|
||||
{
|
||||
hidetitlepics = (boolean)(value != 0 || word2[0] == 'T' || word2[0] == 'Y');
|
||||
|
|
|
|||
|
|
@ -1470,6 +1470,8 @@ static void F_CacheTitleScreen(void)
|
|||
}
|
||||
}
|
||||
|
||||
static boolean cache_gametrulystarted = false;
|
||||
|
||||
void F_StartTitleScreen(void)
|
||||
{
|
||||
INT32 titleMapNum;
|
||||
|
|
@ -1486,7 +1488,10 @@ void F_StartTitleScreen(void)
|
|||
else
|
||||
wipegamestate = GS_TITLESCREEN;
|
||||
|
||||
if (titlemap
|
||||
cache_gametrulystarted = M_GameTrulyStarted();
|
||||
|
||||
if (cache_gametrulystarted == true
|
||||
&& titlemap
|
||||
&& ((titleMapNum = G_MapNumber(titlemap)) < nummapheaders)
|
||||
&& mapheaderinfo[titleMapNum]
|
||||
&& mapheaderinfo[titleMapNum]->lumpnum != LUMPERROR)
|
||||
|
|
@ -1598,16 +1603,19 @@ void F_TitleScreenDrawer(void)
|
|||
{
|
||||
boolean hidepics = false;
|
||||
|
||||
#if 0
|
||||
if (modeattacking)
|
||||
return; // We likely came here from retrying. Don't do a damn thing.
|
||||
#endif
|
||||
|
||||
// Draw that sky!
|
||||
if (curbgcolor >= 0)
|
||||
if (cache_gametrulystarted == false)
|
||||
{
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
}
|
||||
else if (curbgcolor >= 0)
|
||||
{
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
||||
}
|
||||
else if (!curbghide || !titlemapinaction || gamestate == GS_WAITINGPLAYERS)
|
||||
{
|
||||
F_SkyScroll(curbgxspeed, curbgyspeed, curbgname);
|
||||
}
|
||||
|
||||
// Don't draw outside of the title screen, or if the patch isn't there.
|
||||
if (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS)
|
||||
|
|
@ -1629,35 +1637,42 @@ void F_TitleScreenDrawer(void)
|
|||
|
||||
case TTMODE_RINGRACERS:
|
||||
{
|
||||
const char *eggName = "eggman";
|
||||
INT32 eggSkin = R_SkinAvailable(eggName);
|
||||
skincolornum_t eggColor = SKINCOLOR_RED;
|
||||
UINT8 *eggColormap = NULL;
|
||||
|
||||
const char *tailsName = "tails";
|
||||
INT32 tailsSkin = R_SkinAvailable(tailsName);
|
||||
skincolornum_t tailsColor = SKINCOLOR_ORANGE;
|
||||
UINT8 *tailsColormap = NULL;
|
||||
|
||||
if (eggSkin != -1)
|
||||
if (cache_gametrulystarted == true)
|
||||
{
|
||||
eggColor = skins[eggSkin].prefcolor;
|
||||
}
|
||||
eggColormap = R_GetTranslationColormap(TC_DEFAULT, eggColor, GTC_MENUCACHE);
|
||||
const char *eggName = "eggman";
|
||||
INT32 eggSkin = R_SkinAvailable(eggName);
|
||||
skincolornum_t eggColor = SKINCOLOR_RED;
|
||||
UINT8 *eggColormap = NULL;
|
||||
|
||||
if (tailsSkin != -1)
|
||||
const char *tailsName = "tails";
|
||||
INT32 tailsSkin = R_SkinAvailable(tailsName);
|
||||
skincolornum_t tailsColor = SKINCOLOR_ORANGE;
|
||||
UINT8 *tailsColormap = NULL;
|
||||
|
||||
if (eggSkin != -1)
|
||||
{
|
||||
eggColor = skins[eggSkin].prefcolor;
|
||||
}
|
||||
eggColormap = R_GetTranslationColormap(TC_DEFAULT, eggColor, GTC_MENUCACHE);
|
||||
|
||||
if (tailsSkin != -1)
|
||||
{
|
||||
tailsColor = skins[tailsSkin].prefcolor;
|
||||
}
|
||||
tailsColormap = R_GetTranslationColormap(TC_DEFAULT, tailsColor, GTC_MENUCACHE);
|
||||
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_tails_tails, tailsColormap);
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, V_ADD, kts_electricity[finalecount % 6], NULL);
|
||||
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_eggman, eggColormap);
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_tails, tailsColormap);
|
||||
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_bumper, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
tailsColor = skins[tailsSkin].prefcolor;
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, (BASEVIDHEIGHT/2) - 4, 0, "Press any button/key to continue");
|
||||
}
|
||||
tailsColormap = R_GetTranslationColormap(TC_DEFAULT, tailsColor, GTC_MENUCACHE);
|
||||
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_tails_tails, tailsColormap);
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, V_ADD, kts_electricity[finalecount % 6], NULL);
|
||||
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_eggman, eggColormap);
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_tails, tailsColormap);
|
||||
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_bumper, NULL);
|
||||
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_copyright, NULL);
|
||||
break;
|
||||
|
|
@ -1796,7 +1811,7 @@ void F_TitleScreenTicker(boolean run)
|
|||
}
|
||||
|
||||
// no demos to play? or, are they disabled?
|
||||
if (!cv_rollingdemos.value)
|
||||
if (!cv_rollingdemos.value || cache_gametrulystarted == false)
|
||||
return;
|
||||
|
||||
#if defined (TESTERS)
|
||||
|
|
|
|||
24
src/m_cond.c
24
src/m_cond.c
|
|
@ -48,6 +48,9 @@ unlockable_t unlockables[MAXUNLOCKABLES];
|
|||
// Number of emblems
|
||||
INT32 numemblems = 0;
|
||||
|
||||
// The challenge that will truly let the games begin.
|
||||
UINT16 gamestartchallenge = 600; // 601
|
||||
|
||||
// Create a new gamedata_t, for start-up
|
||||
void M_NewGameDataStruct(void)
|
||||
{
|
||||
|
|
@ -3200,6 +3203,27 @@ UINT16 M_CompletionEmblems(void) // Bah! Duplication sucks, but it's for a separ
|
|||
// Quick unlock checks
|
||||
// -------------------
|
||||
|
||||
boolean M_GameTrulyStarted(void)
|
||||
{
|
||||
// Fail safe
|
||||
if (gamedata == NULL)
|
||||
return false;
|
||||
|
||||
// Not set
|
||||
if (gamestartchallenge >= MAXUNLOCKABLES)
|
||||
return true;
|
||||
|
||||
// An unfortunate sidestep, but sync is important.
|
||||
if (netgame)
|
||||
return true;
|
||||
|
||||
// Okay, we can check to see if this challenge has been achieved.
|
||||
return (
|
||||
gamedata->unlockpending[gamestartchallenge]
|
||||
|| gamedata->unlocked[gamestartchallenge]
|
||||
);
|
||||
}
|
||||
|
||||
boolean M_CheckNetUnlockByID(UINT16 unlockid)
|
||||
{
|
||||
if (unlockid >= MAXUNLOCKABLES
|
||||
|
|
|
|||
|
|
@ -435,9 +435,12 @@ void M_UpdateNextPrisonEggPickup(void);
|
|||
UINT16 M_CheckLevelEmblems(void);
|
||||
UINT16 M_CompletionEmblems(void);
|
||||
|
||||
extern UINT16 gamestartchallenge;
|
||||
|
||||
// Checking unlockable status
|
||||
boolean M_CheckNetUnlockByID(UINT16 unlockid);
|
||||
boolean M_SecretUnlocked(INT32 type, boolean local);
|
||||
boolean M_GameTrulyStarted(void);
|
||||
boolean M_CupLocked(cupheader_t *cup);
|
||||
boolean M_CupSecondRowLocked(void);
|
||||
boolean M_MapLocked(UINT16 mapnum);
|
||||
|
|
|
|||
|
|
@ -291,7 +291,8 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
|||
{
|
||||
UINT16 newunlock;
|
||||
|
||||
if (Playing())
|
||||
if (Playing() == true
|
||||
|| M_GameTrulyStarted() == false)
|
||||
return desiredmenu;
|
||||
|
||||
M_UpdateUnlockablesAndExtraEmblems(false, true);
|
||||
|
|
@ -376,9 +377,8 @@ boolean M_CanKeyHiliTile(void)
|
|||
|
||||
UINT16 i = (challengesmenu.hilix * CHALLENGEGRIDHEIGHT) + challengesmenu.hiliy;
|
||||
|
||||
// Not a hinted tile OR a fresh board.
|
||||
if (!(challengesmenu.extradata[i].flags & CHE_HINT)
|
||||
&& (challengesmenu.unlockcount[CMC_UNLOCKED] > 0))
|
||||
// Not a hinted tile.
|
||||
if (!(challengesmenu.extradata[i].flags & CHE_HINT))
|
||||
return false;
|
||||
|
||||
// Marked as major?
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue