summaryrefslogtreecommitdiff
path: root/scripts/bikeshop.asm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bikeshop.asm')
-rwxr-xr-xscripts/bikeshop.asm59
1 files changed, 28 insertions, 31 deletions
diff --git a/scripts/bikeshop.asm b/scripts/bikeshop.asm
index 4bd26a7e..e639caf9 100755
--- a/scripts/bikeshop.asm
+++ b/scripts/bikeshop.asm
@@ -7,27 +7,25 @@ BikeShopTextPointers: ; 1d73f (7:573f)
dw BikeShopText3
BikeShopText1: ; 1d745 (7:5745)
- db $08 ; asm
- ld a, [wd75f]
- bit 0, a
- jr z, .asm_260d4 ; 0x1d74b
+ TX_ASM
+ CheckEvent EVENT_GOT_BICYCLE
+ jr z, .asm_260d4
ld hl, BikeShopText_1d82f
call PrintText
jp .Done
-.asm_260d4 ; 0x1d756
+.asm_260d4
ld b, BIKE_VOUCHER
call IsItemInBag
- jr z, .asm_41190 ; 0x1d75b
+ jr z, .asm_41190
ld hl, BikeShopText_1d81f
call PrintText
- ld bc, (BICYCLE << 8) | 1
+ lb bc, BICYCLE, 1
call GiveItem
jr nc, .BagFull
ld a, BIKE_VOUCHER
- ldh [$db], a
+ ld [$ffdb], a
callba RemoveItemByID
- ld hl, wd75f
- set 0, [hl]
+ SetEvent EVENT_GOT_BICYCLE
ld hl, BikeShopText_1d824
call PrintText
jr .Done
@@ -35,13 +33,13 @@ BikeShopText1: ; 1d745 (7:5745)
ld hl, BikeShopText_1d834
call PrintText
jr .Done
-.asm_41190 ; 0x1d78c
+.asm_41190
ld hl, BikeShopText_1d810
call PrintText
xor a
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
- ld a, $3
+ ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a
ld a, $1
ld [wMaxMenuItem], a
@@ -51,31 +49,31 @@ BikeShopText1: ; 1d745 (7:5745)
ld [wTopMenuItemX], a
ld hl, wd730
set 6, [hl]
- ld hl, wTileMap
+ coord hl, 0, 0
ld b, $4
ld c, $f
call TextBoxBorder
call UpdateSprites
- hlCoord 2, 2
+ coord hl, 2, 2
ld de, BikeShopMenuText
call PlaceString
- hlCoord 8, 3
+ coord hl, 8, 3
ld de, BikeShopMenuPrice
call PlaceString
ld hl, BikeShopText_1d815
call PrintText
call HandleMenuInput
bit 1, a
- jr nz, .asm_b7579 ; 0x1d7dc
+ jr nz, .cancel
ld hl, wd730
res 6, [hl]
ld a, [wCurrentMenuItem]
and a
- jr nz, .asm_b7579 ; 0x1d7e7
- ld hl, BikeShopText_1d81a
+ jr nz, .cancel
+ ld hl, BikeShopCantAffordText
call PrintText
-.asm_b7579 ; 0x1d7ef
- ld hl, BikeShopText_1d82a
+.cancel
+ ld hl, BikeShopComeAgainText
call PrintText
.Done
jp TextScriptEnd
@@ -95,8 +93,8 @@ BikeShopText_1d815: ; 1d815 (7:5815)
TX_FAR _BikeShopText_1d815
db "@"
-BikeShopText_1d81a: ; 1d81a (7:581a)
- TX_FAR _BikeShopText_1d81a
+BikeShopCantAffordText: ; 1d81a (7:581a)
+ TX_FAR _BikeShopCantAffordText
db "@"
BikeShopText_1d81f: ; 1d81f (7:581f)
@@ -104,11 +102,11 @@ BikeShopText_1d81f: ; 1d81f (7:581f)
db "@"
BikeShopText_1d824: ; 1d824 (7:5824)
- TX_FAR _BikeShopText_1d824 ; 0x98eb2
+ TX_FAR _BikeShopText_1d824
db $11, "@"
-BikeShopText_1d82a: ; 1d82a (7:582a)
- TX_FAR _BikeShopText_1d82a
+BikeShopComeAgainText: ; 1d82a (7:582a)
+ TX_FAR _BikeShopComeAgainText
db "@"
BikeShopText_1d82f: ; 1d82f (7:582f)
@@ -120,7 +118,7 @@ BikeShopText_1d834: ; 1d834 (7:5834)
db "@"
BikeShopText2: ; 1d839 (7:5839)
- db $08 ; asm
+ TX_ASM
ld hl, BikeShopText_1d843
call PrintText
jp TextScriptEnd
@@ -130,13 +128,12 @@ BikeShopText_1d843: ; 1d843 (7:5843)
db "@"
BikeShopText3: ; 1d848 (7:5848)
- db $08 ; asm
- ld a, [wd75f]
- bit 0, a
+ TX_ASM
+ CheckEvent EVENT_GOT_BICYCLE
ld hl, BikeShopText_1d861
- jr nz, .asm_34d2d ; 0x1d851
+ jr nz, .asm_34d2d
ld hl, BikeShopText_1d85c
-.asm_34d2d ; 0x1d856
+.asm_34d2d
call PrintText
jp TextScriptEnd