Dont replace multiworld items

This commit is contained in:
Bonta-kun
2020-01-13 03:08:37 +01:00
committed by caitsith2
parent 6818c3e119
commit 94218b048b
10 changed files with 82 additions and 61 deletions

View File

@@ -2,6 +2,7 @@
; Randomize Book of Mudora
;--------------------------------------------------------------------------------
LoadLibraryItemGFX:
LDA.l LibraryItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
@@ -32,6 +33,7 @@ LoadBonkItemGFX:
LDA.b #$08 : STA $0F50, X ; thing we wrote over
LoadBonkItemGFX_inner:
LDA.b #$00 : STA !REDRAW
JSR LoadBonkItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSR LoadBonkItem
JSL.l PrepDynamicTile
RTL
@@ -52,6 +54,7 @@ DrawBonkItemGFX:
RTL
;--------------------------------------------------------------------------------
GiveBonkItem:
JSR LoadBonkItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
JSR LoadBonkItem
CMP #$24 : BNE .notKey
.key
@@ -60,19 +63,6 @@ GiveBonkItem:
LDA.b #$2F : JSL.l Sound_SetSfx3PanLong
RTL
.notKey
PHA
LDA $A0
CMP #115 : BNE + ; Desert Bonk Key
LDA.l BonkKey_Desert_Player
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower_Player
BRA ++
+
LDA.b #$00
++
STA !MULTIWORLD_ITEM_PLAYER_ID
PLA
PHY : TAY : JSL.l Link_ReceiveItem : PLY
RTL
;--------------------------------------------------------------------------------
@@ -82,9 +72,22 @@ LoadBonkItem:
LDA.l BonkKey_Desert
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower
LDA.l BonkKey_GTower
BRA ++
+
LDA.b #$24 ; default to small key
++
RTS
RTS
;--------------------------------------------------------------------------------
LoadBonkItem_Player:
LDA $A0 ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte
CMP #115 : BNE + ; Desert Bonk Key
LDA.l BonkKey_Desert_Player
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower_Player
BRA ++
+
LDA.b #$00
++
RTS