From c79b970d6b597aa20858eea3bd432209db62996a Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sat, 13 Aug 2022 16:29:48 +0100 Subject: [PATCH] =?UTF-8?q?Fixed=20error=20when=20shifting=20Pok=C3=A9mon?= =?UTF-8?q?=20at=20the=20end=20of=20a=20battle=20round,=20fixed=20Giratina?= =?UTF-8?q?'s=20form=20code=20crashing=20if=20the=20current=20map=20doesn'?= =?UTF-8?q?t=20have=20metadata,=20fixed=20item=20sell=20prices=20being=20h?= =?UTF-8?q?alved=20twice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb | 2 +- .../014_Pokemon/001_Pokemon-related/001_FormHandlers.rb | 3 +-- Data/Scripts/016_UI/020_UI_PokeMart.rb | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb b/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb index 0df3a07e6..6a03f5145 100644 --- a/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb +++ b/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb @@ -579,7 +579,7 @@ class Battle swaps.each do |pair| next if pbSideSize(pair[0]) == 2 && swaps.length > 1 next if !pbSwapBattlers(pair[0], pair[1]) - case pbSideSize(side) + case pbSideSize(pair[1]) when 2 pbDisplay(_INTL("{1} moved across!", @battlers[pair[1]].pbThis)) when 3 diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb index fc602f988..10e16a40c 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb @@ -260,8 +260,7 @@ MultipleForms.register(:ROTOM, { MultipleForms.register(:GIRATINA, { "getForm" => proc { |pkmn| next 1 if pkmn.hasItem?(:GRISEOUSORB) - if $game_map && - GameData::MapMetadata.get($game_map.map_id)&.has_flag?("DistortionWorld") + if $game_map && $game_map.metadata&.has_flag?("DistortionWorld") next 1 end next 0 diff --git a/Data/Scripts/016_UI/020_UI_PokeMart.rb b/Data/Scripts/016_UI/020_UI_PokeMart.rb index ae09c384d..e57d0fd92 100644 --- a/Data/Scripts/016_UI/020_UI_PokeMart.rb +++ b/Data/Scripts/016_UI/020_UI_PokeMart.rb @@ -460,7 +460,6 @@ class PokemonMart_Scene ret = 0 helpwindow = @sprites["helpwindow"] itemprice = @adapter.getPrice(item, !@buying) - itemprice /= 2 if !@buying pbDisplay(helptext, true) using(numwindow = Window_AdvancedTextPokemon.new("")) do # Showing number of items pbPrepareWindow(numwindow) @@ -681,7 +680,6 @@ class PokemonMartScreen @scene.pbHideMoney next end - price /= 2 price *= qty if pbConfirm(_INTL("I can pay ${1}.\nWould that be OK?", price.to_s_formatted)) old_money = @adapter.getMoney