summaryrefslogtreecommitdiff
path: root/engine/battle/wild_encounters.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/battle/wild_encounters.asm')
-rw-r--r--engine/battle/wild_encounters.asm52
1 files changed, 26 insertions, 26 deletions
diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm
index 03119b90..231c46e7 100644
--- a/engine/battle/wild_encounters.asm
+++ b/engine/battle/wild_encounters.asm
@@ -1,6 +1,6 @@
; try to initiate a wild pokemon encounter
; returns success in Z
-TryDoWildEncounter: ; 13870 (4:7870)
+TryDoWildEncounter:
ld a, [wNPCMovementScriptPointerTableNum]
and a
ret nz
@@ -18,33 +18,33 @@ TryDoWildEncounter: ; 13870 (4:7870)
jr z, .CantEncounter
ld a, [wRepelRemainingSteps]
and a
- jr z, .asm_1389e
+ jr z, .next
dec a
jr z, .lastRepelStep
ld [wRepelRemainingSteps], a
-.asm_1389e
-; determine if wild pokémon can appear in the half-block we’re standing in
+.next
+; determine if wild pokemon can appear in the half-block we're standing in
; is the bottom right tile (9,9) of the half-block we're standing in a grass/water tile?
- hlCoord 9, 9
+ coord hl, 9, 9
ld c, [hl]
- ld a, [W_GRASSTILE]
+ ld a, [wGrassTile]
cp c
- ld a, [W_GRASSRATE]
+ ld a, [wGrassRate]
jr z, .CanEncounter
ld a, $14 ; in all tilesets with a water tile, this is its id
cp c
- ld a, [W_WATERRATE]
+ ld a, [wWaterRate]
jr z, .CanEncounter
-; even if not in grass/water, standing anywhere we can encounter pokémon
-; so long as the map is “indoor” and has wild pokémon defined.
-; …as long as it’s not Viridian Forest or Safari Zone.
- ld a, [W_CURMAP]
+; even if not in grass/water, standing anywhere we can encounter pokemon
+; so long as the map is "indoor" and has wild pokemon defined.
+; ...as long as it's not Viridian Forest or Safari Zone.
+ ld a, [wCurMap]
cp REDS_HOUSE_1F ; is this an indoor map?
jr c, .CantEncounter2
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
cp FOREST ; Viridian Forest/Safari Zone
jr z, .CantEncounter2
- ld a, [W_GRASSRATE]
+ ld a, [wGrassRate]
.CanEncounter
; compare encounter chance with a random number to determine if there will be an encounter
ld b, a
@@ -61,20 +61,20 @@ TryDoWildEncounter: ; 13870 (4:7870)
inc hl
jr .determineEncounterSlot
.gotEncounterSlot
-; determine which wild pokémon (grass or water) can appear in the half-block we’re standing in
+; determine which wild pokemon (grass or water) can appear in the half-block we're standing in
ld c, [hl]
- ld hl, W_GRASSMONS
- aCoord 8, 9
- cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile?
+ ld hl, wGrassMons
+ aCoord 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
- ld hl, W_WATERMONS
+ 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.
+; "left shore" half-blocks (such as the one in the east coast of Cinnabar) load grass encounters.
.gotWildEncounterType
- ld b, $0
+ ld b, 0
add hl, bc
ld a, [hli]
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld a, [hl]
ld [wcf91], a
ld [wEnemyMonSpecies2], a
@@ -83,14 +83,14 @@ TryDoWildEncounter: ; 13870 (4:7870)
jr z, .willEncounter
ld a, [wPartyMon1Level]
ld b, a
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
cp b
jr c, .CantEncounter2 ; repel prevents encounters if the leading party mon's level is higher than the wild mon
jr .willEncounter
.lastRepelStep
ld [wRepelRemainingSteps], a
- ld a, $d2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld a, TEXT_REPEL_WORE_OFF
+ ld [hSpriteIndexOrTextID], a
call EnableAutoTextBoxDrawing
call DisplayTextID
.CantEncounter2
@@ -101,7 +101,7 @@ TryDoWildEncounter: ; 13870 (4:7870)
xor a
ret
-WildMonEncounterSlotChances: ; 13918 (4:7918)
+WildMonEncounterSlotChances:
; There are 10 slots for wild pokemon, and this is the table that defines how common each of
; those 10 slots is. A random number is generated and then the first byte of each pair in this
; table is compared against that random number. If the random number is less than or equal