summaryrefslogtreecommitdiff
path: root/engine/battle
diff options
context:
space:
mode:
authorklektron <klektron@users.noreply.github.com>2021-01-02 15:24:25 +0100
committerklektron <klektron@users.noreply.github.com>2021-01-02 15:24:25 +0100
commit419eac2a656d5dd034e46c5f93ce808e583050de (patch)
treee624efa8f0f96b763e8a610c0a616988ef72a1b0 /engine/battle
parent36d4d6fe0aeeb60b5137b812b779fa82b05b4a5a (diff)
fixes here and there
Diffstat (limited to 'engine/battle')
-rw-r--r--engine/battle/wild_encounters.asm6
1 files changed, 6 insertions, 0 deletions
diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm
index 8c9c1529..1db9adf6 100644
--- a/engine/battle/wild_encounters.asm
+++ b/engine/battle/wild_encounters.asm
@@ -64,9 +64,13 @@ TryDoWildEncounter:
; determine which wild pokemon (grass or water) can appear in the half-block we're standing in
ld c, [hl]
ld hl, wGrassMons
+ ld a, [wWalkBikeSurfState]
+ bit 1, a
+ jr nz, .gotWaterMon
lda_coord 8, 9
cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile?
jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default
+.gotWaterMon
ld hl, wWaterMons
; since the bottom right tile of a "left shore" half-block is $14 but the bottom left tile is not,
; "left shore" half-blocks (such as the one in the east coast of Cinnabar) load grass encounters.
@@ -74,6 +78,8 @@ TryDoWildEncounter:
ld b, 0
add hl, bc
ld a, [hli]
+ cp $64
+ jr nc, .CantEncounter2
ld [wCurEnemyLVL], a
ld a, [hl]
ld [wcf91], a