• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!

How can I check an opponent's ability?

Sunnygo7

THEY CALL ME SONIC 🗣🔥
Member
Joined
Aug 17, 2022
Posts
18
Would like to check if the ability of the opponent is levitate. Have no idea where to find it and have got false results.

Battle::PokeBallEffects::ModifyCatchRate.add(:WINGBALL, proc { |ball, catchRate, battle, battler|
multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3
catchRate *= multiplier if battler.pbHasType?(:FLYING) || foe.ability == :LEVITATE
next catchRate

my code:
 
foe its undefined, try something like this:

Ruby:
Expand Collapse Copy
Battle::PokeBallEffects::ModifyCatchRate.add(:WINGBALL, proc { |ball, catchRate, battle, battler|
multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3
catchRate *= multiplier if battler.pbHasType?(:FLYING) || battler.hasActiveAbility?(:LEVITATE)
next catchRate
 
Back
Top