Generalised a species' types to allow any number of types

This commit is contained in:
Maruno17
2022-12-31 17:24:33 +00:00
parent 3a4b01e2dc
commit 3fe324d0da
24 changed files with 200 additions and 203 deletions

View File

@@ -416,7 +416,7 @@ MenuHandlers.add(:battle_pokemon_debug_menu, :set_types, {
"parent" => :main,
"usage" => :battler,
"effect" => proc { |pkmn, battler, battle|
max_main_types = 2 # The most types a Pokémon can have normally
max_main_types = 5 # Arbitrary value, could be any number
cmd = 0
loop do
commands = []
@@ -427,7 +427,7 @@ MenuHandlers.add(:battle_pokemon_debug_menu, :set_types, {
commands.push(_INTL("Type {1}: {2}", i + 1, type_name))
types.push(type)
end
extra_type = battler.effects[PBEffects::Type3]
extra_type = battler.effects[PBEffects::ExtraType]
extra_type_name = (extra_type) ? GameData::Type.get(extra_type).name : "-"
commands.push(_INTL("Extra type: {1}", extra_type_name))
types.push(extra_type)
@@ -443,14 +443,14 @@ MenuHandlers.add(:battle_pokemon_debug_menu, :set_types, {
if cmd < max_main_types
battler.types[cmd] = nil
else
battler.effects[PBEffects::Type3] = nil
battler.effects[PBEffects::ExtraType] = nil
end
battler.types.compact!
end
elsif cmd < max_main_types
battler.types[cmd] = new_type
else
battler.effects[PBEffects::Type3] = new_type
battler.effects[PBEffects::ExtraType] = new_type
end
end
end