Advertisement
DaWoblefet

Generation 9 Damage Overflow Demonstration Explanation

Sep 22nd, 2023 (edited)
1,083
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. Situation (originally by SadisticMystic, modified for SV by DaWoblefet):
  2. Level 99 Infernape with a Sp. Atk stat of 222 at +3 Sp. Atk, holding Scope Lens, after Focus Energy for guaranteed critical hits, and Terastallized to a Fire-type using Blast Burn against a level 1 Alolan Sandshrew with a Sp. Def stat of 5 at -6 Sp. Def also affected by Forest's Curse and Tar Shot and given the Ability Fluffy via Skill Swap.
  3.  
  4. Level: 99
  5. Base Power: 150 (no modifiers)
  6. Sp. Atk: floor[222 * 5/2] = 555
  7. Sp. Def: floor[5 * 2/8] = 1
  8.  
  9. Base Damage: floor[floor[((floor[2*99/5] + 2)*150*555)/1]/50] + 2
  10. = floor[floor[(41*150*555)/1]/50] + 2
  11. = floor[3413250/50] + 2
  12. = 68265 + 2
  13. = 68267
  14.  
  15. The move was a critical hit, so multiply by 1.5x and floor: 68267 * 1.5 = 102400.
  16.  
  17. Random damage roll:
  18. [87040, 88064, 89088, 90112, 91136, 92160, 93184, 94208, 95232, 96256, 97280, 98304, 99328, 100352, 101376, 102400]
  19.  
  20. Terastallization STAB boost (Apply modifier of 8192 / 4096):
  21. [174080, 176128, 178176, 180224, 182272, 184320, 186368, 188416, 190464, 192512, 194560, 196608, 198656, 200704, 202752, 204800]
  22.  
  23. Type effectiveness (Ice / Steel / Grass / Tar Shot = Direct 16x multiplication):
  24. [2785280, 2818048, 2850816, 2883584, 2916352, 2949120, 2981888, 3014656, 3047424, 3080192, 3112960, 3145728, 3178496, 3211264, 3244032, 3276800]
  25.  
  26. Fluffy (Apply modifier of 8192 / 4096). The calculation for multiplying the damage roll by 8192 jumps past the 32-bit limit of 4294967295, causing it to roll around to smaller values. It is then divided by 4096.
  27. [327680, 393216, 458752, 524288, 589824, 655360, 720896, 786432, 851968, 917504, 983040, 0, 65536, 131072, 196608, 262144]
  28.  
  29. Then the 1 damage check occurs:
  30. 327680, 393216, 458752, 524288, 589824, 655360, 720896, 786432, 851968, 917504, 983040, 1, 65536, 131072, 196608, 262144
  31.  
  32. Then the damage is truncated to 16-bits to perform the subtraction against of the damage against the target's HP stat. All of the remaining damage rolls are multiples of 65536 which results in 0 damage 15/16 of the time and 1 damage 1/16 of the time:
  33. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement