Update Mermaid/Maple/Librarian action logic structure

This commit is contained in:
scawful
2024-09-18 23:37:34 -04:00
parent 96aa5f916e
commit aa9a75077b

View File

@@ -84,23 +84,22 @@ Sprite_Mermaid_Prep:
Sprite_Mermaid_Main: Sprite_Mermaid_Main:
{ {
LDA.w SprAction, X LDA.w SprMiscE, X
JSL UseImplicitRegIndexedLocalJumpTable JSL UseImplicitRegIndexedLocalJumpTable
dw MermaidHandler
dw MapleHandler
dw LibrarianHandler
MermaidHandler:
{
LDA.w SprAction, X
JSL JumpTableLocal
dw MermaidWait dw MermaidWait
dw MermaidDive dw MermaidDive
dw MermaidSwim dw MermaidSwim
dw MapleIdle
dw Maple_BoughtMilkBottle
dw Maple_NotEnoughRupees
dw LibrarianIdle
dw Librarian_OfferTranslation
dw Maple_HandlePlayerResponse
dw Maple_ComeBackAgain
MermaidWait: MermaidWait:
{ {
%PlayAnimation(0,0, 20) %PlayAnimation(0,0, 20)
@@ -145,6 +144,18 @@ Sprite_Mermaid_Main:
+ +
RTS RTS
} }
}
MapleHandler:
{
LDA.w SprAction, X
JSL JumpTableLocal
dw MapleIdle
dw Maple_BoughtMilkBottle
dw Maple_NotEnoughRupees
dw Maple_HandlePlayerResponse
dw Maple_ComeBackAgain
MapleIdle: MapleIdle:
{ {
@@ -152,7 +163,7 @@ Sprite_Mermaid_Main:
JSL Sprite_PlayerCantPassThrough JSL Sprite_PlayerCantPassThrough
%ShowSolicitedMessage($0187) : BCC .didnt_talk %ShowSolicitedMessage($0187) : BCC .didnt_talk
%GotoAction(8) ; Handle player response %GotoAction(3) ; Handle player response
.didnt_talk .didnt_talk
RTS RTS
} }
@@ -170,25 +181,18 @@ Sprite_Mermaid_Main:
LDA.l $7EF35E : CMP.b #$02 : BEQ .bottle3_available LDA.l $7EF35E : CMP.b #$02 : BEQ .bottle3_available
LDA.l $7EF35F : CMP.b #$02 : BEQ .bottle4_available LDA.l $7EF35F : CMP.b #$02 : BEQ .bottle4_available
%ShowUnconditionalMessage($033) %ShowUnconditionalMessage($033)
%GotoAction(3) %GotoAction(0)
RTS RTS
.bottle1_available .bottle1_available
LDA.b #$0A : STA.l $7EF35C LDA.b #$0A : STA.l $7EF35C : JMP .finish_storage
JMP .finish_storage
.bottle2_available .bottle2_available
LDA.b #$0A : STA.l $7EF35D LDA.b #$0A : STA.l $7EF35D : JMP .finish_storage
JMP .finish_storage
.bottle3_available .bottle3_available
LDA.b #$0A : STA.l $7EF35E LDA.b #$0A : STA.l $7EF35E : JMP .finish_storage
JMP .finish_storage
.bottle4_available .bottle4_available
LDA.b #$0A : STA.l $7EF35F LDA.b #$0A : STA.l $7EF35F
.finish_storage .finish_storage
REP #$20 REP #$20
LDA.l $7EF360 LDA.l $7EF360
SEC SEC
@@ -197,20 +201,47 @@ Sprite_Mermaid_Main:
SEP #$30 SEP #$30
%ShowUnconditionalMessage($0188) ; Thank you! %ShowUnconditionalMessage($0188) ; Thank you!
%GotoAction(3) %GotoAction(0)
RTS RTS
.not_enough_rupees .not_enough_rupees
%GotoAction(6) %GotoAction(2)
RTS RTS
} }
Maple_NotEnoughRupees: Maple_NotEnoughRupees:
{ {
%ShowUnconditionalMessage($0189) ; You don't have enough rupees! %ShowUnconditionalMessage($0189) ; You don't have enough rupees!
%GotoAction(3) %GotoAction(0)
RTS RTS
} }
Maple_HandlePlayerResponse:
{
LDA $1CE8 : BEQ .player_said_yes
%GotoAction(4)
RTS
.player_said_yes
%GotoAction(1)
RTS
}
Maple_ComeBackAgain:
{
%ShowUnconditionalMessage($018B) ; Come back again!
%GotoAction(0)
RTS
}
}
LibrarianHandler:
{
LDA.w SprAction, X
JSL JumpTableLocal
dw LibrarianIdle
dw Librarian_OfferTranslation
LibrarianIdle: LibrarianIdle:
{ {
%PlayAnimation(0,1,16) %PlayAnimation(0,1,16)
@@ -229,23 +260,8 @@ Sprite_Mermaid_Main:
%ShowSolicitedMessage($012C) %ShowSolicitedMessage($012C)
RTS RTS
} }
Maple_HandlePlayerResponse:
{
LDA $1CE8 : BEQ .player_said_yes
%GotoAction(9)
RTS
.player_said_yes
%GotoAction(4)
RTS
} }
Maple_ComeBackAgain:
{
%ShowUnconditionalMessage($018B) ; Come back again!
%GotoAction(3)
RTS
}
} }
Librarian_CheckForAllMaps: Librarian_CheckForAllMaps:
@@ -307,20 +323,16 @@ Sprite_Mermaid_Draw:
LDA .properties, X : STA ($90), Y LDA .properties, X : STA ($90), Y
PHY PHY
TYA : LSR #2 : TAY TYA : LSR #2 : TAY
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
PLY : INY PLY : INY
PLX : DEX : BPL .nextTile PLX : DEX : BPL .nextTile
PLX PLX
RTS RTS
.start_index .start_index
db $00, $02, $04, $05 db $00, $02, $04, $05
.nbr_of_tiles .nbr_of_tiles