VBify Ruto (#4602)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "objects/object_ru1/object_ru1.h"
|
||||
#include "vt.h"
|
||||
#include "soh/ResourceManagerHelpers.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_CAN_PRESS_SWITCH)
|
||||
|
||||
@@ -763,14 +764,6 @@ void func_80AEC2C0(EnRu1* this, PlayState* play) {
|
||||
func_80AEC070(this, play, something);
|
||||
}
|
||||
|
||||
// Convenience function used so that Ruto always spawns in Jabu in rando, even after she's been kidnapped
|
||||
// Equivalent to !Flags_GetInfTable(INFTABLE_145) in vanilla
|
||||
bool shouldSpawnRuto() {
|
||||
// Flags_GetInfTable(INFTABLE_146) check is to prevent Ruto from spawning during the short period of time when
|
||||
// she's on the Zora's Sapphire pedestal but hasn't been kidnapped yet (would result in multiple Rutos otherwise)
|
||||
return !Flags_GetInfTable(INFTABLE_145) || (IS_RANDO && (Flags_GetInfTable(INFTABLE_146)));
|
||||
}
|
||||
|
||||
void func_80AEC320(EnRu1* this, PlayState* play) {
|
||||
s8 actorRoom;
|
||||
|
||||
@@ -778,7 +771,10 @@ void func_80AEC320(EnRu1* this, PlayState* play) {
|
||||
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0);
|
||||
this->action = 7;
|
||||
EnRu1_SetMouthIndex(this, 1);
|
||||
} else if ((Flags_GetInfTable(INFTABLE_147)) && !Flags_GetInfTable(INFTABLE_140) && shouldSpawnRuto()) {
|
||||
} else if (
|
||||
Flags_GetInfTable(INFTABLE_147) && !Flags_GetInfTable(INFTABLE_140) &&
|
||||
GameInteractor_Should(VB_RUTO_BE_CONSIDERED_NOT_KIDNAPPED, !Flags_GetInfTable(INFTABLE_145), this)
|
||||
) {
|
||||
if (!func_80AEB020(this, play)) {
|
||||
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0);
|
||||
actorRoom = this->actor.room;
|
||||
@@ -867,9 +863,9 @@ void func_80AEC780(EnRu1* this, PlayState* play) {
|
||||
s32 pad;
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if ((func_80AEC5FC(this, play)) && (!Play_InCsMode(play)) &&
|
||||
if (GameInteractor_Should(VB_PLAY_CHILD_RUTO_INTRO, (func_80AEC5FC(this, play)) && (!Play_InCsMode(play)) &&
|
||||
(!(player->stateFlags1 & (PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE | PLAYER_STATE1_CLIMBING_LADDER))) &&
|
||||
(player->actor.bgCheckFlags & 1)) {
|
||||
(player->actor.bgCheckFlags & 1), this)) {
|
||||
|
||||
play->csCtx.segment = &D_80AF0880;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
@@ -1183,8 +1179,11 @@ void func_80AED414(EnRu1* this, PlayState* play) {
|
||||
void func_80AED44C(EnRu1* this, PlayState* play) {
|
||||
s8 actorRoom;
|
||||
|
||||
if ((Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_MEET_RUTO)) && shouldSpawnRuto() && !Flags_GetInfTable(INFTABLE_140) &&
|
||||
!Flags_GetInfTable(INFTABLE_147)) {
|
||||
if (
|
||||
Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_MEET_RUTO) &&
|
||||
GameInteractor_Should(VB_RUTO_BE_CONSIDERED_NOT_KIDNAPPED, !Flags_GetInfTable(INFTABLE_145), this) &&
|
||||
!Flags_GetInfTable(INFTABLE_140) && !Flags_GetInfTable(INFTABLE_147)
|
||||
) {
|
||||
if (!func_80AEB020(this, play)) {
|
||||
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0);
|
||||
actorRoom = this->actor.room;
|
||||
@@ -1550,8 +1549,8 @@ s32 func_80AEE394(EnRu1* this, PlayState* play) {
|
||||
colCtx = &play->colCtx;
|
||||
floorBgId = this->actor.floorBgId; // necessary match, can't move this out of this block unfortunately
|
||||
dynaPolyActor = DynaPoly_GetActor(colCtx, floorBgId);
|
||||
if (dynaPolyActor != NULL && dynaPolyActor->actor.id == ACTOR_BG_BDAN_OBJECTS &&
|
||||
dynaPolyActor->actor.params == 0 && !Player_InCsMode(play) && play->msgCtx.msgLength == 0) {
|
||||
if (GameInteractor_Should(VB_RUTO_RUN_TO_SAPPHIRE, dynaPolyActor != NULL && dynaPolyActor->actor.id == ACTOR_BG_BDAN_OBJECTS &&
|
||||
dynaPolyActor->actor.params == 0 && !Player_InCsMode(play) && play->msgCtx.msgLength == 0, this, dynaPolyActor)) {
|
||||
func_80AEE02C(this);
|
||||
play->csCtx.segment = &D_80AF10A4;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
@@ -1611,7 +1610,7 @@ s32 func_80AEE6D0(EnRu1* this, PlayState* play) {
|
||||
s32 pad;
|
||||
s8 curRoomNum = play->roomCtx.curRoom.num;
|
||||
|
||||
if (!Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_WANTS_TO_BE_TOSSED_TO_SAPPHIRE) && (func_80AEB124(play) != 0)) {
|
||||
if (GameInteractor_Should(VB_RUTO_WANT_TO_BE_TOSSED_TO_SAPPHIRE, !Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_WANTS_TO_BE_TOSSED_TO_SAPPHIRE) && (func_80AEB124(play) != 0), this)) {
|
||||
if (!Player_InCsMode(play)) {
|
||||
Animation_Change(&this->skelAnime, &gRutoChildSeesSapphireAnim, 1.0f, 0,
|
||||
Animation_GetLastFrame(&gRutoChildSquirmAnim), ANIMMODE_LOOP, -8.0f);
|
||||
@@ -2190,8 +2189,11 @@ void func_80AEFF40(EnRu1* this, PlayState* play) {
|
||||
void func_80AEFF94(EnRu1* this, PlayState* play) {
|
||||
s8 actorRoom;
|
||||
|
||||
if ((Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_MEET_RUTO)) && (Flags_GetInfTable(INFTABLE_140)) && shouldSpawnRuto() &&
|
||||
(!(func_80AEB020(this, play)))) {
|
||||
if (
|
||||
Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_MEET_RUTO) && Flags_GetInfTable(INFTABLE_140) &&
|
||||
GameInteractor_Should(VB_RUTO_BE_CONSIDERED_NOT_KIDNAPPED, !Flags_GetInfTable(INFTABLE_145), this) &&
|
||||
(!(func_80AEB020(this, play)))
|
||||
) {
|
||||
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0);
|
||||
actorRoom = this->actor.room;
|
||||
this->action = 22;
|
||||
|
||||
Reference in New Issue
Block a user