Damage: Difference between revisions

64 bytes added ,  4 January 2023
(→‎Generation V onward: Interesting how these don't use /4096 modifiers)
Line 228: Line 228:
:If multiple effects influence the ''other'' value, their values stack multiplicatively, in the order listed above. This is done by starting at 4096, multiplying it by each number above in the order listed above, and whenever there is a decimal, standard rounding it and rounding up at 0.5. When the final value is obtained, it is divided by 4096, and this becomes ''other''. For example, if both {{a|Multiscale}} and a [[Chilan Berry]] take effect, ''other'' is <math>\frac{4096 * 0.5 * 0.5}{4096}</math> = 0.25.
:If multiple effects influence the ''other'' value, their values stack multiplicatively, in the order listed above. This is done by starting at 4096, multiplying it by each number above in the order listed above, and whenever there is a decimal, standard rounding it and rounding up at 0.5. When the final value is obtained, it is divided by 4096, and this becomes ''other''. For example, if both {{a|Multiscale}} and a [[Chilan Berry]] take effect, ''other'' is <math>\frac{4096 * 0.5 * 0.5}{4096}</math> = 0.25.
* ''ZMove'' is 0.25 if the move is a [[Z-Move]], [[Max Move]], or [[G-Max Move]] being used into a protection move ({{m|Protect}}, {{m|Detect}}, {{m|King's Shield}}, {{m|Spiky Shield}}, {{m|Mat Block}}, {{m|Baneful Bunker}}, or {{m|Obstruct}}, or potentially {{m|Wide Guard}} or {{w|Quick Guard}} if the move has multiple targets or is given priority, respectively; if the move triggers the "couldn't fully protect" message, the multiplier will be applied), and 1 otherwise.
* ''ZMove'' is 0.25 if the move is a [[Z-Move]], [[Max Move]], or [[G-Max Move]] being used into a protection move ({{m|Protect}}, {{m|Detect}}, {{m|King's Shield}}, {{m|Spiky Shield}}, {{m|Mat Block}}, {{m|Baneful Bunker}}, or {{m|Obstruct}}, or potentially {{m|Wide Guard}} or {{w|Quick Guard}} if the move has multiple targets or is given priority, respectively; if the move triggers the "couldn't fully protect" message, the multiplier will be applied), and 1 otherwise.
* ''TeraShield'' is applied in [[Tera Raid Battle]]s when the Raid boss's shield is active, and is 0.2 if the player's Pokémon is not [[Terastal phenomenon|Terastallized]], 0.35 if it is but the used move is not of its Tera Type, and 0.75 if it is and the used move is of its Tera Type.
* ''TeraShield'' is applied in [[Tera Raid Battle]]s when the Raid boss's shield is active, and is 0.2 if the player's Pokémon is not [[Terastal phenomenon|Terastallized]], 0.35 if it is but the used move is not of its Tera Type, and 0.75 if it is and the used move is of its Tera Type. The result is subject to standard rounding, rounding up at 0.5.


In the first four Generations, during the calculation, any operations are carried out on integers internally, such that effectively each division is a [[wp:Rounding#Rounding_to_integer|truncated integer division]] (rounding towards zero, cutting off any decimals), and any decimals are cut off after each multiplication operation. From [[Generation V]] onward, however, there are three different types of rounding; a simple decimal truncation (also known as flooring), standard rounding, but rounding down at 0.5, and standard rounding, but rounding up at 0.5. If the calculation yields 0, the move will deal 1 HP damage instead (unless ''Type'' is equal to 0, in which case damage calculation is skipped entirely); however, in Generation V, a move may deal 0 damage when ''other'' is less than 1, because the routine to prevent 0 damage is erroneously performed before applying the ''other'' factor.
In the first four Generations, during the calculation, any operations are carried out on integers internally, such that effectively each division is a [[wp:Rounding#Rounding_to_integer|truncated integer division]] (rounding towards zero, cutting off any decimals), and any decimals are cut off after each multiplication operation. From [[Generation V]] onward, however, there are three different types of rounding; a simple decimal truncation (also known as flooring), standard rounding, but rounding down at 0.5, and standard rounding, but rounding up at 0.5. If the calculation yields 0, the move will deal 1 HP damage instead (unless ''Type'' is equal to 0, in which case damage calculation is skipped entirely); however, in Generation V, a move may deal 0 damage when ''other'' is less than 1, because the routine to prevent 0 damage is erroneously performed before applying the ''other'' factor.