Added pokemon.txt/pokemon_forms.txt property "Offspring" for species that could be produced by breeding

This commit is contained in:
Maruno17
2021-10-29 20:34:50 +01:00
parent 0c3ec24936
commit 899d037255
8 changed files with 56 additions and 5 deletions

View File

@@ -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,

View File

@@ -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