Owl Travel cutscenes skipped as One Point cutscenes (#6141)
This commit is contained in:
@@ -0,0 +1,54 @@
|
|||||||
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
|
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
||||||
|
#include "soh/ShipInit.hpp"
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "z64save.h"
|
||||||
|
extern PlayState* gPlayState;
|
||||||
|
extern SaveContext gSaveContext;
|
||||||
|
|
||||||
|
u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CVAR_NAME CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint")
|
||||||
|
#define CVAR_VALUE CVarGetInteger(CVAR_NAME, 0)
|
||||||
|
|
||||||
|
static s16 GetEntranceIndex(s32 owlType) {
|
||||||
|
s16 entranceIndex;
|
||||||
|
|
||||||
|
switch (owlType) {
|
||||||
|
case 7:
|
||||||
|
entranceIndex = ENTR_HYRULE_FIELD_OWL_DROP;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
case 9:
|
||||||
|
entranceIndex = ENTR_KAKARIKO_VILLAGE_OWL_DROP;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
|
return ENTR_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_OWL_DROPS)) {
|
||||||
|
entranceIndex = Entrance_OverrideNextIndex(entranceIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return entranceIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SkipOwlTravel(s32 owlType) {
|
||||||
|
gPlayState->nextEntranceIndex = GetEntranceIndex(owlType);
|
||||||
|
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
|
||||||
|
gPlayState->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void RegisterSkipOwlTravel() {
|
||||||
|
COND_VB_SHOULD(VB_PLAY_OWL_TRAVEL_CS, CVAR_VALUE || IS_RANDO, {
|
||||||
|
s32 owlType = va_arg(args, s32);
|
||||||
|
SkipOwlTravel(owlType);
|
||||||
|
*should = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static RegisterShipInitFunc initFunc(RegisterSkipOwlTravel, { CVAR_NAME, "IS_RANDO" });
|
||||||
@@ -1703,6 +1703,14 @@ typedef enum {
|
|||||||
// - `*int16_t` (cutscene id)
|
// - `*int16_t` (cutscene id)
|
||||||
VB_PLAY_ONEPOINT_CS,
|
VB_PLAY_ONEPOINT_CS,
|
||||||
|
|
||||||
|
// #### `result`
|
||||||
|
// ```c
|
||||||
|
// true
|
||||||
|
// ```
|
||||||
|
// #### `args`
|
||||||
|
// - `int32_t` (owl type)
|
||||||
|
VB_PLAY_OWL_TRAVEL_CS,
|
||||||
|
|
||||||
// #### `result`
|
// #### `result`
|
||||||
// ```c
|
// ```c
|
||||||
// true
|
// true
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#include "scenes/overworld/spot16/spot16_scene.h"
|
#include "scenes/overworld/spot16/spot16_scene.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "soh/OTRGlobals.h"
|
|
||||||
#include "soh/ResourceManagerHelpers.h"
|
#include "soh/ResourceManagerHelpers.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
|
||||||
@@ -941,42 +940,24 @@ void func_80ACC00C(EnOwl* this, PlayState* play) {
|
|||||||
osSyncPrintf(VT_FGCOL(CYAN));
|
osSyncPrintf(VT_FGCOL(CYAN));
|
||||||
osSyncPrintf("%dのフクロウ\n", owlType); // "%d owl"
|
osSyncPrintf("%dのフクロウ\n", owlType); // "%d owl"
|
||||||
osSyncPrintf(VT_RST);
|
osSyncPrintf(VT_RST);
|
||||||
switch (owlType) {
|
if (GameInteractor_Should(VB_PLAY_OWL_TRAVEL_CS, true, owlType)) {
|
||||||
case 7:
|
switch (owlType) {
|
||||||
osSyncPrintf(VT_FGCOL(CYAN));
|
case 7:
|
||||||
osSyncPrintf("SPOT 06 の デモがはしった\n"); // "Demo of SPOT 06 has been completed"
|
osSyncPrintf(VT_FGCOL(CYAN));
|
||||||
osSyncPrintf(VT_RST);
|
osSyncPrintf("SPOT 06 の デモがはしった\n"); // "Demo of SPOT 06 has been completed"
|
||||||
if (IS_RANDO) {
|
osSyncPrintf(VT_RST);
|
||||||
if (Randomizer_GetSettingValue(RSK_SHUFFLE_OWL_DROPS)) {
|
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gLakeHyliaOwlCs);
|
||||||
play->nextEntranceIndex = Entrance_OverrideNextIndex(ENTR_HYRULE_FIELD_OWL_DROP);
|
this->actor.draw = NULL;
|
||||||
} else {
|
|
||||||
play->nextEntranceIndex = ENTR_HYRULE_FIELD_OWL_DROP;
|
|
||||||
}
|
|
||||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
||||||
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
|
||||||
break;
|
break;
|
||||||
}
|
case 8:
|
||||||
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gLakeHyliaOwlCs);
|
case 9:
|
||||||
this->actor.draw = NULL;
|
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gDMTOwlCs);
|
||||||
break;
|
this->actor.draw = NULL;
|
||||||
case 8:
|
|
||||||
case 9:
|
|
||||||
if (IS_RANDO) {
|
|
||||||
if (Randomizer_GetSettingValue(RSK_SHUFFLE_OWL_DROPS)) {
|
|
||||||
play->nextEntranceIndex = Entrance_OverrideNextIndex(ENTR_KAKARIKO_VILLAGE_OWL_DROP);
|
|
||||||
} else {
|
|
||||||
play->nextEntranceIndex = ENTR_KAKARIKO_VILLAGE_OWL_DROP;
|
|
||||||
}
|
|
||||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
||||||
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
|
||||||
break;
|
break;
|
||||||
}
|
default:
|
||||||
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gDMTOwlCs);
|
assert(0);
|
||||||
this->actor.draw = NULL;
|
break;
|
||||||
break;
|
}
|
||||||
default:
|
|
||||||
assert(0);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR);
|
Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR);
|
||||||
|
|||||||
Reference in New Issue
Block a user