-
Notifications
You must be signed in to change notification settings - Fork 25
Rewrite parts of rando, code cleanup #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #include "MiscBehavior.h" | ||
| #include "port/Enhancements/Events/Hooks/Events.h" | ||
|
|
||
| #include "save.h" | ||
|
|
||
| extern "C" { | ||
| #include "core2/gc/zoombox.h" | ||
|
|
||
| extern s8 gameFile_GameIdToFileIdMap[4]; | ||
| void func_803152C4(GcZoombox* self); | ||
| } | ||
|
|
||
| static void FinishPortraitCrossfade(GcZoombox* zoombox) { | ||
| func_803152C4(zoombox); | ||
| zoombox->unk1A4_14 = 0; | ||
| zoombox->unk1A4_13 = 0; | ||
| zoombox->unk17C = 0.0f; | ||
| } | ||
|
|
||
| void Rando::MiscBehavior::InitFileSelectBehavior() { | ||
| REGISTER_LISTENER(OnFileSelectPortrait, EVENT_PRIORITY_NORMAL, [](IEvent* event) { | ||
| OnFileSelectPortrait* ev = (OnFileSelectPortrait*)event; | ||
|
|
||
| if (ev->zoombox == nullptr || ev->gamenum < 0 || ev->gamenum >= 3) { | ||
| return; | ||
| } | ||
|
|
||
| int32_t fileNum = gameFile_GameIdToFileIdMap[ev->gamenum]; | ||
| bool isRando = fileNum >= 0 && fileNum < 4 && gameFile_saveData[fileNum].magic != 0 && | ||
| gameFile_saveData[fileNum].shipSaveData.fileType == FILE_TYPE_SAVE_RANDO; | ||
|
|
||
| // Cheato zoombox sprite for Rando files, otherwise Vanilla | ||
| GcZoomboxSprite wanted = isRando ? ZOOMBOX_SPRITE_5B_CHEATO : ZOOMBOX_SPRITE_C_BANJO_2; | ||
| if (gczoombox_loadSprite((GcZoombox*)ev->zoombox, wanted)) { | ||
| FinishPortraitCrossfade((GcZoombox*)ev->zoombox); | ||
| } | ||
| }) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,6 @@ void Rando::MiscBehavior::OnFileLoad() { | |
| Rando::Logic::GenerateShufflePool(saveData); | ||
| Rando::Logic::GrantStartingLoadout(); | ||
| Rando::Logic::GrantFileProgressFlags(); | ||
| Rando::Logic::GrantSpiralMountainChecks(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where are you applying the Spiral Mountain checks with this function removed? I don't see its new workflow to give those checks if SkipSpiralMountain is enabled.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SkipSpiralMountain is disabled for rando modes.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally don't think it should be disabled since we already know it can work, just needed an iteration. We also shouldn't assume on behalf of the player?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-enable it with v2? When I tested this branch with it still turned on it would grant me all of the vanilla tutorial abilities instead of the checks, and I just didn't feel like chasing it down right now given how much tutorial bottles has bit.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non blocking for the PR but this being disabled for Rando will be a blocker for Rando V2 as a whole.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the milestone for v2 is live I'll create an issue to attach to it as a follow-up, then. The whole idea of this was to create less problems for v2 after all. |
||
| std::string spoilerName = std::to_string(saveData->shipSaveData.randoSaveData.seedId).c_str(); | ||
| std::erase(spoilerName, '-'); | ||
| spoilerName += ".json"; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is following rando's structure that already exists, but this needs to be converted by registering with ShipInit down the line. Just like the port_ functions, this probably shouldn't block the PR, but noting it here so we have reference later.