subtract rupees when buying magic bean

This commit is contained in:
scawful
2024-06-13 22:08:19 -04:00
parent 12acfb15fe
commit ec05fac8ee

View File

@@ -122,16 +122,32 @@ Sprite_BeanVendor_Main:
{ {
%PlayAnimation(0,0,1) %PlayAnimation(0,0,1)
LDA.b #$07 REP #$20
JSL Sprite_SpawnDynamically LDA.l $7EF360
LDA.b #$02 : STA.w SprAction, Y CMP.w #$64 ; 100 rupees
LDA.w SprX, X : CLC : ADC.b #$08 : STA $00 SEP #$30
LDA.w SprY, X : STA $02 BCC .not_enough_rupees
LDA.w SprYH, X : STA $03
LDA.w SprXH, X : STA $01 REP #$20
; TODO: Set a flag that says you've got the magic bean LDA.l $7EF360
%ShowUnconditionalMessage($144) SEC
%GotoAction(0) SBC.w #$64 ; Subtract 100 rupees
STA.l $7EF360
SEP #$30
LDA.b #$07
JSL Sprite_SpawnDynamically
LDA.b #$02 : STA.w SprAction, Y
LDA.w SprX, X : CLC : ADC.b #$08 : STA $00
LDA.w SprY, X : STA $02
LDA.w SprYH, X : STA $03
LDA.w SprXH, X : STA $01
; TODO: Set a flag that says you've got the magic bean
%ShowUnconditionalMessage($145)
%GotoAction(0)
RTS
.not_enough_rupees
%GotoAction(4)
RTS RTS
} }
@@ -139,7 +155,7 @@ Sprite_BeanVendor_Main:
PlayerSaidNo: PlayerSaidNo:
{ {
%PlayAnimation(0,0,1) %PlayAnimation(0,0,1)
%ShowUnconditionalMessage($145) %ShowUnconditionalMessage($144)
%GotoAction(0) %GotoAction(0)
RTS RTS
} }