mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
update to latest 6.0 release
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user