diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 95e74469..f3df4f10 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3272,7 +3272,7 @@ void SV_StartSinglePlayerServer(void) server = true; netgame = false; multiplayer = false; - gametype = GT_COOP; + gametype = GT_RACE; //srb2kart // no more tic the game with this settings! SV_StopServer(); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 8093758d..b72a37d4 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -704,6 +704,7 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_ghost_bestrings); CV_RegisterVar(&cv_ghost_last); CV_RegisterVar(&cv_ghost_guest); + CV_RegisterVar(&cv_ghost_staff); COM_AddCommand("displayplayer", Command_Displayplayer_f); COM_AddCommand("tunes", Command_Tunes_f); @@ -1868,6 +1869,8 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) // a copy of color if (players[0].mo) players[0].mo->color = players[0].skincolor; + + CV_StealthSetValue(&cv_kartcc, 150); // srb2kart } if (metalrecording) G_BeginMetal(); diff --git a/src/g_game.c b/src/g_game.c index da3c91cf..57b9b84b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -645,7 +645,7 @@ void G_SetNightsRecords(void) // Save demo! bestdemo[255] = '\0'; lastdemo[255] = '\0'; - G_SetDemoTime(totaltime, totalscore, 0); + G_SetDemoTime(totaltime, totalscore); G_CheckDemoStatus(); I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755); @@ -2932,7 +2932,7 @@ static void G_DoCompleted(void) // a map of the proper gametype -- skip levels that don't support // the current gametype. (Helps avoid playing boss levels in Race, // for instance). - if (!token && !G_IsSpecialStage(gamemap) + if (!token && !G_IsSpecialStage(gamemap) && !modeattacking && (nextmap >= 0 && nextmap < NUMMAPS)) { register INT16 cm = nextmap; @@ -3809,11 +3809,11 @@ char *G_BuildMapTitle(INT32 mapnum) // DEMO RECORDING // -#define DEMOVERSION 0x0009 -#define DEMOHEADER "\xF0" "SRB2Replay" "\x0F" +#define DEMOVERSION 0x0001 +#define DEMOHEADER "\xF0" "KartReplay" "\x0F" #define DF_GHOST 0x01 // This demo contains ghost data too! -#define DF_RECORDATTACK 0x02 // This demo is from record attack and contains its final completion time, score, and rings! +#define DF_RECORDATTACK 0x02 // This demo is from record attack and contains its final completion time! #define DF_NIGHTSATTACK 0x04 // This demo is from NiGHTS attack and contains its time left, score, and mares! #define DF_ATTACKMASK 0x06 // This demo is from ??? attack and contains ??? #define DF_ATTACKSHIFT 1 @@ -4779,8 +4779,6 @@ void G_BeginRecording(void) case ATTACKING_RECORD: // 1 demotime_p = demo_p; WRITEUINT32(demo_p,UINT32_MAX); // time - WRITEUINT32(demo_p,0); // score - WRITEUINT16(demo_p,0); // rings break; case ATTACKING_NIGHTS: // 2 demotime_p = demo_p; @@ -4824,8 +4822,8 @@ void G_BeginRecording(void) WRITEUINT8(demo_p,player->mindash>>FRACBITS); WRITEUINT8(demo_p,player->maxdash>>FRACBITS); // SRB2kart - WRITEUINT8(demo_p,player->kartspeed>>FRACBITS); - WRITEUINT8(demo_p,player->kartweight>>FRACBITS); + WRITEUINT8(demo_p,player->kartspeed); + WRITEUINT8(demo_p,player->kartweight); // WRITEUINT8(demo_p,player->normalspeed>>FRACBITS); WRITEUINT8(demo_p,player->runspeed>>FRACBITS); @@ -4887,15 +4885,13 @@ void G_BeginMetal(void) oldmetal.angle = mo->angle; } -void G_SetDemoTime(UINT32 ptime, UINT32 pscore, UINT16 prings) +void G_SetDemoTime(UINT32 ptime, UINT32 pscore) { if (!demorecording || !demotime_p) return; if (demoflags & DF_RECORDATTACK) { WRITEUINT32(demotime_p, ptime); - WRITEUINT32(demotime_p, pscore); - WRITEUINT16(demotime_p, prings); demotime_p = NULL; } else if (demoflags & DF_NIGHTSATTACK) @@ -4915,7 +4911,7 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname) UINT8 *buffer,*p; UINT8 flags; UINT32 oldtime, newtime, oldscore, newscore; - UINT16 oldrings, newrings, oldversion; + UINT16 oldversion; size_t bufsize ATTRUNUSED; UINT8 c; UINT16 s ATTRUNUSED; @@ -4948,14 +4944,12 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname) if (flags & DF_RECORDATTACK) { newtime = READUINT32(p); - newscore = READUINT32(p); - newrings = READUINT16(p); + newscore = 0; } else if (flags & DF_NIGHTSATTACK) { newtime = READUINT32(p); newscore = READUINT32(p); - newrings = 0; } else // appease compiler return 0; @@ -4984,8 +4978,6 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname) switch(oldversion) // demoversion { case DEMOVERSION: // latest always supported - // compatibility available? - case 0x0008: break; // too old, cannot support. default: @@ -5000,10 +4992,7 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname) Z_Free(buffer); return UINT8_MAX; } p += 4; // "PLAY" - if (oldversion <= 0x0008) - p++; // gamemap - else - p += 2; // gamemap + p += 2; // gamemap p += 16; // mapmd5 flags = READUINT8(p); if (!(flags & aflags)) @@ -5015,14 +5004,12 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname) if (flags & DF_RECORDATTACK) { oldtime = READUINT32(p); - oldscore = READUINT32(p); - oldrings = READUINT16(p); + oldscore = 0; } else if (flags & DF_NIGHTSATTACK) { oldtime = READUINT32(p); oldscore = READUINT32(p); - oldrings = 0; } else // appease compiler return UINT8_MAX; @@ -5031,14 +5018,11 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname) c = 0; if (newtime < oldtime - || (newtime == oldtime && (newscore > oldscore || newrings > oldrings))) + || (newtime == oldtime && (newscore > oldscore))) c |= 1; // Better time if (newscore > oldscore || (newscore == oldscore && newtime < oldtime)) c |= 1<<1; // Better score - if (newrings > oldrings - || (newrings == oldrings && newtime < oldtime)) - c |= 1<<2; // Better rings return c; } @@ -5060,9 +5044,9 @@ void G_DoPlayDemo(char *defdemoname) UINT8 i; lumpnum_t l; char skin[17],color[17],*n,*pdemoname; - UINT8 version,subversion,charability,charability2,thrustfactor,accelstart,acceleration; + UINT8 version,subversion,charability,charability2,kartspeed,kartweight,thrustfactor,accelstart,acceleration; UINT32 randseed; - fixed_t actionspd,mindash,maxdash,kartspeed,kartweight,normalspeed,runspeed,jumpfactor; + fixed_t actionspd,mindash,maxdash,normalspeed,runspeed,jumpfactor; char msg[1024]; skin[16] = '\0'; @@ -5124,8 +5108,6 @@ void G_DoPlayDemo(char *defdemoname) switch(demoversion) { case DEMOVERSION: // latest always supported - // compatibility available? - case 0x0008: break; // too old, cannot support. default: @@ -5151,10 +5133,7 @@ void G_DoPlayDemo(char *defdemoname) return; } demo_p += 4; // "PLAY" - if (demoversion <= 0x0008) - gamemap = READUINT8(demo_p); - else - gamemap = READINT16(demo_p); + gamemap = READINT16(demo_p); demo_p += 16; // mapmd5 demoflags = READUINT8(demo_p); @@ -5163,7 +5142,6 @@ void G_DoPlayDemo(char *defdemoname) hu_demoscore = 0; hu_demotime = UINT32_MAX; - hu_demorings = 0; switch (modeattacking) { @@ -5171,8 +5149,6 @@ void G_DoPlayDemo(char *defdemoname) break; case ATTACKING_RECORD: // 1 hu_demotime = READUINT32(demo_p); - hu_demoscore = READUINT32(demo_p); - hu_demorings = READUINT16(demo_p); break; case ATTACKING_NIGHTS: // 2 hu_demotime = READUINT32(demo_p); @@ -5204,8 +5180,8 @@ void G_DoPlayDemo(char *defdemoname) mindash = (fixed_t)READUINT8(demo_p)<laps+1, cv_numlaps.value)); // Draw the numerical position - K_DrawKartPositionNum(stplyr->kartstuff[k_position]); + if (!modeattacking) + K_DrawKartPositionNum(stplyr->kartstuff[k_position]); // Draw the speedometer // TODO: Make a better speedometer. diff --git a/src/m_cond.c b/src/m_cond.c index 2ec30f42..c67930d9 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -574,8 +574,8 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] = unlockable_t unlockables[MAXUNLOCKABLES] = { // Name, Objective, Menu Height, ConditionSet, Unlock Type, Variable, NoCecho, NoChecklist - /* 01 */ {"Record Attack", "Complete Greenflower Zone, Act 1", 0, 1, SECRET_RECORDATTACK, 0, true, true, 0}, - /* 02 */ {"NiGHTS Mode", "Complete Floral Field", 0, 2, SECRET_NIGHTSMODE, 0, true, true, 0}, + /* 01 */ {"Record Attack", "Complete Greenflower Zone, Act 1", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0}, + /* 02 */ {"NiGHTS Mode", "Complete Floral Field", 0, -1, SECRET_NIGHTSMODE, 0, true, true, 0}, /* 03 */ {"Play Credits", "Complete 1P Mode", 30, 10, SECRET_CREDITS, 0, true, true, 0}, /* 04 */ {"Sound Test", "Complete 1P Mode", 40, 10, SECRET_SOUNDTEST, 0, false, false, 0}, diff --git a/src/m_menu.c b/src/m_menu.c index 73138e80..2aefc2d8 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -111,10 +111,10 @@ const char *quitmsg[NUM_QUITMESSAGES]; // Stuff for customizing the player select screen Tails 09-22-2003 description_t description[32] = { - {"\x82Sonic\x80 is the fastest of the three, but also the hardest to control. Beginners beware, but experts will find Sonic very powerful.\n\n\x82""Ability:\x80 Speed Thok\nDouble jump to zoom forward with a huge burst of speed.\n\n\x82Tip:\x80 Simply letting go of forward does not slow down in SRB2. To slow down, hold the opposite direction.", "", "sonic"}, - {"\x82Tails\x80 is the most mobile of the three, but has the slowest speed. Because of his mobility, he's well-\nsuited to beginners.\n\n\x82""Ability:\x80 Fly\nDouble jump to start flying for a limited time. Repetitively hit the jump button to ascend.\n\n\x82Tip:\x80 To quickly descend while flying, hit the spin button.", "", "tails"}, - {"\x82Knuckles\x80 is well-\nrounded and can destroy breakable walls simply by touching them, but he can't jump as high as the other two.\n\n\x82""Ability:\x80 Glide & Climb\nDouble jump to glide in the air as long as jump is held. Glide into a wall to climb it.\n\n\x82Tip:\x80 Press spin while climbing to jump off the wall; press jump instead to jump off\nand face away from\nthe wall.", "", "knuckles"}, - {"\x82Sonic & Tails\x80 team up to take on Dr. Eggman!\nControl Sonic while Tails desperately struggles to keep up.\n\nPlayer 2 can control Tails directly by setting the controls in the options menu.\nTails's directional controls are relative to Player 1's camera.\n\nTails can pick up Sonic while flying and carry him around.", "CHRS&T", "sonic&tails"}, + {"\x82Sonic\x80\n\x82Speed:\x80 6\n\x82Weight:\x80 4", "", "sonic"}, + {"???", "", ""}, + {"???", "", ""}, + {"???", "", ""}, {"???", "", ""}, {"???", "", ""}, {"???", "", ""}, @@ -415,6 +415,7 @@ consvar_t cv_ghost_besttime = {"ghost_besttime", "Show", CV_SAVE, ghost_cons_t consvar_t cv_ghost_bestrings = {"ghost_bestrings", "Show", CV_SAVE, ghost_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_ghost_last = {"ghost_last", "Show", CV_SAVE, ghost_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_ghost_guest = {"ghost_guest", "Show", CV_SAVE, ghost2_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_ghost_staff = {"ghost_staff", "Show", CV_SAVE, ghost2_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; //Console variables used solely in the menu system. //todo: add a way to use non-console variables in the menu @@ -723,9 +724,7 @@ enum static menuitem_t SP_ReplayMenu[] = { - {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Score", M_ReplayTimeAttack, 0}, - {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Time", M_ReplayTimeAttack, 8}, - {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Rings", M_ReplayTimeAttack,16}, + {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Time", M_ReplayTimeAttack, 16}, {IT_WHITESTRING|IT_CALL, NULL, "Replay Last", M_ReplayTimeAttack,29}, {IT_WHITESTRING|IT_CALL, NULL, "Replay Guest", M_ReplayTimeAttack,37}, @@ -769,23 +768,23 @@ static menuitem_t SP_NightsGuestReplayMenu[] = static menuitem_t SP_GhostMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Best Score", &cv_ghost_bestscore, 0}, - {IT_STRING|IT_CVAR, NULL, "Best Time", &cv_ghost_besttime, 8}, - {IT_STRING|IT_CVAR, NULL, "Best Rings", &cv_ghost_bestrings,16}, - {IT_STRING|IT_CVAR, NULL, "Last", &cv_ghost_last, 24}, + {IT_STRING|IT_CVAR, NULL, "Best Time", &cv_ghost_besttime, 8}, + {IT_STRING|IT_CVAR, NULL, "Last", &cv_ghost_last, 16}, - {IT_STRING|IT_CVAR, NULL, "Guest", &cv_ghost_guest, 37}, + {IT_STRING|IT_CVAR, NULL, "Guest", &cv_ghost_guest, 29}, + {IT_STRING|IT_CVAR, NULL, "Staff Attack",&cv_ghost_staff, 37}, {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 50} }; static menuitem_t SP_NightsGhostMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Best Score", &cv_ghost_bestscore, 8}, - {IT_STRING|IT_CVAR, NULL, "Best Time", &cv_ghost_besttime, 16}, - {IT_STRING|IT_CVAR, NULL, "Last", &cv_ghost_last, 24}, + {IT_STRING|IT_CVAR, NULL, "Best Score", &cv_ghost_bestscore, 0}, + {IT_STRING|IT_CVAR, NULL, "Best Time", &cv_ghost_besttime, 8}, + {IT_STRING|IT_CVAR, NULL, "Last", &cv_ghost_last, 16}, - {IT_STRING|IT_CVAR, NULL, "Guest", &cv_ghost_guest, 37}, + {IT_STRING|IT_CVAR, NULL, "Guest", &cv_ghost_guest, 29}, + {IT_STRING|IT_CVAR, NULL, "Staff Attack",&cv_ghost_staff, 37}, {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_NightsAttackDef, 50} }; @@ -830,9 +829,9 @@ static menuitem_t SP_LevelStatsMenu[] = menuitem_t PlayerMenu[32] = { {IT_CALL, NULL, NULL, M_ChoosePlayer, 0}, - {IT_CALL, NULL, NULL, M_ChoosePlayer, 0}, - {IT_CALL, NULL, NULL, M_ChoosePlayer, 0}, - {IT_CALL, NULL, NULL, M_ChoosePlayer, 0}, + {IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0}, + {IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0}, + {IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0}, {IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0}, {IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0}, {IT_DISABLED, NULL, NULL, M_ChoosePlayer, 0}, @@ -1829,7 +1828,7 @@ static void Nextmap_OnChange(void) // Check if file exists, if not, disable REPLAY option sprintf(tabase,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s",srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string); - for (i = 0; i < 5; i++) { + for (i = 0; i < 3; i++) { SP_ReplayMenu[i].status = IT_DISABLED; SP_GuestReplayMenu[i].status = IT_DISABLED; } @@ -1838,26 +1837,16 @@ static void Nextmap_OnChange(void) SP_GuestReplayMenu[0].status = IT_WHITESTRING|IT_CALL; active = true; } - if (FIL_FileExists(va("%s-score-best.lmp", tabase))) { + if (FIL_FileExists(va("%s-last.lmp", tabase))) { SP_ReplayMenu[1].status = IT_WHITESTRING|IT_CALL; SP_GuestReplayMenu[1].status = IT_WHITESTRING|IT_CALL; active = true; } - if (FIL_FileExists(va("%s-rings-best.lmp", tabase))) { + if (FIL_FileExists(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value)))) { SP_ReplayMenu[2].status = IT_WHITESTRING|IT_CALL; SP_GuestReplayMenu[2].status = IT_WHITESTRING|IT_CALL; active = true; } - if (FIL_FileExists(va("%s-last.lmp", tabase))) { - SP_ReplayMenu[3].status = IT_WHITESTRING|IT_CALL; - SP_GuestReplayMenu[3].status = IT_WHITESTRING|IT_CALL; - active = true; - } - if (FIL_FileExists(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value)))) { - SP_ReplayMenu[4].status = IT_WHITESTRING|IT_CALL; - SP_GuestReplayMenu[4].status = IT_WHITESTRING|IT_CALL; - active = true; - } if (active) { SP_TimeAttackMenu[taguest].status = IT_WHITESTRING|IT_SUBMENU; SP_TimeAttackMenu[tareplay].status = IT_WHITESTRING|IT_SUBMENU; @@ -5183,23 +5172,23 @@ static void M_DrawGameStats(void) V_DrawCenteredString(BASEVIDWIDTH/2, 90, 0, "* COMBINED RECORDS *"); - sprintf(beststr, "%u", bestscore); + /*sprintf(beststr, "%u", bestscore); V_DrawString(32, 100, V_YELLOWMAP, "SCORE:"); V_DrawRightAlignedString(BASEVIDWIDTH-32, 100, 0, beststr); if (mapsunfinished[0]) - V_DrawRightAlignedString(BASEVIDWIDTH-32, 108, V_REDMAP, va("(%d unfinished)", mapsunfinished[0])); + V_DrawRightAlignedString(BASEVIDWIDTH-32, 108, V_REDMAP, va("(%d unfinished)", mapsunfinished[0]));*/ sprintf(beststr, "%i:%02i:%02i.%02i", G_TicsToHours(besttime), G_TicsToMinutes(besttime, false), G_TicsToSeconds(besttime), G_TicsToCentiseconds(besttime)); - V_DrawString(32, 120, V_YELLOWMAP, "TIME:"); - V_DrawRightAlignedString(BASEVIDWIDTH-32, 120, 0, beststr); + V_DrawString(32, 100, V_YELLOWMAP, "TIME:"); + V_DrawRightAlignedString(BASEVIDWIDTH-32, 100, 0, beststr); if (mapsunfinished[1]) - V_DrawRightAlignedString(BASEVIDWIDTH-32, 128, V_REDMAP, va("(%d unfinished)", mapsunfinished[1])); + V_DrawRightAlignedString(BASEVIDWIDTH-32, 108, V_REDMAP, va("(%d unfinished)", mapsunfinished[1])); - sprintf(beststr, "%u", bestrings); + /*sprintf(beststr, "%u", bestrings); V_DrawString(32, 140, V_YELLOWMAP, "RINGS:"); V_DrawRightAlignedString(BASEVIDWIDTH-32, 140, 0, beststr); if (mapsunfinished[2]) - V_DrawRightAlignedString(BASEVIDWIDTH-32, 148, V_REDMAP, va("(%d unfinished)", mapsunfinished[2])); + V_DrawRightAlignedString(BASEVIDWIDTH-32, 148, V_REDMAP, va("(%d unfinished)", mapsunfinished[2]));*/ } static void M_HandleGameStats(INT32 choice) @@ -5309,13 +5298,13 @@ void M_DrawTimeAttackMenu(void) V_DrawCenteredString(104, 32, 0, "* LEVEL RECORDS *"); - if (!mainrecords[cv_nextmap.value-1] || !mainrecords[cv_nextmap.value-1]->score) + /*if (!mainrecords[cv_nextmap.value-1] || !mainrecords[cv_nextmap.value-1]->score) sprintf(beststr, "(none)"); else sprintf(beststr, "%u", mainrecords[cv_nextmap.value-1]->score); V_DrawString(104-72, 48, V_YELLOWMAP, "SCORE:"); - V_DrawRightAlignedString(104+72, 48, V_ALLOWLOWERCASE, beststr); + V_DrawRightAlignedString(104+72, 48, V_ALLOWLOWERCASE, beststr);*/ if (!mainrecords[cv_nextmap.value-1] || !mainrecords[cv_nextmap.value-1]->time) sprintf(beststr, "(none)"); @@ -5327,13 +5316,13 @@ void M_DrawTimeAttackMenu(void) V_DrawString(104-72, 58, V_YELLOWMAP, "TIME:"); V_DrawRightAlignedString(104+72, 58, V_ALLOWLOWERCASE, beststr); - if (!mainrecords[cv_nextmap.value-1] || !mainrecords[cv_nextmap.value-1]->rings) + /*if (!mainrecords[cv_nextmap.value-1] || !mainrecords[cv_nextmap.value-1]->rings) sprintf(beststr, "(none)"); else sprintf(beststr, "%hu", mainrecords[cv_nextmap.value-1]->rings); V_DrawString(104-72, 68, V_YELLOWMAP, "RINGS:"); - V_DrawRightAlignedString(104+72, 68, V_ALLOWLOWERCASE, beststr); + V_DrawRightAlignedString(104+72, 68, V_ALLOWLOWERCASE, beststr);*/ // Draw record emblems. em = M_GetLevelEmblems(cv_nextmap.value); @@ -5341,9 +5330,9 @@ void M_DrawTimeAttackMenu(void) { switch (em->type) { - case ET_SCORE: yHeight = 48; break; + //case ET_SCORE: yHeight = 48; break; case ET_TIME: yHeight = 58; break; - case ET_RINGS: yHeight = 68; break; + //case ET_RINGS: yHeight = 68; break; default: goto skipThisOne; } @@ -5599,19 +5588,16 @@ static void M_ReplayTimeAttack(INT32 choice) { switch(choice) { default: - case 0: // best score - which = "score-best"; - break; - case 1: // best time + case 0: // best time which = "time-best"; break; - case 2: // best rings - which = "rings-best"; - break; - case 3: // last + case 1: // last which = "last"; break; - case 4: // guest + /*case 2: // best staff + which = "staff-best"; + break;*/ + case 2: // guest // srb2/replay/main/map01-guest.lmp G_DoPlayDemo(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value))); return; @@ -5632,6 +5618,9 @@ static void M_ReplayTimeAttack(INT32 choice) case 2: // last which = "last"; break; + /*case 3: // best staff + which = "staff-best"; + break;*/ case 3: // guest which = "guest"; break; diff --git a/src/p_mobj.c b/src/p_mobj.c index 6701e8a3..d14ee865 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8932,9 +8932,7 @@ void P_RespawnSpecials(void) mapthing_t *mthing = NULL; // only respawn items when cv_itemrespawn is on - if (!(netgame || multiplayer) // Never respawn in single player - || gametype == GT_COOP // Never respawn in co-op gametype - || !cv_itemrespawn.value) // cvar is turned off + if (!cv_itemrespawn.value) return; // Don't respawn in special stages! @@ -9517,12 +9515,8 @@ void P_SpawnMapThing(mapthing_t *mthing) if (modeattacking) // Record Attack special stuff { - // Don't spawn starposts that wouldn't be usable - if (i == MT_STARPOST) - return; - // Emerald Tokens -->> Score Tokens - else if (i == MT_EMMY) + if (i == MT_EMMY) return; /// \todo // 1UPs -->> Score TVs diff --git a/src/p_setup.c b/src/p_setup.c index f41d1fd7..6cf687fa 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -224,7 +224,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) DEH_WriteUndoline("LEVELFLAGS", va("%d", mapheaderinfo[num]->levelflags), UNDO_NONE); mapheaderinfo[num]->levelflags = 0; DEH_WriteUndoline("MENUFLAGS", va("%d", mapheaderinfo[num]->menuflags), UNDO_NONE); - mapheaderinfo[num]->menuflags = 0; + mapheaderinfo[num]->menuflags = LF2_RECORDATTACK|LF2_NOVISITNEEDED; // 0 // TODO grades support for delfile (pfft yeah right) P_DeleteGrades(num); // an even further impossibility, delfile custom opts support @@ -2392,7 +2392,7 @@ static void P_LoadRecordGhosts(void) sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap)); // Best Score ghost - if (cv_ghost_bestscore.value) + /*if (cv_ghost_bestscore.value) { for (i = 0; i < numskins; ++i) { @@ -2402,7 +2402,7 @@ static void P_LoadRecordGhosts(void) if (FIL_FileExists(va("%s-%s-score-best.lmp", gpath, skins[i].name))) G_AddGhost(va("%s-%s-score-best.lmp", gpath, skins[i].name)); } - } + }*/ // Best Time ghost if (cv_ghost_besttime.value) @@ -2418,7 +2418,7 @@ static void P_LoadRecordGhosts(void) } // Best Rings ghost - if (cv_ghost_bestrings.value) + /*if (cv_ghost_bestrings.value) { for (i = 0; i < numskins; ++i) { @@ -2428,7 +2428,7 @@ static void P_LoadRecordGhosts(void) if (FIL_FileExists(va("%s-%s-rings-best.lmp", gpath, skins[i].name))) G_AddGhost(va("%s-%s-rings-best.lmp", gpath, skins[i].name)); } - } + }*/ // Last ghost if (cv_ghost_last.value) @@ -2446,6 +2446,18 @@ static void P_LoadRecordGhosts(void) // Guest ghost if (cv_ghost_guest.value && FIL_FileExists(va("%s-guest.lmp", gpath))) G_AddGhost(va("%s-guest.lmp", gpath)); + + // Staff Attack ghosts + if (cv_ghost_staff.value) + { + lumpnum_t l; + UINT8 i = 1; + while (i <= 99 && (l = W_CheckNumForName(va("%sK%02u",G_BuildMapName(gamemap),i))) != LUMPERROR) + { + G_AddGhost(va("%sK%02u",G_BuildMapName(gamemap),i)); + i++; + } + } free(gpath); } @@ -2476,6 +2488,18 @@ static void P_LoadNightsGhosts(void) if (cv_ghost_guest.value && FIL_FileExists(va("%s-guest.lmp", gpath))) G_AddGhost(va("%s-guest.lmp", gpath)); + // Staff Attack ghosts + if (cv_ghost_staff.value) + { + lumpnum_t l; + UINT8 i = 1; + while (i <= 99 && (l = W_CheckNumForName(va("%sN%02u",G_BuildMapName(gamemap),i))) != LUMPERROR) + { + G_AddGhost(va("%sN%02u",G_BuildMapName(gamemap),i)); + i++; + } + } + free(gpath); } diff --git a/src/y_inter.c b/src/y_inter.c index c133b881..5bfed538 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -864,7 +864,10 @@ void Y_Ticker(void) if (r) S_StartSound(NULL, sfx_menu1); else - endtic = intertic + 3*TICRATE; // 3 second pause after end of tally + if (modeattacking) + endtic = intertic + 10*TICRATE; // 10 second pause after end of tally + else + endtic = intertic + 3*TICRATE; // 3 second pause after end of tally } else if (intertype == int_match || intertype == int_ctf || intertype == int_teammatch) // match { @@ -901,19 +904,13 @@ static void Y_UpdateRecordReplays(void) if (!mainrecords[gamemap-1]) G_AllocMainRecordData(gamemap-1); - if (players[consoleplayer].score > mainrecords[gamemap-1]->score) - mainrecords[gamemap-1]->score = players[consoleplayer].score; - if ((mainrecords[gamemap-1]->time == 0) || (players[consoleplayer].realtime < mainrecords[gamemap-1]->time)) mainrecords[gamemap-1]->time = players[consoleplayer].realtime; - if ((UINT16)(players[consoleplayer].health - 1) > mainrecords[gamemap-1]->rings) - mainrecords[gamemap-1]->rings = (UINT16)(players[consoleplayer].health - 1); - // Save demo! bestdemo[255] = '\0'; lastdemo[255] = '\0'; - G_SetDemoTime(players[consoleplayer].realtime, players[consoleplayer].score, (UINT16)(players[consoleplayer].health-1)); + G_SetDemoTime(players[consoleplayer].realtime, 0); G_CheckDemoStatus(); I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755); @@ -939,24 +936,6 @@ static void Y_UpdateRecordReplays(void) CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW RECORD TIME!"), M_GetText("Saved replay as"), bestdemo); } - snprintf(bestdemo, 255, "%s-%s-score-best.lmp", gpath, cv_chooseskin.string); - if (!FIL_FileExists(bestdemo) || (G_CmpDemoTime(bestdemo, lastdemo) & (1<<1))) - { // Better score, save this demo. - if (FIL_FileExists(bestdemo)) - remove(bestdemo); - FIL_WriteFile(bestdemo, buf, len); - CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW HIGH SCORE!"), M_GetText("Saved replay as"), bestdemo); - } - - snprintf(bestdemo, 255, "%s-%s-rings-best.lmp", gpath, cv_chooseskin.string); - if (!FIL_FileExists(bestdemo) || (G_CmpDemoTime(bestdemo, lastdemo) & (1<<2))) - { // Better rings, save this demo. - if (FIL_FileExists(bestdemo)) - remove(bestdemo); - FIL_WriteFile(bestdemo, buf, len); - CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW MOST RINGS!"), M_GetText("Saved replay as"), bestdemo); - } - //CONS_Printf("%s '%s'\n", M_GetText("Saved replay as"), lastdemo); Z_Free(buf); @@ -998,9 +977,11 @@ void Y_StartIntermission(void) else intertype = (maptol & TOL_NIGHTS) ? int_nights : int_coop; */ + /* // srb2kart: time attack tally is UGLY rn if (modeattacking) intertype = int_timeattack; else + */ intertype = int_race; } else @@ -1323,6 +1304,24 @@ void Y_StartIntermission(void) case int_race: // (time-only race) { + if ((!modifiedgame || savemoddata) && !multiplayer && !demoplayback) // remove this once we have a proper time attack screen + { + // setup time data + data.coop.tics = players[consoleplayer].realtime; + + // Update visitation flags + mapvisited[gamemap-1] |= MV_BEATEN; + if (ALL7EMERALDS(emeralds)) + mapvisited[gamemap-1] |= MV_ALLEMERALDS; + if (ultimatemode) + mapvisited[gamemap-1] |= MV_ULTIMATE; + if (data.coop.gotperfbonus) + mapvisited[gamemap-1] |= MV_PERFECT; + + if (modeattacking == ATTACKING_RECORD) + Y_UpdateRecordReplays(); + } + // Calculate who won Y_CalculateTournamentPoints();