pokered/scripts/BikeShop.asm

148 lines
2.4 KiB
NASM
Raw Normal View History

BikeShop_Script:
2014-05-18 18:19:10 +00:00
jp EnableAutoTextBoxDrawing
BikeShop_TextPointers:
2014-05-18 18:19:10 +00:00
dw BikeShopText1
dw BikeShopText2
dw BikeShopText3
2016-06-08 11:45:50 +00:00
BikeShopText1:
text_asm
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_GOT_BICYCLE
jr z, .asm_260d4
2014-05-18 18:19:10 +00:00
ld hl, BikeShopText_1d82f
call PrintText
jp .Done
.asm_260d4
2014-05-18 18:19:10 +00:00
ld b, BIKE_VOUCHER
call IsItemInBag
jr z, .asm_41190
2014-05-18 18:19:10 +00:00
ld hl, BikeShopText_1d81f
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
2014-05-18 18:19:10 +00:00
ld hl, BikeShopText_1d824
call PrintText
jr .Done
.BagFull
ld hl, BikeShopText_1d834
call PrintText
jr .Done
.asm_41190
2014-05-18 18:19:10 +00:00
ld hl, BikeShopText_1d810
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, wd730
2014-05-18 18:19:10 +00:00
set 6, [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, BikeShopText_1d815
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, wd730
2014-05-18 18:19:10 +00:00
res 6, [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@"
2016-06-08 11:45:50 +00:00
BikeShopText_1d810:
text_far _BikeShopText_1d810
text_end
2014-05-18 18:19:10 +00:00
2016-06-08 11:45:50 +00:00
BikeShopText_1d815:
text_far _BikeShopText_1d815
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
2016-06-08 11:45:50 +00:00
BikeShopText_1d81f:
text_far _BikeShopText_1d81f
text_end
2014-05-18 18:19:10 +00:00
2016-06-08 11:45:50 +00:00
BikeShopText_1d824:
text_far _BikeShopText_1d824
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
2016-06-08 11:45:50 +00:00
BikeShopText_1d82f:
text_far _BikeShopText_1d82f
text_end
2014-05-18 18:19:10 +00:00
2016-06-08 11:45:50 +00:00
BikeShopText_1d834:
text_far _BikeShopText_1d834
text_end
2014-05-18 18:19:10 +00:00
2016-06-08 11:45:50 +00:00
BikeShopText2:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, BikeShopText_1d843
call PrintText
jp TextScriptEnd
2016-06-08 11:45:50 +00:00
BikeShopText_1d843:
text_far _BikeShopText_1d843
text_end
2014-05-18 18:19:10 +00:00
2016-06-08 11:45:50 +00:00
BikeShopText3:
text_asm
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_GOT_BICYCLE
2014-05-18 18:19:10 +00:00
ld hl, BikeShopText_1d861
jr nz, .asm_34d2d
2014-05-18 18:19:10 +00:00
ld hl, BikeShopText_1d85c
.asm_34d2d
2014-05-18 18:19:10 +00:00
call PrintText
jp TextScriptEnd
2016-06-08 11:45:50 +00:00
BikeShopText_1d85c:
text_far _BikeShopText_1d85c
text_end
2014-05-18 18:19:10 +00:00
2016-06-08 11:45:50 +00:00
BikeShopText_1d861:
text_far _BikeShopText_1d861
text_end