mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
[wip] generate fusions dynamically
This commit is contained in:
@@ -59,18 +59,19 @@ module GameData
|
||||
# @param form [Integer]
|
||||
# @return [self, nil]
|
||||
def self.get_species_form(species, form)
|
||||
return nil if !species || !form
|
||||
validate species => [Symbol, self, String, Integer]
|
||||
validate form => Integer
|
||||
# if other.is_a?(Integer)
|
||||
# p "Please switch to symbols, thanks."
|
||||
# end
|
||||
species = species.species if species.is_a?(self)
|
||||
species = DATA[species].species if species.is_a?(Integer)
|
||||
species = species.to_sym if species.is_a?(String)
|
||||
trial = sprintf("%s_%d", species, form).to_sym
|
||||
species_form = (DATA[trial].nil?) ? species : trial
|
||||
return (DATA.has_key?(species_form)) ? DATA[species_form] : nil
|
||||
return GameData::Species.get(species) rescue nil
|
||||
# return nil if !species || !form
|
||||
# validate species => [Symbol, self, String, Integer]
|
||||
# validate form => Integer
|
||||
# # if other.is_a?(Integer)
|
||||
# # p "Please switch to symbols, thanks."
|
||||
# # end
|
||||
# species = species.species if species.is_a?(self)
|
||||
# species = DATA[species].species if species.is_a?(Integer)
|
||||
# species = species.to_sym if species.is_a?(String)
|
||||
# trial = sprintf("%s_%d", species, form).to_sym
|
||||
# species_form = (DATA[trial].nil?) ? species : trial
|
||||
# return (DATA.has_key?(species_form)) ? DATA[species_form] : nil
|
||||
end
|
||||
|
||||
def self.schema(compiling_forms = false)
|
||||
@@ -191,22 +192,26 @@ module GameData
|
||||
end
|
||||
# @return [String] the translated name of this species
|
||||
def name
|
||||
return pbGetMessage(MessageTypes::Species, @id_number)
|
||||
return @real_name
|
||||
#return pbGetMessage(MessageTypes::Species, @id_number)
|
||||
end
|
||||
|
||||
# @return [String] the translated name of this form of this species
|
||||
def form_name
|
||||
return pbGetMessage(MessageTypes::FormNames, @id_number)
|
||||
return @real_form_name
|
||||
#return pbGetMessage(MessageTypes::FormNames, @id_number)
|
||||
end
|
||||
|
||||
# @return [String] the translated Pokédex category of this species
|
||||
def category
|
||||
return pbGetMessage(MessageTypes::Kinds, @id_number)
|
||||
return @real_category
|
||||
#return pbGetMessage(MessageTypes::Kinds, @id_number)
|
||||
end
|
||||
|
||||
# @return [String] the translated Pokédex entry of this species
|
||||
def pokedex_entry
|
||||
return pbGetMessage(MessageTypes::Entries, @id_number)
|
||||
return @real_pokedex_entry
|
||||
#return pbGetMessage(MessageTypes::Entries, @id_number)
|
||||
end
|
||||
|
||||
def is_fusion
|
||||
|
||||
@@ -210,10 +210,10 @@ module GameData
|
||||
species_data = GameData::Species.get(getHeadID(species_data))
|
||||
end
|
||||
|
||||
if form > 0
|
||||
ret = sprintf("Cries/%s_%d", species_data.species, form)
|
||||
return ret if pbResolveAudioSE(ret)
|
||||
end
|
||||
# if form > 0
|
||||
# ret = sprintf("Cries/%s_%d", species_data.species, form)
|
||||
# return ret if pbResolveAudioSE(ret)
|
||||
# end
|
||||
ret = sprintf("Cries/%s", species_data.species)
|
||||
return (pbResolveAudioSE(ret)) ? ret : nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user