pokered/scripts/BikeShop.asm

148 lines
2.3 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:
2015-07-03 19:58:50 +00:00
TX_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
2015-07-03 20:13:35 +00:00
ld [$ffdb], a
callba 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]
2015-07-18 20:52:03 +00:00
coord hl, 0, 0
2014-05-18 18:19:10 +00:00
ld b, $4
ld c, $f
call TextBoxBorder
call UpdateSprites
2015-07-18 20:52:03 +00:00
coord hl, 2, 2
2014-05-18 18:19:10 +00:00
ld de, BikeShopMenuText
call PlaceString
2015-07-18 20:52:03 +00:00
coord hl, 8, 3
2014-05-18 18:19:10 +00:00
ld de, BikeShopMenuPrice
call PlaceString
ld hl, BikeShopText_1d815
call PrintText
call HandleMenuInput
bit 1, 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:
2014-05-18 18:19:10 +00:00
TX_FAR _BikeShopText_1d810
db "@"
2016-06-08 11:45:50 +00:00
BikeShopText_1d815:
2014-05-18 18:19:10 +00:00
TX_FAR _BikeShopText_1d815
db "@"
2016-06-08 11:45:50 +00:00
BikeShopCantAffordText:
2015-08-11 05:34:32 +00:00
TX_FAR _BikeShopCantAffordText
2014-05-18 18:19:10 +00:00
db "@"
2016-06-08 11:45:50 +00:00
BikeShopText_1d81f:
2014-05-18 18:19:10 +00:00
TX_FAR _BikeShopText_1d81f
db "@"
2016-06-08 11:45:50 +00:00
BikeShopText_1d824:
TX_FAR _BikeShopText_1d824
2016-07-18 06:17:03 +00:00
TX_SFX_KEY_ITEM
db "@"
2014-05-18 18:19:10 +00:00
2016-06-08 11:45:50 +00:00
BikeShopComeAgainText:
2015-08-11 05:34:32 +00:00
TX_FAR _BikeShopComeAgainText
2014-05-18 18:19:10 +00:00
db "@"
2016-06-08 11:45:50 +00:00
BikeShopText_1d82f:
2014-05-18 18:19:10 +00:00
TX_FAR _BikeShopText_1d82f
db "@"
2016-06-08 11:45:50 +00:00
BikeShopText_1d834:
2014-05-18 18:19:10 +00:00
TX_FAR _BikeShopText_1d834
db "@"
2016-06-08 11:45:50 +00:00
BikeShopText2:
2015-07-03 19:58:50 +00:00
TX_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:
2014-05-18 18:19:10 +00:00
TX_FAR _BikeShopText_1d843
db "@"
2016-06-08 11:45:50 +00:00
BikeShopText3:
2015-07-03 19:58:50 +00:00
TX_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:
2014-05-18 18:19:10 +00:00
TX_FAR _BikeShopText_1d85c
db "@"
2016-06-08 11:45:50 +00:00
BikeShopText_1d861:
2014-05-18 18:19:10 +00:00
TX_FAR _BikeShopText_1d861
db "@"