Accuracy: Difference between revisions

2,400 bytes added ,  9 August 2020
Moving from Statistic
m (→‎In other languages: Added Brazilian Portuguese from PS193)
(Moving from Statistic)
Line 7: Line 7:
Many moves have an accuracy of "—", indicating that they are exempt from regular accuracy calculations. Oftentimes, these moves affect no one but the user (and/or the partner in a [[Double Battle]]), or are simply intended to be {{cat|moves that cannot miss}} (unless the target has used {{cat|Moves with a semi-invulnerable turn|a move that grants it semi-invulnerability for a turn}} such as {{m|Fly}}).
Many moves have an accuracy of "—", indicating that they are exempt from regular accuracy calculations. Oftentimes, these moves affect no one but the user (and/or the partner in a [[Double Battle]]), or are simply intended to be {{cat|moves that cannot miss}} (unless the target has used {{cat|Moves with a semi-invulnerable turn|a move that grants it semi-invulnerability for a turn}} such as {{m|Fly}}).


==1/256 miss glitch==
==In the core series games==
===Accuracy check===
====Generations I and II====
Whether a move hits depends on the formula:
 
T = Accuracy<sub>move</sub> * Accuracy<sub>user</sub> * Evasion<sub>target</sub> - BrightPowder
 
Where...
* ''T'' is the computed threshold value that will determine whether the move will hit, always at least 1 and at most 255,
* ''Accuracy<sub>move</sub>'' is the move's [[accuracy]], a value from 0 to 255,
* ''Accuracy<sub>user</sub>'' is the accuracy [[#Stage multipliers|stage multiplier]] of the user,
* ''Evasion<sub>target</sub>'' is the evasion stage multiplier of the target, and
* ''BrightPowder'' is 20 if the user is [[held item|holding]] [[Bright Powder|BrightPowder]] (in Generation II) or 0 otherwise.
 
The game then selects a random number ''r'' from 0 to 255 and compares it to ''T'' to determine whether the move hits.
 
In Generation I, if ''r'' is less than ''T'', the move hits. This results in a bug where no move can be guaranteed to hit (excluding {{m|Bide}} and {{m|Swift}}) since even if ''T'' is 255, if ''r'' is also 255, the move will miss.
 
In Generation II, if ''T'' is 255 or else if ''r'' is less than ''T'', the move hits. This eliminates the bug from Generation I.
 
====Generations III onward====
Whether a move hits depends on the formula:
 
T = Accuracy<sub>move</sub> * Adjusted_stages * Other_mods
 
Where...
* ''T'' is the computed threshold value that will determine whether the move will hit,
* ''Accuracy<sub>move</sub>'' is the move's [[accuracy]], a value from 1 to 100 (internally, 0 is also a valid value, but this is displayed as "&mdash;" and means that the move ignores accuracy checks),
* ''Adjusted_stages'' is the equivalent accuracy [[#Stage multipliers|stage multiplier]] of the user after the target's evasion stage is subtracted from the user's accuracy stage, both possibly modified by Ability or move effects such as {{a|Simple}} or {{m|Foresight}} (to no less than -6 and no more than 6 after the subtraction), and
* ''Other_mods'' encompasses all multipliers from other accuracy or evasion modifiers from Ability effects, [[fog]], move effects, and item effects (as can be seen in the table in the following section), serially applied.
 
The game then selects a random number ''r'' from 1 to 100 and compares it to ''T'' to determine whether the move hits. If ''r'' is less than or equal to ''T'', the move hits.
 
===1/256 miss glitch===
In the [[Generation I]] handheld games, moves with 100% accuracy have a chance to miss if neither {{stat|accuracy}} nor {{stat|evasion}} stats are modified, due to accuracy being internally stored as a single byte ranging from 0 to 255, and the probability of a move hitting being determined by comparing a randomly generated byte to the accuracy value, with the move hitting if it was less and missing if it was equal or greater. There is therefore a 1/256 chance of the randomly generated byte being equal to 255, which can never be less than even the highest possible accuracy value, causing moves intended to be 100% accurate to miss 1/256 of the time (yielding an effective accuracy of about 99.6%). {{m|Swift}} is unaffected in non-Japanese games, as it automatically skips all accuracy checks (including the invulnerability effects of {{m|Fly}} and {{m|Dig}}) and thus truly has 100% accuracy. A similar bug also applied to [[critical hit]]s.
In the [[Generation I]] handheld games, moves with 100% accuracy have a chance to miss if neither {{stat|accuracy}} nor {{stat|evasion}} stats are modified, due to accuracy being internally stored as a single byte ranging from 0 to 255, and the probability of a move hitting being determined by comparing a randomly generated byte to the accuracy value, with the move hitting if it was less and missing if it was equal or greater. There is therefore a 1/256 chance of the randomly generated byte being equal to 255, which can never be less than even the highest possible accuracy value, causing moves intended to be 100% accurate to miss 1/256 of the time (yielding an effective accuracy of about 99.6%). {{m|Swift}} is unaffected in non-Japanese games, as it automatically skips all accuracy checks (including the invulnerability effects of {{m|Fly}} and {{m|Dig}}) and thus truly has 100% accuracy. A similar bug also applied to [[critical hit]]s.