Created and implemented GameData::Type

This commit is contained in:
Maruno17
2020-12-12 21:26:46 +00:00
parent c8790bafc9
commit bc13517cb7
50 changed files with 698 additions and 784 deletions

View File

@@ -481,14 +481,11 @@ class Pokemon
return ret
end
# @param type [Integer, Symbol, String] type to check (from PBTypes)
# @param type [Integer, Symbol, String] type to check
# @return [Boolean] whether this Pokémon has the specified type
def hasType?(type)
t = self.types
if !type.is_a?(Integer)
return t.any? { |tp| isConst?(tp, PBTypes, type) }
end
return t.any? { |tp| tp == type }
type = GameData::Type.get(type).id
return self.types.include?(type)
end
#=============================================================================