Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Check if the move will hit with certainty
- 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
- 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
- 3. Check if the defender has Telekinesis
- Apply accuracy / evasion modifiers
- 4. Look up the move's "base accuracy". For example, Fire Blast's base accuracy is 85.
- 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.
- 6. Chain the accuracy and evasion modifiers. Order?
- Bright Powder / Lax Incense - 3686/4096
- Wide Lens - 4505/4096
- Zoom Lens - 4915/4096
- Tangled Feet - 2048/4096
- Hustle / Sand Veil / Snow Cloak - 3277/4096
- Compound Eyes - 5325/4096
- Victory Star - 4506/4096 for each Victory Star
- Gravity - 6840/4096
- 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.
- Apply accuracy stat boosts / drops
- 8. Determine the number of accuracy / evasion boosts. The number must be within 0-12. (0 = -6, 1 = -5, 6 = 0, 12 = +6, etc.)
- 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).
- 10. Start with 6, then add all accuracy stat boosts / drops, and subtract all evasion stat boosts / drops.
- 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.
- 0 = 6/18
- 1 = 6/16
- 2 = 6/14
- 3 = 6/12
- 4 = 6/10
- 5 = 6/8
- 6 = 6/6
- 7 = 8/6
- 8 = 10/6
- 9 = 12/6
- 10 = 14/6
- 11 = 16/6
- 12 = 18/6
- 12. If Micle Berry would boost the move's accuracy, pokeRound([step 11 * 4915]/4096).
- 13. If the percentage is above 100, make it 100.
- 14. If the affection of the target is 4 hearts or more, subtract 10 from the percentage.
- BONUS: OHKO move accuracy
- 1. Fail if the attacker's level is less than the defender's level.
- 2. Fail if the defender has the ability Sturdy.
- 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
- 4. Look up the move's "base accuracy" (always 30 in the case of OHKO moves).
- 5. If the move is Sheer Cold and the user is not Ice-type, set move accuracy to 20.
- 6. Add (attacker level - defender level) to move accuracy.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement