Rename MON_ID to MON_OT_ID (#1114)

* 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 <snorlaxmonster@users.noreply.github.com>
Co-authored-by: Sylvie <35663410+Rangi42@users.noreply.github.com>
Co-authored-by: vulcandth <vulcandth@gmail.com>
This commit is contained in:
SnorlaxMonster
2024-04-28 03:16:34 +10:00
committed by GitHub
parent b0b5ed2eb8
commit b9dce73573
10 changed files with 18 additions and 18 deletions

View File

@@ -3864,9 +3864,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
@@ -3950,9 +3950,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
@@ -7074,7 +7074,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]

View File

@@ -655,9 +655,9 @@ BattleCommand_CheckObedience:
and a
ret nz
; If the monster's id doesn't match the player's,
; If the Pokémon's Trainer 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]

View File

@@ -491,7 +491,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

View File

@@ -172,7 +172,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

View File

@@ -149,7 +149,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

View File

@@ -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

View File

@@ -107,7 +107,7 @@ ReadCaughtData:
ld a, SEERACTION_TRADED
ld [wSeerAction], a
ld a, MON_ID
ld a, MON_OT_ID
call GetPartyParamLocation
ld a, [wPlayerID]
cp [hl]

View File

@@ -296,7 +296,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

View File

@@ -191,7 +191,7 @@ CheckOwnMon:
; wScriptVar should contain the species we're looking for
; outputs:
; sets carry if monster matches species, ID, and OT name.
; sets carry if monster matches species, Trainer ID, and OT name.
push bc
push hl
@@ -206,9 +206,9 @@ CheckOwnMon:
cp b
jr nz, .notfound
; check ID number
; check Trainer ID number
ld bc, MON_ID
ld bc, MON_OT_ID
add hl, bc
ld a, [wPlayerID]
cp [hl]