mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-26 03:12:18 -05:00
Migrate purple poe faster fight
This commit is contained in:
parent
1683617210
commit
abdbe25c8a
@ -23,6 +23,7 @@ extern "C" {
|
||||
#include "src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h"
|
||||
#include "src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h"
|
||||
#include "src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h"
|
||||
#include "src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h"
|
||||
extern SaveContext gSaveContext;
|
||||
extern PlayState* gPlayState;
|
||||
}
|
||||
@ -686,6 +687,8 @@ static uint32_t enFuUpdateHook = 0;
|
||||
static uint32_t enFuKillHook = 0;
|
||||
static uint32_t bgSpot02UpdateHook = 0;
|
||||
static uint32_t bgSpot02KillHook = 0;
|
||||
static uint32_t enPoSistersUpdateHook = 0;
|
||||
static uint32_t enPoSistersKillHook = 0;
|
||||
void TimeSaverOnActorInitHandler(void* actorRef) {
|
||||
Actor* actor = static_cast<Actor*>(actorRef);
|
||||
|
||||
@ -816,6 +819,33 @@ void TimeSaverOnActorInitHandler(void* actorRef) {
|
||||
EnDntDemo* enDntDemo = static_cast<EnDntDemo*>(actorRef);
|
||||
enDntDemo->actionFunc = EnDntDemo_JudgeSkipToReward;
|
||||
}
|
||||
|
||||
// Forest Temple entrance cutscene
|
||||
if (actor->id == ACTOR_EN_PO_SISTERS && actor->params == 4124) {
|
||||
if (CVarGetInteger("gTimeSavers.SkipCutscene.GlitchAiding", 0)) {
|
||||
Flags_SetSwitch(gPlayState, 0x1B);
|
||||
Actor_Kill(actor);
|
||||
}
|
||||
}
|
||||
|
||||
// Forest Temple purple poe fight speedup
|
||||
if (actor->id == ACTOR_EN_PO_SISTERS && actor->params == 28) {
|
||||
enPoSistersUpdateHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorUpdate>([](void* innerActorRef) mutable {
|
||||
Actor* innerActor = static_cast<Actor*>(innerActorRef);
|
||||
if (innerActor->id == ACTOR_EN_PO_SISTERS && innerActor->params == 28 && (CVarGetInteger("gTimeSavers.SkipMiscInteractions", IS_RANDO))) {
|
||||
EnPoSisters* enPoSisters = static_cast<EnPoSisters*>(innerActorRef);
|
||||
if (enPoSisters->actionFunc == func_80ADB338) {
|
||||
enPoSisters->unk_19C = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
enPoSistersKillHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneInit>([](int16_t sceneNum) mutable {
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnActorUpdate>(enPoSistersUpdateHook);
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnSceneInit>(enPoSistersKillHook);
|
||||
enPoSistersUpdateHook = 0;
|
||||
enPoSistersKillHook = 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void TimeSaverOnSceneInitHandler(int16_t sceneNum) {
|
||||
|
@ -183,12 +183,6 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->epoch++;
|
||||
|
||||
// Skip Poe Intro Cutscene
|
||||
if (IS_RANDO && thisx->params == 4124 && !Randomizer_GetSettingValue(RSK_ENABLE_GLITCH_CUTSCENES)) {
|
||||
Flags_SetSwitch(play, 0x1B);
|
||||
Actor_Kill(thisx);
|
||||
}
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f);
|
||||
SkelAnime_Init(play, &this->skelAnime, &gPoeSistersSkel, &gPoeSistersSwayAnim, this->jointTable,
|
||||
@ -862,11 +856,6 @@ void func_80ADB338(EnPoSisters* this, PlayState* play) {
|
||||
if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) < 600.0f) {
|
||||
if (this->unk_19C != 0) {
|
||||
this->unk_19C--;
|
||||
|
||||
// Force Meg to respawn instantly after getting hit
|
||||
if (IS_RANDO) {
|
||||
this->unk_19C = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->unk_19C = 100;
|
||||
|
@ -32,4 +32,6 @@ typedef struct EnPoSisters {
|
||||
u32 epoch;
|
||||
} EnPoSisters; // size = 0x0338
|
||||
|
||||
void func_80ADB338(EnPoSisters* enPoSisters, PlayState* play);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user