implement remote item checks
This commit is contained in:
@@ -92,6 +92,10 @@ db #$20, #$19, #$08, #$31 ; year/month/day
|
|||||||
!MULTIWORLD_ITEM_FROM = "$7EF4D3"
|
!MULTIWORLD_ITEM_FROM = "$7EF4D3"
|
||||||
!MULTIWORLD_ROOMID = "$7EF4D4"
|
!MULTIWORLD_ROOMID = "$7EF4D4"
|
||||||
!MULTIWORLD_ROOMDATA = "$7EF4D6"
|
!MULTIWORLD_ROOMDATA = "$7EF4D6"
|
||||||
|
!MULTIWORLD_SCOUT_LOCATION = "$7EF4D7"
|
||||||
|
!MULTIWORLD_SCOUTREPLY_LOCATION = "$7EF4D8"
|
||||||
|
!MULTIWORLD_SCOUTREPLY_ITEM = "$7EF4D9"
|
||||||
|
!MULTIWORLD_SCOUTREPLY_PLAYER = "$7EF4DA"
|
||||||
!MULTIWORLD_RECEIVING_ITEM = "$7EC057" ; 0 = default | 1 = receiving
|
!MULTIWORLD_RECEIVING_ITEM = "$7EC057" ; 0 = default | 1 = receiving
|
||||||
!MULTIWORLD_HUD_CHARACTER_DATA = "$7EC058" ; 0x40 bytes
|
!MULTIWORLD_HUD_CHARACTER_DATA = "$7EC058" ; 0x40 bytes
|
||||||
!MULTIWORLD_ITEM_PLAYER_ID = "$7EC098" ; 0 = disabled
|
!MULTIWORLD_ITEM_PLAYER_ID = "$7EC098" ; 0 = disabled
|
||||||
|
|||||||
@@ -64,16 +64,13 @@ DrawHeartPieceGFX:
|
|||||||
|
|
||||||
.skipLoad
|
.skipLoad
|
||||||
|
|
||||||
PHA
|
|
||||||
JSL.l IsNarrowSprite : BCC +
|
|
||||||
LDA $0E60, X : ORA.b #$20 : STA $0E60, X
|
|
||||||
+
|
|
||||||
;LDA $0E60, X : ORA.b #$10 : STA $0E60, X
|
|
||||||
|
|
||||||
PLA
|
|
||||||
|
|
||||||
JSL.l DrawDynamicTile
|
JSL.l DrawDynamicTile
|
||||||
JSL.l Sprite_DrawShadowLong
|
|
||||||
|
CMP #$03 : BNE +
|
||||||
|
PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA
|
||||||
|
+
|
||||||
|
|
||||||
|
JSL.l Sprite_DrawShadowLong
|
||||||
|
|
||||||
.done
|
.done
|
||||||
PLY : PLA
|
PLY : PLA
|
||||||
|
|||||||
19
newitems.asm
19
newitems.asm
@@ -434,19 +434,28 @@ RTL
|
|||||||
AddReceivedItemExpanded:
|
AddReceivedItemExpanded:
|
||||||
{
|
{
|
||||||
PHA : PHX
|
PHA : PHX
|
||||||
|
LDA RemoteItems : BEQ + : LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
|
||||||
|
LDA $02E9 : BEQ ++ : CMP #$03 : BNE +++ : ++
|
||||||
|
; fromTextOrObject
|
||||||
|
LDA $0345 : BEQ ++ : LDA.b #$04 : ++ : STA $5D ; Restore Link to his swimming state
|
||||||
|
STZ $02DA : STZ $037B : STZ $02E4
|
||||||
|
LDA #$0E : STA $012F
|
||||||
|
+++
|
||||||
|
STZ $02D8 : STZ $02D9 : STZ $02E9
|
||||||
|
PHY : LDY.b #$00 : JSL AddInventory : PLY
|
||||||
|
PLX : PLA : RTL
|
||||||
|
+
|
||||||
|
|
||||||
JSL.l PreItemGet
|
JSL.l PreItemGet
|
||||||
|
|
||||||
LDA $02D8 : PHA ; Item Value
|
|
||||||
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
|
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
|
||||||
PLA
|
LDA $02D8
|
||||||
JSR AttemptItemSubstitution
|
JSR AttemptItemSubstitution
|
||||||
STA $02D8
|
STA $02D8
|
||||||
|
|
||||||
JSR IncrementItemCounters
|
JSR IncrementItemCounters
|
||||||
BRA ++
|
|
||||||
+
|
+
|
||||||
PLA
|
LDA $02D8 ; Item Value
|
||||||
++
|
|
||||||
|
|
||||||
CMP.b #$16 : BEQ .bottle ; Bottle
|
CMP.b #$16 : BEQ .bottle ; Bottle
|
||||||
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
|
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
|
||||||
|
|||||||
@@ -1817,6 +1817,10 @@ db #$00
|
|||||||
ChestGameItem_Player: ; 0x18636B
|
ChestGameItem_Player: ; 0x18636B
|
||||||
db #$00
|
db #$00
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
org $30E36C ; PC 0x18636C
|
||||||
|
RemoteItems:
|
||||||
|
db #$00 ; $00 = off; $01 = on (default: off)
|
||||||
|
;--------------------------------------------------------------------------------
|
||||||
; Player names (32 bytes/player)
|
; Player names (32 bytes/player)
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $30E380 ; PC 0x186380
|
org $30E380 ; PC 0x186380
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ ItemCheck_BombosTablet:
|
|||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
SetTabletItem:
|
SetTabletItem:
|
||||||
JSL.l GetSpriteID
|
|
||||||
PHA
|
PHA
|
||||||
LDA $8A : CMP.b #$03 : BEQ .ether ; if we're on the map where ether is, we're the ether tablet
|
LDA $8A : CMP.b #$03 : BEQ .ether ; if we're on the map where ether is, we're the ether tablet
|
||||||
.bombos
|
.bombos
|
||||||
|
|||||||
@@ -389,6 +389,19 @@ RTL
|
|||||||
;-------------------------------------------------------------------------------- 20/8477
|
;-------------------------------------------------------------------------------- 20/8477
|
||||||
PrepDynamicTile:
|
PrepDynamicTile:
|
||||||
PHA : PHX : PHY
|
PHA : PHX : PHY
|
||||||
|
TAX : LDA RemoteItems : BEQ +
|
||||||
|
TXA
|
||||||
|
CMP !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++
|
||||||
|
LDA !MULTIWORLD_SCOUTREPLY_PLAYER : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
|
||||||
|
LDA !MULTIWORLD_SCOUTREPLY_ITEM
|
||||||
|
TAX
|
||||||
|
BRA +
|
||||||
|
++
|
||||||
|
STA !MULTIWORLD_SCOUT_LOCATION
|
||||||
|
LDA #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
|
||||||
|
LDX #$6B
|
||||||
|
+
|
||||||
|
TXA
|
||||||
JSR.w LoadDynamicTileOAMTable
|
JSR.w LoadDynamicTileOAMTable
|
||||||
JSL.l GetSpriteID ; convert loot id to sprite id
|
JSL.l GetSpriteID ; convert loot id to sprite id
|
||||||
JSL.l GetAnimatedSpriteTile_variable
|
JSL.l GetAnimatedSpriteTile_variable
|
||||||
@@ -446,6 +459,8 @@ RTS
|
|||||||
!SKIP_EOR = "$7F5008"
|
!SKIP_EOR = "$7F5008"
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
DrawDynamicTile:
|
DrawDynamicTile:
|
||||||
|
JSR PrepDrawRemoteItemSprite
|
||||||
|
|
||||||
JSL.l IsNarrowSprite : BCS .narrow
|
JSL.l IsNarrowSprite : BCS .narrow
|
||||||
|
|
||||||
.full
|
.full
|
||||||
@@ -475,6 +490,8 @@ DrawDynamicTile:
|
|||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
DrawDynamicTileNoShadow:
|
DrawDynamicTileNoShadow:
|
||||||
|
JSR PrepDrawRemoteItemSprite
|
||||||
|
|
||||||
JSL.l IsNarrowSprite : BCS .narrow
|
JSL.l IsNarrowSprite : BCS .narrow
|
||||||
|
|
||||||
.full
|
.full
|
||||||
@@ -501,6 +518,31 @@ DrawDynamicTileNoShadow:
|
|||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
;--------------------------------------------------------------------------------
|
||||||
|
PrepDrawRemoteItemSprite:
|
||||||
|
PHA
|
||||||
|
LDA RemoteItems : BEQ +
|
||||||
|
PLA
|
||||||
|
CMP !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++
|
||||||
|
LDA !MULTIWORLD_SCOUT_LOCATION : BEQ +++
|
||||||
|
LDA !MULTIWORLD_SCOUTREPLY_LOCATION
|
||||||
|
JSL PrepDynamicTile
|
||||||
|
LDA #$00
|
||||||
|
BRA ++
|
||||||
|
+++
|
||||||
|
LDA !MULTIWORLD_SCOUTREPLY_PLAYER : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
|
||||||
|
LDA !MULTIWORLD_SCOUTREPLY_ITEM
|
||||||
|
RTS
|
||||||
|
++
|
||||||
|
STA !MULTIWORLD_SCOUT_LOCATION
|
||||||
|
LDA #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
|
||||||
|
LDA #$6B
|
||||||
|
RTS
|
||||||
|
+
|
||||||
|
PLA
|
||||||
|
RTS
|
||||||
|
;--------------------------------------------------------------------------------
|
||||||
|
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
!TILE_UPLOAD_OFFSET_OVERRIDE = "$7F5042"
|
!TILE_UPLOAD_OFFSET_OVERRIDE = "$7F5042"
|
||||||
LoadModifiedTileBufferAddress:
|
LoadModifiedTileBufferAddress:
|
||||||
|
|||||||
Reference in New Issue
Block a user