shorten RA intro & allow to restart with pause

This commit is contained in:
Latapostrophe 2019-09-01 23:04:07 +02:00
parent eb8cb12b8f
commit eb8cef41e4
6 changed files with 32 additions and 11 deletions

View File

@ -2688,11 +2688,17 @@ static void Command_Pause(void)
if (cv_pause.value || server || (IsPlayerAdmin(consoleplayer)))
{
if (!paused && (modeattacking || !(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS)))
if (!paused && (!(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS)))
{
CONS_Printf(M_GetText("You can't pause here.\n"));
return;
}
else if (modeattacking) // in time attack, pausing restarts the map
{
M_ModeAttackRetry(0); // directly call from m_menu;
return;
}
SendNetXCmd(XD_PAUSE, &buf, 2);
}
else

View File

@ -2320,6 +2320,12 @@ void G_Ticker(boolean run)
UINT32 i;
INT32 buf;
ticcmd_t *cmd;
UINT32 ra_timeskip = (modeattacking && !demo.playback && leveltime < starttime - TICRATE*4) ? 0 : (starttime - TICRATE*4 - 1);
// starttime - TICRATE*4 is where we want RA to start when we PLAY IT, so we will loop the main thinker on RA start to get it to this point,
// the reason this is done is to ensure that ghosts won't look out of synch with other map elements (objects, moving platforms...)
// when we REPLAY, don't skip, let the camera spin, do its thing etc~
// also the -1 is to ensure that the thinker runs in the loop below.
P_MapStart();
// do player reborns if needed
@ -2392,12 +2398,16 @@ void G_Ticker(boolean run)
switch (gamestate)
{
case GS_LEVEL:
if (demo.title)
F_TitleDemoTicker();
P_Ticker(run); // tic the game
ST_Ticker();
AM_Ticker();
HU_Ticker();
for (; ra_timeskip < starttime - TICRATE*4; ra_timeskip++) // this looks weird but this is done to not break compability with older demos for now.
{
if (demo.title)
F_TitleDemoTicker();
P_Ticker(run); // tic the game
ST_Ticker();
AM_Ticker();
HU_Ticker();
}
break;
case GS_INTERMISSION:

View File

@ -231,7 +231,6 @@ static void M_HandleStaffReplay(INT32 choice);
static void M_ReplayTimeAttack(INT32 choice);
static void M_ChooseTimeAttack(INT32 choice);
//static void M_ChooseNightsAttack(INT32 choice);
static void M_ModeAttackRetry(INT32 choice);
static void M_ModeAttackEndGame(INT32 choice);
static void M_SetGuestReplay(INT32 choice);
//static void M_ChoosePlayer(INT32 choice);
@ -8085,7 +8084,7 @@ static void M_SetGuestReplay(INT32 choice)
which(0);
}
static void M_ModeAttackRetry(INT32 choice)
void M_ModeAttackRetry(INT32 choice)
{
(void)choice;
G_CheckDemoStatus(); // Cancel recording

View File

@ -54,6 +54,9 @@ void M_SortServerList(void);
// Draws a box with a texture inside as background for messages
void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines);
// Used in d_netcmd to restart time attack
void M_ModeAttackRetry(INT32 choice);
// the function to show a message box typing with the string inside
// string must be static (not in the stack)
// routine is a function taking a INT32 in parameter

View File

@ -689,7 +689,10 @@ void P_Ticker(boolean run)
if (run)
leveltime++;
timeinmap++;
// as this is mostly used for HUD stuff, add the record attack specific hack to it as well!
if (!(modeattacking && !demo.playback) || leveltime >= starttime - TICRATE*4)
timeinmap++;
/*if (G_TagGametype())
P_DoTagStuff();

View File

@ -7426,7 +7426,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
const INT32 timeovercam = max(0, min(180, (player->kartstuff[k_timeovercam] - 2*TICRATE)*15));
camrotate += timeovercam;
}
else if (leveltime < introtime) // Whoooshy camera!
else if (leveltime < introtime && !(modeattacking && !demo.playback)) // Whoooshy camera! (don't do this in RA when we PLAY, still do it in replays however~)
{
const INT32 introcam = (introtime - leveltime);
camrotate += introcam*5;