(Translated by https://www.hiragana.jp/)
Size and weight variation: Difference between revisions - Bulbapedia, the community-driven Pokémon encyclopedia

Size and weight variation: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
→‎Generation II: Just using a multiplier of 256 instead of concatenation, since IMO it's a bit clearer (there isn't really a standardized symbol for it, and the Gen 3 & 4 section does the same) | Adding floor to division in the equation | Making the list of sizes by probability sortable, so it can be sorted by probability
(→‎Generation II: Just using a multiplier of 256 instead of concatenation, since IMO it's a bit clearer (there isn't really a standardized symbol for it, and the Gen 3 & 4 section does the same) | Adding floor to division in the equation | Making the list of sizes by probability sortable, so it can be sorted by probability)
Line 7: Line 7:
The calculation used to determine the Magikarp's size depends on its [[individual values]] and its [[Original Trainer]]'s [[Trainer ID number]].
The calculation used to determine the Magikarp's size depends on its [[individual values]] and its [[Original Trainer]]'s [[Trainer ID number]].


A {{wp|Bitwise operation#Rotate through carry|rotate right carry}} (rrc) is performed on the four bits comprising the Attack and Defense IVs, the four bits comprising the Speed and Special IVs, and the eight bits comprising the Trainer ID. After this, the two four-bit IVs are concatenated to generate a single eight bit number, which is then XOR'd with the Trainer ID, like as follows.
A {{wp|Bitwise operation#Rotate through carry|rotate right carry}} (rrc) is performed on the four bits comprising the Attack and Defense IVs, the four bits comprising the Speed and Special IVs, and the eight bits comprising the Trainer ID. After this, the two four-bit IVs are concatenated to generate a single eight bit number, which is then {{wp|Exclusive or|XOR}}'d with the Trainer ID, as follows.


<math>bc = (rrc(IV_1) || \ rrc(IV_2)) \oplus rrc(ID)</math>
<math>bc = (256 \cdot rrc(IV_1) + \ rrc(IV_2)) \oplus rrc(ID)</math>


Afterwards, <code>bc</code> is put through two checks:
Afterwards, <code>bc</code> is put through two checks:
Line 19: Line 19:
Note that the first as well as the last column of this table are inaccessible—<code>b</code> cannot be less than zero, and if <code>b</code> is 255 it will have already been processed earlier.
Note that the first as well as the last column of this table are inaccessible—<code>b</code> cannot be less than zero, and if <code>b</code> is 255 it will have already been processed earlier.


{| class="roundtable" style="text-align:center; background:#{{johto color}}; border:3px solid #{{johto color dark}}; {{roundy|10px}} padding:1px; margin:auto"
{| class="roundtable" style="text-align:center; background:#{{johto color}}; border:3px solid #{{johto color dark}}; padding:1px; margin:auto"
|-
|-
! b (less than): || 0 || 1 || 2 || 10 || 30 || 69 || 127 || 186 || 225 || 244 || 252 || 254 || 255 || 256
! b (less than): || 0 || 1 || 2 || 10 || 30 || 69 || 127 || 186 || 225 || 244 || 252 || 254 || 255 || 256
Line 35: Line 35:
The final length of the Magikarp in millimeters is then calculated as follows:
The final length of the Magikarp in millimeters is then calculated as follows:


<math>length = 100 \times z + \left( \frac{65536 + bc - x }{y} \mod{256} \right)</math>
<math>length = 100 \times z + \left( \left\lfloor \frac{65536 + bc - x }{y} \right\rfloor \mod{256} \right)</math>


In the English version of the Generation II games, the result is then converted into feet and inches, rounding down to the nearest inch.
In the English version of the Generation II games, the result is then converted into feet and inches, rounding down to the nearest inch.
Line 41: Line 41:
The following table indicates the probability of each size of Magikarp.
The following table indicates the probability of each size of Magikarp.


{| class="roundtable" style="text-align:center; background:#{{johto color}}; border:3px solid #{{johto color dark}}; {{roundy|10px}} padding:1px; margin:auto"
{| class="roundtable sortable" style="text-align:center; background:#{{johto color}}; border:3px solid #{{johto color dark}}; {{roundy|10px}} padding:1px; margin:auto"
|- style="background:#{{johto color light}}"
|- style="background:#{{johto color light}}"
! Size
! Size

Navigation menu