mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +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
|
||||
|
||||
|
||||
@@ -21,6 +21,15 @@ module GameData
|
||||
attr_reader :must_walk
|
||||
attr_reader :ignore_passability
|
||||
|
||||
#oricorio
|
||||
attr_reader :flowerRed
|
||||
attr_reader :flowerPink
|
||||
attr_reader :flowerYellow
|
||||
attr_reader :flowerBlue
|
||||
attr_reader :flower
|
||||
attr_reader :trashcan
|
||||
attr_reader :sharpedoObstacle
|
||||
|
||||
DATA = {}
|
||||
|
||||
extend ClassMethods
|
||||
@@ -61,6 +70,15 @@ module GameData
|
||||
@shows_reflections = false #= hash[:shows_reflections] || false
|
||||
@must_walk = hash[:must_walk] || false
|
||||
@ignore_passability = hash[:ignore_passability] || false
|
||||
|
||||
@flowerRed = hash[:flowerRed] || false
|
||||
@flowerYellow = hash[:flowerYellow] || false
|
||||
@flowerPink = hash[:flowerPink] || false
|
||||
@flowerBlue = hash[:flowerBlue] || false
|
||||
@flower = hash[:flower] || false
|
||||
@trashcan = hash[:trashcan] || false
|
||||
@sharpedoObstacle = hash[:sharpedoObstacle] || false
|
||||
|
||||
end
|
||||
|
||||
def can_surf_freely
|
||||
@@ -202,5 +220,46 @@ GameData::TerrainTag.register({
|
||||
:id => :Puddle,
|
||||
:id_number => 16,
|
||||
:battle_environment => :Puddle,
|
||||
:shows_reflections => false
|
||||
:shows_reflections => true
|
||||
})
|
||||
|
||||
GameData::TerrainTag.register({
|
||||
:id => :FlowerRed,
|
||||
:id_number => 17,
|
||||
:flowerRed => true,
|
||||
:flower => true
|
||||
})
|
||||
GameData::TerrainTag.register({
|
||||
:id => :FlowerYellow,
|
||||
:id_number => 18,
|
||||
:flowerYellow => true,
|
||||
:flower => true
|
||||
})
|
||||
GameData::TerrainTag.register({
|
||||
:id => :FlowerPink,
|
||||
:id_number => 19,
|
||||
:flowerPink => true,
|
||||
:flower => true
|
||||
})
|
||||
GameData::TerrainTag.register({
|
||||
:id => :FlowerBlue,
|
||||
:id_number => 20,
|
||||
:flowerBlue => true,
|
||||
:flower => true
|
||||
})
|
||||
GameData::TerrainTag.register({
|
||||
:id => :FlowerOther,
|
||||
:id_number => 21,
|
||||
:flower => true
|
||||
})
|
||||
GameData::TerrainTag.register({
|
||||
:id => :Trashcan,
|
||||
:id_number => 22,
|
||||
:trashcan => true
|
||||
})
|
||||
|
||||
GameData::TerrainTag.register({
|
||||
:id => :SharpedoObstacle,
|
||||
:id_number => 23,
|
||||
:sharpedoObstacle => true
|
||||
})
|
||||
@@ -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