Wrote a generalised data property editor that deals with a list of things from a GameData module, allowed the WildItem properties for species to contain multiple items each

This commit is contained in:
Maruno17
2021-11-21 22:24:58 +00:00
parent c8b574ed7c
commit d93d73caa8
9 changed files with 170 additions and 354 deletions

View File

@@ -824,9 +824,9 @@ module Compiler
:egg_moves => contents["EggMoves"] || base_data.egg_moves.clone,
:abilities => contents["Abilities"] || base_data.abilities.clone,
:hidden_abilities => contents["HiddenAbilities"] || contents["HiddenAbility"] || base_data.hidden_abilities.clone,
:wild_item_common => contents["WildItemCommon"] || base_data.wild_item_common,
:wild_item_uncommon => contents["WildItemUncommon"] || base_data.wild_item_uncommon,
:wild_item_rare => contents["WildItemRare"] || base_data.wild_item_rare,
:wild_item_common => contents["WildItemCommon"] || base_data.wild_item_common.clone,
:wild_item_uncommon => contents["WildItemUncommon"] || base_data.wild_item_uncommon.clone,
:wild_item_rare => contents["WildItemRare"] || base_data.wild_item_rare.clone,
: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,
@@ -847,7 +847,9 @@ module Compiler
# If form is single-typed, ensure it remains so if base species is dual-typed
species_hash[:type2] = contents["Type1"] if contents["Type1"] && !contents["Type2"]
# If form has any wild items, ensure none are inherited from base species
if contents["WildItemCommon"] || contents["WildItemUncommon"] || contents["WildItemRare"]
if (contents["WildItemCommon"] && !contents["WildItemCommon"].empty?) ||
(contents["WildItemUncommon"] && !contents["WildItemUncommon"].empty?) ||
(contents["WildItemRare"] && !contents["WildItemRare"].empty?)
species_hash[:wild_item_common] = contents["WildItemCommon"]
species_hash[:wild_item_uncommon] = contents["WildItemUncommon"]
species_hash[:wild_item_rare] = contents["WildItemRare"]

View File

@@ -329,9 +329,9 @@ module Compiler
f.write(sprintf("FormName = %s\r\n", species.real_form_name)) if species.real_form_name && !species.real_form_name.empty?
f.write(sprintf("Generation = %d\r\n", species.generation)) if species.generation != 0
f.write(sprintf("Flags = %s\r\n", species.flags.join(","))) if species.flags.length > 0
f.write(sprintf("WildItemCommon = %s\r\n", species.wild_item_common)) if species.wild_item_common
f.write(sprintf("WildItemUncommon = %s\r\n", species.wild_item_uncommon)) if species.wild_item_uncommon
f.write(sprintf("WildItemRare = %s\r\n", species.wild_item_rare)) if species.wild_item_rare
f.write(sprintf("WildItemCommon = %s\r\n", species.wild_item_common.join(","))) if species.wild_item_common.length > 0
f.write(sprintf("WildItemUncommon = %s\r\n", species.wild_item_uncommon.join(","))) if species.wild_item_uncommon.length > 0
f.write(sprintf("WildItemRare = %s\r\n", species.wild_item_rare.join(","))) if species.wild_item_rare.length > 0
if species.evolutions.any? { |evo| !evo[3] }
f.write("Evolutions = ")
need_comma = false
@@ -431,9 +431,9 @@ module Compiler
if species.wild_item_common != base_species.wild_item_common ||
species.wild_item_uncommon != base_species.wild_item_uncommon ||
species.wild_item_rare != base_species.wild_item_rare
f.write(sprintf("WildItemCommon = %s\r\n", species.wild_item_common)) if species.wild_item_common
f.write(sprintf("WildItemUncommon = %s\r\n", species.wild_item_uncommon)) if species.wild_item_uncommon
f.write(sprintf("WildItemRare = %s\r\n", species.wild_item_rare)) if species.wild_item_rare
f.write(sprintf("WildItemCommon = %s\r\n", species.wild_item_common.join(","))) if species.wild_item_common.length > 0
f.write(sprintf("WildItemUncommon = %s\r\n", species.wild_item_uncommon.join(","))) if species.wild_item_uncommon.length > 0
f.write(sprintf("WildItemRare = %s\r\n", species.wild_item_rare.join(","))) if species.wild_item_rare.length > 0
end
if species.evolutions != base_species.evolutions && species.evolutions.any? { |evo| !evo[3] }
f.write("Evolutions = ")