• 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.

check pokemon-type?

8
Posts
8
Years
  • Age 37
  • Seen Sep 8, 2015
Is there a Contitinal Branch or something, that can check if I have a curtain type of pokemon in my team?
 
824
Posts
8
Years
Add this in the scripts, in PSystem_Utilities. I have it right below the "pbHasSpecies?" function.

Code:
def pbHasPokemonType?(type)
  if type.is_a?(String) || type.is_a?(Symbol)
    type=getID(PBTypes,type)
  end
  for pokemon in $Trainer.party
    next if pokemon.isEgg?
    return true if pokemon.hasType?(type)
  end
  return false
end

you can then in the events, use, for example, "pbHasPokemonType?( :FIGHTING)" to test if the player has a Fighting type with them.
 
Back
Top