From 0f36eca4ab6925b7c547fadb18a9113b66b7c486 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Sat, 2 May 2026 23:22:37 -0500 Subject: [PATCH] Add more shield logic --- hooks.asm | 20 ++++++++++++++++++-- multiworld.asm | 41 +++++++++++++++++++++++++++++++++-------- npcitems.asm | 18 ++++++++++++++++-- pikit.asm | 18 ++++++++++++++++++ 4 files changed, 85 insertions(+), 12 deletions(-) diff --git a/hooks.asm b/hooks.asm index 60040a5..d191c87 100755 --- a/hooks.asm +++ b/hooks.asm @@ -1522,8 +1522,9 @@ JSL DrawHeartPiecesMenu : BRA DrawEquipment_in_a_dungeon ;================================================================================ ; 300 Rupee NPC ;-------------------------------------------------------------------------------- -org $9EF060 ; <- F7060 - sprite_shopkeeper.asm:242 (INC $0D80, X) -JSL Set300RupeeNPCItem : NOP +org $9EF058 ; <- F7060 - sprite_shopkeeper.asm:242 (INC $0D80, X) +JSL Set300RupeeNPCItem +BCS + : RTS : NOP #6 : + ;================================================================================ ; Tree Kid Fix @@ -2024,8 +2025,15 @@ JSL ItemCheck_MagicBat : BEQ + : RTS : NOP : + ;================================================================================ org $86BD6C ; <- 33D6C - sprite_middle_aged_man.asm:143 (JSL Link_ReceiveItem) JSL Multiworld_MiddleAgedMan_ReactToSecretKeepingResponse +BRA + : NOP #8 : + +;-------------------------------------------------------------------------------- +org $86BE70 ; <- 33E72 - bank_06.asm:11877 +BRA + : NOP #10 : + + org $86BE81 ; <- 33E81 - sprite_hobo.asm:150 (JSL Link_ReceiveItem) JSL Multiworld_Hobo_GrantBottle +BRA + : NOP #8 : + +;-------------------------------------------------------------------------------- org $8589B4 ; <- 289B4 ; sprite_master_sword.asm:183 (JSL Link_ReceiveItem) JSL Multiworld_MasterSword_GrantToPlayer ;================================================================================ @@ -2872,3 +2880,11 @@ NOP #2 org $80F950 NOP #2 + +org $81EEB3 +JSL MaybeFlagVoOChestGamePrize +BCS ContinueVoOCheck +PLB : RTL + +org $81EEC7 +ContinueVoOCheck: diff --git a/multiworld.asm b/multiworld.asm index 1a1d729..dea0e40 100644 --- a/multiworld.asm +++ b/multiworld.asm @@ -222,24 +222,49 @@ Multiworld_BottleVendor_GiveBottle: Multiworld_MiddleAgedMan_ReactToSecretKeepingResponse: { + PHA + JSL ShieldCheck + PLA + BCC .no_take_shield + PHA : PHP SEP #$20 LDA.l PurpleChest_Item_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID PLP : PLA - JSL Link_ReceiveItem ; thing we wrote over -RTL + ; what we wrote over + JSL Link_ReceiveItem + LDA.l NpcFlagsVanilla + ORA.b #$10 + STA.l NpcFlagsVanilla + +.no_take_shield + RTL } Multiworld_Hobo_GrantBottle: { - PHA : PHP - SEP #$20 - LDA.l HoboItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID - PLP : PLA + PHA + JSL ShieldCheck + PLA + BCC .no_take_shield - JSL Link_ReceiveItem ; thing we wrote over -RTL + ; first bit we wrote over + LDX.b OverworldIndex + LDA.l OverworldEventDataWRAM, X + ORA.b #$20 + STA.l OverworldEventDataWRAM, X + + LDA.l HoboItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID + + ; second bit we wrote over + JSL Link_ReceiveItem + LDA.l NpcFlagsVanilla + ORA.b #$01 + STA.l NpcFlagsVanilla + +.no_take_shield + RTL } Multiworld_MasterSword_GrantToPlayer: diff --git a/npcitems.asm b/npcitems.asm index 73e5b47..791108d 100644 --- a/npcitems.asm +++ b/npcitems.asm @@ -223,11 +223,25 @@ Set300RupeeNPCItem: + LDA.w #$0000 LDY.b #$46 ; default to a normal 300 rupees - .done + +.done SEP #$20 STA.l !MULTIWORLD_ITEM_PLAYER_ID + JSL ShieldCheck + BCC .cant_take + + LDA.w RoomItemsTaken + ORA.b #$40 + STA.w RoomItemsTaken + PLP : PLA -RTL + SEC + RTL + +.cant_take + PLP : PLA + CLC + RTL ;================================================================================ ; Randomize Zora King diff --git a/pikit.asm b/pikit.asm index f155598..f0d477b 100644 --- a/pikit.asm +++ b/pikit.asm @@ -184,6 +184,24 @@ PikitDigest: RTL +MaybeFlagVoOChestGamePrize: + LDA.l $81EDA1, X + TAY + JSL ShieldCheck + BCC .cant_take + + LDA.w RoomItemsTaken + ORA.b #$40 + STA.w RoomItemsTaken + + STX.b $C8 + STY.b $0C + + SEC + +.cant_take + RTL + PikitItemList: db $01 ; 00 - Fighter Sword and Shield db $01 ; 01 - Master Sword