mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Added pokemon.txt/pokemon_forms.txt property "Offspring" for species that could be produced by breeding
This commit is contained in:
@@ -28,6 +28,7 @@ module GameData
|
||||
attr_reader :egg_groups
|
||||
attr_reader :hatch_steps
|
||||
attr_reader :incense
|
||||
attr_reader :offspring
|
||||
attr_reader :evolutions
|
||||
attr_reader :height
|
||||
attr_reader :weight
|
||||
@@ -119,6 +120,7 @@ module GameData
|
||||
}
|
||||
if compiling_forms
|
||||
ret["PokedexForm"] = [0, "u"]
|
||||
ret["Offspring"] = [0, "*e", :Species]
|
||||
ret["Evolutions"] = [0, "*ees", :Species, :Evolution, nil]
|
||||
ret["MegaStone"] = [0, "e", :Item]
|
||||
ret["MegaMove"] = [0, "e", :Move]
|
||||
@@ -130,6 +132,7 @@ module GameData
|
||||
ret["GrowthRate"] = [0, "e", :GrowthRate]
|
||||
ret["GenderRatio"] = [0, "e", :GenderRatio]
|
||||
ret["Incense"] = [0, "e", :Item]
|
||||
ret["Offspring"] = [0, "*s"]
|
||||
ret["Evolutions"] = [0, "*ses", nil, :Evolution, nil]
|
||||
# All properties below here are old names for some properties above.
|
||||
# They will be removed in v21.
|
||||
@@ -171,6 +174,7 @@ module GameData
|
||||
@egg_groups = hash[:egg_groups] || [:Undiscovered]
|
||||
@hatch_steps = hash[:hatch_steps] || 1
|
||||
@incense = hash[:incense]
|
||||
@offspring = hash[:offspring] || []
|
||||
@evolutions = hash[:evolutions] || []
|
||||
@height = hash[:height] || 1
|
||||
@weight = hash[:weight] || 1
|
||||
@@ -275,13 +279,23 @@ module GameData
|
||||
return ret
|
||||
end
|
||||
|
||||
def get_related_species
|
||||
# Returns an array of all the species in this species' evolution family.
|
||||
def get_family_species
|
||||
sp = self.get_baby_species
|
||||
evos = GameData::Species.get(sp).get_family_evolutions(false)
|
||||
return [sp] if evos.length == 0
|
||||
return [sp].concat(evos.map { |e| e[1] }).uniq
|
||||
end
|
||||
|
||||
# This takes into account whether other_species is evolved.
|
||||
def breeding_can_produce?(other_species)
|
||||
other_family = GameData::Species.get(other_species).get_family_species
|
||||
if @offspring.length > 0
|
||||
return (other_family & @offspring).length > 0
|
||||
end
|
||||
return other_family.include?(@id)
|
||||
end
|
||||
|
||||
def family_evolutions_have_method?(check_method, check_param = nil)
|
||||
sp = self.get_baby_species
|
||||
evos = GameData::Species.get(sp).get_family_evolutions
|
||||
|
||||
@@ -1131,6 +1131,7 @@ def pbPokemonEditor
|
||||
:egg_groups => egg_groups, # 26, 27
|
||||
:hatch_steps => data[28],
|
||||
:incense => data[29],
|
||||
:offspring => spec.offspring,
|
||||
:evolutions => data[30],
|
||||
:height => data[31],
|
||||
:weight => data[32],
|
||||
@@ -1321,7 +1322,7 @@ def pbRegionalDexEditorMain
|
||||
seen = []
|
||||
GameData::Species.each_species do |s|
|
||||
next if seen.include?(s.species)
|
||||
family = s.get_related_species
|
||||
family = s.get_family_species
|
||||
new_dex.concat(family)
|
||||
seen.concat(family)
|
||||
end
|
||||
|
||||
@@ -630,6 +630,7 @@ module Compiler
|
||||
:egg_groups => contents["EggGroups"] || contents["Compatibility"],
|
||||
:hatch_steps => contents["HatchSteps"] || contents["StepsToHatch"],
|
||||
:incense => contents["Incense"],
|
||||
:offspring => contents["Offspring"],
|
||||
:evolutions => contents["Evolutions"],
|
||||
:height => contents["Height"],
|
||||
:weight => contents["Weight"],
|
||||
@@ -662,7 +663,15 @@ module Compiler
|
||||
end
|
||||
}
|
||||
}
|
||||
# Enumerate all evolution species and parameters (this couldn't bedone earlier)
|
||||
# Enumerate all offspring species (this couldn't be done earlier)
|
||||
GameData::Species.each do |species|
|
||||
FileLineData.setSection(species.id.to_s, "Offspring", nil) # For error reporting
|
||||
offspring = species.offspring
|
||||
offspring.each_with_index do |sp, i|
|
||||
offspring[i] = csvEnumField!(sp, :Species, "Offspring", species.id)
|
||||
end
|
||||
end
|
||||
# Enumerate all evolution species and parameters (this couldn't be done earlier)
|
||||
GameData::Species.each do |species|
|
||||
FileLineData.setSection(species.id.to_s, "Evolutions", nil) # For error reporting
|
||||
species.evolutions.each do |evo|
|
||||
@@ -821,6 +830,7 @@ module Compiler
|
||||
:egg_groups => contents["EggGroups"] || contents["Compatibility"] || base_data.egg_groups.clone,
|
||||
:hatch_steps => contents["HatchSteps"] || contents["StepsToHatch"] || base_data.hatch_steps,
|
||||
:incense => base_data.incense,
|
||||
:offspring => contents["Offspring"] || base_data.offspring.clone,
|
||||
:evolutions => evolutions,
|
||||
:height => contents["Height"] || base_data.height,
|
||||
:weight => contents["Weight"] || base_data.weight,
|
||||
|
||||
@@ -315,6 +315,10 @@ module Compiler
|
||||
f.write(sprintf("EggGroups = %s\r\n", species.egg_groups.join(",")))
|
||||
end
|
||||
f.write(sprintf("HatchSteps = %d\r\n", species.hatch_steps))
|
||||
f.write(sprintf("Incense = %s\r\n", species.incense)) if species.incense
|
||||
if species.offspring.length > 0
|
||||
f.write(sprintf("Offspring = %s\r\n", species.offspring.join(",")))
|
||||
end
|
||||
f.write(sprintf("Height = %.1f\r\n", species.height / 10.0))
|
||||
f.write(sprintf("Weight = %.1f\r\n", species.weight / 10.0))
|
||||
f.write(sprintf("Color = %s\r\n", species.color))
|
||||
@@ -348,7 +352,6 @@ module Compiler
|
||||
end
|
||||
f.write("\r\n")
|
||||
end
|
||||
f.write(sprintf("Incense = %s\r\n", species.incense)) if species.incense
|
||||
end
|
||||
}
|
||||
process_pbs_file_message_end
|
||||
@@ -411,6 +414,9 @@ module Compiler
|
||||
f.write(sprintf("EggGroups = %s\r\n", species.egg_groups.join(",")))
|
||||
end
|
||||
f.write(sprintf("HatchSteps = %d\r\n", species.hatch_steps)) if species.hatch_steps != base_species.hatch_steps
|
||||
if species.offspring.length > 0 && species.offspring != base_species.offspring
|
||||
f.write(sprintf("Offspring = %s\r\n", species.offspring.join(",")))
|
||||
end
|
||||
f.write(sprintf("Height = %.1f\r\n", species.height / 10.0)) if species.height != base_species.height
|
||||
f.write(sprintf("Weight = %.1f\r\n", species.weight / 10.0)) if species.weight != base_species.weight
|
||||
f.write(sprintf("Color = %s\r\n", species.color)) if species.color != base_species.color
|
||||
@@ -546,7 +552,7 @@ module Compiler
|
||||
if current_family && current_family.include?(species)
|
||||
f.write(",") if comma
|
||||
else
|
||||
current_family = GameData::Species.get(species).get_related_species
|
||||
current_family = GameData::Species.get(species).get_family_species
|
||||
comma = false
|
||||
f.write("\r\n")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user