From 144133d98e2aa395001dbb1230c3078de05d27fe Mon Sep 17 00:00:00 2001 From: SnorlaxMonster <7100450+SnorlaxMonster@users.noreply.github.com> Date: Sun, 28 Apr 2024 03:16:34 +1000 Subject: [PATCH] Rename `MON_ID` to `MON_OT_ID` (pret/pokecrystal#1114) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rename MON_ID to MON_TRAINER_ID The constant name MON_ID implies it relates to the ID number of the Pokémon itself. However, it actually refers to the Trainer ID number of the Pokémon's Original Trainer. Renaming it to MON_TRAINER_ID makes it substantially more clear what its purpose is. The original definition of MON_ID is preserved in macros/legacy.asm * Remove MON_ID from macros/legacy.asm Co-authored-by: Sylvie <35663410+Rangi42@users.noreply.github.com> * Apply rename to missed file * Rename to `MON_OT_ID` --------- Co-authored-by: SnorlaxMonster Co-authored-by: Sylvie <35663410+Rangi42@users.noreply.github.com> Co-authored-by: vulcandth --- constants/pokemon_data_constants.asm | 2 +- engine/battle/core.asm | 10 +++++----- engine/battle/effect_commands.asm | 2 +- engine/events/daycare.asm | 2 +- engine/events/halloffame.asm | 2 +- engine/events/lucky_number.asm | 2 +- engine/events/magikarp.asm | 4 ++-- engine/pokemon/breeding.asm | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/constants/pokemon_data_constants.asm b/constants/pokemon_data_constants.asm index f69f21aea..a00d9180d 100644 --- a/constants/pokemon_data_constants.asm +++ b/constants/pokemon_data_constants.asm @@ -77,7 +77,7 @@ rsreset DEF MON_SPECIES rb DEF MON_ITEM rb DEF MON_MOVES rb NUM_MOVES -DEF MON_ID rw +DEF MON_OT_ID rw DEF MON_EXP rb 3 DEF MON_STAT_EXP rw NUM_EXP_STATS rsset MON_STAT_EXP diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 95a33a232..c6fe7c20a 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -3633,9 +3633,9 @@ InitBattleMon: ld a, MON_SPECIES call GetPartyParamLocation ld de, wBattleMonSpecies - ld bc, MON_ID + ld bc, MON_OT_ID call CopyBytes - ld bc, MON_DVS - MON_ID + ld bc, MON_DVS - MON_OT_ID add hl, bc ld de, wBattleMonDVs ld bc, MON_POKERUS - MON_DVS @@ -3719,9 +3719,9 @@ InitEnemyMon: ld hl, wOTPartyMon1Species call GetPartyLocation ld de, wEnemyMonSpecies - ld bc, MON_ID + ld bc, MON_OT_ID call CopyBytes - ld bc, MON_DVS - MON_ID + ld bc, MON_DVS - MON_OT_ID add hl, bc ld de, wEnemyMonDVs ld bc, MON_POKERUS - MON_DVS @@ -6834,7 +6834,7 @@ GiveExperiencePoints: call Divide ; Boost Experience for traded Pokemon pop bc - ld hl, MON_ID + ld hl, MON_OT_ID add hl, bc ld a, [wPlayerID] cp [hl] diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 1ef7866dd..01bf05541 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -664,7 +664,7 @@ BattleCommand_CheckObedience: ; If the monster's id doesn't match the player's, ; some conditions need to be met. - ld a, MON_ID + ld a, MON_OT_ID call BattlePartyAttr ld a, [wPlayerID] diff --git a/engine/events/daycare.asm b/engine/events/daycare.asm index 48f2203c2..5893bd4e9 100644 --- a/engine/events/daycare.asm +++ b/engine/events/daycare.asm @@ -485,7 +485,7 @@ DayCare_GiveEgg: call AddNTimes ld b, h ld c, l - ld hl, MON_ID + 1 + ld hl, MON_OT_ID + 1 add hl, bc push hl ld hl, MON_MAXHP diff --git a/engine/events/halloffame.asm b/engine/events/halloffame.asm index addde1d15..8eb1ecc72 100644 --- a/engine/events/halloffame.asm +++ b/engine/events/halloffame.asm @@ -167,7 +167,7 @@ GetHallOfFameParty: ld [de], a inc de - ld hl, MON_ID + ld hl, MON_OT_ID add hl, bc ld a, [hli] ld [de], a diff --git a/engine/events/lucky_number.asm b/engine/events/lucky_number.asm index 8e3905255..da60a8ecb 100644 --- a/engine/events/lucky_number.asm +++ b/engine/events/lucky_number.asm @@ -150,7 +150,7 @@ CheckForLuckyNumberWinners: .done pop hl push hl - ld de, MON_SPECIES - MON_ID + ld de, MON_SPECIES - MON_OT_ID add hl, de ld a, [hl] pop hl diff --git a/engine/events/magikarp.asm b/engine/events/magikarp.asm index 390db85f3..e91002de2 100644 --- a/engine/events/magikarp.asm +++ b/engine/events/magikarp.asm @@ -11,7 +11,7 @@ CheckMagikarpLength: cp MAGIKARP jr nz, .not_magikarp - ; Now let's compute its length based on its DVs and ID. + ; Now let's compute its length based on its DVs and Trainer ID. ld a, [wCurPartyMon] ld hl, wPartyMon1Species ld bc, PARTYMON_STRUCT_LENGTH @@ -22,7 +22,7 @@ CheckMagikarpLength: ld d, h ld e, l pop hl - ld bc, MON_ID + ld bc, MON_OT_ID add hl, bc ld b, h ld c, l diff --git a/engine/pokemon/breeding.asm b/engine/pokemon/breeding.asm index 0f24d3d21..e0e42233b 100644 --- a/engine/pokemon/breeding.asm +++ b/engine/pokemon/breeding.asm @@ -294,7 +294,7 @@ HatchEggs: ld [hli], a ld a, [de] ld [hl], a - ld hl, MON_ID + ld hl, MON_OT_ID add hl, bc ld a, [wPlayerID] ld [hli], a