From 9841bd26308a34a3a98347095b4776c3b28f93b9 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Wed, 11 Nov 2020 22:09:34 +0000 Subject: [PATCH] Fixed typo in Duel minigame, fixed crash when battling a single trainer while you have a partner, fixed undefined variable in Relic Song's form-changing code --- Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb | 2 +- Data/Scripts/013_Overworld/006_PField_Battles.rb | 2 ++ Data/Scripts/013_Overworld/009_PField_RoamingPokemon.rb | 3 ++- Data/Scripts/018_Minigames/001_PMinigame_Duel.rb | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb b/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb index 629551f20..211697740 100644 --- a/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb +++ b/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb @@ -48,7 +48,7 @@ class PokeBattle_Move_003 < PokeBattle_SleepMove return if !isConst?(@id,PBMoves,:RELICSONG) return if !user.isSpecies?(:MELOETTA) return if user.hasActiveAbility?(:SHEERFORCE) && @addlEffect>0 - newForm = (oldForm+1)%2 + newForm = (user.Form+1)%2 user.pbChangeForm(newForm,_INTL("{1} transformed!",user.pbThis)) end end diff --git a/Data/Scripts/013_Overworld/006_PField_Battles.rb b/Data/Scripts/013_Overworld/006_PField_Battles.rb index 40492caf2..57ebec8d7 100644 --- a/Data/Scripts/013_Overworld/006_PField_Battles.rb +++ b/Data/Scripts/013_Overworld/006_PField_Battles.rb @@ -266,6 +266,7 @@ def pbWildBattleCore(*args) $Trainer.party.each { |pkmn| playerParty.push(pkmn) } playerPartyStarts.push(playerParty.length) ally.party.each { |pkmn| playerParty.push(pkmn) } + setBattleRule("double") if !$PokemonTemp.battleRules["size"] end # Create the battle scene (the visual side of it) scene = pbNewBattleScene @@ -411,6 +412,7 @@ def pbTrainerBattleCore(*args) $Trainer.party.each { |pkmn| playerParty.push(pkmn) } playerPartyStarts.push(playerParty.length) ally.party.each { |pkmn| playerParty.push(pkmn) } + setBattleRule("double") if !$PokemonTemp.battleRules["size"] end # Create the battle scene (the visual side of it) scene = pbNewBattleScene diff --git a/Data/Scripts/013_Overworld/009_PField_RoamingPokemon.rb b/Data/Scripts/013_Overworld/009_PField_RoamingPokemon.rb index 72099b882..5e270a59f 100644 --- a/Data/Scripts/013_Overworld/009_PField_RoamingPokemon.rb +++ b/Data/Scripts/013_Overworld/009_PField_RoamingPokemon.rb @@ -183,7 +183,8 @@ EncounterModifier.register(proc { |encounter| # are in the same region if roamerMap!=$game_map.map_id currentRegion = pbGetCurrentRegion - next if pbGetMetadata(roamerMap,MetadataMapPosition)[0]!=currentRegion + map_position = pbGetMetadata(roamerMap,MetadataMapPosition) + next if !map_position || map_position[0] != currentRegion currentMapName = pbGetMessage(MessageTypes::MapNames,$game_map.map_id) next if pbGetMessage(MessageTypes::MapNames,roamerMap)!=currentMapName end diff --git a/Data/Scripts/018_Minigames/001_PMinigame_Duel.rb b/Data/Scripts/018_Minigames/001_PMinigame_Duel.rb index 99942e94a..7a1bb3d13 100644 --- a/Data/Scripts/018_Minigames/001_PMinigame_Duel.rb +++ b/Data/Scripts/018_Minigames/001_PMinigame_Duel.rb @@ -64,7 +64,7 @@ class PokemonDuel @sprites["player"].x += distance_per_frame @sprites["playerwindow"].x += distance_per_frame @sprites["opponent"].x -= distance_per_frame - @sprites["opponentwindow"].x -= distandistance_per_framecePerFrame + @sprites["opponentwindow"].x -= distance_per_frame Graphics.update Input.update pbUpdateSceneMap