Restore Kodongo AI when in vanilla rooms

This commit is contained in:
codemann8
2025-07-13 00:27:22 -05:00
committed by aerinon
parent b24e440597
commit fa72adb53d

View File

@@ -2,8 +2,7 @@ pushpc
org $9EC147
JSL NewKodongoCollision
JMP .continue : NOP #2
.continue
BRA + : NOP #3 : +
org $9EC152
Kodongo_SetDirection:
@@ -12,8 +11,18 @@ pullpc
NewKodongoCollision:
LDA.w SpriteMoveDirection, X : INC A : AND.b #$03 : STA.w SpriteMoveDirection, X
JSL Kodongo_InVanillaRoom : BEQ .continue
;If they collide more than 4 times just set direction
LDA.w SpriteAuxTable, X : INC A : STA.w SpriteAuxTable, X : CMP.b #$04 : BCC .continue
PLA : PLA : PEA.w Kodongo_SetDirection-1
.continue
RTL
RTL
Kodongo_InVanillaRoom:
LDA.b RoomIndex+1 : BNE .return
LDA.b RoomIndex : CMP.b #$19 : BEQ .return
CMP.b #$27 : BEQ .return
CMP.b #$77 : BEQ .return
.return
RTL
nop #10