Advertisement
DaWoblefet

Calculating move accuracy

Nov 27th, 2020 (edited)
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. Check if the move will hit with certainty
  2. 1. Check if user or target has No Guard, or if the user has sure-hit accuracy from Poison-type Toxic, or if the user has used Lock-On / Mind Reader
  3. 2. Check if the move itself is sure-hit (accuracy 101, like Aerial Ace), or if the move was custom-set to be sure-hit: Pursuit and target is switching, Thunder / Hurricane in rain, Blizzard in hail, Stomp / Steamroller / Dragon Rush / Body Slam / Malicious Moonsault / Heavy Slam / Heat Crash / Flying Press vs. Minimize
  4. 3. Check if the defender has Telekinesis
  5.  
  6. Apply accuracy / evasion modifiers
  7. 4. Look up the move's "base accuracy". For example, Fire Blast's base accuracy is 85.
  8. 5. If the move is a status move and the target has Wonder Skin, or the move is Thunder / Hurricane and the weather is sun, set the move's accuracy to 50.
  9. 6. Chain the accuracy and evasion modifiers. Order?
  10.  
  11. Bright Powder / Lax Incense - 3686/4096
  12. Wide Lens - 4505/4096
  13. Zoom Lens - 4915/4096
  14. Tangled Feet - 2048/4096
  15. Hustle / Sand Veil / Snow Cloak - 3277/4096
  16. Compound Eyes - 5325/4096
  17. Victory Star - 4506/4096 for each Victory Star
  18. Gravity - 6840/4096
  19.  
  20. 7. Apply a modifier to the value from step 5) with the result of step 6). That is, pokeRound[(step 5 * step 6) / 4096], where pokeRound means do standard rounding, but round down on 0.5.
  21.  
  22. Apply accuracy stat boosts / drops
  23. 8. Determine the number of accuracy / evasion boosts. The number must be within 0-12. (0 = -6, 1 = -5, 6 = 0, 12 = +6, etc.)
  24. 9. If the user has Keen Eye or Unaware, or the move is Sacred Sword / Chip Away / Darkest Lariat, or the target is identified (Odor Sleuth / Foresight / Miracle Eye) and has positive evasion boosts, set the target's evasion boosts to 6 (+0).
  25. 10. Start with 6, then add all accuracy stat boosts / drops, and subtract all evasion stat boosts / drops.
  26. 11. Take the value of step 10 and compare to the following table. Multiply the result from step 7 by the numerator first, then divide by the denominator and floor the result. If the resulting value would be greater than 100, make it 100.
  27.  
  28. 0 = 6/18
  29. 1 = 6/16
  30. 2 = 6/14
  31. 3 = 6/12
  32. 4 = 6/10
  33. 5 = 6/8
  34. 6 = 6/6
  35. 7 = 8/6
  36. 8 = 10/6
  37. 9 = 12/6
  38. 10 = 14/6
  39. 11 = 16/6
  40. 12 = 18/6
  41.  
  42. 12. If Micle Berry would boost the move's accuracy, pokeRound([step 11 * 4915]/4096).
  43. 13. If the percentage is above 100, make it 100.
  44. 14. If the affection of the target is 4 hearts or more, subtract 10 from the percentage.
  45.  
  46.  
  47. BONUS: OHKO move accuracy
  48. 1. Fail if the attacker's level is less than the defender's level.
  49. 2. Fail if the defender has the ability Sturdy.
  50. 3. Check if user or target has No Guard, or if the user has sure-hit accuracy from Poison-type Toxic, or if the user has used Lock-On / Mind Reader
  51. 4. Look up the move's "base accuracy" (always 30 in the case of OHKO moves).
  52. 5. If the move is Sheer Cold and the user is not Ice-type, set move accuracy to 20.
  53. 6. Add (attacker level - defender level) to move accuracy.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement