Rando, prevent carrying abducted Ruto into Bigocto room#6845
Rando, prevent carrying abducted Ruto into Bigocto room#6845djevangelia wants to merge 1 commit into
Conversation
It's been a minute, but I assume we're doing this intentionally so the player can continue using ruto for switches? |
| if (this->doorType == SHUTTER_BOSS) { | ||
| if (!CHECK_DUNGEON_ITEM(DUNGEON_KEY_BOSS, gSaveContext.mapIndex)) { | ||
| player->naviTextId = -0x204; | ||
| if (GameInteractor_Should(VB_JABU_PREVENT_RUTO_REENTER_BIGOCTO, true, player, &this->dyna.actor)) { |
There was a problem hiding this comment.
The idea with VB/shoulds is that they should be generic and ideally wrap around vanilla conditions with the enum making sense as you read it, so in this case it seems like you could wrap around the doorDirection != 0 and the VB could be VB_SHUTTER_CONSIDER_PLAYER_FACING_DOOR
Then when you are overriding it you can think about it intuitively,
Should shutter consider the player facing the door? If they are holding ruto, and the flag is set, then no (*should = false), otherwise let the vanilla condition apply.
Correct, there's a few things that logically assume you have ruto. |
| // Don't let player carry Ruto through doors 21 and 3 to Bigocto room if Ruto abducted flag set | ||
| Player* player = va_arg(args, Player*); | ||
| Actor* doorActor = va_arg(args, Actor*); | ||
| *should = (gPlayState->sceneNum != SCENE_JABU_JABU || !GET_INFTABLE(INFTABLE_146) || |
There was a problem hiding this comment.
In addition to my other comment, so that other handlers in the future could potentially override this same VB, only override the *should in the exact case you want to prevent, rather than always setting it to true/false
eg
if (condition) {
*should = false;
}
Fixes #1776.
If Ruto enters Bigocto's room after she has already been abducted, the room behaves weird due to actor functions. Randomizer respawns Ruto after abduction, so this can become a problem.
The easiest solution is probably to just not let player open doors to Bigocto room while carrying Ruto after abduction.
This fix makes shutter doors in randomizer when offering player to open the door - check scene, abduction flag, if door is transition actor index 21 or 3, held actor, and if held actor is Ruto.
Looks like this: https://www.youtube.com/watch?v=2Siq2Z41Pqo
The shutter door in decomp and thus this fix uses macros that are missing here, I copied all of them to the corresponding place in actor.h as they are very useful for actor params and will be added anyway when/if code is synced with decomp.
Build Artifacts