FINAL CHANGE, I PROMISE, I THINK

* MainCfg property smpstage_start - controls the special stage multiplayer games go to.
This commit is contained in:
toaster 2018-06-06 16:07:14 +01:00
parent 33e0343cac
commit 13053bd1ba
5 changed files with 41 additions and 28 deletions

View File

@ -2670,7 +2670,21 @@ static void readmaincfg(MYFILE *f)
value = get_number(word2);
sstage_start = (INT16)value;
sstage_end = (INT16)(sstage_start+6); // 7 special stages total
sstage_end = (INT16)(sstage_start+7); // 7 special stages total plus one weirdo
}
else if (fastcmp(word, "SMPSTAGE_START"))
{
// Support using the actual map name,
// i.e., Level AB, Level FZ, etc.
// Convert to map number
if (word2[0] >= 'A' && word2[0] <= 'Z')
value = M_MapNumber(word2[0], word2[1]);
else
value = get_number(word2);
smpstage_start = (INT16)value;
smpstage_end = (INT16)(smpstage_start+6); // 7 special stages total
}
else if (fastcmp(word, "REDTEAM"))
{

View File

@ -126,8 +126,7 @@ extern INT32 secondarydisplayplayer; // for splitscreen
// Maps of special importance
extern INT16 spstage_start;
extern INT16 sstage_start;
extern INT16 sstage_end;
extern INT16 sstage_start, sstage_end, smpstage_start, smpstage_end;
extern INT16 titlemap;
extern boolean hidetitlepics;

View File

@ -121,8 +121,7 @@ INT16 lastmap; // last level you were at (returning from special stages)
tic_t timeinmap; // Ticker for time spent in level (used for levelcard display)
INT16 spstage_start;
INT16 sstage_start;
INT16 sstage_end;
INT16 sstage_start, sstage_end, smpstage_start, smpstage_end;
INT16 titlemap = 0;
boolean hidetitlepics = false;
@ -2795,7 +2794,11 @@ INT32 G_GetGametypeByName(const char *gametypestr)
//
boolean G_IsSpecialStage(INT32 mapnum)
{
if (gametype == GT_COOP && modeattacking != ATTACKING_RECORD && mapnum >= sstage_start && mapnum <= sstage_end)
if (gametype != GT_COOP || modeattacking == ATTACKING_RECORD)
return false;
if (mapnum >= sstage_start && mapnum <= sstage_end)
return true;
if (mapnum >= smpstage_start && mapnum <= smpstage_end)
return true;
return false;
@ -3018,23 +3021,17 @@ static void G_DoCompleted(void)
if ((gottoken = (gametype == GT_COOP && token)))
{
INT16 i;
token--;
if (!(emeralds & EMERALD1))
nextmap = (INT16)(sstage_start - 1); // Special Stage 1
else if (!(emeralds & EMERALD2))
nextmap = (INT16)(sstage_start); // Special Stage 2
else if (!(emeralds & EMERALD3))
nextmap = (INT16)(sstage_start + 1); // Special Stage 3
else if (!(emeralds & EMERALD4))
nextmap = (INT16)(sstage_start + 2); // Special Stage 4
else if (!(emeralds & EMERALD5))
nextmap = (INT16)(sstage_start + 3); // Special Stage 5
else if (!(emeralds & EMERALD6))
nextmap = (INT16)(sstage_start + 4); // Special Stage 6
else if (!(emeralds & EMERALD7))
nextmap = (INT16)(sstage_start + 5); // Special Stage 7
else
for (i = 0; i < 7; i++)
if (!(emeralds & i))
{
nextmap = ((netgame || multiplayer) ? smpstage_start : sstage_start) + i - 1; // to special stage!
break;
}
if (i == 7)
gottoken = false;
}
@ -3206,8 +3203,9 @@ void G_LoadGameSettings(void)
{
// defaults
spstage_start = 1;
sstage_start = 50;
sstage_end = 57; // 8 special stages in vanilla SRB2
sstage_start = smpstage_start = 50;
sstage_end = smpstage_end = 57; // 7 special stages in vanilla SRB2
sstage_end++; // plus one weirdo
// initialize free sfx slots for skin sounds
S_InitRuntimeSounds();

View File

@ -283,9 +283,11 @@ boolean P_PlayerMoving(INT32 pnum)
//
UINT8 P_GetNextEmerald(void)
{
if (gamemap < sstage_start || gamemap > sstage_end)
return 0;
return (UINT8)(gamemap - sstage_start);
if (gamemap >= sstage_start && gamemap <= sstage_end)
return (UINT8)(gamemap - sstage_start);
if (gamemap >= smpstage_start || gamemap <= smpstage_end)
return (UINT8)(gamemap - smpstage_start);
return 0;
}
//

View File

@ -427,7 +427,7 @@ void Y_IntermissionDrawer(void)
{
boolean drawthistic = !(ALL7EMERALDS(emeralds) && (intertic & 1));
INT32 emeraldx = 152 - 3*28;
INT32 em = (gamemap - sstage_start);
INT32 em = P_GetNextEmerald();
if (em == 7)
{
@ -1358,7 +1358,7 @@ void Y_StartIntermission(void)
else
strcpy(data.spec.passed1, "YOU GOT");
strcpy(data.spec.passed2, "A CHAOS EMERALD");
if (gamemap > (sstage_start + 5))
if (P_GetNextEmerald() > 6)
{
data.spec.passed2[15] = '?';
data.spec.passed2[16] = '\0';