some cleanup i forgor to merge

This commit is contained in:
Alug committed 2024-03-19 22:16:26 +01:00
1 parent 80f003bf79
commit f3a80dd6d9
6 files changed
+22 -1156

No files matched your search

+3 -369
View File
@@ -182,12 +182,8 @@ boolean gamedataloaded = false;
// Time attack data for levels
// These are dynamically allocated for space reasons now
recorddata_t *mainrecords[NUMMAPS] = {NULL};
//nightsdata_t *nightsrecords[NUMMAPS] = {NULL};
UINT8 mapvisited[NUMMAPS];
// Temporary holding place for nights data for the current map
//nightsdata_t ntemprecords;
UINT32 bluescore, redscore; // CTF and Team Match team scores
// ring count... for PERFECT!
@@ -386,10 +382,6 @@ static CV_PossibleValue_t deadzone_cons_t[] = {{FRACUNIT/16, "MIN"}, {FRACUNIT,
// don't mind me putting these here, I was lazy to figure out where else I could put those without blowing up the compiler.
// it automatically becomes compact with 20+ players, but if you like it, I guess you can turn that on!
// SRB2Kart: irrelevant for us.
//consvar_t cv_compactscoreboard= {"compactscoreboard", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// chat timer thingy
static CV_PossibleValue_t chattime_cons_t[] = {{1, "MIN"}, {999, "MAX"}, {0, NULL}};
consvar_t cv_chattime = {"chattime", "8", CV_SAVE, chattime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -568,13 +560,6 @@ void G_AllocMainRecordData(INT16 i)
memset(mainrecords[i], 0, sizeof(recorddata_t));
}
/*void G_AllocNightsRecordData(INT16 i)
{
if (!nightsrecords[i])
nightsrecords[i] = Z_Malloc(sizeof(nightsdata_t), PU_STATIC, NULL);
memset(nightsrecords[i], 0, sizeof(nightsdata_t));
}*/
// MAKE SURE YOU SAVE DATA BEFORE CALLING THIS
void G_ClearRecords(void)
{
@@ -586,11 +571,6 @@ void G_ClearRecords(void)
Z_Free(mainrecords[i]);
mainrecords[i] = NULL;
}
/*if (nightsrecords[i])
{
Z_Free(nightsrecords[i]);
nightsrecords[i] = NULL;
}*/
}
}
@@ -611,170 +591,6 @@ tic_t G_GetBestTime(INT16 map)
return mainrecords[map-1]->time;
}
// Not needed
/*tic_t G_GetBestLap(INT16 map)
{
if (!mainrecords[map-1] || mainrecords[map-1]->lap <= 0)
return (tic_t)UINT32_MAX;
return mainrecords[map-1]->lap;
}*/
/*UINT16 G_GetBestRings(INT16 map)
{
if (!mainrecords[map-1])
return 0;
return mainrecords[map-1]->rings;
}*/
// No NiGHTS records for SRB2Kart
/*UINT32 G_GetBestNightsScore(INT16 map, UINT8 mare)
{
if (!nightsrecords[map-1])
return 0;
return nightsrecords[map-1]->score[mare];
}
tic_t G_GetBestNightsTime(INT16 map, UINT8 mare)
{
if (!nightsrecords[map-1] || nightsrecords[map-1]->time[mare] <= 0)
return (tic_t)UINT32_MAX;
return nightsrecords[map-1]->time[mare];
}
UINT8 G_GetBestNightsGrade(INT16 map, UINT8 mare)
{
if (!nightsrecords[map-1])
return 0;
return nightsrecords[map-1]->grade[mare];
}
// For easy adding of NiGHTS records
void G_AddTempNightsRecords(UINT32 pscore, tic_t ptime, UINT8 mare)
{
ntemprecords.score[mare] = pscore;
ntemprecords.grade[mare] = P_GetGrade(pscore, gamemap, mare - 1);
ntemprecords.time[mare] = ptime;
// Update nummares
// Note that mare "0" is overall, mare "1" is the first real mare
if (ntemprecords.nummares < mare)
ntemprecords.nummares = mare;
}
void G_SetNightsRecords(void)
{
INT32 i;
UINT32 totalscore = 0;
tic_t totaltime = 0;
const size_t glen = strlen(srb2home)+1+strlen("replay")+1+strlen(timeattackfolder)+1+strlen("MAPXX")+1;
char *gpath;
char lastdemo[256], bestdemo[256];
if (!ntemprecords.nummares)
return;
// Set overall
{
UINT8 totalrank = 0, realrank = 0;
for (i = 1; i <= ntemprecords.nummares; ++i)
{
totalscore += ntemprecords.score[i];
totalrank += ntemprecords.grade[i];
totaltime += ntemprecords.time[i];
}
// Determine overall grade
realrank = (UINT8)((FixedDiv((fixed_t)totalrank << FRACBITS, ntemprecords.nummares << FRACBITS) + (FRACUNIT/2)) >> FRACBITS);
// You need ALL rainbow As to get a rainbow A overall
if (realrank == GRADE_S && (totalrank / ntemprecords.nummares) != GRADE_S)
realrank = GRADE_A;
ntemprecords.score[0] = totalscore;
ntemprecords.grade[0] = realrank;
ntemprecords.time[0] = totaltime;
}
// Now take all temp records and put them in the actual records
{
nightsdata_t *maprecords;
if (!nightsrecords[gamemap-1])
G_AllocNightsRecordData(gamemap-1);
maprecords = nightsrecords[gamemap-1];
if (maprecords->nummares != ntemprecords.nummares)
maprecords->nummares = ntemprecords.nummares;
for (i = 0; i < ntemprecords.nummares + 1; ++i)
{
if (maprecords->score[i] < ntemprecords.score[i])
maprecords->score[i] = ntemprecords.score[i];
if (maprecords->grade[i] < ntemprecords.grade[i])
maprecords->grade[i] = ntemprecords.grade[i];
if (!maprecords->time[i] || maprecords->time[i] > ntemprecords.time[i])
maprecords->time[i] = ntemprecords.time[i];
}
}
memset(&ntemprecords, 0, sizeof(nightsdata_t));
// Save demo!
bestdemo[255] = '\0';
lastdemo[255] = '\0';
G_SetDemoTime(totaltime, totalscore);
G_CheckDemoStatus();
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
I_mkdir(va("%s"PATHSEP"replay"PATHSEP"%s", srb2home, timeattackfolder), 0755);
if ((gpath = malloc(glen)) == NULL)
I_Error("Out of memory for replay filepath\n");
sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap));
snprintf(lastdemo, 255, "%s-last.lmp", gpath);
if (FIL_FileExists(lastdemo))
{
UINT8 *buf;
size_t len = FIL_ReadFile(lastdemo, &buf);
snprintf(bestdemo, 255, "%s-time-best.lmp", gpath);
if (!FIL_FileExists(bestdemo) || G_CmpDemoTime(bestdemo, lastdemo) & 1)
{ // Better time, 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 RECORD TIME!"), M_GetText("Saved replay as"), bestdemo);
}
snprintf(bestdemo, 255, "%s-score-best.lmp", gpath);
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);
}
//CONS_Printf("%s '%s'\n", M_GetText("Saved replay as"), lastdemo);
Z_Free(buf);
}
free(gpath);
// If the mare count changed, this will update the score display
CV_AddValue(&cv_nextmap, 1);
CV_AddValue(&cv_nextmap, -1);
}*/
// for consistency among messages: this modifies the game and removes savemoddata.
void G_SetGameModified(boolean silent, boolean major)
{
@@ -2127,31 +1943,6 @@ boolean G_CouldView(INT32 playernum)
return false;
}
// SRB2Kart: we have no team-based modes, YET...
/*if (G_GametypeHasTeams())
{
if (players[consoleplayer].ctfteam
&& player->ctfteam != players[consoleplayer].ctfteam)
return false;
}
else if (gametype == GT_HIDEANDSEEK)
{
if (players[consoleplayer].pflags & PF_TAGIT)
return false;
}
// Other Tag-based gametypes?
else if (G_TagGametype())
{
if (!players[consoleplayer].spectator
&& (players[consoleplayer].pflags & PF_TAGIT) != (player->pflags & PF_TAGIT))
return false;
}
else if (G_GametypeHasSpectators() && G_BattleGametype())
{
if (!players[consoleplayer].spectator)
return false;
}*/
return true;
}
@@ -2859,39 +2650,7 @@ void G_PlayerReborn(INT32 player)
p->maxlink = 0;
// If NiGHTS, find lowest mare to start with.
p->mare = 0; /*P_FindLowestMare();
CONS_Debug(DBG_NIGHTS, M_GetText("Current mare is %d\n"), p->mare);
if (p->mare == 255)
p->mare = 0;*/
// Check to make sure their color didn't change somehow...
/*if (G_GametypeHasTeams())
{
if (p->ctfteam == 1 && p->skincolor != skincolor_redteam)
{
if (p == &players[consoleplayer])
CV_SetValue(&cv_playercolor, skincolor_redteam);
else if (p == &players[displayplayers[1]])
CV_SetValue(&cv_playercolor2, skincolor_redteam);
else if (p == &players[displayplayers[2]])
CV_SetValue(&cv_playercolor3, skincolor_redteam);
else if (p == &players[displayplayers[3]])
CV_SetValue(&cv_playercolor4, skincolor_redteam);
}
else if (p->ctfteam == 2 && p->skincolor != skincolor_blueteam)
{
if (p == &players[consoleplayer])
CV_SetValue(&cv_playercolor, skincolor_blueteam);
else if (p == &players[displayplayers[1]])
CV_SetValue(&cv_playercolor2, skincolor_blueteam);
else if (p == &players[displayplayers[2]])
CV_SetValue(&cv_playercolor3, skincolor_blueteam);
else if (p == &players[displayplayers[3]])
CV_SetValue(&cv_playercolor4, skincolor_blueteam);
}
}*/
p->mare = 0;
}
//
@@ -3405,12 +3164,8 @@ INT32 G_GetGametypeByName(const char *gametypestr)
//
boolean G_IsSpecialStage(INT32 mapnum)
{
#if 0
return (gametype == GT_COOP && modeattacking != ATTACKING_RECORD && mapnum >= sstage_start && mapnum <= sstage_end);
#else
(void)mapnum;
return false;
#endif
}
//
@@ -3422,17 +3177,7 @@ boolean G_IsSpecialStage(INT32 mapnum)
boolean G_GametypeUsesLives(void)
{
// SRB2kart NEEDS no lives
#if 0
// Coop, Competitive
if ((gametype == GT_COOP || gametype == GT_COMPETITION)
&& !modeattacking // No lives in Time Attack
//&& !G_IsSpecialStage(gamemap)
&& !(maptol & TOL_NIGHTS)) // No lives in NiGHTS
return true;
return false;
#else
return false;
#endif
}
//
@@ -4141,11 +3886,6 @@ void G_LoadGameData(void)
//For records
tic_t rectime;
tic_t reclap;
//UINT32 recscore;
//UINT16 recrings;
//UINT8 recmares;
//INT32 curmare;
// Clear things so previously read gamedata doesn't transfer
// to new gamedata
@@ -4236,43 +3976,15 @@ void G_LoadGameData(void)
{
rectime = (tic_t)READUINT32(save_p);
reclap = (tic_t)READUINT32(save_p);
//recscore = READUINT32(save_p);
//recrings = READUINT16(save_p);
/*if (recrings > 10000 || recscore > MAXSCORE)
goto datacorrupt;*/
if (rectime || reclap)
{
G_AllocMainRecordData((INT16)i);
mainrecords[i]->time = rectime;
mainrecords[i]->lap = reclap;
//mainrecords[i]->score = recscore;
//mainrecords[i]->rings = recrings;
}
}
// Nights records
/*for (i = 0; i < NUMMAPS; ++i)
{
if ((recmares = READUINT8(save_p)) == 0)
continue;
G_AllocNightsRecordData((INT16)i);
for (curmare = 0; curmare < (recmares+1); ++curmare)
{
nightsrecords[i]->score[curmare] = READUINT32(save_p);
nightsrecords[i]->grade[curmare] = READUINT8(save_p);
nightsrecords[i]->time[curmare] = (tic_t)READUINT32(save_p);
if (nightsrecords[i]->grade[curmare] > GRADE_S)
goto datacorrupt;
}
nightsrecords[i]->nummares = recmares;
}*/
// done
Z_Free(savebuffer);
save_p = NULL;
@@ -4372,7 +4084,6 @@ void G_SaveGameData(boolean force)
WRITEUINT32(save_p, timesBeaten);
WRITEUINT32(save_p, timesBeatenWithEmeralds);
//WRITEUINT32(save_p, timesBeatenUltimate);
// Main records
for (i = 0; i < NUMMAPS; i++)
@@ -4381,8 +4092,6 @@ void G_SaveGameData(boolean force)
{
WRITEUINT32(save_p, mainrecords[i]->time);
WRITEUINT32(save_p, mainrecords[i]->lap);
//WRITEUINT32(save_p, mainrecords[i]->score);
//WRITEUINT16(save_p, mainrecords[i]->rings);
}
else
{
@@ -4391,25 +4100,6 @@ void G_SaveGameData(boolean force)
}
}
// NiGHTS records
/*for (i = 0; i < NUMMAPS; i++)
{
if (!nightsrecords[i] || !nightsrecords[i]->nummares)
{
WRITEUINT8(save_p, 0);
continue;
}
WRITEUINT8(save_p, nightsrecords[i]->nummares);
for (curmare = 0; curmare < (nightsrecords[i]->nummares + 1); ++curmare)
{
WRITEUINT32(save_p, nightsrecords[i]->score[curmare]);
WRITEUINT8(save_p, nightsrecords[i]->grade[curmare]);
WRITEUINT32(save_p, nightsrecords[i]->time[curmare]);
}
}*/
length = save_p - savebuffer;
FIL_WriteFile(va(pandf, srb2home, gamedatafilename), savebuffer, length);
@@ -4701,28 +4391,7 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
players[i].playerstate = PST_REBORN;
players[i].starpostangle = players[i].starpostnum = players[i].starposttime = 0;
players[i].starpostx = players[i].starposty = players[i].starpostz = 0;
#if 0
if (netgame || multiplayer)
{
players[i].lives = cv_startinglives.value;
players[i].continues = 0;
}
else if (pultmode)
{
players[i].lives = 1;
players[i].continues = 0;
}
else
{
players[i].lives = 3;
players[i].continues = 1;
}
players[i].xtralife = 0;
#else
players[i].lives = 1; // SRB2Kart
#endif
// The latter two should clear by themselves, but just in case
players[i].pflags &= ~(PF_TAGIT|PF_TAGGED|PF_FULLSTASIS);
@@ -5674,7 +5343,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
ziptic_p = demo_p++; // the ziptic, written at the end of this function
#define MAXMOM (0x7FFF<<8)
#define MAXMOM (0x7FFF<<8)
// GZT_XYZ is only useful if you've moved 256 FRACUNITS or more in a single tic.
if (abs(ghost->x-oldghost[playernum].x) > MAXMOM
@@ -5729,7 +5398,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
oldghost[playernum].z += oldghost[playernum].momz<<8;
}
#undef MAXMOM
#undef MAXMOM
// Only store the 8 most relevant bits of angle
// because exact values aren't too easy to discern to begin with when only 8 angles have different sprites
@@ -6820,11 +6489,6 @@ void G_BeginRecording(void)
WRITEUINT32(demo_p,UINT32_MAX); // time
WRITEUINT32(demo_p,UINT32_MAX); // lap
break;
/*case ATTACKING_NIGHTS: // 2
demotime_p = demo_p;
WRITEUINT32(demo_p,UINT32_MAX); // time
WRITEUINT32(demo_p,0); // score
break;*/
default: // 3
break;
}
@@ -6975,12 +6639,6 @@ void G_SetDemoTime(UINT32 ptime, UINT32 plap)
WRITEUINT32(demotime_p, plap);
demotime_p = NULL;
}
/*else if (demoflags & DF_NIGHTSATTACK)
{
WRITEUINT32(demotime_p, ptime);
WRITEUINT32(demotime_p, pscore);
demotime_p = NULL;
}*/
}
static void G_LoadDemoExtraFiles(UINT8 **pp)
@@ -7192,11 +6850,6 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
newtime = READUINT32(p);
newlap = READUINT32(p);
}
/*else if (flags & DF_NIGHTSATTACK)
{
newtime = READUINT32(p);
newscore = READUINT32(p);
}*/
else // appease compiler
return 0;
@@ -7262,11 +6915,6 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
oldtime = READUINT32(p);
oldlap = READUINT32(p);
}
/*else if (flags & DF_NIGHTSATTACK)
{
oldtime = READUINT32(p);
oldscore = READUINT32(p);
}*/
else // appease compiler
return UINT8_MAX;
@@ -7409,13 +7057,6 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
if (pdemoflags & DF_ENCORE)
pdemo->kartspeed |= DF_ENCORE;
/*// Temporary info until this is actually present in replays.
(void)extrainfo_p;
sprintf(pdemo->winnername, "transrights420");
pdemo->winnerskin = 1;
pdemo->winnercolor = SKINCOLOR_MOONSLAM;
pdemo->winnertime = 6666;*/
// Read standings!
count = 0;
@@ -7705,10 +7346,6 @@ void G_DoPlayDemo(char *defdemoname)
hu_demotime = READUINT32(demo_p);
hu_demolap = READUINT32(demo_p);
break;
/*case ATTACKING_NIGHTS: // 2
hu_demotime = READUINT32(demo_p);
hu_demoscore = READUINT32(demo_p);
break;*/
default: // 3
modeattacking = ATTACKING_NONE;
break;
@@ -8375,9 +8012,6 @@ void G_UpdateStaffGhostName(lumpnum_t l)
case ATTACKING_RECORD: // 1
p += 8; // demo time, lap
break;
/*case ATTACKING_NIGHTS: // 2
p += 8; // demo time left, score
break;*/
default: // 3
break;
}
-160
View File
@@ -1992,8 +1992,6 @@ static void HU_DrawChat(void)
// For anyone who, for some godforsaken reason, likes oldchat.
static void HU_DrawChat_Old(void)
{
INT32 t = 0, c = 0, y = HU_INPUTY;
@@ -2064,164 +2062,6 @@ static void HU_DrawChat_Old(void)
}
#endif
// draw the Crosshair, at the exact center of the view.
//
// Crosshairs are pre-cached at HU_Init
/*static inline void HU_DrawCrosshair(void)
{
INT32 i, x, y;
i = cv_crosshair.value & 3;
if (!i)
return;
if ((netgame || multiplayer) && players[displayplayers[0]].spectator)
return;
#ifdef HWRENDER
if (rendermode != render_soft)
{
x = (INT32)gr_basewindowcenterx;
y = (INT32)gr_basewindowcentery;
}
else
#endif
{
x = viewwindowx + (viewwidth>>1);
y = viewwindowy + (viewheight>>1);
}
V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]);
}
static inline void HU_DrawCrosshair2(void)
{
INT32 i, x, y;
i = cv_crosshair2.value & 3;
if (!i)
return;
if ((netgame || multiplayer) && players[displayplayers[1]].spectator)
return;
#ifdef HWRENDER
if (rendermode != render_soft)
{
x = (INT32)gr_basewindowcenterx;
y = (INT32)gr_basewindowcentery;
}
else
#endif
{
x = viewwindowx + (viewwidth>>1);
y = viewwindowy + (viewheight>>1);
}
if (splitscreen)
{
if (splitscreen > 1)
#ifdef HWRENDER
if (rendermode != render_soft)
x += (INT32)gr_viewwidth;
else
#endif
x += viewwidth;
else
{
#ifdef HWRENDER
if (rendermode != render_soft)
y += (INT32)gr_viewheight;
else
#endif
y += viewheight;
}
V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]);
}
}
static inline void HU_DrawCrosshair3(void)
{
INT32 i, x, y;
i = cv_crosshair3.value & 3;
if (!i)
return;
if ((netgame || multiplayer) && players[displayplayers[2]].spectator)
return;
#ifdef HWRENDER
if (rendermode != render_soft)
{
x = (INT32)gr_basewindowcenterx;
y = (INT32)gr_basewindowcentery;
}
else
#endif
{
x = viewwindowx + (viewwidth>>1);
y = viewwindowy + (viewheight>>1);
}
if (splitscreen > 1)
{
#ifdef HWRENDER
if (rendermode != render_soft)
y += (INT32)gr_viewheight;
else
#endif
y += viewheight;
V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]);
}
}
static inline void HU_DrawCrosshair4(void)
{
INT32 i, x, y;
i = cv_crosshair4.value & 3;
if (!i)
return;
if ((netgame || multiplayer) && players[displayplayers[3]].spectator)
return;
#ifdef HWRENDER
if (rendermode != render_soft)
{
x = (INT32)gr_basewindowcenterx;
y = (INT32)gr_basewindowcentery;
}
else
#endif
{
x = viewwindowx + (viewwidth>>1);
y = viewwindowy + (viewheight>>1);
}
if (splitscreen > 2)
{
#ifdef HWRENDER
if (rendermode != render_soft)
{
x += (INT32)gr_viewwidth;
y += (INT32)gr_viewheight;
}
else
#endif
{
x += viewwidth;
y += viewheight;
}
V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]);
}
}*/
static void HU_DrawCEcho(void)
{
INT32 i = 0;
-16
View File
@@ -3216,18 +3216,6 @@ static void K_QuiteSaltyHop(player_t *p)
}
}
/*static INT32 K_FindPlayerNum(player_t *plyr)
{
INT32 i;
for(i = 0; i < 4; i++)
{
if (plyr == &players[displayplayers[i]])
return i;
}
return 0; // technically defaulting to player 1 but fuck it
}*/
#define SLOPEROLL_DIV 3
void K_RollMobjBySlopes(mobj_t* mo, boolean usedistance)
@@ -3373,14 +3361,10 @@ void K_SpawnSparkleTrail(mobj_t *mo)
sparkle = P_SpawnMobj(newx, newy, newz, MT_SPARKLETRAIL);
K_FlipFromObject(sparkle, mo);
//if (i == 0)
//P_SetMobjState(sparkle, S_KARTINVULN_LARGE1);
P_SetTarget(&sparkle->target, mo);
sparkle->destscale = mo->destscale;
P_SetScale(sparkle, mo->scale);
sparkle->color = mo->color;
//sparkle->colorized = mo->colorized;
}
P_SetMobjState(sparkle, S_KARTINVULN_LARGE1);
+16 -409
View File
@@ -240,9 +240,6 @@ static char *M_GetConditionString(condition_t cond);
menu_t SR_MainDef, SR_UnlockChecklistDef;
// Misc. Main Menu
#if 0 // Bring this back when we have actual single-player
static void M_SinglePlayerMenu(INT32 choice);
#endif
static void M_Options(INT32 choice);
static void M_LocalSkinMenu(INT32 choice);
static void M_LocalSkinChange(INT32 choice);
@@ -267,18 +264,15 @@ menu_t MISC_ScrambleTeamDef, MISC_ChangeTeamDef, MISC_ChangeSpectateDef;
//static void M_LoadGame(INT32 choice);
static void M_TimeAttack(INT32 choice);
static boolean M_QuitTimeAttackMenu(void);
//static void M_NightsAttack(INT32 choice);
static void M_Statistics(INT32 choice);
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_ModeAttackEndGame(INT32 choice);
static void M_SetGuestReplay(INT32 choice);
//static void M_ChoosePlayer(INT32 choice);
menu_t SP_LevelStatsDef;
static menu_t SP_TimeAttackDef, SP_ReplayDef, SP_GuestReplayDef, SP_GhostDef;
//static menu_t SP_NightsAttackDef, SP_NightsReplayDef, SP_NightsGuestReplayDef, SP_NightsGhostDef;
// Multiplayer
#ifndef NONET
@@ -460,7 +454,6 @@ static void M_HandleMonitorToggles(INT32 choice);
static void Nextmap_OnChange(void);
static void Newgametype_OnChange(void);
static void Dummymenuplayer_OnChange(void);
//static void Dummymares_OnChange(void);
static void Dummystaff_OnChange(void);
// ==========================================================================
@@ -538,7 +531,6 @@ static consvar_t cv_dummyscramble = {"dummyscramble", "Random", CV_HIDEN, dummys
static consvar_t cv_dummyrings = {"dummyrings", "0", CV_HIDEN, ringlimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_dummylives = {"dummylives", "0", CV_HIDEN, liveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_dummycontinues = {"dummycontinues", "0", CV_HIDEN, liveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
//static consvar_t cv_dummymares = {"dummymares", "Overall", CV_HIDEN|CV_CALL, dummymares_cons_t, Dummymares_OnChange, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_dummystaff = {"dummystaff", "0", CV_HIDEN|CV_CALL, dummystaff_cons_t, Dummystaff_OnChange, 0, NULL, NULL, 0, 0, NULL};
// ==========================================================================
@@ -1106,7 +1098,6 @@ static menuitem_t OP_MainMenu[] =
{IT_SUBMENU|IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 70},
{IT_SUBMENU|IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 90},
{IT_CALL|IT_STRING, NULL, "Custom Options...", M_CustomCvarMenu, 100},
{IT_CALL|IT_STRING, NULL, "Tricks & Secrets (F1)", M_Manual, 110},
@@ -1336,8 +1327,8 @@ static const char* OP_VideoTooltips[] =
"Enable fullscreen.",
#endif
"Gamma (brightness) of the game.",
NULL,
NULL,
"Saturation of the game.",
"Advanced color settings of the game.",
"How far away objects are drawn.",
"How far away weather is drawn.",
"Toggle being able to see the sky.",
@@ -2040,6 +2031,7 @@ static const char* OP_SaturnTooltips[] =
"Show Localskin Menus.",
"Nametag Options.",
"Driftgauge Options.",
"Use your native Keyboard Layout.",
"Disables the flicker effect on Midnight Channel.",
"Options for sprite distortion effects.",
"Move position of HUD elements.",
@@ -2065,6 +2057,7 @@ enum
sm_showlocalskin,
sm_nametagmen,
sm_driftgaugemen,
sm_nativkey,
sm_pisschannel,
sm_distortionmenu,
sm_hudoffsets,
@@ -2279,7 +2272,6 @@ static menuitem_t OP_NametagMenu[] =
//{IT_STRING | IT_CVAR, NULL, "Nametag Scaling", &cv_nametagscaling, 70}
};
static const char* OP_NametagTooltips[] =
{
NULL,
@@ -3044,24 +3036,6 @@ static void Dummymenuplayer_OnChange(void)
CV_StealthSetValue(&cv_dummymenuplayer, 1);
}
/*static void Dummymares_OnChange(void)
{
if (!nightsrecords[cv_nextmap.value-1])
{
CV_StealthSetValue(&cv_dummymares, 0);
return;
}
else
{
UINT8 mares = nightsrecords[cv_nextmap.value-1]->nummares;
if (cv_dummymares.value < 0)
CV_StealthSetValue(&cv_dummymares, mares);
else if (cv_dummymares.value > mares)
CV_StealthSetValue(&cv_dummymares, 0);
}
}*/
char dummystaffname[22];
static void Dummystaff_OnChange(void)
@@ -3108,11 +3082,7 @@ static void Newgametype_OnChange(void)
P_AllocMapHeader((INT16)(cv_nextmap.value-1));
if ((cv_newgametype.value == GT_RACE && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_RACE)) || // SRB2kart
//(cv_newgametype.value == GT_COMPETITION && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_COMPETITION)) ||
//(cv_newgametype.value == GT_RACE && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_RACE)) ||
((cv_newgametype.value == GT_MATCH || cv_newgametype.value == GT_TEAMMATCH) && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_MATCH))) // ||
//((cv_newgametype.value == GT_TAG || cv_newgametype.value == GT_HIDEANDSEEK) && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_TAG)) ||
//(cv_newgametype.value == GT_CTF && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_CTF)))
((cv_newgametype.value == GT_MATCH || cv_newgametype.value == GT_TEAMMATCH) && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_MATCH)))
{
INT32 value = 0;
@@ -4122,45 +4092,20 @@ void M_StartControlPanel(void)
}
else if (!(netgame || multiplayer)) // Single Player
{
if (gamestate != GS_LEVEL /*|| ultimatemode*/) // intermission, so gray out stuff.
if (gamestate != GS_LEVEL) // intermission, so gray out stuff.
{
SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA)) ? (IT_GRAYEDOUT) : (IT_DISABLED);
SPauseMenu[spause_retry].status = IT_GRAYEDOUT;
}
else
{
//INT32 numlives = 2;
SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA)) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
/*if (&players[consoleplayer])
{
numlives = players[consoleplayer].lives;
if (players[consoleplayer].playerstate != PST_LIVE)
++numlives;
}
// The list of things that can disable retrying is (was?) a little too complex
// for me to want to use the short if statement syntax
if (numlives <= 1 || G_IsSpecialStage(gamemap))
SPauseMenu[spause_retry].status = (IT_GRAYEDOUT);
else*/
SPauseMenu[spause_retry].status = (IT_STRING | IT_CALL);
SPauseMenu[spause_retry].status = (IT_STRING | IT_CALL);
}
// We can always use level select though. :33
//SPauseMenu[spause_levelselect].status = (gamecomplete) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
// And emblem hints.
SPauseMenu[spause_hints].status = (M_SecretUnlocked(SECRET_EMBLEMHINTS)) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
// Shift up Pandora's Box if both pandora and levelselect are active
/*if (SPauseMenu[spause_pandora].status != (IT_DISABLED)
&& SPauseMenu[spause_levelselect].status != (IT_DISABLED))
SPauseMenu[spause_pandora].alphaKey = 24;
else
SPauseMenu[spause_pandora].alphaKey = 32;*/
currentMenu = &SPauseDef;
itemOn = spause_continue;
}
@@ -4442,7 +4387,6 @@ void M_Init(void)
CV_RegisterVar(&cv_dummyrings);
CV_RegisterVar(&cv_dummylives);
CV_RegisterVar(&cv_dummycontinues);
//CV_RegisterVar(&cv_dummymares);
CV_RegisterVar(&cv_dummystaff);
quitmsg[QUITMSG] = M_GetText("Eggman's tied explosives\nto your girlfriend, and\nwill activate them if\nyou press the 'Y' key!\nPress 'N' to save her!\n\n(Press 'Y' to quit)");
@@ -5230,7 +5174,6 @@ static void M_DrawGenericScrollMenu(void)
case IT_CV_INVISSLIDER: // monitor toggles use this
break;
case IT_CV_STRING:
#if 1
if (y + 12 > (currentMenu->y + 2*scrollareaheight))
break;
M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1);
@@ -5238,18 +5181,6 @@ static void M_DrawGenericScrollMenu(void)
if (skullAnimCounter < 4 && i == itemOn)
V_DrawCharacter(x + 8 + V_StringWidth(cv->string, 0), y + 12,
'_' | 0x80, false);
#else // cool new string type stuff, not ready for limelight
if (i == itemOn)
{
V_DrawFill(x-2, y-1, MAXSTRINGLENGTH*8 + 4, 8+3, 159);
V_DrawString(x, y, lowercase, cv->string);
if (skullAnimCounter < 4)
V_DrawCharacter(x + V_StringWidth(cv->string, 0), y, '_' | 0x80, false);
}
else
V_DrawRightAlignedString(BASEVIDWIDTH - x, y,
highlightflags|lowercase, cv->string);
#endif
break;
default:
V_DrawRightAlignedString(BASEVIDWIDTH - x, y,
@@ -5655,18 +5586,6 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
return false;
}
/*if (gt == GT_COOP && (mapheaderinfo[mapnum]->typeoflevel & TOL_COOP))
return true;
if (gt == GT_COMPETITION && (mapheaderinfo[mapnum]->typeoflevel & TOL_COMPETITION))
return true;
if (gt == GT_CTF && (mapheaderinfo[mapnum]->typeoflevel & TOL_CTF))
return true;
if ((gt == GT_TAG || gt == GT_HIDEANDSEEK) && (mapheaderinfo[mapnum]->typeoflevel & TOL_TAG))
return true;*/
if ((gt == GT_MATCH || gt == GT_TEAMMATCH) && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH))
return true;
@@ -5706,20 +5625,6 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
return false;*/
return true;
/*case LLM_NIGHTSATTACK:
if (!(mapheaderinfo[mapnum]->menuflags & LF2_NIGHTSATTACK))
return false;
if (M_MapLocked(mapnum+1))
return false; // not unlocked
if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED)
return true;
if (!mapvisited[mapnum])
return false;
return true;*/
default:
return false;
}
@@ -6041,16 +5946,13 @@ static void M_AddonsInternal(void)
{
const char *pathname = ".";
#if 1
if (cv_addons_option.value == 0)
pathname = usehome ? srb2home : srb2path;
else if (cv_addons_option.value == 1)
pathname = srb2home;
else if (cv_addons_option.value == 2)
pathname = srb2path;
else
#endif
if (cv_addons_option.value == 3 && *cv_addons_folder.string != '\0')
else if (cv_addons_option.value == 3 && *cv_addons_folder.string != '\0')
pathname = cv_addons_folder.string;
strlcpy(menupath, pathname, 1024);
@@ -6521,15 +6423,8 @@ static void M_HandleAddons(INT32 choice)
char *tempname = NULL;
if (dirmenu && dirmenu[dir_on[menudepthleft]])
tempname = Z_StrDup(dirmenu[dir_on[menudepthleft]]+DIR_STRING); // don't need to I_Error if can't make - not important, just QoL
#if 0 // much slower
if (!preparefilemenu(true, false))
{
UNEXIST;
return;
}
#else // streamlined
searchfilemenu(tempname);
#endif
}
switch (choice)
@@ -8225,10 +8120,6 @@ static size_t st_namescrollstate = 0;
static void M_MusicTest(INT32 choice)
{
//INT32 ul = skyRoomMenuTranslations[choice-1];
//UINT8 i;
//char buf[8];
(void)choice;
if (!S_PrepareSoundTest())
@@ -8237,24 +8128,6 @@ static void M_MusicTest(INT32 choice)
return;
}
/*STRBUFCPY(buf, "M_RADIOn");
for (i = 0; i < 9; i++)
{
if (st_radio[i])
W_UnlockCachedPatch(st_radio[i]);
buf[7] = (char)('0'+i);
st_radio[i] = W_CachePatchName(buf, PU_STATIC);
}
STRBUFCPY(buf, "M_LPADn");
for (i = 0; i < 4; i++)
{
if (st_launchpad[i])
W_UnlockCachedPatch(st_launchpad[i]);
buf[6] = (char)('0'+i);
st_launchpad[i] = W_CachePatchName(buf, PU_STATIC);
}*/
curplaying = NULL;
st_time = 0;
@@ -8266,31 +8139,17 @@ static void M_MusicTest(INT32 choice)
static void M_DrawMusicTest(void)
{
INT32 x, y, i;
//char* title;
//fixed_t hscale = FRACUNIT/2, vscale = FRACUNIT/2, bounce = 0;
//UINT8 frame[4] = {0, 0, -1, SKINCOLOR_RUBY};
// let's handle the ticker first. ideally we'd tick this somewhere else, BUT...
if (curplaying)
{
{
fixed_t work;
//angle_t ang;
//bpm = FixedDiv((60*TICRATE)<<FRACBITS, bpm); -- bake this in on load
work = st_time;
//work %= bpm;
if (st_time >= (FRACUNIT << (FRACBITS - 2))) // prevent overflow jump - takes about 15 minutes of loop on the same song to reach
st_time = work;
//work = FixedDiv(work*180, bpm);
//frame[0] = 8-(work/(20<<FRACBITS));
//ang = (FixedAngle(work)>>ANGLETOFINESHIFT) & FINEMASK;
//bounce = (FINESINE(ang) - FRACUNIT/2);
//hscale -= bounce/16;
//vscale += bounce/16;
st_time += renderdeltatics;
}
}
@@ -8298,34 +8157,6 @@ static void M_DrawMusicTest(void)
x = 90<<FRACBITS;
y = (BASEVIDHEIGHT-32)<<FRACBITS;
/*V_DrawStretchyFixedPatch(x, y,
hscale, vscale,
0, st_radio[frame[0]], NULL);
V_DrawFixedPatch(x, y, FRACUNIT/2, 0, st_launchpad[0], NULL);
for (i = 0; i < 9; i++)
{
if (i == frame[2])
{
UINT8 *colmap = R_GetTranslationColormap(TC_RAINBOW, frame[3], GTC_CACHE);
V_DrawFixedPatch(x, y + (frame[1]<<FRACBITS), FRACUNIT/2, 0, st_launchpad[frame[1]+1], colmap);
}
else
V_DrawFixedPatch(x, y, FRACUNIT/2, 0, st_launchpad[1], NULL);
if ((i % 3) == 2)
{
x -= ((2*28) + 25)<<(FRACBITS-1);
y -= ((2*7) - 11)<<(FRACBITS-1);
}
else
{
x += 28<<(FRACBITS-1);
y += 7<<(FRACBITS-1);
}
}*/
y = (BASEVIDWIDTH-(vid.width/vid.dupx))/2;
V_DrawFill(y-1, 20, vid.width/vid.dupx+1, 24, 239);
@@ -8511,8 +8342,6 @@ static void M_DrawMusicTest(void)
if (curplaying == soundtestdefs[t])
{
V_DrawFill(20+280-9, y-4, 8, 16, 230);
//V_DrawCharacter(165+140-8, y, '\x19' | V_YELLOWMAP, false);
//V_DrawFixedPatch((165+140-9)<<FRACBITS, (y<<FRACBITS)-(bounce*4), FRACUNIT, 0, hu_font['\x19'-HU_FONTSTART], V_GetStringColormap(V_YELLOWMAP));
}
}
t++;
@@ -8620,20 +8449,6 @@ static void M_Credits(INT32 choice)
F_StartCredits();
}
// ==================
// SINGLE PLAYER MENU
// ==================
#if 0 // Bring this back when we have actual single-player
static void M_SinglePlayerMenu(INT32 choice)
{
(void)choice;
SP_MainMenu[sprecordattack].status =
(M_SecretUnlocked(SECRET_RECORDATTACK)) ? IT_CALL|IT_STRING : IT_SECRET;
M_SetupNextMenu(&SP_MainDef);
}
#endif
// ===============
// STATISTICS MENU
// ===============
@@ -9090,161 +8905,6 @@ static boolean M_QuitTimeAttackMenu(void)
return true;
}
// Drawing function for Nights Attack
/*void M_DrawNightsAttackMenu(void)
{
patch_t *PictureOfLevel;
lumpnum_t lumpnum;
char beststr[40];
S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback
V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE));
// draw menu (everything else goes on top of it)
M_DrawGenericMenu();
// A 160x100 image of the level as entry MAPxxP
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cv_nextmap.value)));
if (lumpnum != LUMPERROR)
PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE);
else
PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE);
V_DrawSmallScaledPatch(90, 28, 0, PictureOfLevel);
// Level record list
if (cv_nextmap.value)
{
emblem_t *em;
INT32 yHeight;
UINT8 bestoverall = G_GetBestNightsGrade(cv_nextmap.value, 0);
UINT8 bestgrade = G_GetBestNightsGrade(cv_nextmap.value, cv_dummymares.value);
UINT32 bestscore = G_GetBestNightsScore(cv_nextmap.value, cv_dummymares.value);
tic_t besttime = G_GetBestNightsTime(cv_nextmap.value, cv_dummymares.value);
if (P_HasGrades(cv_nextmap.value, 0))
V_DrawScaledPatch(200, 28 + 8, 0, ngradeletters[bestoverall]);
if (currentMenu == &SP_NightsAttackDef)
{
if (P_HasGrades(cv_nextmap.value, cv_dummymares.value))
{
V_DrawString(160-88, 112, highlightflags, "BEST GRADE:");
V_DrawSmallScaledPatch(160 + 86 - (ngradeletters[bestgrade]->width/2),
112 + 8 - (ngradeletters[bestgrade]->height/2),
0, ngradeletters[bestgrade]);
}
if (!bestscore)
sprintf(beststr, "(none)");
else
sprintf(beststr, "%u", bestscore);
V_DrawString(160 - 88, 122, highlightflags, "BEST SCORE:");
V_DrawRightAlignedString(160 + 88, 122, V_ALLOWLOWERCASE, beststr);
if (besttime == UINT32_MAX)
sprintf(beststr, "(none)");
else
sprintf(beststr, "%i:%02i.%02i", G_TicsToMinutes(besttime, true),
G_TicsToSeconds(besttime),
G_TicsToCentiseconds(besttime));
V_DrawString(160-88, 132, highlightflags, "BEST TIME:");
V_DrawRightAlignedString(160+88, 132, V_ALLOWLOWERCASE, beststr);
if (cv_dummymares.value == 0) {
// Draw record emblems.
em = M_GetLevelEmblems(cv_nextmap.value);
while (em)
{
switch (em->type)
{
case ET_NGRADE: yHeight = 112; break;
case ET_NTIME: yHeight = 132; break;
default:
goto skipThisOne;
}
if (em->collected)
V_DrawSmallMappedPatch(160+88, yHeight, 0, W_CachePatchName(M_GetEmblemPatch(em), PU_CACHE),
R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(em), GTC_MENUCACHE));
else
V_DrawSmallScaledPatch(160+88, yHeight, 0, W_CachePatchName("NEEDIT", PU_CACHE));
skipThisOne:
em = M_GetLevelEmblems(-1);
}
}
}
// ALWAYS DRAW level name even when not on this menu!
else
{
consvar_t *ncv;
INT32 x = SP_NightsAttackDef.x;
INT32 y = SP_NightsAttackDef.y;
ncv = (consvar_t *)SP_NightsAttackMenu[0].itemaction;
V_DrawString(x, y + SP_NightsAttackMenu[0].alphaKey, V_TRANSLUCENT, SP_NightsAttackMenu[0].text);
V_DrawString(BASEVIDWIDTH - x - V_StringWidth(ncv->string, 0),
y + SP_NightsAttackMenu[0].alphaKey, highlightflags|V_TRANSLUCENT, ncv->string);
}
}
}*/
// Going to Nights Attack menu...
/*static void M_NightsAttack(INT32 choice)
{
(void)choice;
memset(skins_cons_t, 0, sizeof (skins_cons_t));
levellistmode = LLM_NIGHTSATTACK; // Don't be dependent on cv_newgametype
if (M_CountLevelsToShowInList() == 0)
{
M_StartMessage(M_GetText("No NiGHTS-attackable levels found.\n"),NULL,MM_NOTHING);
return;
}
// This is really just to make sure Sonic is the played character, just in case
M_PatchSkinNameTable();
M_PrepareLevelSelect();
M_SetupNextMenu(&SP_NightsAttackDef);
Nextmap_OnChange();
itemOn = nastart; // "Start" is selected.
G_SetGamestate(GS_TIMEATTACK);
S_ChangeMusicInternal("racent", true);
}*/
// Player has selected the "START" from the nights attack screen
/*static void M_ChooseNightsAttack(INT32 choice)
{
char nameofdemo[256];
(void)choice;
emeralds = 0;
M_ClearMenus(true);
modeattacking = ATTACKING_NIGHTS;
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
I_mkdir(va("%s"PATHSEP"replay"PATHSEP"%s", srb2home, timeattackfolder), 0755);
snprintf(nameofdemo, sizeof nameofdemo, "replay"PATHSEP"%s"PATHSEP"%s-last", timeattackfolder, G_BuildMapName(cv_nextmap.value));
if (!cv_autorecord.value)
remove(va("%s"PATHSEP"%s.lmp", srb2home, nameofdemo));
else
G_RecordDemo(nameofdemo);
G_DeferedInitNew(false, G_BuildMapName(cv_nextmap.value), 0, 0, false);
}*/
// Player has selected the "START" from the time attack screen
static void M_ChooseTimeAttack(INT32 choice)
{
@@ -9349,28 +9009,6 @@ static void M_ReplayTimeAttack(INT32 choice)
// srb2/replay/main/map01-sonic-time-best.lmp
G_DoPlayDemo(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string, which));
}
/*else if (currentMenu == &SP_NightsReplayDef)
{
switch(choice) {
default:
case 0: // best score
which = "score-best";
break;
case 1: // best time
which = "time-best";
break;
case 2: // last
which = "last";
break;
case 3: // staff
return; // M_HandleStaffReplay
case 4: // guest
which = "guest";
break;
}
// srb2/replay/main/map01-score-best.lmp
G_DoPlayDemo(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), which));
}*/
}
static void M_EraseGuest(INT32 choice)
@@ -9379,12 +9017,8 @@ static void M_EraseGuest(INT32 choice)
(void)choice;
if (FIL_FileExists(rguest))
remove(rguest);
/*if (currentMenu == &SP_NightsGuestReplayDef)
M_SetupNextMenu(&SP_NightsAttackDef);
else*/
{
M_SetupNextMenu(&SP_TimeAttackDef);
}
M_SetupNextMenu(&SP_TimeAttackDef);
CV_AddValue(&cv_nextmap, -1);
CV_AddValue(&cv_nextmap, 1);
M_StartMessage(M_GetText("Guest replay data erased.\n"),NULL,MM_NOTHING);
@@ -9405,10 +9039,8 @@ static void M_OverwriteGuest(const char *which)
}
FIL_WriteFile(rguest, buf, len);
Z_Free(rguest);
/*if (currentMenu == &SP_NightsGuestReplayDef)
M_SetupNextMenu(&SP_NightsAttackDef);
else*/
M_SetupNextMenu(&SP_TimeAttackDef);
M_SetupNextMenu(&SP_TimeAttackDef);
CV_AddValue(&cv_nextmap, -1);
CV_AddValue(&cv_nextmap, 1);
M_StartMessage(M_GetText("Guest replay data saved.\n"),NULL,MM_NOTHING);
@@ -9426,19 +9058,6 @@ static void M_OverwriteGuest_Lap(INT32 choice)
M_OverwriteGuest("lap-best");
}
/* SRB2Kart
static void M_OverwriteGuest_Score(INT32 choice)
{
(void)choice;
M_OverwriteGuest("score-best");
}
static void M_OverwriteGuest_Rings(INT32 choice)
{
(void)choice;
M_OverwriteGuest("rings-best");
}*/
static void M_OverwriteGuest_Last(INT32 choice)
{
(void)choice;
@@ -9493,9 +9112,6 @@ static void M_ModeAttackEndGame(INT32 choice)
case ATTACKING_RECORD:
currentMenu = &SP_TimeAttackDef;
break;
/*case ATTACKING_NIGHTS:
currentMenu = &SP_NightsAttackDef;
break;*/
}
itemOn = currentMenu->lastOn;
G_SetGamestate(GS_TIMEATTACK);
@@ -9982,7 +9598,6 @@ static void M_CheckMODVersion(int id)
static void
Check_new_version_thread (int *id)
{
M_SetWaitingMode(M_WAITING_VERSION);
M_CheckMODVersion(*id);
@@ -9995,7 +9610,6 @@ Check_new_version_thread (int *id)
{
free(id);
}
}
#endif
#endif/*defined (UPDATE_ALERT) && defined (HAVE_THREADS)*/
@@ -10045,7 +9659,6 @@ static void M_ConnectMenu(INT32 choice)
#endif/*defined (MASTERSERVER) && defined (HAVE_THREADS)*/
}
static void M_ConnectMenuModChecks(INT32 choice)
{
(void)choice;
@@ -10095,7 +9708,6 @@ static void M_HandleMasterServerResetChoice(event_t *ev)
}
}
}
}
void M_PopupMasterServerConnectError(void)
@@ -10813,8 +10425,6 @@ static void M_DrawSetupMultiPlayerMenu(void)
break;
}
M_DrawTextBox(mx + 32, my - 8 + nameboxaddy, MAXPLAYERNAME, 1);
V_DrawString(mx + 40, my + nameboxaddy, V_ALLOWLOWERCASE, setupm_name);
@@ -10979,9 +10589,9 @@ static void M_DrawSetupMultiPlayerMenu(void)
V_DrawScaledPatch(statx - 30, staty + 63 -(5 *i), 0, W_CachePatchName("K_STATN5", PU_CACHE));
}
}
#undef GETSELECTEDSPEED
#undef GETSELECTEDWEIGHT
break;
case SKINMENUTYPE_GRID:
@@ -11732,7 +11342,8 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
default:
if (choice < 32 || choice > 127)
break;
if (itemOn == 0){
if (itemOn == 0)
{
l = strlen(setupm_name);
if (l < MAXPLAYERNAME)
{
@@ -11742,10 +11353,6 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
}
}
break;
}
#undef BREAKWHENLOCKED
-195
View File
@@ -918,201 +918,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
return;
// ********************************** //
// NiGHTS gameplay items and powerups //
// ********************************** //
/*case MT_NIGHTSDRONE:
if (player->bot)
return;
if (player->exiting)
return;
if (player->bonustime)
{
if (G_IsSpecialStage(gamemap)) //After-mare bonus time/emerald reward in special stages.
{
// only allow the player with the emerald in-hand to leave.
if (toucher->tracer && toucher->tracer->target
&& toucher->tracer->target->type == MT_GOTEMERALD)
{
}
else // Make sure that SOMEONE has the emerald, at least!
{
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && players[i].playerstate == PST_LIVE
&& players[i].mo->tracer && players[i].mo->tracer->target
&& players[i].mo->tracer->target->type == MT_GOTEMERALD)
return;
// Well no one has an emerald, so exit anyway!
}
P_GiveEmerald(false);
// Don't play Ideya sound in special stage mode
}
else
S_StartSound(toucher, special->info->activesound);
}
else //Initial transformation. Don't allow second chances in special stages!
{
if (player->pflags & PF_NIGHTSMODE)
return;
S_StartSound(toucher, sfx_supert);
}
if (!(netgame || multiplayer) && !(player->pflags & PF_NIGHTSMODE))
P_SetTarget(&special->tracer, toucher);
P_NightserizePlayer(player, special->health); // Transform!
return;
case MT_NIGHTSLOOPHELPER:
// One second delay
if (special->fuse < toucher->fuse - TICRATE)
{
thinker_t *th;
mobj_t *mo2;
INT32 count;
fixed_t x,y,z, gatherradius;
angle_t d;
statenum_t sparklestate = S_NULL;
if (special->target != toucher) // These ain't your helpers, pal!
return;
x = special->x>>FRACBITS;
y = special->y>>FRACBITS;
z = special->z>>FRACBITS;
count = 1;
// scan the remaining thinkers
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if (mo2 == special)
continue;
// Not our stuff!
if (mo2->target != toucher)
continue;
if (mo2->type == MT_NIGHTSPARKLE)
mo2->tics = 1;
else if (mo2->type == MT_NIGHTSLOOPHELPER)
{
if (mo2->fuse >= special->fuse)
{
count++;
x += mo2->x>>FRACBITS;
y += mo2->y>>FRACBITS;
z += mo2->z>>FRACBITS;
}
P_RemoveMobj(mo2);
}
}
x = (x/count)<<FRACBITS;
y = (y/count)<<FRACBITS;
z = (z/count)<<FRACBITS;
gatherradius = P_AproxDistance(P_AproxDistance(special->x - x, special->y - y), special->z - z);
P_RemoveMobj(special);
if (player->powers[pw_nights_superloop])
{
gatherradius *= 2;
sparklestate = mobjinfo[MT_NIGHTSPARKLE].seestate;
}
if (gatherradius < 30*FRACUNIT) // Player is probably just sitting there.
return;
for (d = 0; d < 16; d++)
P_SpawnParaloop(x, y, z, gatherradius, 16, MT_NIGHTSPARKLE, sparklestate, d*ANGLE_22h, false);
S_StartSound(toucher, sfx_prloop);
// Now we RE-scan all the thinkers to find close objects to pull
// in from the paraloop. Isn't this just so efficient?
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if (P_AproxDistance(P_AproxDistance(mo2->x - x, mo2->y - y), mo2->z - z) > gatherradius)
continue;
if (mo2->flags & MF_SHOOTABLE)
{
P_DamageMobj(mo2, toucher, toucher, 1);
continue;
}
// Make these APPEAR!
// Tails 12-15-2003
if (mo2->flags & MF_NIGHTSITEM)
{
// Requires Bonus Time
if ((mo2->flags2 & MF2_STRONGBOX) && !player->bonustime)
continue;
if (!(mo2->flags & MF_SPECIAL) && mo2->health)
{
P_SetMobjState(mo2, mo2->info->seestate);
mo2->flags |= MF_SPECIAL;
mo2->flags &= ~MF_NIGHTSITEM;
S_StartSound(toucher, sfx_hidden);
continue;
}
}
if (!(mo2->type == MT_NIGHTSWING || mo2->type == MT_RING || mo2->type == MT_COIN
|| mo2->type == MT_BLUEBALL))
continue;
// Yay! The thing's in reach! Pull it in!
mo2->flags |= MF_NOCLIP|MF_NOCLIPHEIGHT;
mo2->flags2 |= MF2_NIGHTSPULL;
P_SetTarget(&mo2->tracer, toucher);
}
}
return;
case MT_EGGCAPSULE:
if (player->bot)
return;
// make sure everything is as it should be, THEN take rings from players in special stages
if (player->pflags & PF_NIGHTSMODE && !toucher->target)
return;
if (player->mare != special->threshold) // wrong mare
return;
if (special->reactiontime > 0) // capsule already has a player attacking it, ignore
return;
if (G_IsSpecialStage(gamemap) && !player->exiting)
{ // In special stages, share rings. Everyone gives up theirs to the player who touched the capsule
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && (&players[i] != player) && players[i].mo->health > 1)
{
toucher->health += players[i].mo->health-1;
player->health = toucher->health;
players[i].mo->health = 1;
players[i].health = players[i].mo->health;
}
}
if (!(player->health > 1) || player->exiting)
return;
// Mark the player as 'pull into the capsule'
P_SetTarget(&player->capsule, special);
special->reactiontime = (player-players)+1;
P_SetTarget(&special->target, NULL);
// Clear text
player->texttimer = 0;
return;*/
case MT_NIGHTSBUMPER:
// Don't trigger if the stage is ended/failed
if (player->exiting)
+3 -7
View File
@@ -265,7 +265,6 @@ void P_ResetScore(player_t *player)
player->scoreadd = 0;
}
//
// P_FindLowestLap
//
@@ -632,7 +631,8 @@ static UINT8 getPlayerPos(player_t *player)
static boolean isPlayerLosing(player_t *player)
{
if (G_BattleGametype()) {
if (G_BattleGametype())
{
UINT8 pos = 1;
UINT8 maxpos = 1;
@@ -1830,7 +1830,6 @@ static void P_DoPlayerHeadSigns(player_t *player)
}
}
//
// P_DoJumpShield
//
@@ -3311,7 +3310,6 @@ void P_DemoCameraMovement(camera_t *cam)
cam->aiming = R_PointToAngle2(0, cam->z, R_PointToDist2(cam->x, cam->y, lastp->mo->x, lastp->mo->y), lastp->mo->z + lastp->mo->scale*128*P_MobjFlip(lastp->mo)); // This is still unholy. Aim a bit above their heads.
}
cam->momx = cam->momy = cam->momz = 0;
if (cmd->forwardmove != 0)
{
@@ -3527,7 +3525,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (P_CameraThinker(player, thiscam, resetcalled))
return true;
if (thiscam == &camera[1]) // Camera 2
{
num = 1;
@@ -4819,8 +4816,7 @@ void P_PlayerThink(player_t *player)
player->losstime--;
// Flash player after being hit.
if (!(//player->pflags & PF_NIGHTSMODE ||
player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
if (!(player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
|| player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either.
|| player->kartstuff[k_respawn] // Respawn timer (for drop dash effect)
|| (player->pflags & PF_TIMEOVER) // NO CONTEST explosion