summaryrefslogtreecommitdiff
path: root/engine/wildmons.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/wildmons.asm')
-rwxr-xr-xengine/wildmons.asm72
1 files changed, 14 insertions, 58 deletions
diff --git a/engine/wildmons.asm b/engine/wildmons.asm
index 6208cfbce..9aed7017a 100755
--- a/engine/wildmons.asm
+++ b/engine/wildmons.asm
@@ -65,7 +65,7 @@ FindNest: ; 2a01f
inc hl
inc hl
inc hl
- ld a, NUM_WILDMONS_PER_AREA_TIME_OF_DAY * 3
+ ld a, NUM_GRASSMON * 3
call .SearchMapForMon
jr nc, .next_grass
ld [de], a
@@ -73,7 +73,7 @@ FindNest: ; 2a01f
.next_grass
pop hl
- ld bc, WILDMON_GRASS_STRUCTURE_LENGTH
+ ld bc, GRASS_WILDDATA_LENGTH
add hl, bc
jr .FindGrass
; 2a06e
@@ -271,14 +271,14 @@ ChooseWildEncounter: ; 2a14f
inc hl
inc hl
call CheckOnWater
- ld de, .WaterMonTable
+ ld de, WaterMonProbTable
jr z, .watermon
inc hl
inc hl
ld a, [TimeOfDay]
ld bc, $e
call AddNTimes
- ld de, .GrassMonTable
+ ld de, GrassMonProbTable
.watermon
; hl contains the pointer to the wild mon data, let's save that to the stack
@@ -357,21 +357,7 @@ ChooseWildEncounter: ; 2a14f
ret
; 2a1cb
-.GrassMonTable: ; 2a1cb
- db 30, $0 ; 30% chance
- db 60, $2 ; 30% chance
- db 80, $4 ; 20% chance
- db 90, $6 ; 10% chance
- db 95, $8 ; 5% chance
- db 99, $a ; 4% chance
- db 100, $c ; 1% chance
-; 2a1d9
-
-.WaterMonTable: ; 2a1d9
- db 60, $0 ; 60% chance
- db 90, $2 ; 30% chance
- db 100, $4 ; 10% chance
-; 2a1df
+INCLUDE "data/wild/probabilities.asm"
CheckRepelEffect:: ; 2a1df
; If there is no active Repel, there's no need to be here.
@@ -798,29 +784,9 @@ _BackUpMapIndices: ; 2a3f6
ret
; 2a40f
-RoamMaps: ; 2a40f
-; Maps that roaming monsters can be on,
-; and possible maps they can jump to.
-; Notably missing are Route 40 and
-; Route 41, which are water routes.
- roam_map ROUTE_29, 2, ROUTE_30, ROUTE_46
- roam_map ROUTE_30, 2, ROUTE_29, ROUTE_31
- roam_map ROUTE_31, 3, ROUTE_30, ROUTE_32, ROUTE_36
- roam_map ROUTE_32, 3, ROUTE_36, ROUTE_31, ROUTE_33
- roam_map ROUTE_33, 2, ROUTE_32, ROUTE_34
- roam_map ROUTE_34, 2, ROUTE_33, ROUTE_35
- roam_map ROUTE_35, 2, ROUTE_34, ROUTE_36
- roam_map ROUTE_36, 4, ROUTE_35, ROUTE_31, ROUTE_32, ROUTE_37
- roam_map ROUTE_37, 3, ROUTE_36, ROUTE_38, ROUTE_42
- roam_map ROUTE_38, 3, ROUTE_37, ROUTE_39, ROUTE_42
- roam_map ROUTE_39, 1, ROUTE_38
- roam_map ROUTE_42, 4, ROUTE_43, ROUTE_44, ROUTE_37, ROUTE_38
- roam_map ROUTE_43, 2, ROUTE_42, ROUTE_44
- roam_map ROUTE_44, 3, ROUTE_42, ROUTE_43, ROUTE_45
- roam_map ROUTE_45, 2, ROUTE_44, ROUTE_46
- roam_map ROUTE_46, 2, ROUTE_45, ROUTE_29
- db -1
-; 2a4a0
+
+INCLUDE "data/wild/roammon_maps.asm"
+
ValidateTempWildMonSpecies: ; 2a4a0
; Due to a development oversight, this function is called with the wild Pokemon's level, not its species, in a.
@@ -836,9 +802,10 @@ ValidateTempWildMonSpecies: ; 2a4a0
ret
; 2a4ab
-RandomPhoneRareWildMon: ; 2a4ab
-; Related to the phone?
- callba GetCallerLocation
+; Finds a rare wild Pokemon in the route of the trainer calling, then checks if it's been Seen already.
+; The trainer will then tell you about the Pokemon if you haven't seen it.
+RandomUnseenWildMon: ; 2a4ab
+ farcall GetCallerLocation
ld d, b
ld e, c
ld hl, JohtoGrassWildMons
@@ -911,7 +878,7 @@ RandomPhoneRareWildMon: ; 2a4ab
; 0x2a51f
RandomPhoneWildMon: ; 2a51f
- callba GetCallerLocation
+ farcall GetCallerLocation
ld d, b
ld e, c
ld hl, JohtoGrassWildMons
@@ -952,7 +919,7 @@ RandomPhoneWildMon: ; 2a51f
RandomPhoneMon: ; 2a567
; Get a random monster owned by the trainer who's calling.
- callba GetCallerLocation
+ farcall GetCallerLocation
ld hl, TrainerGroups
ld a, d
dec a
@@ -1034,20 +1001,9 @@ RandomPhoneMon: ; 2a567
; 2a5e9
-JohtoGrassWildMons: ; 0x2a5e9
INCLUDE "data/wild/johto_grass.asm"
-
-JohtoWaterWildMons: ; 0x2b11d
INCLUDE "data/wild/johto_water.asm"
-
-KantoGrassWildMons: ; 0x2b274
INCLUDE "data/wild/kanto_grass.asm"
-
-KantoWaterWildMons: ; 0x2b7f7
INCLUDE "data/wild/kanto_water.asm"
-
-SwarmGrassWildMons: ; 0x2b8d0
INCLUDE "data/wild/swarm_grass.asm"
-
-SwarmWaterWildMons: ; 0x2b92f
INCLUDE "data/wild/swarm_water.asm"