mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
6.0 release
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
|
||||
@@ -245,8 +250,8 @@ module GameData
|
||||
end
|
||||
|
||||
def shows_shadow?
|
||||
#return true
|
||||
return @front_sprite_altitude > 0
|
||||
return true
|
||||
# return @front_sprite_altitude > 0
|
||||
end
|
||||
|
||||
def get_evolutions(exclude_invalid = false)
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
module GameData
|
||||
class Species
|
||||
def self.check_graphic_file(path, species, form = 0, gender = 0, shiny = false, shadow = false, subfolder = "")
|
||||
def self.check_graphic_file(path, species, form = "", gender = 0, shiny = false, shadow = false, subfolder = "")
|
||||
try_subfolder = sprintf("%s/", subfolder)
|
||||
try_species = species
|
||||
try_form = (form > 0) ? sprintf("_%d", form) : ""
|
||||
|
||||
try_form = form ? sprintf("_%s", form) : ""
|
||||
try_gender = (gender == 1) ? "_female" : ""
|
||||
try_shadow = (shadow) ? "_shadow" : ""
|
||||
factors = []
|
||||
factors.push([4, sprintf("%s shiny/", subfolder), try_subfolder]) if shiny
|
||||
factors.push([3, try_shadow, ""]) if shadow
|
||||
factors.push([2, try_gender, ""]) if gender == 1
|
||||
factors.push([1, try_form, ""]) if form > 0
|
||||
factors.push([1, try_form, ""]) if form
|
||||
factors.push([0, try_species, "000"])
|
||||
# Go through each combination of parameters in turn to find an existing sprite
|
||||
for i in 0...2 ** factors.length
|
||||
@@ -131,17 +132,17 @@ module GameData
|
||||
return (ret) ? ret : pbResolveBitmap("Graphics/Pokemon/Eggs/000_icon")
|
||||
end
|
||||
|
||||
def self.icon_filename(species, form = 0, gender = 0, shiny = false, shadow = false, egg = false)
|
||||
return self.egg_icon_filename(species, form) if egg
|
||||
return self.check_graphic_file("Graphics/Pokemon/", species, form, gender, shiny, shadow, "Icons")
|
||||
def self.icon_filename(species, spriteform= nil, gender=nil, shiny = false, shadow = false, egg = false)
|
||||
return self.egg_icon_filename(species, 0) if egg
|
||||
return self.check_graphic_file("Graphics/Pokemon/", species, spriteform, gender, shiny, shadow, "Icons")
|
||||
end
|
||||
|
||||
def self.icon_filename_from_pokemon(pkmn)
|
||||
return pbResolveBitmap(sprintf("Graphics/Icons/iconEgg")) if pkmn.egg?
|
||||
if pkmn.isFusion?
|
||||
return pbResolveBitmap(sprintf("Graphics/Icons/iconDNA"))
|
||||
end
|
||||
|
||||
return self.icon_filename(pkmn.species, pkmn.form, pkmn.gender, pkmn.shiny?, pkmn.shadowPokemon?, pkmn.egg?)
|
||||
return self.icon_filename(pkmn.species, pkmn.spriteform_head, pkmn.gender, pkmn.shiny?, pkmn.shadowPokemon?, pkmn.egg?)
|
||||
end
|
||||
|
||||
def self.icon_filename_from_species(species)
|
||||
@@ -210,10 +211,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
|
||||
|
||||
@@ -61,7 +61,7 @@ module GameData
|
||||
end
|
||||
|
||||
def self.player_back_sprite_filename(tr_type)
|
||||
outfit = ($Trainer) ? $Trainer.outfit : 0
|
||||
outfit = ($Trainer) ? $Trainer.outfit : 0 rescue 0
|
||||
return self.check_file(tr_type, "Graphics/Trainers/", sprintf("_%d", outfit), "_back")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user