I believe it's Ruby.
As for the code khkramer posted, it belongs in your game's script section.
The code posted is a method you need to declare in your main script. Then you can call that part of the script from anywhere in your game.
Open your Script Editor.
Press Ctrl+Shift+F to do a global search. Search for "pbHasType".
Double click the result. Now you'll see a section of code that defines "pbHasType".
Beneath that block of code you'll want to paste the new code posted by khkramer.
Like this: (the RED text is the code you need to paste)
Code:
def pbHasType?(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
[COLOR="Red"]def pbHasMonoType?(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 false unless pokemon.hasType?(type)
end
return true[/COLOR]
Hit 'OK' to save changes. Now you declared a new section of code to your game, but it's not being used yet.
You use events for that. Anywhere in your game, use an event (I'm assuming you know what an event is and how they work) and place this line in a conditional branch:
...to check if the player's party consists entirely of FLYING TYPE Pokémon.
You can of course also use
and
etc.
The conditional branch will return true if the player only has Pokémon of that type, and false (else) if the player doesn't.
I'm assuming the script posted by khkramer works. I haven't tested it out myself.