• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Eventing Question] Checking for Abilities

  • 4
    Posts
    5
    Years
    • Seen Jan 16, 2021
    Is there a way to check if a pokemon in the party has a specific ability through an event, the same way you can check for moves with a conditional branch?

    If not, how can I define a method to do so? I guess finding where the method for checking moves is, and using it as a sheet to make one checking abilities would work, but I don't know where that is located.
     

    Poq

  • 144
    Posts
    6
    Years
    • Seen Aug 28, 2021
    I did something like this recently to have an event check for a certain held item. Use CTRL+SHIFT +F to search for "def pbCheckMove" and try imitating that script.
     
  • 4
    Posts
    5
    Years
    • Seen Jan 16, 2021
    def hasAbility?(value=0)
    if value==0
    return self.ability>0
    else
    if value.is_a?(String) || value.is_a?(Symbol)
    value=getID(PBAbilities,value)
    end
    return self.ability==value
    end
    return false
    end


    So I found this code, but I don't know how to make it check for specific ability in a pokemon that's in the party using the conditional branches. Can someone more experienced in coding help?
     

    Poq

  • 144
    Posts
    6
    Years
    • Seen Aug 28, 2021
    Try this as the script for your conditional branch:
    Code:
    for i in 0..$Trainer.party.length
    	return $Trainer.party[i].hasAbility?(:INTIMIDATE)
    return false
    end
    replacing Intimidate with whatever ability you want to check for.
     
    Back
    Top