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: LoadLibraryItemGFX:
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues) %GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
STA $0DA0, X ; Store item type STA $0E80, X ; Store item type
JSL.l PrepDynamicTile JSL.l PrepDynamicTile
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawLibraryItemGFX: DrawLibraryItemGFX:
PHA PHA
LDA $0DA0, X ; Retrieve stored item type LDA $0E80, X ; Retrieve stored item type
JSL.l DrawDynamicTile JSL.l DrawDynamicTile
PLA PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SetLibraryItem: SetLibraryItem:
PHA PHA
LDY $0DA0, X ; Retrieve stored item type LDY $0E80, X ; Retrieve stored item type
PLA PLA
JSL.l ItemSet_Library ; contains thing we wrote over JSL.l ItemSet_Library ; contains thing we wrote over
RTL RTL

View File

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

View File

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

View File

@@ -155,7 +155,7 @@ RTL
ItemSet_Mushroom: ItemSet_Mushroom:
PHA PHA
LDA !NPC_FLAGS_2 : ORA.b #$10 : STA !NPC_FLAGS_2 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 + BNE +
; if for any reason the item value is 0 reload it, just in case ; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) : TAY %GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) : TAY

View File

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