Restore previous state of z_door_warp1.c, and reimplement boss rush blue warp bypass. This also fixes the issue with shadow and spirit medallions not being given in vanilla without cutscene skips on. (#5763)
Ensure shadow and spirit medallions get queued when skipping story cutscenes in vanilla.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
|
#include "soh/Enhancements/timesaver_hook_handlers.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
@@ -12,6 +13,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define RAND_GET_OPTION(option) Rando::Context::GetInstance()->GetOption(option).Get()
|
#define RAND_GET_OPTION(option) Rando::Context::GetInstance()->GetOption(option).Get()
|
||||||
|
|
||||||
|
extern "C" PlayState* gPlayState;
|
||||||
static bool sEnteredBlueWarp = false;
|
static bool sEnteredBlueWarp = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -124,6 +126,13 @@ void SkipBlueWarp_ShouldPlayBlueWarpCS(GIVanillaBehavior _, bool* should, va_lis
|
|||||||
*/
|
*/
|
||||||
void SkipBlueWarp_ShouldGiveItem(GIVanillaBehavior _, bool* should, va_list originalArgs) {
|
void SkipBlueWarp_ShouldGiveItem(GIVanillaBehavior _, bool* should, va_list originalArgs) {
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) {
|
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) {
|
||||||
|
if (IS_VANILLA) {
|
||||||
|
if (gPlayState->sceneNum == SCENE_SHADOW_TEMPLE_BOSS) {
|
||||||
|
TimeSaverQueueItem(RG_SHADOW_MEDALLION);
|
||||||
|
} else if (gPlayState->sceneNum == SCENE_SPIRIT_TEMPLE_BOSS) {
|
||||||
|
TimeSaverQueueItem(RG_SPIRIT_MEDALLION);
|
||||||
|
}
|
||||||
|
}
|
||||||
*should = false;
|
*should = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -501,6 +501,10 @@ void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case VB_PLAY_BLUE_WARP_CS: {
|
||||||
|
*should = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
// Spawn clean blue warps (no ruto, adult animation, etc)
|
// Spawn clean blue warps (no ruto, adult animation, etc)
|
||||||
case VB_SPAWN_BLUE_WARP: {
|
case VB_SPAWN_BLUE_WARP: {
|
||||||
switch (gPlayState->sceneNum) {
|
switch (gPlayState->sceneNum) {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#include <libultraship/bridge.h>
|
#include <libultraship/bridge.h>
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
#include "soh/Enhancements/randomizer/randomizerTypes.h"
|
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
#include "soh/Enhancements/enhancementTypes.h"
|
#include "soh/Enhancements/enhancementTypes.h"
|
||||||
@@ -1199,6 +1198,10 @@ void TimeSaverOnSceneInitHandler(int16_t sceneNum) {
|
|||||||
|
|
||||||
static GetItemEntry vanillaQueuedItemEntry = GET_ITEM_NONE;
|
static GetItemEntry vanillaQueuedItemEntry = GET_ITEM_NONE;
|
||||||
|
|
||||||
|
void TimeSaverQueueItem(RandomizerGet randoGet) {
|
||||||
|
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(randoGet).GetGIEntry_Copy();
|
||||||
|
}
|
||||||
|
|
||||||
void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) {
|
void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) {
|
||||||
// Do nothing when in a boss rush
|
// Do nothing when in a boss rush
|
||||||
if (IS_BOSS_RUSH) {
|
if (IS_BOSS_RUSH) {
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
#ifndef TIMESAVER_HOOK_HANDLERS_H
|
#ifndef TIMESAVER_HOOK_HANDLERS_H
|
||||||
#define TIMESAVER_HOOK_HANDLERS_H
|
#define TIMESAVER_HOOK_HANDLERS_H
|
||||||
|
|
||||||
|
#include "soh/Enhancements/randomizer/randomizerTypes.h"
|
||||||
|
|
||||||
void TimeSaverRegisterHooks();
|
void TimeSaverRegisterHooks();
|
||||||
|
void TimeSaverQueueItem(RandomizerGet randoGet);
|
||||||
|
|
||||||
#endif // TIMESAVER_HOOK_HANDLERS_H
|
#endif // TIMESAVER_HOOK_HANDLERS_H
|
||||||
@@ -813,8 +813,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) {
|
|||||||
gSaveContext.nextCutsceneIndex = 0;
|
gSaveContext.nextCutsceneIndex = 0;
|
||||||
}
|
}
|
||||||
} else if (play->sceneNum == SCENE_SPIRIT_TEMPLE_BOSS) {
|
} else if (play->sceneNum == SCENE_SPIRIT_TEMPLE_BOSS) {
|
||||||
if (GameInteractor_Should(VB_PLAY_BLUE_WARP_CS,
|
if (GameInteractor_Should(VB_PLAY_BLUE_WARP_CS, !CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT),
|
||||||
!Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE),
|
|
||||||
RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE)) {
|
RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE)) {
|
||||||
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE);
|
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE);
|
||||||
if (GameInteractor_Should(VB_GIVE_ITEM_FROM_BLUE_WARP, true, ITEM_MEDALLION_SPIRIT)) {
|
if (GameInteractor_Should(VB_GIVE_ITEM_FROM_BLUE_WARP, true, ITEM_MEDALLION_SPIRIT)) {
|
||||||
@@ -832,8 +831,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) {
|
|||||||
gSaveContext.nextCutsceneIndex = 0;
|
gSaveContext.nextCutsceneIndex = 0;
|
||||||
}
|
}
|
||||||
} else if (play->sceneNum == SCENE_SHADOW_TEMPLE_BOSS) {
|
} else if (play->sceneNum == SCENE_SHADOW_TEMPLE_BOSS) {
|
||||||
if (GameInteractor_Should(VB_PLAY_BLUE_WARP_CS,
|
if (GameInteractor_Should(VB_PLAY_BLUE_WARP_CS, !CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW),
|
||||||
!Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE),
|
|
||||||
RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE)) {
|
RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE)) {
|
||||||
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE);
|
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE);
|
||||||
if (GameInteractor_Should(VB_GIVE_ITEM_FROM_BLUE_WARP, true, ITEM_MEDALLION_SHADOW)) {
|
if (GameInteractor_Should(VB_GIVE_ITEM_FROM_BLUE_WARP, true, ITEM_MEDALLION_SHADOW)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user