From 5a0f269fedf765297b1016d1a81247840b62754c Mon Sep 17 00:00:00 2001 From: Melody Date: Sun, 4 Nov 2018 18:30:48 -0500 Subject: [PATCH] fixes issues with surf and cycling road --- engine/items/items.asm | 18 +++++++++++++++++- engine/overworld/bike_shortcut.asm | 12 +++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/engine/items/items.asm b/engine/items/items.asm index dd87d5e13..8810a33a0 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -685,8 +685,17 @@ ItemUseBicycle: jp z,ItemUseNotTime dec a ; is player already bicycling? jr nz,.tryToGetOnBike -.getOffBike +.tryToGetOffBike call ItemUseReloadOverworldData + ld a,[wPseudoItemID] + and a ; if not using select shortcut + jr z,.getOffBike + ; check cycling road + ld a,[wd732] + bit 5,a + jr z,.getOffBike ; if not on cycling road, get off bike + jr .printCannotGetOffText +.getOffBike xor a ld [wWalkBikeSurfState],a ; change player state to walking call PlayDefaultMusic ; play walking music @@ -710,6 +719,13 @@ ItemUseBicycle: ld hl,GotOnBicycleText .printText jp PrintText +.printCannotGetOffText + ld hl,CannotGetOffBicycleText + jp PrintText + +CannotGetOffBicycleText: + TX_FAR _CannotGetOffHereText + db "@" ; used for Surf out-of-battle effect ItemUseSurfboard: diff --git a/engine/overworld/bike_shortcut.asm b/engine/overworld/bike_shortcut.asm index 18c0188d2..8d783c14f 100644 --- a/engine/overworld/bike_shortcut.asm +++ b/engine/overworld/bike_shortcut.asm @@ -17,7 +17,17 @@ TryRideBike:: jr .cleanUp .hasBike farcall IsBikeRidingAllowed - jr c,.useItem + jr c,.checkSurfing + call EnableBikeShortcutText +.checkSurfing + ld a,[wWalkBikeSurfState] + cp a,2 + jr nz,.checkCyclingRoad ; if not surfing + call EnableBikeShortcutText +.checkCyclingRoad + ld a,[wd732] ; cycling road + bit 5,a + jr z,.useItem ;if not on cycling road skip text call EnableBikeShortcutText .useItem call UseItem