shithub: pokecrystal

Download patch

ref: d435bd8911981674b45622c6534ef7e3e7fe55c5
parent: 802cf616e7adfdf758203e61783764b0d361a19c
author: Remy Oukaour <[email protected]>
date: Tue Jan 2 06:50:08 EST 2018

Reword Magikarp length comments

--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -6376,9 +6376,9 @@
 ; 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,9 +6388,9 @@
 	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
@@ -6397,9 +6397,9 @@
 	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
@@ -6406,24 +6406,25 @@
 	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 @@
 	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