From d435bd8911981674b45622c6534ef7e3e7fe55c5 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Tue, 2 Jan 2018 11:50:08 -0500 Subject: [PATCH] Reword Magikarp length comments --- engine/battle/core.asm | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 08021fc8b..58f42f8b1 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6376,9 +6376,9 @@ LoadEnemyMon: ; 3e8eb ; but the value is in feet and inches (one byte each). ; The first filter is supposed to make very large Magikarp even rarer, -; by targeting those 1600 mm or larger. +; by targeting those 1600 mm (= 5'3") or larger. ; After the conversion to feet, it is unable to target any, -; as the largest possible Magikarp is 5'3'', which reads as 1283. +; since the largest possible Magikarp is 5'3", and $0503 = 1283 mm. ld a, [TempEnemyMonSpecies] cp MAGIKARP jr nz, .Happiness @@ -6388,42 +6388,43 @@ LoadEnemyMon: ; 3e8eb ld bc, PlayerID callfar CalcMagikarpLength -; No reason to keep going if length > 1536 (i.e. if length / 256 != 6) +; No reason to keep going if length > 1536 mm (i.e. if HIGH(length) > 6) ld a, [wMagikarpLength] - cp HIGH(1536) ; this compares to 6'0'', should be cp 5 + cp HIGH(1536) ; should be "cp 5", since 1536 mm = 5'0", but HIGH(1536) = 6 jr nz, .CheckMagikarpArea ; 5% chance of skipping both size checks call Random cp 5 percent jr c, .CheckMagikarpArea -; Try again if length > 1615 +; Try again if length >= 1616 mm ld a, [wMagikarpLength + 1] - cp LOW(1616) ; this compares to 6'80'', should be cp 3 + cp LOW(1616) ; should be "cp 3", since 1616 mm = 5'3", but LOW(1616) = 80 jr nc, .GenerateDVs ; 20% chance of skipping this check call Random cp 20 percent - 1 jr c, .CheckMagikarpArea -; Try again if length > 1599 +; Try again if length >= 1600 mm ld a, [wMagikarpLength + 1] - cp LOW(1600) ; this compares to 6'64'', should be cp 2 + cp LOW(1600) ; should be "cp 2", since 1600 mm = 5'2", but LOW(1600) = 64 jr nc, .GenerateDVs .CheckMagikarpArea: -; The z checks are supposed to be nz -; Instead, all maps in GROUP_LAKE_OF_RAGE (mahogany area) -; and routes 20 and 44 are treated as Lake of Rage +; The "jr z" checks are supposed to be "jr nz". + +; Instead, all maps in GROUP_LAKE_OF_RAGE (Mahogany area) +; and Routes 20 and 44 are treated as Lake of Rage. ; This also means Lake of Rage Magikarp can be smaller than ones -; caught elsewhere rather than the other way around +; caught elsewhere rather than the other way around. -; Intended behavior enforces a minimum size at Lake of Rage -; The real behavior prevents size flooring in the Lake of Rage area +; Intended behavior enforces a minimum size at Lake of Rage. +; The real behavior prevents a minimum size in the Lake of Rage area. -; Moreover, due to the check not being translated to feet, all Magikarp -; smaller than 4'0'' may be caught by the filter, a lot more than intended +; Moreover, due to the check not being translated to feet+inches, all Magikarp +; smaller than 4'0" may be caught by the filter, a lot more than intended. ld a, [MapGroup] cp GROUP_LAKE_OF_RAGE jr z, .Happiness @@ -6434,9 +6435,9 @@ LoadEnemyMon: ; 3e8eb call Random cp 40 percent - 2 jr c, .Happiness -; Floor at length 1024 +; Try again if length < 1024 mm ld a, [wMagikarpLength] - cp HIGH(1024) ; compares to 4'0'', cp 3 would be closer to intended value + cp HIGH(1024) ; should be "cp 3", since 1024 mm = 3'4", but HIGH(1024) = 4 jr c, .GenerateDVs ; try again ; Finally done with DVs