update to latest 6.0 release

This commit is contained in:
infinitefusion
2023-11-12 21:45:07 -05:00
parent ba7ee9bae2
commit d3662c3f10
4980 changed files with 21185 additions and 317635 deletions

View File

@@ -24,12 +24,33 @@ module GameData
# @return [self]
def get(other)
validate other => [Symbol, self, String, Integer]
return other if other.is_a?(self)
other = other.to_sym if other.is_a?(String)
# if other.is_a?(Integer)
# p "Please switch to symbols, thanks."
# end
raise "Unknown ID #{other}." unless self::DATA.has_key?(other)
if other.to_s.match?(/\AB\d+H\d+\z/)
species = GameData::FusedSpecies.new(other)
return species
end
if other.is_a?(Integer) && self == GameData::Species
if other > NB_POKEMON
body_id = getBodyID(other)
head_id = getHeadID(other, body_id)
pokemon_id = getFusedPokemonIdFromDexNum(body_id, head_id)
return GameData::FusedSpecies.new(pokemon_id)
end
end
if !self::DATA.has_key?(other)
echo _INTL("Unknown ID {1}.", other)
return self::get(:PIKACHU)
end
#if other == :Species
# end
return self::DATA[other]
end
@@ -40,9 +61,23 @@ module GameData
validate other => [Symbol, self, String, Integer]
return other if other.is_a?(self)
other = other.to_sym if other.is_a?(String)
# if other.is_a?(Integer)
# p "Please switch to symbols, thanks."
# end
if other.to_s.match?(/\AB\d+H\d+\z/)
species = GameData::FusedSpecies.new(other)
return species
end
if other.is_a?(Integer) && self == GameData::Species
if other > NB_POKEMON
body_id = getBodyID(other)
head_id = getHeadID(other, body_id)
pokemon_id = getFusedPokemonIdFromDexNum(body_id, head_id)
return GameData::FusedSpecies.new(pokemon_id)
end
end
# if other.is_a?(Integer)
# p "Please switch to symbols, thanks."
# end
return (self::DATA.has_key?(other)) ? self::DATA[other] : nil
end