Prevent Standing items from corrupting if hit by hookshot/boomerang

This commit is contained in:
Kevin Cathcart
2018-09-14 18:16:27 -04:00
parent 90ed9ed7da
commit 72f7451b6c
5 changed files with 17 additions and 17 deletions

View File

@@ -3,20 +3,20 @@
;--------------------------------------------------------------------------------
LoadLibraryItemGFX:
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
STA $0DA0, X ; Store item type
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
RTL
;--------------------------------------------------------------------------------
DrawLibraryItemGFX:
PHA
LDA $0DA0, X ; Retrieve stored item type
LDA $0E80, X ; Retrieve stored item type
JSL.l DrawDynamicTile
PLA
RTL
;--------------------------------------------------------------------------------
SetLibraryItem:
PHA
LDY $0DA0, X ; Retrieve stored item type
LDY $0E80, X ; Retrieve stored item type
PLA
JSL.l ItemSet_Library ; contains thing we wrote over
RTL

View File

@@ -3,7 +3,7 @@
;--------------------------------------------------------------------------------
HeartPieceGet:
PHX : PHY
LDY $0DA0, X ; load item value into Y register
LDY $0E80, X ; load item value into Y register
BNE +
; if for any reason the item value is 0 reload it, just in case
JSL.l LoadHeartPieceRoomValue : TAY
@@ -38,7 +38,7 @@ RTL
HeartContainerGet:
PHX : PHY
JSL.l AddInventory_incrementBossSwordLong
LDY $0DA0, X ; load item value into Y register
LDY $0E80, X ; load item value into Y register
BNE +
; if for any reason the item value is 0 reload it, just in case
JSL.l LoadHeartContainerRoomValue : TAY
@@ -57,7 +57,7 @@ DrawHeartPieceGFX:
BRL .done ; don't draw on the init frame
.skipInit
LDA $0DA0, X ; Retrieve stored item type
LDA $0E80, X ; Retrieve stored item type
.skipLoad
@@ -89,7 +89,7 @@ DrawHeartContainerGFX:
BRA DrawHeartPieceGFX_done ; don't draw on the init frame
.skipInit
LDA $0DA0, X ; Retrieve stored item type
LDA $0E80, X ; Retrieve stored item type
BRA DrawHeartPieceGFX_skipLoad
;--------------------------------------------------------------------------------
@@ -152,7 +152,7 @@ HeartPieceSpritePrep:
LDA #$00 : STA !REDRAW
JSL.l LoadHeartPieceRoomValue ; load item type
STA $0DA0, X ; Store item type
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
.skip
@@ -165,7 +165,7 @@ HeartContainerSpritePrep:
LDA #$00 : STA !REDRAW
JSL.l LoadHeartContainerRoomValue ; load item type
STA $0DA0, X ; Store item type
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
PLA

View File

@@ -932,7 +932,7 @@ RTL
LoadPowder:
JSL.l Sprite_SpawnDynamically ; thing we wrote over
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues)
STA $0DA0, Y ; Store item type
STA $0E80, Y ; Store item type
JSL.l PrepDynamicTile
RTL
;--------------------------------------------------------------------------------
@@ -958,12 +958,12 @@ RTL
DrawPowder:
LDA $02DA : BNE .defer ; defer if link is buying a potion
LDA.l !REDRAW : BEQ +
LDA $0DA0, X ; Retrieve stored item type
LDA $0E80, X ; Retrieve stored item type
JSL.l PrepDynamicTile
LDA #$00 : STA.l !REDRAW ; reset redraw flag
BRA .defer
+
LDA $0DA0, X ; Retrieve stored item type
LDA $0E80, X ; Retrieve stored item type
JSL.l DrawDynamicTile
.defer
RTL
@@ -985,7 +985,7 @@ LoadMushroom:
LDA #$00 : STA !REDRAW
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues)
STA $0DA0, X ; Store item type
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
.skip
@@ -1005,7 +1005,7 @@ DrawMushroom:
BRA .done ; don't draw on the init frame
.skipInit
LDA $0DA0, X ; Retrieve stored item type
LDA $0E80, X ; Retrieve stored item type
JSL.l DrawDynamicTile
.done
@@ -1017,7 +1017,7 @@ RTL
; CollectPowder:
;--------------------------------------------------------------------------------
CollectPowder:
LDY $0DA0, X ; Retrieve stored item type
LDY $0E80, X ; Retrieve stored item type
BNE +
; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY

View File

@@ -155,7 +155,7 @@ RTL
ItemSet_Mushroom:
PHA
LDA !NPC_FLAGS_2 : ORA.b #$10 : STA !NPC_FLAGS_2
LDY $0DA0, X ; Retrieve stored item type
LDY $0E80, X ; Retrieve stored item type
BNE +
; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) : TAY

View File

@@ -43,7 +43,7 @@ SpawnTabletItem:
STA $7FFE00
JSL Sprite_SpawnDynamically
PLA : STA $0DA0, Y ; Store item type
PLA : STA $0E80, Y ; Store item type
LDA $22 : STA $0D10, Y
LDA $23 : STA $0D30, Y