mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-18 10:31:42 +00:00
* Made levels with TOL_COOP inaccessible from the multiplayer map select unless you'd visited them in singleplayer (mapvisited, saves to gamedata) or visited a Co-op level number equal to/after it (multiplayer, doesn't save to gamedata)
* Tweaked Pandora's box to add: - A mid-game link to the Addons menu. - A button to give everyone SF_SUPER (except Tails in non-devmode executables).
This commit is contained in:
parent
d65e23f3ec
commit
b217e9eb92
4 changed files with 46 additions and 10 deletions
|
@ -44,6 +44,7 @@ extern INT32 cursaveslot;
|
|||
//extern INT16 lastmapsaved;
|
||||
extern INT16 lastmaploaded;
|
||||
extern boolean gamecomplete;
|
||||
extern INT16 lastcoop;
|
||||
|
||||
#define PRECIP_NONE 0
|
||||
#define PRECIP_STORM 1
|
||||
|
|
|
@ -80,6 +80,7 @@ INT32 cursaveslot = -1; // Auto-save 1p savegame slot
|
|||
//INT16 lastmapsaved = 0; // Last map we auto-saved at
|
||||
INT16 lastmaploaded = 0; // Last map the game loaded
|
||||
boolean gamecomplete = false;
|
||||
INT16 lastcoop = 0;
|
||||
|
||||
UINT16 mainwads = 0;
|
||||
boolean modifiedgame; // Set if homebrew PWAD stuff has been added.
|
||||
|
|
39
src/m_menu.c
39
src/m_menu.c
|
@ -236,6 +236,7 @@ static void M_CustomLevelSelect(INT32 choice);
|
|||
static void M_CustomWarp(INT32 choice);
|
||||
FUNCNORETURN static ATTRNORETURN void M_UltimateCheat(INT32 choice);
|
||||
static void M_LoadGameLevelSelect(INT32 choice);
|
||||
static void M_AllowSuper(INT32 choice);
|
||||
static void M_GetAllEmeralds(INT32 choice);
|
||||
static void M_DestroyRobots(INT32 choice);
|
||||
static void M_LevelSelectWarp(INT32 choice);
|
||||
|
@ -677,6 +678,8 @@ static menuitem_t MISC_HelpMenu[] =
|
|||
// Pause Menu Pandora's Box Options
|
||||
static menuitem_t SR_PandorasBox[] =
|
||||
{
|
||||
{IT_STRING | IT_CALL, NULL, "Mid-game add-ons...", M_Addons, 0},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Rings", &cv_dummyrings, 20},
|
||||
{IT_STRING | IT_CVAR, NULL, "Lives", &cv_dummylives, 30},
|
||||
{IT_STRING | IT_CVAR, NULL, "Continues", &cv_dummycontinues, 40},
|
||||
|
@ -684,8 +687,9 @@ static menuitem_t SR_PandorasBox[] =
|
|||
{IT_STRING | IT_CVAR, NULL, "Gravity", &cv_gravity, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Throw Rings", &cv_ringslinger, 70},
|
||||
|
||||
{IT_STRING | IT_CALL, NULL, "Get All Emeralds", M_GetAllEmeralds, 90},
|
||||
{IT_STRING | IT_CALL, NULL, "Destroy All Robots", M_DestroyRobots, 100},
|
||||
{IT_STRING | IT_CALL, NULL, "Enable Super form", M_AllowSuper, 90},
|
||||
{IT_STRING | IT_CALL, NULL, "Get All Emeralds", M_GetAllEmeralds, 100},
|
||||
{IT_STRING | IT_CALL, NULL, "Destroy All Robots", M_DestroyRobots, 110},
|
||||
|
||||
{IT_STRING | IT_CALL, NULL, "Ultimate Cheat", M_UltimateCheat, 130},
|
||||
};
|
||||
|
@ -1536,7 +1540,7 @@ menu_t SR_PandoraDef =
|
|||
&SPauseDef,
|
||||
SR_PandorasBox,
|
||||
M_DrawGenericMenu,
|
||||
60, 40,
|
||||
60, 30,
|
||||
0,
|
||||
M_ExitPandorasBox
|
||||
};
|
||||
|
@ -3822,6 +3826,16 @@ static boolean M_LevelAvailableOnPlatter(INT32 mapnum)
|
|||
|
||||
switch (levellistmode)
|
||||
{
|
||||
case LLM_CREATESERVER:
|
||||
if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED)
|
||||
return true;
|
||||
|
||||
if (!mapvisited[mapnum]
|
||||
&& (mapheaderinfo[mapnum]->typeoflevel & TOL_COOP)
|
||||
&& (mapnum+1) > lastcoop)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
case LLM_RECORDATTACK:
|
||||
case LLM_NIGHTSATTACK:
|
||||
if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED)
|
||||
|
@ -3831,7 +3845,6 @@ static boolean M_LevelAvailableOnPlatter(INT32 mapnum)
|
|||
return false;
|
||||
|
||||
// intentional fallthrough
|
||||
case LLM_CREATESERVER:
|
||||
case LLM_LEVELSELECT:
|
||||
default:
|
||||
return true;
|
||||
|
@ -5211,6 +5224,12 @@ static void M_PandorasBox(INT32 choice)
|
|||
CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].rings, 0));
|
||||
CV_StealthSetValue(&cv_dummylives, players[consoleplayer].lives);
|
||||
CV_StealthSetValue(&cv_dummycontinues, players[consoleplayer].continues);
|
||||
SR_PandorasBox[6].status = ((players[consoleplayer].charflags & SF_SUPER)
|
||||
#ifndef DEVELOP
|
||||
|| cv_skin.value == 1
|
||||
#endif
|
||||
) ? (IT_GRAYEDOUT) : (IT_STRING | IT_CALL);
|
||||
SR_PandorasBox[7].status = (emeralds == ((EMERALD7)*2)-1) ? (IT_GRAYEDOUT) : (IT_STRING | IT_CALL);
|
||||
M_SetupNextMenu(&SR_PandoraDef);
|
||||
}
|
||||
|
||||
|
@ -5347,12 +5366,24 @@ static void M_UltimateCheat(INT32 choice)
|
|||
I_Quit();
|
||||
}
|
||||
|
||||
static void M_AllowSuper(INT32 choice)
|
||||
{
|
||||
(void)choice;
|
||||
|
||||
players[consoleplayer].charflags |= SF_SUPER;
|
||||
M_StartMessage(M_GetText("You are now capable of turning super.\nRemember to get all the emeralds!\n"),NULL,MM_NOTHING);
|
||||
SR_PandorasBox[6].status = IT_GRAYEDOUT;
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
}
|
||||
|
||||
static void M_GetAllEmeralds(INT32 choice)
|
||||
{
|
||||
(void)choice;
|
||||
|
||||
emeralds = ((EMERALD7)*2)-1;
|
||||
M_StartMessage(M_GetText("You now have all 7 emeralds.\nUse them wisely.\nWith great power comes great ring drain.\n"),NULL,MM_NOTHING);
|
||||
SR_PandorasBox[7].status = IT_GRAYEDOUT;
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
}
|
||||
|
|
|
@ -3014,6 +3014,9 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
if (!(netgame || multiplayer) && (!modifiedgame || savemoddata))
|
||||
mapvisited[gamemap-1] |= MV_VISITED;
|
||||
|
||||
if ((maptol & TOL_COOP) && lastcoop < gamemap)
|
||||
lastcoop = gamemap;
|
||||
|
||||
levelloading = false;
|
||||
|
||||
P_RunCachedActions();
|
||||
|
|
Loading…
Reference in a new issue