diff options
author | PikalaxALT <PikalaxALT@gmail.com> | 2015-07-23 03:41:52 -0400 |
---|---|---|
committer | PikalaxALT <PikalaxALT@gmail.com> | 2015-07-23 03:51:15 -0400 |
commit | 185b0a1c86e442d9c3ecd38d7c3fc7cfdb24be21 (patch) | |
tree | 0a7b16d82178d2d99f41bbb0be80ba7e9ab84f23 /engine | |
parent | 4c480a23dc2f81323b48670612cb23516a544e86 (diff) |
Wild Pokemon functions and data
Replaced encounter rates with percent values
Added new constants denoting the number of wild Pokemon in the grass and water wild constructs
Annotated and relabeled the encounter generating functions
Renamed a WRAM address associaed with the temporary storage of the wild Pokemon's species
Moved spawn constants to constants/map_constants.asm for use anywhere in the disassembly
Diffstat (limited to 'engine')
-rw-r--r-- | engine/events_2.asm | 16 | ||||
-rw-r--r-- | engine/map_objects.asm | 2 | ||||
-rw-r--r-- | engine/map_setup.asm | 2 | ||||
-rw-r--r-- | engine/movement.asm | 2 | ||||
-rw-r--r-- | engine/radio.asm | 8 | ||||
-rw-r--r-- | engine/scripting.asm | 4 | ||||
-rw-r--r-- | engine/spawn_points.asm | 68 |
7 files changed, 49 insertions, 53 deletions
diff --git a/engine/events_2.asm b/engine/events_2.asm index bca1ec27b..019894298 100644 --- a/engine/events_2.asm +++ b/engine/events_2.asm @@ -105,7 +105,7 @@ Function97cc0:: ; 97cc0 ld hl, StatusFlags2 bit 2, [hl] jr nz, .asm_97cdb - callba Function2a0e7 + callba TryWildEncounter jr nz, .asm_97ce2 jr .asm_97ce6 @@ -167,10 +167,10 @@ Function97cfd:: ; 97cfd ; 97d23 Function97d23: ; 97d23 - call Function97d64 + call TryWildEncounter_BugContest ret nc call Function97d31 - callba Function2a1df + callba CheckRepelEffect ret ; 97d31 @@ -196,7 +196,7 @@ Function97d31:: ; 97d31 ; Species ld a, [hli] - ld [wd22e], a + ld [TempWildMonSpecies], a ; Min level ld a, [hli] @@ -228,16 +228,16 @@ Function97d31:: ; 97d31 ret ; 97d64 -Function97d64: ; 97d64 +TryWildEncounter_BugContest: ; 97d64 ld a, [StandingTile] - call Function188e + call CheckSuperTallGrassTile ld b, $66 jr z, .asm_97d70 ld b, $33 .asm_97d70 - callba Function2a124 - callba Function2a138 + callba ApplyMusicEffectOnEncounterRate + callba ApplyCleanseTagEffectOnEncounterRate call Random ld a, [hRandomAdd] cp b diff --git a/engine/map_objects.asm b/engine/map_objects.asm index 6cbdc87aa..0a4649384 100644 --- a/engine/map_objects.asm +++ b/engine/map_objects.asm @@ -626,7 +626,7 @@ Function463f: ; 463f ; 4661 Function4661: ; 4661 - call Function188e + call CheckSuperTallGrassTile jr z, .set call Function1875 jr c, .reset diff --git a/engine/map_setup.asm b/engine/map_setup.asm index baa45e636..0e20c2cb5 100644 --- a/engine/map_setup.asm +++ b/engine/map_setup.asm @@ -439,7 +439,7 @@ Function1551a: ; 1551a (5:551a) ret Function1554e: ; 1554e (5:554e) - call Function1852 + call CheckOnWater jr nz, .ret_nc ld a, [PlayerState] cp PLAYER_SURF diff --git a/engine/movement.asm b/engine/movement.asm index f1ab0ec77..d3c570cf5 100644 --- a/engine/movement.asm +++ b/engine/movement.asm @@ -727,7 +727,7 @@ Function5412: ; 5412 ld hl, OBJECT_STANDING_TILE add hl, bc ld a, [hl] - call Function188e + call CheckSuperTallGrassTile jr z, .asm_542d call Function1875 diff --git a/engine/radio.asm b/engine/radio.asm index 74d0383e7..737b626b6 100644 --- a/engine/radio.asm +++ b/engine/radio.asm @@ -218,16 +218,16 @@ endr ld c, [hl] push bc - ld hl, WildMons1 + ld hl, JohtoGrassWildMons .greater_than_10 - ld a, BANK(WildMons1) + ld a, BANK(JohtoGrassWildMons) call GetFarByte cp -1 jr z, .done2 inc hl cp b jr nz, .next - ld a, BANK(WildMons1) + ld a, BANK(JohtoGrassWildMons) call GetFarByte cp c jr z, .done @@ -263,7 +263,7 @@ rept 2 add hl, de endr inc hl - ld a, BANK(WildMons1) + ld a, BANK(JohtoGrassWildMons) call GetFarByte ld [wd265], a ld [CurPartySpecies], a diff --git a/engine/scripting.asm b/engine/scripting.asm index b01ac0c52..32d036d48 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -1470,7 +1470,7 @@ Script_loadpikachudata: ; 0x973f0 ; script command 0x5a ld a, PIKACHU - ld [wd22e], a + ld [TempWildMonSpecies], a ld a, 5 ld [CurPartyLevel], a ret @@ -1505,7 +1505,7 @@ Script_loadpokedata: ; 0x97412 ld a, $80 ld [wd459], a call GetScriptByte - ld [wd22e], a + ld [TempWildMonSpecies], a call GetScriptByte ld [CurPartyLevel], a ret diff --git a/engine/spawn_points.asm b/engine/spawn_points.asm index eb42ab0d1..d5a648594 100644 --- a/engine/spawn_points.asm +++ b/engine/spawn_points.asm @@ -4,46 +4,42 @@ SpawnPoints: ; 0x152ab const_def spawn: MACRO -; name, map, y, x -\1\@ EQUS "SPAWN_\1" - const \1\@ - map \2 - db \3, \4 +; map, y, x + map \1 + db \2, \3 ENDM - spawn HOME, KRISS_HOUSE_2F, 3, 3 - spawn DEBUG, VIRIDIAN_POKECENTER_1F, 5, 3 + spawn KRISS_HOUSE_2F, 3, 3 + spawn VIRIDIAN_POKECENTER_1F, 5, 3 - spawn PALLET, PALLET_TOWN, 5, 6 - spawn VIRIDIAN, VIRIDIAN_CITY, 23, 26 - spawn PEWTER, PEWTER_CITY, 13, 26 - spawn CERULEAN, CERULEAN_CITY, 19, 22 - spawn ROCK_TUNNEL, ROUTE_10_NORTH, 11, 2 - spawn VERMILION, VERMILION_CITY, 9, 6 - spawn LAVENDER, LAVENDER_TOWN, 5, 6 - spawn SAFFRON, SAFFRON_CITY, 9, 30 - spawn CELADON, CELADON_CITY, 29, 10 - spawn FUCHSIA, FUCHSIA_CITY, 19, 28 - spawn CINNABAR, CINNABAR_ISLAND, 11, 12 - spawn INDIGO, ROUTE_23, 9, 6 + spawn PALLET_TOWN, 5, 6 + spawn VIRIDIAN_CITY, 23, 26 + spawn PEWTER_CITY, 13, 26 + spawn CERULEAN_CITY, 19, 22 + spawn ROUTE_10_NORTH, 11, 2 + spawn VERMILION_CITY, 9, 6 + spawn LAVENDER_TOWN, 5, 6 + spawn SAFFRON_CITY, 9, 30 + spawn CELADON_CITY, 29, 10 + spawn FUCHSIA_CITY, 19, 28 + spawn CINNABAR_ISLAND, 11, 12 + spawn ROUTE_23, 9, 6 - spawn NEW_BARK, NEW_BARK_TOWN, 13, 6 - spawn CHERRYGROVE, CHERRYGROVE_CITY, 29, 4 - spawn VIOLET, VIOLET_CITY, 31, 26 - spawn UNION_CAVE, ROUTE_32, 11, 74 - spawn AZALEA, AZALEA_TOWN, 15, 10 - spawn CIANWOOD, CIANWOOD_CITY, 23, 44 - spawn GOLDENROD, GOLDENROD_CITY, 15, 28 - spawn OLIVINE, OLIVINE_CITY, 13, 22 - spawn ECRUTEAK, ECRUTEAK_CITY, 23, 28 - spawn MAHOGANY, MAHOGANY_TOWN, 15, 14 - spawn LAKE, LAKE_OF_RAGE, 21, 29 - spawn BLACKTHORN, BLACKTHORN_CITY, 21, 30 - spawn MT_SILVER, SILVER_CAVE_OUTSIDE, 23, 20 - spawn FAST_SHIP, FAST_SHIP_CABINS_SW_SSW_NW, 6, 2 -NUM_SPAWNS EQU const_value -const_value = -1 - spawn N_A, N_A, -1, -1 + spawn NEW_BARK_TOWN, 13, 6 + spawn CHERRYGROVE_CITY, 29, 4 + spawn VIOLET_CITY, 31, 26 + spawn ROUTE_32, 11, 74 + spawn AZALEA_TOWN, 15, 10 + spawn CIANWOOD_CITY, 23, 44 + spawn GOLDENROD_CITY, 15, 28 + spawn OLIVINE_CITY, 13, 22 + spawn ECRUTEAK_CITY, 23, 28 + spawn MAHOGANY_TOWN, 15, 14 + spawn LAKE_OF_RAGE, 21, 29 + spawn BLACKTHORN_CITY, 21, 30 + spawn SILVER_CAVE_OUTSIDE, 23, 20 + spawn FAST_SHIP_CABINS_SW_SSW_NW, 6, 2 + spawn N_A, -1, -1 |