Merge remote-tracking branch 'refs/remotes/origin/attack-is-back' into zarrotsu

This commit is contained in:
TehRealSalt 2017-10-17 23:56:55 -04:00
commit 5a7458be98
11 changed files with 141 additions and 164 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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)<<FRACBITS;
maxdash = (fixed_t)READUINT8(demo_p)<<FRACBITS;
// SRB2kart
kartspeed = READUINT8(demo_p)<<FRACBITS;
kartweight = READUINT8(demo_p)<<FRACBITS;
kartspeed = READUINT8(demo_p);
kartweight = READUINT8(demo_p);
//
normalspeed = (fixed_t)READUINT8(demo_p)<<FRACBITS;
runspeed = (fixed_t)READUINT8(demo_p)<<FRACBITS;
@ -5354,8 +5330,6 @@ void G_AddGhost(char *defdemoname)
switch(ghostversion)
{
case DEMOVERSION: // latest always supported
// compatibility available?
case 0x0008:
break;
// too old, cannot support.
default:
@ -5380,10 +5354,7 @@ void G_AddGhost(char *defdemoname)
Z_Free(buffer);
return;
} p += 4; // "PLAY"
if (ghostversion <= 0x0008)
p++; // gamemap
else
p += 2; // gamemap
p += 2; // gamemap
p += 16; // mapmd5 (possibly check for consistency?)
flags = READUINT8(p);
if (!(flags & DF_GHOST))
@ -5398,7 +5369,7 @@ void G_AddGhost(char *defdemoname)
case ATTACKING_NONE: // 0
break;
case ATTACKING_RECORD: // 1
p += 10; // demo time, score, and rings
p += 4; // demo time
break;
case ATTACKING_NIGHTS: // 2
p += 8; // demo time left, score
@ -5584,8 +5555,6 @@ void G_DoPlayMetal(void)
switch(metalversion)
{
case DEMOVERSION: // latest always supported
// compatibility available?
case 0x0008:
break;
// too old, cannot support.
default:

View File

@ -58,7 +58,7 @@ extern consvar_t cv_crosshair, cv_crosshair2;
extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove;
extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_fireaxis,cv_firenaxis;
extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_fireaxis2,cv_firenaxis2;
extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest;
extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest, cv_ghost_staff;
// mouseaiming (looking up/down with the mouse or keyboard)
#define KB_LOOKSPEED (1<<25)
@ -120,7 +120,7 @@ void G_BeginRecording(void);
void G_BeginMetal(void);
// Only called by shutdown code.
void G_SetDemoTime(UINT32 ptime, UINT32 pscore, UINT16 prings);
void G_SetDemoTime(UINT32 ptime, UINT32 pscore);
UINT8 G_CmpDemoTime(char *oldname, char *newname);
typedef enum

View File

@ -1038,30 +1038,28 @@ static void HU_drawGametype(void)
//
UINT32 hu_demoscore;
UINT32 hu_demotime;
UINT16 hu_demorings;
static void HU_DrawDemoInfo(void)
{
V_DrawString(4, 188-24, V_YELLOWMAP, va(M_GetText("%s's replay"), player_names[0]));
UINT8 timeoffset = 8;
V_DrawString(4, 188-16, V_YELLOWMAP, va(M_GetText("%s's replay"), player_names[0]));
if (modeattacking)
{
V_DrawString(4, 188-16, V_YELLOWMAP|V_MONOSPACE, "SCORE:");
V_DrawRightAlignedString(120, 188-16, V_MONOSPACE, va("%d", hu_demoscore));
if (modeattacking == ATTACKING_NIGHTS)
{
V_DrawString(4, 188-8, V_YELLOWMAP|V_MONOSPACE, "SCORE:");
V_DrawRightAlignedString(120, 188-8, V_MONOSPACE, va("%d", hu_demoscore));
timeoffset = 0;
}
V_DrawString(4, 188- 8, V_YELLOWMAP|V_MONOSPACE, "TIME:");
V_DrawString(4, 188- timeoffset, V_YELLOWMAP|V_MONOSPACE, "TIME:");
if (hu_demotime != UINT32_MAX)
V_DrawRightAlignedString(120, 188- 8, V_MONOSPACE, va("%i:%02i.%02i",
V_DrawRightAlignedString(120, 188- timeoffset, V_MONOSPACE, va("%i:%02i.%02i",
G_TicsToMinutes(hu_demotime,true),
G_TicsToSeconds(hu_demotime),
G_TicsToCentiseconds(hu_demotime)));
else
V_DrawRightAlignedString(120, 188- 8, V_MONOSPACE, "--:--.--");
if (modeattacking == ATTACKING_RECORD)
{
V_DrawString(4, 188 , V_YELLOWMAP|V_MONOSPACE, "RINGS:");
V_DrawRightAlignedString(120, 188 , V_MONOSPACE, va("%d", hu_demorings));
}
V_DrawRightAlignedString(120, 188- timeoffset, V_MONOSPACE, "--:--.--");
}
}

View File

@ -4031,7 +4031,7 @@ void K_drawKartHUD(void)
// If not splitscreen, draw...
// The little triple-item icons at the bottom
// The top-four faces on the left
if (!splitscreen)
if (!(splitscreen || modeattacking))
{
//K_DrawKartTripleItem();
K_drawKartPositionFaces();
@ -4048,7 +4048,8 @@ void K_drawKartHUD(void)
V_DrawKartString(LAPS_X+33, STRINGY(LAPS_Y+3), 0, va("%d/%d", stplyr->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.

View File

@ -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},

View File

@ -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;

View File

@ -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

View File

@ -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);
}

View File

@ -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();