Telemetius
Tele*
- 256
- Posts
- 10
- Years
- Italy
- Seen Jan 9, 2022
Hi forum
I just noticed that the utility pbHasType only works for your party.
So I tried writing a similar one that checks if the opponent has a particular type.
It's not working and I'd like to know why is that.
Is it because @battle.opponent.party is not a method?
I just noticed that the utility pbHasType only works for your party.
So I tried writing a similar one that checks if the opponent has a particular type.
It's not working and I'd like to know why is that.
Is it because @battle.opponent.party is not a method?
Code:
def pbOppHasType?(type)
if type.is_a?(String) || type.is_a?(Symbol)
type=getID(PBTypes,type)
end
for pokemon in @battle.opponent.party
next if pokemon.isEgg?
return true if pokemon.hasType?(type)
end
return false
end