2019-01-01 20:06:23 +00:00
|
|
|
BikeShop_Script:
|
2014-05-18 18:19:10 +00:00
|
|
|
jp EnableAutoTextBoxDrawing
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
BikeShop_TextPointers:
|
2023-07-14 01:27:56 +00:00
|
|
|
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
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
BikeShopClerkText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_GOT_BICYCLE
|
2023-07-14 01:27:56 +00:00
|
|
|
jr z, .dontHaveBike
|
|
|
|
ld hl, BikeShopClerkHowDoYouLikeYourBicycleText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jp .Done
|
2023-07-14 01:27:56 +00:00
|
|
|
.dontHaveBike
|
2014-05-18 18:19:10 +00:00
|
|
|
ld b, BIKE_VOUCHER
|
|
|
|
call IsItemInBag
|
2023-07-14 01:27:56 +00:00
|
|
|
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
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hItemToRemoveID], a
|
2020-07-07 01:18:22 +00:00
|
|
|
farcall RemoveItemByID
|
2015-07-21 17:36:03 +00:00
|
|
|
SetEvent EVENT_GOT_BICYCLE
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, BikeShopExchangedVoucherText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jr .Done
|
|
|
|
.BagFull
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, BikeShopBagFullText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jr .Done
|
2023-07-14 01:27:56 +00:00
|
|
|
.dontHaveVoucher
|
|
|
|
ld hl, BikeShopClerkWelcomeText
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
xor a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wCurrentMenuItem], a
|
|
|
|
ld [wLastMenuItem], a
|
2015-08-11 05:34:32 +00:00
|
|
|
ld a, A_BUTTON | B_BUTTON
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wMenuWatchedKeys], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $1
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wMaxMenuItem], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $2
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wTopMenuItemY], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $1
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wTopMenuItemX], a
|
2024-07-16 17:02:54 +00:00
|
|
|
ld hl, wStatusFlags5
|
|
|
|
set BIT_NO_TEXT_DELAY, [hl]
|
2020-07-07 15:30:10 +00:00
|
|
|
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
|
2020-07-07 15:30:10 +00:00
|
|
|
hlcoord 2, 2
|
2014-05-18 18:19:10 +00:00
|
|
|
ld de, BikeShopMenuText
|
|
|
|
call PlaceString
|
2020-07-07 15:30:10 +00:00
|
|
|
hlcoord 8, 3
|
2014-05-18 18:19:10 +00:00
|
|
|
ld de, BikeShopMenuPrice
|
|
|
|
call PlaceString
|
2023-07-14 01:27:56 +00:00
|
|
|
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
|
2024-07-16 17:02:54 +00:00
|
|
|
ld hl, wStatusFlags5
|
|
|
|
res BIT_NO_TEXT_DELAY, [hl]
|
2014-05-26 21:04:56 +00:00
|
|
|
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@"
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
BikeShopClerkWelcomeText:
|
|
|
|
text_far _BikeShopClerkWelcomeText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
BikeShopClerkDoYouLikeItText:
|
|
|
|
text_far _BikeShopClerkDoYouLikeItText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-08 11:45:50 +00:00
|
|
|
BikeShopCantAffordText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _BikeShopCantAffordText
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
BikeShopClerkOhThatsAVoucherText:
|
|
|
|
text_far _BikeShopClerkOhThatsAVoucherText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
BikeShopExchangedVoucherText:
|
|
|
|
text_far _BikeShopExchangedVoucherText
|
2020-07-04 21:09:35 +00:00
|
|
|
sound_get_key_item
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-08 11:45:50 +00:00
|
|
|
BikeShopComeAgainText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _BikeShopComeAgainText
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
BikeShopClerkHowDoYouLikeYourBicycleText:
|
|
|
|
text_far _BikeShopClerkHowDoYouLikeYourBicycleText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
BikeShopBagFullText:
|
|
|
|
text_far _BikeShopBagFullText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
BikeShopMiddleAgedWomanText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .Text
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.Text:
|
|
|
|
text_far _BikeShopMiddleAgedWomanText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
BikeShopYoungsterText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_GOT_BICYCLE
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .CoolBikeText
|
|
|
|
jr nz, .gotBike
|
|
|
|
ld hl, .TheseBikesAreExpensiveText
|
|
|
|
.gotBike
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.TheseBikesAreExpensiveText:
|
|
|
|
text_far _BikeShopYoungsterTheseBikesAreExpensiveText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.CoolBikeText:
|
|
|
|
text_far _BikeShopYoungsterCoolBikeText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|