From dcba641a86ec1f716a6fe5025607c7efa9bad15b Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sat, 10 Sep 2022 16:33:11 +0100 Subject: [PATCH] =?UTF-8?q?Fixed=20typos=20in=20def=20pbCalcTypeModPokemon?= =?UTF-8?q?,=20fixed=20party=20screen=20navigation=20errors=20when=20there?= =?UTF-8?q?=20are=20no=20Pok=C3=A9mon,=20advanced=20battle=20Debug=20funct?= =?UTF-8?q?ions=20now=20trigger=20modifiers,=20can=20now=20always=20change?= =?UTF-8?q?=20a=20Pok=C3=A9mon's=20form=20to=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/Scripts/011_Battle/005_AI/008_AI_Move_Utilities.rb | 8 ++++---- Data/Scripts/016_UI/005_UI_Party.rb | 5 ++++- .../020_Debug/003_Debug menus/002_Debug_MenuCommands.rb | 4 +++- .../003_Debug menus/007_Debug_PokemonCommands.rb | 5 +++++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Data/Scripts/011_Battle/005_AI/008_AI_Move_Utilities.rb b/Data/Scripts/011_Battle/005_AI/008_AI_Move_Utilities.rb index a126bcfe3..98f5869ec 100644 --- a/Data/Scripts/011_Battle/005_AI/008_AI_Move_Utilities.rb +++ b/Data/Scripts/011_Battle/005_AI/008_AI_Move_Utilities.rb @@ -83,12 +83,12 @@ class Battle::AI # For switching. Determines the effectiveness of a potential switch-in against # an opposing battler. - def pbCalcTypeModPokemon(battlerThis, _battlerOther) - mod1 = Effectiveness.calculate(battlerThis.types[0], target.types[0], target.types[1]) + def pbCalcTypeModPokemon(battlerThis, battlerOther) + mod1 = Effectiveness.calculate(battlerThis.types[0], battlerOther.types[0], battlerOther.types[1]) mod2 = Effectiveness::NORMAL_EFFECTIVE if battlerThis.types.length > 1 - mod2 = Effectiveness.calculate(battlerThis.types[1], target.types[0], target.types[1]) - mod2 = mod2.to_f / Effectivenesss::NORMAL_EFFECTIVE + mod2 = Effectiveness.calculate(battlerThis.types[1], battlerOther.types[0], battlerOther.types[1]) + mod2 = mod2.to_f / Effectiveness::NORMAL_EFFECTIVE end return mod1 * mod2 end diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb index 9e432d984..6110ca77d 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016_UI/005_UI_Party.rb @@ -811,6 +811,7 @@ class PokemonParty_Scene currentsel = Settings::MAX_PARTY_SIZE elsif currentsel == numsprites currentsel = 0 + currentsel = numsprites - 1 if currentsel >= @party.length end when Input::UP if currentsel >= Settings::MAX_PARTY_SIZE @@ -818,6 +819,7 @@ class PokemonParty_Scene while currentsel > 0 && currentsel < Settings::MAX_PARTY_SIZE && !@party[currentsel] currentsel -= 1 end + currentsel = numsprites - 1 if currentsel >= @party.length else loop do currentsel -= 2 @@ -839,6 +841,7 @@ class PokemonParty_Scene currentsel = Settings::MAX_PARTY_SIZE elsif currentsel >= numsprites currentsel = 0 + currentsel = numsprites - 1 if currentsel >= @party.length end end return currentsel @@ -853,7 +856,7 @@ class PokemonParty_Scene @sprites["pokemon#{i}"].dispose end lastselected = @party.length - 1 if lastselected >= @party.length - lastselected = 0 if lastselected < 0 + lastselected = Settings::MAX_PARTY_SIZE if lastselected < 0 Settings::MAX_PARTY_SIZE.times do |i| if @party[i] @sprites["pokemon#{i}"] = PokemonPartyPanel.new(@party[i], i, @viewport) diff --git a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb index 939d5fa42..7501bb6d2 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb @@ -233,7 +233,7 @@ MenuHandlers.add(:debug_menu, :test_wild_battle_advanced, { params.setCancelValue(0) level = pbMessageChooseNumber(_INTL("Set the wild {1}'s level.", GameData::Species.get(species).name), params) - pkmn.push(Pokemon.new(species, level)) if level > 0 + pkmn.push(pbGenerateWildPokemon(species, level)) if level > 0 end else # Edit a Pokémon if pbConfirmMessage(_INTL("Change this Pokémon?")) @@ -336,6 +336,7 @@ MenuHandlers.add(:debug_menu, :test_trainer_battle_advanced, { trainerdata = pbListScreen(_INTL("CHOOSE A TRAINER"), TrainerBattleLister.new(0, false)) if trainerdata tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2]) + EventHandlers.trigger(:on_trainer_load, tr) trainers.push([0, tr]) end else # Edit a trainer @@ -344,6 +345,7 @@ MenuHandlers.add(:debug_menu, :test_trainer_battle_advanced, { TrainerBattleLister.new(trainers[trainerCmd][0], false)) if trainerdata tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2]) + EventHandlers.trigger(:on_trainer_load, tr) trainers[trainerCmd] = [0, tr] end elsif pbConfirmMessage(_INTL("Delete this trainer?")) diff --git a/Data/Scripts/020_Debug/003_Debug menus/007_Debug_PokemonCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/007_Debug_PokemonCommands.rb index 7538a866e..242f3c8ba 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/007_Debug_PokemonCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/007_Debug_PokemonCommands.rb @@ -773,6 +773,11 @@ MenuHandlers.add(:pokemon_debug_menu, :species_and_form, { end if formcmds[0].length <= 1 screen.pbDisplay(_INTL("Species {1} only has one form.", pkmn.speciesName)) + if pkmn.form != 0 && screen.pbConfirm(_INTL("Do you want to reset the form to 0?")) + pkmn.form = 0 + $player.pokedex.register(pkmn) if !settingUpBattle && !pkmn.egg? + screen.pbRefreshSingle(pkmnid) + end else cmd2 = screen.pbShowCommands(_INTL("Set the Pokémon's form."), formcmds[1], cmd2) next if cmd2 < 0