From 3de4e955db89b176e72654022dff34ba96be96fd Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Mon, 18 Jul 2022 14:44:55 -0700 Subject: [PATCH 1/2] Giant's Knife Behaviour Fixes Fixes a case where Giant's Knife (specifically, breaking and re-buying it) can behave unexpectedly if you don't have a Kokiri Sword in your inventory. Also fixes the broken icon not showing up in inventory after you break it. --- soh/src/code/z_parameter.c | 7 +++++-- .../overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 0ac1e1048..926634339 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1676,13 +1676,16 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { if (item == ITEM_SWORD_BGS) { gSaveContext.swordHealth = 8; - if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF) { - gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; + if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF + ||(gSaveContext.n64ddFlag && ALL_EQUIP_VALUE(EQUIP_SWORD))) { // In rando, when buying Giant's Knife, also check + gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; // for 0xE in case we don't have Kokiri Sword if (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; Interface_LoadItemIcon1(globalCtx, 0); } } + + } else if (item == ITEM_SWORD_MASTER) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; gSaveContext.equips.equipment &= 0xFFF0; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index a7d22e584..79b43eb3c 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -652,7 +652,10 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); gsSPGrayscale(POLY_KAL_DISP++, true); } - KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, point); + + if (!((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment))) { // Don't draw the full BGS icon when we have a broken Giant's Knife + KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, point); + } gsSPGrayscale(POLY_KAL_DISP++, false); } } From b188ed8fb4770945cb99b5e4811c7cff44dc5540 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Mon, 18 Jul 2022 14:47:15 -0700 Subject: [PATCH 2/2] less whitespace --- soh/src/code/z_parameter.c | 1 - 1 file changed, 1 deletion(-) diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 926634339..3baf7dd77 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1685,7 +1685,6 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { } } - } else if (item == ITEM_SWORD_MASTER) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; gSaveContext.equips.equipment &= 0xFFF0;