mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
[wip] generate fusions dynamically
This commit is contained in:
@@ -24,12 +24,28 @@ 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
|
||||
|
||||
if other.to_s.match?(/\AB\d+H\d+\z/)
|
||||
species = GameData::FusedSpecies.new(other)
|
||||
return species
|
||||
end
|
||||
if other.is_a?(Integer) #assume it's a 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
|
||||
raise "Unknown ID #{other}." unless self::DATA.has_key?(other)
|
||||
|
||||
#if other == :Species
|
||||
|
||||
# end
|
||||
|
||||
return self::DATA[other]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user