diff options
-rw-r--r-- | audio.asm | 2 | ||||
-rw-r--r-- | constants/pokedex_constants.asm | 2 | ||||
-rw-r--r-- | constants/pokemon_constants.asm | 2 | ||||
-rwxr-xr-x | constants/trainer_constants.asm | 4 | ||||
-rw-r--r-- | engine/battle/battle_transitions.asm | 2 | ||||
-rwxr-xr-x | engine/battle/core.asm | 2 | ||||
-rwxr-xr-x | engine/battle/read_trainer_party.asm | 2 | ||||
-rw-r--r-- | engine/overworld/movement.asm | 16 | ||||
-rwxr-xr-x | engine/palettes.asm | 2 | ||||
-rwxr-xr-x | engine/pokedex_rating.asm | 2 | ||||
-rw-r--r-- | home.asm | 4 | ||||
-rw-r--r-- | home/overworld.asm | 2 | ||||
-rwxr-xr-x | scripts/PokemonMansion3F.asm | 12 | ||||
-rwxr-xr-x | scripts/SeafoamIslands1F.asm | 2 | ||||
-rwxr-xr-x | scripts/SeafoamIslandsB1F.asm | 2 | ||||
-rwxr-xr-x | scripts/SeafoamIslandsB2F.asm | 2 | ||||
-rwxr-xr-x | scripts/SeafoamIslandsB3F.asm | 2 | ||||
-rwxr-xr-x | wram.asm | 5 |
18 files changed, 37 insertions, 30 deletions
@@ -371,7 +371,7 @@ PlayBattleMusic:: jr .playSong .notGymLeaderBattle ld a, [wCurOpponent] - cp 200 + cp OPP_ID_OFFSET jr c, .wildBattle cp OPP_SONY3 jr z, .finalBattle diff --git a/constants/pokedex_constants.asm b/constants/pokedex_constants.asm index 360fbb4c..b80547f7 100644 --- a/constants/pokedex_constants.asm +++ b/constants/pokedex_constants.asm @@ -152,4 +152,4 @@ const_value = 1 const DEX_MEWTWO ; 150 const DEX_MEW ; 151 -NUM_POKEMON EQU 151 +NUM_POKEMON EQU const_value + -1 diff --git a/constants/pokemon_constants.asm b/constants/pokemon_constants.asm index c4189911..f8a38731 100644 --- a/constants/pokemon_constants.asm +++ b/constants/pokemon_constants.asm @@ -190,3 +190,5 @@ const_value = 1 const BELLSPROUT ; $BC const WEEPINBELL ; $BD const VICTREEBEL ; $BE + +NUM_POKEMON_INDEXES EQU const_value + -1 diff --git a/constants/trainer_constants.asm b/constants/trainer_constants.asm index ee890282..d936aa06 100755 --- a/constants/trainer_constants.asm +++ b/constants/trainer_constants.asm @@ -1,6 +1,8 @@ +OPP_ID_OFFSET EQU 200 + trainer_const: MACRO \1 EQU const_value -OPP_\1 EQU const_value + 200 +OPP_\1 EQU const_value + OPP_ID_OFFSET const_value = const_value + 1 ENDM diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index 1967d33b..436e38b5 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -82,7 +82,7 @@ BattleTransitions: GetBattleTransitionID_WildOrTrainer: ld a, [wCurOpponent] - cp 200 + cp OPP_ID_OFFSET jr nc, .trainer res 0, c ret diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 056a9588..04336810 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6867,7 +6867,7 @@ InitBattleCommon: res 1, [hl] callab InitBattleVariables ld a, [wEnemyMonSpecies2] - sub 200 + sub OPP_ID_OFFSET jp c, InitWildBattle ld [wTrainerClass], a call GetTrainerInformation diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm index ba00083b..ba4f6f8e 100755 --- a/engine/battle/read_trainer_party.asm +++ b/engine/battle/read_trainer_party.asm @@ -101,7 +101,7 @@ ReadTrainer: ; get trainer class number ld a, [wCurOpponent] - sub 200 + sub OPP_ID_OFFSET ld b, a ld hl, TeamMoves diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index bbfbbc39..b561df7d 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -1,3 +1,5 @@ +MAP_TILESET_SIZE EQU $60 + UpdatePlayerSprite: ld a, [wSpriteStateData2] and a @@ -13,7 +15,7 @@ UpdatePlayerSprite: .checkIfTextBoxInFrontOfSprite aCoord 8, 9 ld [hTilePlayerStandingOn], a - cp $60 + cp MAP_TILESET_SIZE jr c, .lowerLeftTileIsMapTile .disableSprite ld a, $ff @@ -127,7 +129,7 @@ UpdateNPCSprite: and a jp z, InitializeSpriteStatus call CheckSpriteAvailability - ret c ; if sprite is invisible, on tile >=$60, in grass or player is currently walking + ret c ; if sprite is invisible, on tile >=MAP_TILESET_SIZE, in grass or player is currently walking ld h, $c1 ld a, [H_CURRENTSPRITEOFFSET] ld l, a @@ -508,21 +510,21 @@ CheckSpriteAvailability: ; make the sprite invisible if a text box is in front of it ; $5F is the maximum number for map tiles call GetTileSpriteStandsOn - ld d, $60 + ld d, MAP_TILESET_SIZE ld a, [hli] cp d - jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom left tile) + jr nc, .spriteInvisible ; standing on tile with ID >=MAP_TILESET_SIZE (bottom left tile) ld a, [hld] cp d - jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom right tile) + jr nc, .spriteInvisible ; standing on tile with ID >=MAP_TILESET_SIZE (bottom right tile) ld bc, -20 add hl, bc ; go back one row of tiles ld a, [hli] cp d - jr nc, .spriteInvisible ; standing on tile with ID >=$60 (top left tile) + jr nc, .spriteInvisible ; standing on tile with ID >=MAP_TILESET_SIZE (top left tile) ld a, [hl] cp d - jr c, .spriteVisible ; standing on tile with ID >=$60 (top right tile) + jr c, .spriteVisible ; standing on tile with ID >=MAP_TILESET_SIZE (top right tile) .spriteInvisible ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] diff --git a/engine/palettes.asm b/engine/palettes.asm index 4ab83f36..39991d48 100755 --- a/engine/palettes.asm +++ b/engine/palettes.asm @@ -70,7 +70,7 @@ SetPal_StatusScreen: ld bc, $10 call CopyData ld a, [wcf91] - cp VICTREEBEL + 1 + cp NUM_POKEMON_INDEXES + 1 jr c, .pokemon ld a, $1 ; not pokemon .pokemon diff --git a/engine/pokedex_rating.asm b/engine/pokedex_rating.asm index aff9769e..f1aaf618 100755 --- a/engine/pokedex_rating.asm +++ b/engine/pokedex_rating.asm @@ -86,7 +86,7 @@ DexRatingsTable: dw PokedexRatingText_44242 db 150 dw PokedexRatingText_44247 - db 152 + db NUM_POKEMON + 1 dw PokedexRatingText_4424c PokedexRatingText_44201: @@ -2390,7 +2390,7 @@ EndTrainerBattle:: ld b, FLAG_SET call TrainerFlagAction ; flag trainer as fought ld a, [wEnemyMonOrTrainerClass] - cp 200 + cp OPP_ID_OFFSET jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite) ld hl, wMissableObjectList ld de, $2 @@ -2424,7 +2424,7 @@ InitBattleEnemyParameters:: ld a, [wEngagedTrainerClass] ld [wCurOpponent], a ld [wEnemyMonOrTrainerClass], a - cp 200 + cp OPP_ID_OFFSET ld a, [wEngagedTrainerSet] jr c, .noTrainer ld [wTrainerNo], a diff --git a/home/overworld.asm b/home/overworld.asm index 66bf73a7..9404a713 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -887,7 +887,7 @@ LoadTileBlockMap:: ld hl, wOverworldMap ld a, [wMapBackgroundTile] ld d, a - ld bc, $0514 + ld bc, wOverworldMapEnd - wOverworldMap .backgroundTileLoop ld a, d ld [hli], a diff --git a/scripts/PokemonMansion3F.asm b/scripts/PokemonMansion3F.asm index 3edc7bfd..ff172413 100755 --- a/scripts/PokemonMansion3F.asm +++ b/scripts/PokemonMansion3F.asm @@ -16,18 +16,18 @@ Mansion3Script_52204: CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_52224 ld a, $e - ld bc, $207 + lb bc, 2, 7 call Mansion2Script_5202f ld a, $5f - ld bc, $507 + lb bc, 5, 7 call Mansion2Script_5202f ret .asm_52224 ld a, $5f - ld bc, $207 + lb bc, 2, 7 call Mansion2Script_5202f ld a, $e - ld bc, $507 + lb bc, 5, 7 call Mansion2Script_5202f ret @@ -43,9 +43,9 @@ Mansion3Script0: and a jp z, CheckFightingMapTrainers cp $3 - ld a, $a5 + ld a, POKEMON_MANSION_1F jr nz, .asm_52250 - ld a, $d6 + ld a, POKEMON_MANSION_2F .asm_52250 ld [wDungeonWarpDestinationMap], a ret diff --git a/scripts/SeafoamIslands1F.asm b/scripts/SeafoamIslands1F.asm index dc3b8599..b024a6bd 100755 --- a/scripts/SeafoamIslands1F.asm +++ b/scripts/SeafoamIslands1F.asm @@ -32,7 +32,7 @@ SeafoamIslands1F_Script: ld [wMissableObjectIndex], a predef_jump ShowObject .asm_4483b - ld a, $9f + ld a, SEAFOAM_ISLANDS_B1F ld [wDungeonWarpDestinationMap], a ld hl, Seafoam1HolesCoords jp IsPlayerOnDungeonWarp diff --git a/scripts/SeafoamIslandsB1F.asm b/scripts/SeafoamIslandsB1F.asm index 876c0837..a4c5767b 100755 --- a/scripts/SeafoamIslandsB1F.asm +++ b/scripts/SeafoamIslandsB1F.asm @@ -31,7 +31,7 @@ SeafoamIslandsB1F_Script: ld [wMissableObjectIndex], a predef_jump ShowObject .asm_46362 - ld a, $a0 + ld a, SEAFOAM_ISLANDS_B2F ld [wDungeonWarpDestinationMap], a ld hl, Seafoam2HolesCoords jp IsPlayerOnDungeonWarp diff --git a/scripts/SeafoamIslandsB2F.asm b/scripts/SeafoamIslandsB2F.asm index c0141a3e..eb6d2437 100755 --- a/scripts/SeafoamIslandsB2F.asm +++ b/scripts/SeafoamIslandsB2F.asm @@ -31,7 +31,7 @@ SeafoamIslandsB2F_Script: ld [wMissableObjectIndex], a predef_jump ShowObject .asm_4649e - ld a, $a1 + ld a, SEAFOAM_ISLANDS_B3F ld [wDungeonWarpDestinationMap], a ld hl, Seafoam3HolesCoords jp IsPlayerOnDungeonWarp diff --git a/scripts/SeafoamIslandsB3F.asm b/scripts/SeafoamIslandsB3F.asm index 7343b17d..c8fec338 100755 --- a/scripts/SeafoamIslandsB3F.asm +++ b/scripts/SeafoamIslandsB3F.asm @@ -32,7 +32,7 @@ SeafoamIslandsB3F_Script: predef ShowObject jr .asm_465ed .asm_465dc - ld a, $a2 + ld a, SEAFOAM_ISLANDS_B4F ld [wDungeonWarpDestinationMap], a ld hl, Seafoam4HolesCoords call IsPlayerOnDungeonWarp @@ -346,6 +346,7 @@ wSerialEnemyMonsPatchList:: ; c5d0 wTempPic:: wOverworldMap:: ; c6e8 ds 1300 +wOverworldMapEnd:: wRedrawRowOrColumnSrcTiles:: ; cbfc ; the tiles of the row or column to be redrawn by RedrawRowOrColumn @@ -1638,7 +1639,7 @@ wPartyGainExpFlags:: ; d058 wCurOpponent:: ; d059 ; in a wild battle, this is the species of pokemon -; in a trainer battle, this is the trainer class + 200 +; in a trainer battle, this is the trainer class + OPP_ID_OFFSET ds 1 wBattleType:: ; d05a @@ -2916,7 +2917,7 @@ wFossilMon:: ; d710 ds 2 wEnemyMonOrTrainerClass:: ; d713 -; trainer classes start at 200 +; trainer classes start at OPP_ID_OFFSET ds 1 wPlayerJumpingYScreenCoordsIndex:: ; d714 |