From b2c66b7b0c935c2f9ffbc0e4d3a74bbcaf43d0ef Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Thu, 21 Sep 2023 19:36:10 +0100 Subject: [PATCH] =?UTF-8?q?Fixed=20typo=20relating=20to=20AI=20switching,?= =?UTF-8?q?=20fixed=20Pok=C3=A9mon=20sent=20from=20the=20party=20to=20stor?= =?UTF-8?q?age=20in=20battle=20not=20resetting=20their=20battle-only=20con?= =?UTF-8?q?ditions,=20fixed=20player's=20sprite=20in=20Duel=20minigame=20n?= =?UTF-8?q?ot=20caring=20about=20the=20player's=20outfit,=20added=20missin?= =?UTF-8?q?g=20move=20flags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/Scripts/001_Settings.rb | 5 +++-- Data/Scripts/011_Battle/005_AI/005_AI_ChooseMove.rb | 2 +- .../007_Other battle code/005_Battle_CatchAndStoreMixin.rb | 7 ++++++- Data/Scripts/017_Minigames/001_Minigame_Duel.rb | 2 +- PBS/Gen 8 backup/moves.txt | 4 ++-- PBS/moves.txt | 4 ++-- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 88edb57b9..f8b9f6315 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -197,7 +197,8 @@ module Settings end # The maximum number of slots per pocket (-1 means infinite number). BAG_MAX_POCKET_SIZE = [-1, -1, -1, -1, -1, -1, -1, -1] - # Whether each pocket in turn auto-sorts itself by item ID number. + # Whether each pocket in turn auto-sorts itself by the order items are defined + # in the PBS file items.txt. BAG_POCKET_AUTO_SORT = [false, false, false, true, true, false, false, false] # The maximum number of items each slot in the Bag can hold. BAG_MAX_PER_SLOT = 999 @@ -206,7 +207,7 @@ module Settings # The number of boxes in Pokémon storage. NUM_STORAGE_BOXES = 40 - # Whether putting a Pokémon into Pokémon storage will heal it. IF false, they + # Whether putting a Pokémon into Pokémon storage will heal it. If false, they # are healed by the Recover All: Entire Party event command (at Poké Centers). HEAL_STORED_POKEMON = (MECHANICS_GENERATION <= 7) diff --git a/Data/Scripts/011_Battle/005_AI/005_AI_ChooseMove.rb b/Data/Scripts/011_Battle/005_AI/005_AI_ChooseMove.rb index 1d02c079d..30f8e28cc 100644 --- a/Data/Scripts/011_Battle/005_AI/005_AI_ChooseMove.rb +++ b/Data/Scripts/011_Battle/005_AI/005_AI_ChooseMove.rb @@ -342,7 +342,7 @@ class Battle::AI if @trainer.high_skill? && @user.can_switch_lax? badMoves = false if max_score <= MOVE_USELESS_SCORE - badMoves = user_battler.can_attack? + badMoves = user.can_attack? badMoves = true if !badMoves && pbAIRandom(100) < 25 elsif max_score < MOVE_BASE_SCORE * move_score_threshold && user_battler.turnCount > 2 badMoves = true if pbAIRandom(100) < 80 diff --git a/Data/Scripts/011_Battle/007_Other battle code/005_Battle_CatchAndStoreMixin.rb b/Data/Scripts/011_Battle/007_Other battle code/005_Battle_CatchAndStoreMixin.rb index dae58025d..5d9c5f596 100644 --- a/Data/Scripts/011_Battle/007_Other battle code/005_Battle_CatchAndStoreMixin.rb +++ b/Data/Scripts/011_Battle/007_Other battle code/005_Battle_CatchAndStoreMixin.rb @@ -32,8 +32,13 @@ module Battle::CatchAndStoreMixin end next if party_index < 0 # Cancelled party_size = pbPlayer.party.length - # Send chosen Pokémon to storage + # Get chosen Pokémon and clear battle-related conditions send_pkmn = pbPlayer.party[party_index] + @peer.pbOnLeavingBattle(self, send_pkmn, @usedInBattle[0][party_index], true) + send_pkmn.statusCount = 0 if send_pkmn.status == :POISON # Bad poison becomes regular + send_pkmn.makeUnmega + send_pkmn.makeUnprimal + # Send chosen Pokémon to storage stored_box = @peer.pbStorePokemon(pbPlayer, send_pkmn) pbPlayer.party.delete_at(party_index) box_name = @peer.pbBoxName(stored_box) diff --git a/Data/Scripts/017_Minigames/001_Minigame_Duel.rb b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb index 84720d60a..bebbd5264 100644 --- a/Data/Scripts/017_Minigames/001_Minigame_Duel.rb +++ b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb @@ -60,7 +60,7 @@ class PokemonDuel @viewport.z = 99999 @sprites = {} @sprites["player"] = IconSprite.new(-160, 96, @viewport) - @sprites["player"].setBitmap(GameData::TrainerType.front_sprite_filename($player.trainer_type)) + @sprites["player"].setBitmap(GameData::TrainerType.player_front_sprite_filename($player.trainer_type)) @sprites["opponent"] = IconSprite.new(Graphics.width + 32, 96, @viewport) @sprites["opponent"].setBitmap(GameData::TrainerType.front_sprite_filename(opponent.trainer_type)) @sprites["playerwindow"] = DuelWindow.new($player.name, false) diff --git a/PBS/Gen 8 backup/moves.txt b/PBS/Gen 8 backup/moves.txt index 0ee30413b..fa5dbaf27 100644 --- a/PBS/Gen 8 backup/moves.txt +++ b/PBS/Gen 8 backup/moves.txt @@ -479,7 +479,7 @@ Accuracy = 100 TotalPP = 5 Target = NearOther FunctionCode = AlwaysCriticalHit -Flags = Contact,CanProtect,CanMirrorMove,CannotMetronome +Flags = Contact,CanProtect,CanMirrorMove,Punching,CannotMetronome Description = Strikes with a fierce blow through mastery of the Dark style. Always results in a critical hit. #------------------------------- [LASHOUT] @@ -8633,7 +8633,7 @@ Accuracy = 100 TotalPP = 5 Target = NearOther FunctionCode = HitThreeTimesAlwaysCriticalHit -Flags = Contact,CanProtect,CanMirrorMove,CannotMetronome +Flags = Contact,CanProtect,CanMirrorMove,Punching,CannotMetronome Description = Hits three times in a row with mastery of the Water style. This attack always deals critical hits. #------------------------------- [WATERSHURIKEN] diff --git a/PBS/moves.txt b/PBS/moves.txt index 0ee30413b..fa5dbaf27 100644 --- a/PBS/moves.txt +++ b/PBS/moves.txt @@ -479,7 +479,7 @@ Accuracy = 100 TotalPP = 5 Target = NearOther FunctionCode = AlwaysCriticalHit -Flags = Contact,CanProtect,CanMirrorMove,CannotMetronome +Flags = Contact,CanProtect,CanMirrorMove,Punching,CannotMetronome Description = Strikes with a fierce blow through mastery of the Dark style. Always results in a critical hit. #------------------------------- [LASHOUT] @@ -8633,7 +8633,7 @@ Accuracy = 100 TotalPP = 5 Target = NearOther FunctionCode = HitThreeTimesAlwaysCriticalHit -Flags = Contact,CanProtect,CanMirrorMove,CannotMetronome +Flags = Contact,CanProtect,CanMirrorMove,Punching,CannotMetronome Description = Hits three times in a row with mastery of the Water style. This attack always deals critical hits. #------------------------------- [WATERSHURIKEN]