Add shop shield handling, credits counter, softlock protection

This commit is contained in:
2026-06-05 01:07:17 -05:00
parent 0f36eca4ab
commit 0264a85511
8 changed files with 73 additions and 15 deletions
+31
View File
@@ -89,6 +89,9 @@ GetMultiworldItem:
PHP
LDA.l !MULTIWORLD_ITEM : BNE +
LDA.l !MULTIWORLD_HUD_TIMER : BNE +
LDA.l ShieldEquipment : BNE ++
LDA.l PikitItem : CMP.b #$04 : BNE +
++
BRL .return
+
@@ -123,6 +126,34 @@ GetMultiworldItem:
BRL .return
+
LDA.l ShieldEquipment : BNE +
LDA.l PikitItem : CMP.b #$04 : BEQ +
LDY.b #$10
-
DEY
BMI .restore_shield
LDA.w $0E20, Y
CMP.b #$AA
BNE - ; go to next sprite if this sprite isn't a pikit
LDA.w $0DD0, Y
BEQ - ; go to next sprite if this sprite is dead/inactive
LDA.w $0ED0, Y
CMP.b #$04
BNE - ; go to next sprite if this pikit isn't grabbing a shield
LDA.w $0E90, Y
CMP.b #$04
BNE - ; go to next sprite if this pikit isn't grabbing a shield
BRA + ; active pikit has a shield
.restore_shield
; we have a pikit item, but no shield, and there's no pikit actively
; eating a shield, so return the shield to prevent a softlock
LDA.b #$01
STA.l ShieldEquipment
+
LDA.l !MULTIWORLD_ITEM : BNE +
BRL .return
+