Commented out support for ID numbers in Pokémon filenames, added class GameData::EggGroup

This commit is contained in:
Maruno17
2021-02-06 21:30:19 +00:00
parent e9ed260277
commit 033434807d
30 changed files with 180 additions and 70 deletions

View File

@@ -974,8 +974,8 @@ def pbPokemonEditor
[_INTL("WildItemCommon"), ItemProperty, _INTL("Item commonly held by wild Pokémon of this species.")],
[_INTL("WildItemUncommon"), ItemProperty, _INTL("Item uncommonly held by wild Pokémon of this species.")],
[_INTL("WildItemRare"), ItemProperty, _INTL("Item rarely held by wild Pokémon of this species.")],
[_INTL("Compat1"), EnumProperty2.new(PBEggGroups), _INTL("Compatibility group (egg group) for breeding purposes.")],
[_INTL("Compat2"), EnumProperty2.new(PBEggGroups), _INTL("Compatibility group (egg group) for breeding purposes.")],
[_INTL("Compat1"), EggGroupProperty, _INTL("Compatibility group (egg group) for breeding purposes.")],
[_INTL("Compat2"), EggGroupProperty, _INTL("Compatibility group (egg group) for breeding purposes.")],
[_INTL("StepsToHatch"), LimitProperty.new(99999), _INTL("Number of steps until an egg of this species hatches.")],
[_INTL("Incense"), ItemProperty, _INTL("Item needed to be held by a parent to produce an egg of this species.")],
[_INTL("Evolutions"), EvolutionsProperty.new, _INTL("Evolution paths of this species.")],
@@ -1067,7 +1067,7 @@ def pbPokemonEditor
data[5] = data[6] if !data[5] # Type1
data[6] = data[5] if !data[6] # Type2
egg_groups = [data[26], data[27]].uniq.compact # Egg groups
egg_groups.push(PBEggGroups::Undiscovered) if egg_groups.length == 0
egg_groups.push(:Undiscovered) if egg_groups.length == 0
abilities = [data[17], data[18]].uniq.compact # Abilities
hidden_abilities = [data[19], data[20], data[21], data[22]].uniq.compact # Hidden abilities
# Construct species hash

View File

@@ -436,6 +436,23 @@ end
module EggGroupProperty
def self.set(_settingname, oldsetting)
ret = pbChooseEggGroupList((oldsetting) ? oldsetting : nil)
return ret || oldsetting
end
def self.defaultValue
return nil
end
def self.format(value)
return (value && GameData::EggGroup.exists?(value)) ? GameData::EggGroup.get(value).real_name : "-"
end
end
class IVsProperty
def initialize(limit)
@limit = limit

View File

@@ -212,6 +212,16 @@ def pbChooseNatureList(default = nil)
return pbChooseList(commands, default, nil, -1)
end
def pbChooseEggGroupList(default = nil)
commands = []
i = 0
GameData::EggGroup.each do |g|
commands.push([i, g.name, g.id])
i += 1
end
return pbChooseList(commands, default, nil, -1)
end
def pbChooseBallList(defaultMoveID = -1)
cmdwin = pbListWindow([], 200)
commands = []