mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 09:22:18 -05:00
Restoration: RBA Values (#2672)
* Restore RBA Values Matches all rba scenarios achievable in game to their original outcomes. This only ends up affecting certain trade items. * tooltip rewrite * rba cases generalised * re-add to menu bar * better byteswap and checks for endianness * remove leftover defines
This commit is contained in:
parent
da92ac6a37
commit
cff2e37287
@ -167,6 +167,7 @@ const std::vector<const char*> enhancementsCvars = {
|
||||
"gBombchusOOB",
|
||||
"gQuickPutaway",
|
||||
"gGsCutscene",
|
||||
"gRestoreRBAValues",
|
||||
"gSkipSaveConfirmation",
|
||||
"gAutosave",
|
||||
"gDisableCritWiggle",
|
||||
|
@ -1067,6 +1067,8 @@ void DrawEnhancementsMenu() {
|
||||
UIWidgets::PaddedEnhancementCheckbox("Restore old Gold Skulltula cutscene", "gGsCutscene", true, false);
|
||||
UIWidgets::PaddedEnhancementCheckbox("Quick Bongo Kill", "gQuickBongoKill", true, false);
|
||||
UIWidgets::Tooltip("Restore a bug from NTSC 1.0 that allows bypassing Bongo Bongo's intro cutscene to quickly kill him");
|
||||
UIWidgets::PaddedEnhancementCheckbox("Original RBA Values", "gRestoreRBAValues", true, false);
|
||||
UIWidgets::Tooltip("Restores the original outcomes when performing Reverse Bottle Adventure.");
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
@ -2782,6 +2782,13 @@ s32 Inventory_HasSpecificBottle(u8 bottleItem) {
|
||||
}
|
||||
}
|
||||
|
||||
void byteSwapInventory() {
|
||||
gSaveContext.inventory.equipment = BE16SWAP(gSaveContext.inventory.equipment);
|
||||
gSaveContext.inventory.upgrades = BE32SWAP(gSaveContext.inventory.upgrades);
|
||||
gSaveContext.inventory.questItems = BE32SWAP(gSaveContext.inventory.questItems);
|
||||
gSaveContext.inventory.gsTokens = BE16SWAP(gSaveContext.inventory.gsTokens);
|
||||
}
|
||||
|
||||
void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) {
|
||||
osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, button,
|
||||
gSaveContext.equips.cButtonSlots[button - 1],
|
||||
@ -2793,7 +2800,14 @@ void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) {
|
||||
item = ITEM_MILK_HALF;
|
||||
}
|
||||
|
||||
gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] = item;
|
||||
if (CVarGetInteger("gRestoreRBAValues",0)) {
|
||||
byteSwapInventory();
|
||||
gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] = item;
|
||||
byteSwapInventory();
|
||||
} else {
|
||||
gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] = item;
|
||||
}
|
||||
|
||||
gSaveContext.equips.buttonItems[button] = item;
|
||||
|
||||
Interface_LoadItemIcon1(play, button);
|
||||
|
Loading…
Reference in New Issue
Block a user