Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix skip intro and skip first cycle logic running when it shouldn't #846

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 17 additions & 24 deletions mm/2s2h/Enhancements/Cutscenes/SkipIntroSequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ void Flags_SetWeekEventReg(s32 flag);
void RegisterSkipIntroSequence() {
REGISTER_VB_SHOULD(VB_PLAY_TRANSITION_CS, {
// Intro cutscene
if (!(gSaveContext.save.entrance == ENTRANCE(CUTSCENE, 0) && gSaveContext.save.cutsceneIndex == 0))
if (!(gSaveContext.save.entrance == ENTRANCE(CUTSCENE, 0) && gSaveContext.save.cutsceneIndex == 0) ||
gSaveContext.save.isFirstCycle) {
return;
}

if (CVarGetInteger("gEnhancements.Cutscenes.SkipIntroSequence", 0)) {
gSaveContext.save.entrance = ENTRANCE(SOUTH_CLOCK_TOWN, 0);
Expand All @@ -23,6 +25,10 @@ void RegisterSkipIntroSequence() {
gSaveContext.cycleSceneFlags[SCENE_OPENINGDAN].switch0 |= (1 << 0);
gSaveContext.save.playerForm = PLAYER_FORM_DEKU;

// Marks when Link enters clock town for the first time.
// This should be true forever, it is not "just" for "first cycle". Don't unset it in the first cycle skip.
gSaveContext.save.isFirstCycle = true;

// Mark chest as opened and give the player the Deku Nuts
gSaveContext.cycleSceneFlags[SCENE_OPENINGDAN].chest |= (1 << 0);
Item_Give(gPlayState, ITEM_DEKU_NUTS_10);
Expand All @@ -32,38 +38,25 @@ void RegisterSkipIntroSequence() {
gSaveContext.save.saveInfo.playerData.isMagicAcquired = true;
Item_Give(gPlayState, ITEM_OCARINA_OF_TIME);
Item_Give(gPlayState, ITEM_MASK_DEKU);
gSaveContext.save.saveInfo.inventory.questItems = (1 << QUEST_SONG_TIME) | (1 << QUEST_SONG_HEALING);
if (gSaveContext.save.saveInfo.playerData.threeDayResetCount < 1) {
gSaveContext.save.saveInfo.playerData.threeDayResetCount = 1;
}
gSaveContext.save.isFirstCycle = false;
gSaveContext.save.saveInfo.inventory.questItems |= (1 << QUEST_SONG_TIME) | (1 << QUEST_SONG_HEALING);
gSaveContext.save.saveInfo.playerData.threeDayResetCount = 1;

// Lose nuts
AMMO(ITEM_DEKU_NUT) = 0;

// Tatl's text at seeing the broken great fairy
gSaveContext.cycleSceneFlags[SCENE_YOUSEI_IZUMI].switch0 |= (1 << 10);

// Tatl's text when first entering South Clock Town if not already set
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_59_04)) {
SET_WEEKEVENTREG(WEEKEVENTREG_59_04);
}
// Tatl's text when first entering South Clock Town
SET_WEEKEVENTREG(WEEKEVENTREG_59_04);

// Set Tatl second cycle (?) text if not already set
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_31_04)) {
SET_WEEKEVENTREG(WEEKEVENTREG_31_04);
}
// Set Tatl second cycle (?)
SET_WEEKEVENTREG(WEEKEVENTREG_31_04);

// Set Entrance Cutscene flags for Clock Town if not already set
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_ENTERED_EAST_CLOCK_TOWN)) {
SET_WEEKEVENTREG(WEEKEVENTREG_ENTERED_EAST_CLOCK_TOWN);
}
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_ENTERED_WEST_CLOCK_TOWN)) {
SET_WEEKEVENTREG(WEEKEVENTREG_ENTERED_WEST_CLOCK_TOWN);
}
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_ENTERED_NORTH_CLOCK_TOWN)) {
SET_WEEKEVENTREG(WEEKEVENTREG_ENTERED_NORTH_CLOCK_TOWN);
}
// Set Entrance Cutscene flags for Clock Town
SET_WEEKEVENTREG(WEEKEVENTREG_ENTERED_EAST_CLOCK_TOWN);
SET_WEEKEVENTREG(WEEKEVENTREG_ENTERED_WEST_CLOCK_TOWN);
SET_WEEKEVENTREG(WEEKEVENTREG_ENTERED_NORTH_CLOCK_TOWN);
}
}
});
Expand Down
Loading