Use ceremony gamestate when warping to podium on startup

Doesn't spawn the bots for some reason still, but I need this for quicker prototyping
This commit is contained in:
Sally Coolatta 2023-03-01 21:31:59 -05:00
parent 2eba418334
commit 2d84837e5b
5 changed files with 42 additions and 23 deletions

View file

@ -346,7 +346,7 @@ static void D_Display(void)
F_RunWipe(wipedefindex, wipetypepre, gamestate != GS_MENU, "FADEMAP0", false, false);
}
if (gamestate != GS_LEVEL && rendermode != render_none)
if (G_GamestateUsesLevel() == false && rendermode != render_none)
{
V_SetPaletteLump("PLAYPAL"); // Reset the palette
R_ReInitColormaps(0, NULL, 0);
@ -381,7 +381,6 @@ static void D_Display(void)
}
/* FALLTHRU */
case GS_LEVEL:
case GS_CEREMONY:
if (!gametic)
break;
HU_Erase();
@ -400,6 +399,13 @@ static void D_Display(void)
HU_Drawer();
break;
case GS_CEREMONY:
if (!gametic)
break;
HU_Erase();
HU_Drawer();
break;
case GS_MENU:
break;
@ -464,7 +470,7 @@ static void D_Display(void)
// clean up border stuff
// see if the border needs to be initially drawn
if (G_GamestateUsesLevel() == true || (gamestate == GS_TITLESCREEN && titlemapinaction && curbghide && (!hidetitlemap)))
if (G_GamestateUsesLevel() == true)
{
if (!automapactive && !dedicated && cv_renderview.value)
{
@ -757,17 +763,6 @@ void D_SRB2Loop(void)
because I_FinishUpdate was called afterward
*/
#if 0
/* Smells like a hack... Don't fade Sonic's ass into the title screen. */
if (gamestate != GS_TITLESCREEN)
{
static lumpnum_t gstartuplumpnum = W_CheckNumForName("STARTUP");
if (gstartuplumpnum == LUMPERROR)
gstartuplumpnum = W_GetNumForName("MISSING");
V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(gstartuplumpnum, PU_PATCH));
}
#endif
for (;;)
{
// capbudget is the minimum precise_t duration of a single loop iteration

View file

@ -44,6 +44,7 @@
// SRB2Kart
#include "k_menu.h"
#include "k_grandprix.h"
// Stage of animation:
// 0 = text, 1 = art screen
@ -3144,11 +3145,18 @@ boolean F_StartCeremony(void)
INT32 podiumMapNum = nummapheaders;
INT32 i;
if (grandprixinfo.gp == false)
{
return false;
}
if (podiummap
&& ((podiumMapNum = G_MapNumber(podiummap)) < nummapheaders)
&& mapheaderinfo[podiumMapNum]
&& mapheaderinfo[podiumMapNum]->lumpnum != LUMPERROR)
{
P_SetTarget(&titlemapcam.mobj, NULL);
gamemap = podiumMapNum+1;
maptol = mapheaderinfo[gamemap-1]->typeoflevel;

View file

@ -1454,7 +1454,7 @@ void G_DoLoadLevelEx(boolean resetplayer, gamestate_t newstate)
levelstarttic = gametic; // for time calculation
if (wipegamestate == GS_LEVEL)
if (wipegamestate == newstate)
wipegamestate = -1; // force a wipe
if (cv_currprofile.value == -1 && !demo.playback)
@ -1715,6 +1715,16 @@ boolean G_Responder(event_t *ev)
return true;
}
}
else if (gamestate == GS_CEREMONY)
{
if (HU_Responder(ev))
{
hu_keystrokes = true;
return true; // chat ate the event
}
// todo
}
else if (gamestate == GS_CONTINUING)
{
return true;
@ -1725,11 +1735,13 @@ boolean G_Responder(event_t *ev)
return true;
}
else if (gamestate == GS_INTERMISSION || gamestate == GS_VOTING || gamestate == GS_EVALUATION)
{
if (HU_Responder(ev))
{
hu_keystrokes = true;
return true; // chat ate the event
}
}
if (gamestate == GS_LEVEL && ev->type == ev_keydown && multiplayer && demo.playback && !demo.freecam)
{
@ -5059,6 +5071,16 @@ void G_InitNew(UINT8 pencoremode, INT32 map, boolean resetplayer, boolean skippr
return;
}
if (map == G_MapNumber(podiummap)+1)
{
// Didn't want to do this, but it needs to be here
// for it to work on startup.
if (F_StartCeremony() == true)
{
return;
}
}
gamemap = map;
maptol = mapheaderinfo[gamemap-1]->typeoflevel;

View file

@ -1624,12 +1624,6 @@ void K_UpdateBotGameplayVars(player_t *player)
return;
}
if (K_PodiumSequence() == true)
{
// We don't want these during podium.
return;
}
botController = K_FindBotController(player->mo);
player->botvars.controller = botController ? (botController - lines) : UINT16_MAX;

View file

@ -78,7 +78,7 @@ void Command_Numthinkers_f(void)
thinklistnum_t end = NUM_THINKERLISTS - 1;
thinklistnum_t i;
if (gamestate != GS_LEVEL)
if (G_GamestateUsesLevel() == false)
{
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
return;
@ -149,7 +149,7 @@ void Command_CountMobjs_f(void)
mobjtype_t i;
INT32 count;
if (gamestate != GS_LEVEL)
if (G_GamestateUsesLevel() == false)
{
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
return;