v21.1 how would i make an ability where it lowers all moves accuracy by 50%

This thread pertains to v21.1 of Pokémon Essentials.
Solution
Just to start off, risking bugs and errors? That's how you learn. You have to break stuff sometimes. Worst case scenario, you delete the code or go back to a fresh backup. That's it. There's no other consequences to breaking code. So there's nothing to be afraid of or "risk".

But you are right, it is basically like Hustle's code. I just removed the qualifier for if it's a physical move, and changed the multiplier
Ruby:
Battle::AbilityEffects::AccuracyCalcFromUser.add(:ABILITY,
  proc { |ability, mods, user, target, move, type|
    mods[:accuracy_multiplier] *= 0.5
  }
)
If you only wanted the accuracy debuff to apply to damaging moves only, you'd want the move.damagingMove? but I leave that to you to figure out how to implement...

Vendily

Elite Trainer
Member
Just to start off, risking bugs and errors? That's how you learn. You have to break stuff sometimes. Worst case scenario, you delete the code or go back to a fresh backup. That's it. There's no other consequences to breaking code. So there's nothing to be afraid of or "risk".

But you are right, it is basically like Hustle's code. I just removed the qualifier for if it's a physical move, and changed the multiplier
Ruby:
Battle::AbilityEffects::AccuracyCalcFromUser.add(:ABILITY,
  proc { |ability, mods, user, target, move, type|
    mods[:accuracy_multiplier] *= 0.5
  }
)
If you only wanted the accuracy debuff to apply to damaging moves only, you'd want the move.damagingMove? but I leave that to you to figure out how to implement.

Next time you want to make an ability, especially if you already know what ability is similar to it, why not "risk it" and take a stab a implementing it. It's very rewarding to making something yourself. And of course, feel free to come and ask for help afterwards if you still got stuck.
 
Solution
Top