-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Add Moon Crash Cutscene Skip to Story Cutscenes time savers #970
base: develop
Are you sure you want to change the base?
Changes from all commits
fea40eb
d483f0c
09ec12f
fd44259
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <libultraship/bridge.h> | ||
#include <libultraship/luslog.h> | ||
#include "2s2h/GameInteractor/GameInteractor.h" | ||
#include "2s2h/ShipInit.hpp" | ||
|
||
extern "C" { | ||
#include "variables.h" | ||
} | ||
|
||
#define CVAR_NAME "gEnhancements.Cutscenes.SkipStoryCutscenes" | ||
#define CVAR CVarGetInteger(CVAR_NAME, 0) | ||
|
||
#define TERMINA_FIELD_MOON_CRASH_CS_ENTRANCE 0x54C0 | ||
|
||
#define MOON_CRASH_NEW_CYCLE_CS_ID 13 | ||
#define MOON_CRASH_NEW_CYCLE_ENTRANCE_ID 0xC030 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, but this value is |
||
|
||
/** | ||
* Skips only the visible cutscenes (Clock Tower destruction and Link's terrible fate with the Fire Wall). | ||
* Note: There is a cutscene command SPECIFICALLY for resetting game state related to the moon crash, | ||
* CS_MISC_RESET_SAVE_FROM_MOON_CRASH, that MUST NOT be skipped, or else | ||
* it would break the vanilla functionality of a Moon Crash reset. | ||
*/ | ||
void RegisterSkipMoonCrash() { | ||
// Skips initial cutscene in Termina Field where the moon falls, goes straight to clock tower cutscene | ||
COND_VB_SHOULD(VB_PLAY_TRANSITION_CS, CVAR, { | ||
if (gSaveContext.save.cutsceneIndex == 0x0 && | ||
gSaveContext.save.entrance == TERMINA_FIELD_MOON_CRASH_CS_ENTRANCE) { | ||
// This cutscene command would otherwise be run as part of the Fire Wall cutscene that gets skipped. | ||
// IT MUST BE CALLED HERE IF THAT CUTSCENE IS SKIPPED OR ELSE THE GAME STATE WILL NOT RESET CORRECTLY! | ||
Sram_ResetSaveFromMoonCrash(&gPlayState->sramCtx); | ||
|
||
gSaveContext.save.cutsceneIndex = MOON_CRASH_NEW_CYCLE_CS_ID; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This value |
||
gSaveContext.save.entrance = MOON_CRASH_NEW_CYCLE_ENTRANCE_ID; | ||
} | ||
}); | ||
} | ||
|
||
static RegisterShipInitFunc initFunc(RegisterSkipMoonCrash, { CVAR_NAME }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of these defines, instead we should just compare against the entrance values using the entrance macro.
If you really want the define, then it should contain the
ENTRANCE
value instead of these hardcoded numbersIn this case its
ENTRANCE(TERMINA_FIELD, 12)