diff --git a/Data/Scripts/015_Items/001_PItem_Items.rb b/Data/Scripts/015_Items/001_PItem_Items.rb index a06d7c921..c0a2a2253 100644 --- a/Data/Scripts/015_Items/001_PItem_Items.rb +++ b/Data/Scripts/015_Items/001_PItem_Items.rb @@ -729,7 +729,7 @@ def pbUseItem(bag,item,bagscene=nil) if ret && useType==1 # Usable on Pokémon, consumed bag.pbDeleteItem(item) if !bag.pbHasItem?(item) - pbMessage(_INTL("You used your last {1}.",PBItems.getName(item))) + pbMessage(_INTL("You used your last {1}.",PBItems.getName(item))) { screen.pbUpdate } break end end @@ -764,13 +764,13 @@ def pbUseItemOnPokemon(item,pkmn,scene) return false if machine==nil movename = PBMoves.getName(machine) if pkmn.shadowPokemon? - pbMessage(_INTL("Shadow Pokémon can't be taught any moves.")) + pbMessage(_INTL("Shadow Pokémon can't be taught any moves.")) { scene.pbUpdate } elsif !pkmn.compatibleWithMove?(machine) - pbMessage(_INTL("{1} can't learn {2}.",pkmn.name,movename)) + pbMessage(_INTL("{1} can't learn {2}.",pkmn.name,movename)) { scene.pbUpdate } else - pbMessage(_INTL("\\se[PC access]You booted up {1}.\1",PBItems.getName(item))) - if pbConfirmMessage(_INTL("Do you want to teach {1} to {2}?",movename,pkmn.name)) - if pbLearnMove(pkmn,machine,false,true) + pbMessage(_INTL("\\se[PC access]You booted up {1}.\1",PBItems.getName(item))) { scene.pbUpdate } + if pbConfirmMessage(_INTL("Do you want to teach {1} to {2}?",movename,pkmn.name)) { scene.pbUpdate } + if pbLearnMove(pkmn,machine,false,true) { scene.pbUpdate } $PokemonBag.pbDeleteItem(item) if pbIsTechnicalMachine?(item) && !INFINITE_TMS return true end @@ -786,7 +786,7 @@ def pbUseItemOnPokemon(item,pkmn,scene) if ret && useType && useType==1 # Usable on Pokémon, consumed $PokemonBag.pbDeleteItem(item) if !$PokemonBag.pbHasItem?(item) - pbMessage(_INTL("You used your last {1}.",PBItems.getName(item))) + pbMessage(_INTL("You used your last {1}.",PBItems.getName(item))) { scene.pbUpdate } end end return ret diff --git a/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb b/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb index 496980a3a..73598486b 100644 --- a/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb +++ b/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb @@ -1025,24 +1025,21 @@ def pbMoveTutorChoose(move,movelist=nil,bymachine=false) screen.pbStartScene(_INTL("Teach which Pokémon?"),false,annot) loop do chosen = screen.pbChoosePokemon - if chosen>=0 - pokemon = $Trainer.party[chosen] - if pokemon.egg? - pbMessage(_INTL("Eggs can't be taught any moves.")) - elsif pokemon.shadowPokemon? - pbMessage(_INTL("Shadow Pokémon can't be taught any moves.")) - elsif movelist && !movelist.any? { |j| j==pokemon.species } - pbMessage(_INTL("{1} can't learn {2}.",pokemon.name,movename)) - elsif !pokemon.compatibleWithMove?(move) - pbMessage(_INTL("{1} can't learn {2}.",pokemon.name,movename)) - else - if pbLearnMove(pokemon,move,false,bymachine) - ret = true - break - end - end + break if chosen<0 + pokemon = $Trainer.party[chosen] + if pokemon.egg? + pbMessage(_INTL("Eggs can't be taught any moves.")) { screen.pbUpdate } + elsif pokemon.shadowPokemon? + pbMessage(_INTL("Shadow Pokémon can't be taught any moves.")) { screen.pbUpdate } + elsif movelist && !movelist.any? { |j| j==pokemon.species } + pbMessage(_INTL("{1} can't learn {2}.",pokemon.name,movename)) { screen.pbUpdate } + elsif !pokemon.compatibleWithMove?(move) + pbMessage(_INTL("{1} can't learn {2}.",pokemon.name,movename)) { screen.pbUpdate } else - break + if pbLearnMove(pokemon,move,false,bymachine) { screen.pbUpdate } + ret = true + break + end end end screen.pbEndScene