Damage: Difference between revisions

98 bytes removed ,  13 September 2022
→‎Generation V onward: Simplified priority Z and Max Move cases
(→‎Generation III: And since I forgot to include it in my last edit summary, here's that research I was talking about: https://www.smogon.com/forums/threads/sword-shield-battle-mechanics-research.3655528/page-59#post-8685465)
(→‎Generation V onward: Simplified priority Z and Max Move cases)
Line 206: Line 206:
|}
|}
: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}}), the move is {{m|Clangorous Soulblaze}} being used into {{m|Wide Guard}}, or the move is {{m|Supersonic Skystrike}} given priority by {{a|Gale Wings}} or a {{a|Prankster}}-boosted Z-Move called by a Z-Power-boosted {{cat|Moves that call other moves|move that calls other moves}} being used into {{m|Quick Guard}}, 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}}), the move is {{m|Clangorous Soulblaze}} being used into {{m|Wide Guard}}, or the move is a Z-Move, Max Move, or G-Max Move given [[priority]] by {{a|Prankster}} or {{a|Gale Wings}} being used into {{m|Quick Guard}}, and 1 otherwise.


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); 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); 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.