ref: d96f914315c6ab82d30facbc4a5be1710f3c4a33
parent: a9941e28cc3beb33742ef072aaa46941606781fa
author: Rangi <[email protected]>
date: Tue Jul 21 08:15:14 EDT 2020
Define JOHTO_FLYPOINT like KANTO_FLYPOINT
--- a/constants/map_data_constants.asm
+++ b/constants/map_data_constants.asm
@@ -102,6 +102,7 @@
; Flypoints indexes (see data/maps/flypoints.asm)
const_def
; johto
+JOHTO_FLYPOINT EQU const_value
const FLY_NEW_BARK
const FLY_CHERRYGROVE
const FLY_VIOLET
--- a/engine/pokegear/pokegear.asm
+++ b/engine/pokegear/pokegear.asm
@@ -1452,7 +1452,6 @@
RadioChannels:
; entries correspond to constants/radio_constants.asm
-
; frequency value given here = 4 × ingame_frequency − 2
dbw 16, .PKMNTalkAndPokedexShow ; 04.5
dbw 28, .PokemonMusic ; 07.5
@@ -1467,7 +1466,6 @@
.PKMNTalkAndPokedexShow:
; Pokédex Show in the morning
-
; Oak's Pokémon Talk in the afternoon and evening
call .InJohto
jr nc, .NoSignal
@@ -1542,7 +1540,6 @@
.InJohto:
; if in Johto or on the S.S. Aqua, set carry
-
; otherwise clear carry
ld a, [wPokegearMapPlayerIconLandmark]
cp LANDMARK_FAST_SHIP
@@ -2271,13 +2268,10 @@
.JohtoFlyMap:
; Note that .NoKanto should be modified in tandem with this branch
push af
-; Start from New Bark Town
- ld a, FLY_NEW_BARK
- ld [wTownMapPlayerIconLandmark], a
-; Flypoints begin at New Bark Town...
+ ld a, JOHTO_FLYPOINT ; first Johto flypoint
+ ld [wTownMapPlayerIconLandmark], a ; first one is default (New Bark Town)
ld [wStartFlypoint], a
-; ..and end at Silver Cave.
- ld a, FLY_MT_SILVER
+ ld a, KANTO_FLYPOINT - 1 ; last Johto flypoint
ld [wEndFlypoint], a
; Fill out the map
call FillJohtoMap
@@ -2301,16 +2295,11 @@
and a
jr z, .NoKanto
; Kanto's map is only loaded if we've visited Indigo Plateau
-
-; Flypoints begin at Pallet Town...
- ld a, FLY_PALLET
+ ld a, KANTO_FLYPOINT ; first Kanto flypoint
ld [wStartFlypoint], a
-; ...and end at Indigo Plateau
- ld a, FLY_INDIGO
+ ld a, NUM_FLYPOINTS - 1 ; last Kanto flypoint
ld [wEndFlypoint], a
-; Because Indigo Plateau is the first flypoint the player
-; visits, it's made the default flypoint.
- ld [wTownMapPlayerIconLandmark], a
+ ld [wTownMapPlayerIconLandmark], a ; last one is default (Indigo Plateau)
; Fill out the map
call FillKantoMap
call .MapHud
@@ -2320,14 +2309,10 @@
.NoKanto:
; If Indigo Plateau hasn't been visited, we use Johto's map instead
-
-; Start from New Bark Town
- ld a, FLY_NEW_BARK
- ld [wTownMapPlayerIconLandmark], a
-; Flypoints begin at New Bark Town...
+ ld a, JOHTO_FLYPOINT ; first Johto flypoint
+ ld [wTownMapPlayerIconLandmark], a ; first one is default (New Bark Town)
ld [wStartFlypoint], a
-; ..and end at Silver Cave
- ld a, FLY_MT_SILVER
+ ld a, KANTO_FLYPOINT - 1 ; last Johto flypoint
ld [wEndFlypoint], a
call FillJohtoMap
pop af