2020-06-06 01:50:05 +00:00
|
|
|
; subtracts the amount the player paid from their money
|
2020-06-04 19:32:12 +00:00
|
|
|
; OUTPUT: carry = 0(success) or 1(fail because there is not enough money)
|
2016-09-18 01:17:57 +00:00
|
|
|
SubtractAmountPaidFromMoney_:
|
2017-12-30 00:54:27 +00:00
|
|
|
ld de, wPlayerMoney
|
|
|
|
ld hl, hMoney ; total price of items
|
|
|
|
ld c, 3 ; length of money in bytes
|
2016-09-18 01:17:57 +00:00
|
|
|
call StringCmp
|
|
|
|
ret c
|
2017-12-30 00:54:27 +00:00
|
|
|
ld de, wPlayerMoney + 2
|
|
|
|
ld hl, hMoney + 2 ; total price of items
|
|
|
|
ld c, 3 ; length of money in bytes
|
2016-09-18 01:17:57 +00:00
|
|
|
predef SubBCDPredef ; subtract total price from money
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, MONEY_BOX
|
|
|
|
ld [wTextBoxID], a
|
2016-09-18 01:17:57 +00:00
|
|
|
call DisplayTextBoxID ; redraw money text box
|
|
|
|
and a
|
|
|
|
ret
|