pokered/scripts/BikeShop.asm

149 lines
2.9 KiB
NASM
Raw Normal View History

BikeShop_Script:
2014-05-18 18:19:10 +00:00
jp EnableAutoTextBoxDrawing
BikeShop_TextPointers:
def_text_pointers
dw_const BikeShopClerkText, TEXT_BIKESHOP_CLERK
dw_const BikeShopMiddleAgedWomanText, TEXT_BIKESHOP_MIDDLE_AGED_WOMAN
dw_const BikeShopYoungsterText, TEXT_BIKESHOP_YOUNGSTER
2014-05-18 18:19:10 +00:00
BikeShopClerkText:
text_asm
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_GOT_BICYCLE
jr z, .dontHaveBike
ld hl, BikeShopClerkHowDoYouLikeYourBicycleText
2014-05-18 18:19:10 +00:00
call PrintText
jp .Done
.dontHaveBike
2014-05-18 18:19:10 +00:00
ld b, BIKE_VOUCHER
call IsItemInBag
jr z, .dontHaveVoucher
ld hl, BikeShopClerkOhThatsAVoucherText
2014-05-18 18:19:10 +00:00
call PrintText
2015-08-05 21:20:29 +00:00
lb bc, BICYCLE, 1
2014-05-18 18:19:10 +00:00
call GiveItem
jr nc, .BagFull
ld a, BIKE_VOUCHER
ldh [hItemToRemoveID], a
farcall RemoveItemByID
2015-07-21 17:36:03 +00:00
SetEvent EVENT_GOT_BICYCLE
ld hl, BikeShopExchangedVoucherText
2014-05-18 18:19:10 +00:00
call PrintText
jr .Done
.BagFull
ld hl, BikeShopBagFullText
2014-05-18 18:19:10 +00:00
call PrintText
jr .Done
.dontHaveVoucher
ld hl, BikeShopClerkWelcomeText
2014-05-18 18:19:10 +00:00
call PrintText
xor a
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
2015-08-11 05:34:32 +00:00
ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a
2014-05-18 18:19:10 +00:00
ld a, $1
ld [wMaxMenuItem], a
2014-05-18 18:19:10 +00:00
ld a, $2
ld [wTopMenuItemY], a
2014-05-18 18:19:10 +00:00
ld a, $1
ld [wTopMenuItemX], a
ld hl, wStatusFlags5
set BIT_NO_TEXT_DELAY, [hl]
hlcoord 0, 0
2020-11-06 15:33:58 +00:00
ld b, 4
ld c, 15
2014-05-18 18:19:10 +00:00
call TextBoxBorder
call UpdateSprites
hlcoord 2, 2
2014-05-18 18:19:10 +00:00
ld de, BikeShopMenuText
call PlaceString
hlcoord 8, 3
2014-05-18 18:19:10 +00:00
ld de, BikeShopMenuPrice
call PlaceString
ld hl, BikeShopClerkDoYouLikeItText
2014-05-18 18:19:10 +00:00
call PrintText
call HandleMenuInput
2020-11-06 15:33:58 +00:00
bit BIT_B_BUTTON, a
2015-08-11 05:34:32 +00:00
jr nz, .cancel
ld hl, wStatusFlags5
res BIT_NO_TEXT_DELAY, [hl]
ld a, [wCurrentMenuItem]
2014-05-18 18:19:10 +00:00
and a
2015-08-11 05:34:32 +00:00
jr nz, .cancel
ld hl, BikeShopCantAffordText
2014-05-18 18:19:10 +00:00
call PrintText
2015-08-11 05:34:32 +00:00
.cancel
ld hl, BikeShopComeAgainText
2014-05-18 18:19:10 +00:00
call PrintText
.Done
jp TextScriptEnd
2016-06-08 11:45:50 +00:00
BikeShopMenuText:
2014-05-18 18:19:10 +00:00
db "BICYCLE"
next "CANCEL@"
2016-06-08 11:45:50 +00:00
BikeShopMenuPrice:
2014-05-18 18:19:10 +00:00
db "¥1000000@"
BikeShopClerkWelcomeText:
text_far _BikeShopClerkWelcomeText
text_end
2014-05-18 18:19:10 +00:00
BikeShopClerkDoYouLikeItText:
text_far _BikeShopClerkDoYouLikeItText
text_end
2014-05-18 18:19:10 +00:00
2016-06-08 11:45:50 +00:00
BikeShopCantAffordText:
text_far _BikeShopCantAffordText
text_end
2014-05-18 18:19:10 +00:00
BikeShopClerkOhThatsAVoucherText:
text_far _BikeShopClerkOhThatsAVoucherText
text_end
2014-05-18 18:19:10 +00:00
BikeShopExchangedVoucherText:
text_far _BikeShopExchangedVoucherText
sound_get_key_item
text_end
2014-05-18 18:19:10 +00:00
2016-06-08 11:45:50 +00:00
BikeShopComeAgainText:
text_far _BikeShopComeAgainText
text_end
2014-05-18 18:19:10 +00:00
BikeShopClerkHowDoYouLikeYourBicycleText:
text_far _BikeShopClerkHowDoYouLikeYourBicycleText
text_end
2014-05-18 18:19:10 +00:00
BikeShopBagFullText:
text_far _BikeShopBagFullText
text_end
2014-05-18 18:19:10 +00:00
BikeShopMiddleAgedWomanText:
text_asm
ld hl, .Text
2014-05-18 18:19:10 +00:00
call PrintText
jp TextScriptEnd
.Text:
text_far _BikeShopMiddleAgedWomanText
text_end
2014-05-18 18:19:10 +00:00
BikeShopYoungsterText:
text_asm
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_GOT_BICYCLE
ld hl, .CoolBikeText
jr nz, .gotBike
ld hl, .TheseBikesAreExpensiveText
.gotBike
2014-05-18 18:19:10 +00:00
call PrintText
jp TextScriptEnd
.TheseBikesAreExpensiveText:
text_far _BikeShopYoungsterTheseBikesAreExpensiveText
text_end
2014-05-18 18:19:10 +00:00
.CoolBikeText:
text_far _BikeShopYoungsterCoolBikeText
text_end