Personality value: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
m (→‎Shininess: bitwise means bit not byte)
Line 6: Line 6:
<code>00000000 00000000 00000000 <span style="background:#FF9999">00000000</span></code>
<code>00000000 00000000 00000000 <span style="background:#FF9999">00000000</span></code>


A Pokémon's [[gender]] is determined by the lowest eight digits (a byte) of ''p'' in binary form; essentially, ''p''[[wp:modulo operation|%]]256. This value will, from here on out, be known as ''p<sub>gender</sub>''.
A Pokémon's [[gender]] is determined by the lowest eight digits (a byte) of ''p'' in binary form; essentially, <code>''p'' [[wp:modulo operation|%]] 256</code>. This value will, from here on out, be known as ''p<sub>gender</sub>''.
 
In a Pokémon species's [[Pokémon base stats data structure in the GBA|base stat structure]], there is a byte that may be set to any value between <code>00000000</code> and <code>11111111</code>. For genderless Pokémon such as {{p|Magnemite}}, the value of this byte always is <code>11111111</code>. Pokémon ''with'' gender, however, occupy the rest of the gamut. For these Pokémon, if the value of ''p<sub>gender</sub>'' is greater than that of the base stat value, the Pokémon is male. Likewise, if ''p<sub>gender</sub>'' is equal to or less than the base stat value, the Pokémon is female.


In a Pokémon species's [[Pokémon base stats data structure in the GBA|base stat structure]], there is a byte that may be set to any value between <code>00000000</code> and <code>11111111</code>. For genderless Pokémon such as {{p|Magnemite}}, the value of this byte always is <code>11111111</code>.  For female only Pokémon such as {{p|Nidoran♀}}, the value of this byte is <code>11111110</code>.  For male only Pokémon such as {{p|Nidoran♂}}, the value of this byte is <code>00000000</code>.  Pokémon with ''both'' genders, however, occupy the rest of the spectrum.  For these Pokémon, if the value of ''p<sub>gender</sub>'' is greater than that of the base stat value, the Pokémon is male, otherwise it is female.
<br><br>
<!--Is this calctable correct?-->
<!--Is this calctable correct?-->
{| border=1 align="left" style="background: #fff; border:1px solid #000; border-collapse:collapse;"
{| border=1 align="left" style="background: #fff; border:1px solid #000; border-collapse:collapse;"
Line 60: Line 60:
| 0%
| 0%
|}
|}
<br clear="all">
{{Bad Game Mechanics}}
<!--p%256 will output a result from 0-255 and in the case of a Pokémon being 100% female (having a base gender of 254) there is a possibility of p%256 being greater than 254, therefor, causing an outcome of a female-only Pokémon being male. Needs fixing by anyone who knows how these game mechanics work.-->


==Ability==
==Ability==
509

edits

Navigation menu