From 4e0484553d3668c118746b684edf152449e370fe Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 3 May 2021 18:57:13 -0700 Subject: [PATCH] Move Secret Lab nocompetitive check to Super Gravitron It turns out, despite the game attempting to prevent you from using invincibility or slowdown in the Super Gravitron by simply preventing you from entering the Secret Lab from the menu, it's still possible to enter the Super Gravitron with it anyways. Just have invincibility or slowdown (or both!) enabled, enter the game normally, and talk to Victoria when you have 20 trinkets, to start the epilogue cutscene. Yeah, that's a pretty big gaping hole right there... It's also possible to do a trick that speedrunners use called telejumping to the Secret Lab to bypass the invincibility/slowdown check, too. So rather than single-case patch both of these, I'm going to fix it as generally as possible, by moving the invincibility/slowdown check to the gamestate that starts the Super Gravitron, gamestate 9. If you have invincibility/slowdown enabled, you immediately get sent back to the Secret Lab. However, this check is ignored in custom levels, because custom levels may want to use the Super Gravitron and let players have invincibility/slowdown while doing so (and there are in fact custom levels out in the wild that use the Super Gravitron; it was like one of the first things done when people discovered internal scripting). No message pops up when the game sends you back to the Secret Lab, but no message popped up when the Secret Lab menu option was disabled previously in the first place, so I haven't made anything WORSE, per se. A nice effect of this is that you can have invincibility/slowdown enabled and still be able to go to the Secret Lab from the menu. This is useful if you just want to check your trophies and leave, without having to go out of your way to disable invincibility/slowdown just to go inside. --- desktop_version/src/Game.cpp | 17 +++++++++++++++-- desktop_version/src/Input.cpp | 9 ++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 2b599f35..83b5ddf8 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -791,6 +791,13 @@ void Game::updatestate(void) break; case 9: + if (!map.custommode && nocompetitive()) + { + returntolab(); + state = 0; + break; + } + //Start SWN Minigame Mode B obj.removetrigger(9); @@ -6251,7 +6258,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) //ok, secret lab! no notification, but test: if (unlock[8]) { - option("secret lab", !nocompetitive()); + option("secret lab"); } option("play modes"); if (save_exists()) @@ -6808,7 +6815,13 @@ int Game::get_timestep(void) bool Game::incompetitive(void) { - return insecretlab || intimetrial || nodeathmode; + return ( + !map.custommode + && swnmode + && (swngame == 1 || swngame == 6 || swngame == 7) + ) + || intimetrial + || nodeathmode; } bool Game::nocompetitive(void) diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index fa060af9..c1644cf6 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -1252,13 +1252,8 @@ static void menuactionpress(void) } else if (game.currentmenuoption == 1 && game.unlock[8]) { - if(!game.nocompetitive()){ - music.playef(11); - startmode(11); - }else{ - //Can't do yet! play sad sound - music.playef(2); - } + music.playef(11); + startmode(11); } else if (game.currentmenuoption == sloffset+2) {