diff --git a/bookofmudora.asm b/bookofmudora.asm index 55c048a..5f48936 100644 --- a/bookofmudora.asm +++ b/bookofmudora.asm @@ -3,6 +3,7 @@ ;-------------------------------------------------------------------------------- LoadLibraryItemGFX: %GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues) + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID, X JSL.l PrepDynamicTile_loot_resolved @@ -30,6 +31,7 @@ LoadBonkItemGFX: LoadBonkItemGFX_inner: LDA.b #$00 : STA.l RedrawFlag JSR LoadBonkItem + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteItemType, X STA.w SpriteID, X diff --git a/dungeondrops.asm b/dungeondrops.asm index 6a364e8..6abf178 100644 --- a/dungeondrops.asm +++ b/dungeondrops.asm @@ -3,6 +3,7 @@ ;-------------------------------------------------------------------------------- SpawnDungeonPrize: PHX : PHB + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w ItemReceiptID TAX @@ -61,6 +62,7 @@ RTS PrepPrizeTile: PHA : PHX : PHY LDA.w AncillaGet, X + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID,X JSL.l TransferItemReceiptToBuffer_using_ReceiptID @@ -69,6 +71,7 @@ RTL SetItemPose: PHA + LDA.w DungeonID : BMI .one_handed LDA.w RoomItemsTaken : BIT.b #$80 : BNE + .one_handed PLA @@ -97,6 +100,7 @@ SetCutsceneFlag: ; Out: c - Cutscene flag $02 if set, $01 if unset. PHX LDY.b #$01 ; wrote over + LDA.w DungeonID : BMI .no_cutscene LDA.w RoomItemsTaken : BIT #$80 : BNE .dungeon_prize .no_cutscene PLX @@ -112,6 +116,7 @@ RTL AnimatePrizeCutscene: LDA.w ItemReceiptMethod : CMP.b #$03 : BNE + JSR.w CrystalOrPendantBehavior : BCC + + LDA.w DungeonID : BMI + LDA.w RoomItemsTaken : BIT #$80 : BEQ + SEC RTL @@ -148,7 +153,9 @@ RTL MaybeKeepLootID: PHA + LDA.w DungeonID : BMI .no_prize LDA.w RoomItemsTaken : BIT #$80 : BNE .prize + .no_prize STZ.w ItemReceiptID STZ.w ItemReceiptPose PLA diff --git a/heartpieces.asm b/heartpieces.asm index a236318..7243aa2 100644 --- a/heartpieces.asm +++ b/heartpieces.asm @@ -4,6 +4,7 @@ HeartPieceGet: PHX : PHY JSL.l LoadHeartPieceRoomValue + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong TAY JSL.l MaybeMarkDigSpotCollected @@ -112,6 +113,7 @@ HeartPieceSpritePrep: LDA.b #$00 : STA.l RedrawFlag JSL.l LoadHeartPieceRoomValue + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID, X JSL.l PrepDynamicTile_loot_resolved @@ -125,6 +127,7 @@ HeartContainerSpritePrep: LDA.b #$00 : STA.l RedrawFlag JSL.l LoadHeartContainerRoomValue ; load item type + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID, X JSL.l PrepDynamicTile_loot_resolved diff --git a/inventory.asm b/inventory.asm index 9246d65..9f8b93f 100644 --- a/inventory.asm +++ b/inventory.asm @@ -520,6 +520,7 @@ LoadPowder: PHX JSL.l Sprite_SpawnDynamically ; thing we wrote over %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID, Y TYX @@ -572,6 +573,7 @@ LoadMushroom: LDA.b #$00 : STA.l RedrawFlag %GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) + JSL.l AttemptItemSubstitution JSR.w ResolveLootID STA.w SpriteID,X JSL.l PrepDynamicTile diff --git a/npcitems.asm b/npcitems.asm index f633cca..3206fe5 100644 --- a/npcitems.asm +++ b/npcitems.asm @@ -175,6 +175,7 @@ RTL ;-------------------------------------------------------------------------------- LoadZoraKingItemGFX: LDA.l $9DE1C3 ; location randomizer writes zora item to + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID,Y TYX @@ -190,6 +191,7 @@ JumpToSplashItemTarget: ;-------------------------------------------------------------------------------- LoadCatfishItemGFX: LDA.l $9DE185 ; location randomizer writes catfish item to + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID, Y TYX diff --git a/tables.asm b/tables.asm index 17ad2f6..10fbf31 100644 --- a/tables.asm +++ b/tables.asm @@ -87,7 +87,6 @@ SmithItemMode: db $01 ; #$00 = Classic Tempering Process - #$01 = Quick Item Get (default) SmithItem: db $02 ; #$02 = Tempered Sword (default) - org $86B55C ; PC 0x3355C ; sprite_smithy_bros.asm : 634 SmithSword: db $02 ; #$02 = Tempered Sword (default) diff --git a/tablets.asm b/tablets.asm index 07a45e6..3ab31d5 100644 --- a/tablets.asm +++ b/tablets.asm @@ -30,6 +30,7 @@ RTS ;-------------------------------------------------------------------------------- SpawnTabletItem: JSL.l LoadOutdoorValue + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong PHA LDA.b #$EB : STA.l MiniGameTime