From e49cd8d4986186ba566d0a5f1d4103f2dd061268 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Wed, 20 Oct 2021 22:57:43 +0100 Subject: [PATCH] Renamed $Trainer to $player --- Data/Scripts/001_Settings.rb | 2 +- .../002_Save data/004_Game_SaveValues.rb | 4 +- .../003_Game processing/003_Interpreter.rb | 2 +- .../004_Interpreter_Commands.rb | 14 +-- .../004_Game classes/009_Game_Player.rb | 6 +- .../007_Objects and windows/011_Messages.rb | 32 +++---- .../001_Hardcoded data/007_Evolution.rb | 6 +- .../Scripts/010_Data/002_PBS data/006_Item.rb | 2 +- .../010_Data/002_PBS data/012_TrainerType.rb | 6 +- .../010_Data/002_PBS data/013_Trainer.rb | 2 +- .../001_Battler/001_PokeBattle_Battler.rb | 2 +- .../003_Battle/001_PokeBattle_BattleCommon.rb | 4 +- .../003_Battle/003_Battle_StartAndEnd.rb | 12 +-- .../002_PokeBattle_SafariZone.rb | 2 +- .../008_PokeBattle_BattlePeer.rb | 2 +- .../003_Overworld_MapTransitionAnims.rb | 6 +- Data/Scripts/012_Overworld/001_Overworld.rb | 18 ++-- .../001_Overworld_BattleStarting.rb | 48 +++++----- .../002_Overworld_BattleIntroAnim.rb | 6 +- .../003_Overworld_WildEncounters.rb | 16 ++-- .../004_Overworld_EncounterModifiers.rb | 14 +-- .../012_Overworld/004_Overworld_FieldMoves.rb | 42 ++++---- .../012_Overworld/005_Overworld_Fishing.rb | 2 +- .../006_Overworld_BerryPlants.rb | 8 +- .../012_Overworld/007_Overworld_DayCare.rb | 12 +-- Data/Scripts/013_Items/001_Item_Utilities.rb | 10 +- Data/Scripts/013_Items/002_Item_Effects.rb | 53 +++++----- Data/Scripts/013_Items/004_Item_Phone.rb | 4 +- Data/Scripts/013_Items/006_Item_Mail.rb | 10 +- .../001_Pokemon-related/001_FormHandlers.rb | 2 +- .../002_ShadowPokemon_Other.rb | 10 +- .../001_Pokemon-related/004_PokemonStorage.rb | 4 +- Data/Scripts/014_Pokemon/001_Pokemon.rb | 8 +- Data/Scripts/014_Pokemon/005_Pokemon_Owner.rb | 2 +- .../003_UI_EggHatching.rb | 10 +- .../004_UI_Evolution.rb | 10 +- .../001_Non-interactive UI/005_UI_Trading.rb | 12 +-- .../006_UI_HallOfFame.rb | 12 +-- Data/Scripts/016_UI/001_UI_PauseMenu.rb | 16 ++-- Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb | 8 +- Data/Scripts/016_UI/003_UI_Pokedex_Main.rb | 44 ++++----- Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb | 24 ++--- Data/Scripts/016_UI/005_UI_Party.rb | 18 ++-- Data/Scripts/016_UI/006_UI_Summary.rb | 10 +- Data/Scripts/016_UI/007_UI_Bag.rb | 10 +- Data/Scripts/016_UI/008_UI_Pokegear.rb | 4 +- Data/Scripts/016_UI/009_UI_RegionMap.rb | 2 +- Data/Scripts/016_UI/012_UI_TrainerCard.rb | 16 ++-- Data/Scripts/016_UI/014_UI_Save.rb | 14 +-- Data/Scripts/016_UI/016_UI_ReadyMenu.rb | 6 +- Data/Scripts/016_UI/019_UI_PC.rb | 12 +-- Data/Scripts/016_UI/020_UI_PokeMart.rb | 4 +- Data/Scripts/016_UI/022_UI_PurifyChamber.rb | 4 +- Data/Scripts/016_UI/023_UI_MysteryGift.rb | 24 ++--- Data/Scripts/016_UI/024_UI_TextEntry.rb | 4 +- .../017_Minigames/001_Minigame_Duel.rb | 4 +- .../017_Minigames/002_Minigame_TripleTriad.rb | 16 ++-- .../017_Minigames/003_Minigame_SlotMachine.rb | 10 +- .../017_Minigames/004_Minigame_VoltorbFlip.rb | 18 ++-- .../017_Minigames/005_Minigame_Lottery.rb | 2 +- .../001_Challenge_BattleChallenge.rb | 10 +- .../001_Battle Frontier/002_Challenge_Data.rb | 4 +- .../004_Challenge_Battles.rb | 12 +-- .../001_SafariZone.rb | 2 +- .../002_BugContest.rb | 18 ++-- Data/Scripts/019_Utilities/001_Utilities.rb | 20 ++-- .../019_Utilities/002_Utilities_Pokemon.rb | 54 +++++------ .../003_Debug menus/002_Debug_MenuCommands.rb | 96 +++++++++---------- .../003_Debug_MenuExtraCode.rb | 10 +- .../005_Debug_PokemonCommands.rb | 14 +-- .../004_Compiler_MapsAndEvents.rb | 13 +-- 71 files changed, 470 insertions(+), 470 deletions(-) diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 58422fc8c..dbdb6522d 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -214,7 +214,7 @@ module Settings # The names of the Pokédex lists, in the order they are defined in the PBS # file "regional_dexes.txt". The last name is for the National Dex and is # added onto the end of this array (remember that you don't need to use it). - # This array's order is also the order of $Trainer.pokedex.unlocked_dexes, + # This array's order is also the order of $player.pokedex.unlocked_dexes, # which records which Dexes have been unlocked (the first is unlocked by # default). If an entry is just a name, then the region map shown in the Area # page while viewing that Dex list will be the region map of the region the diff --git a/Data/Scripts/002_Save data/004_Game_SaveValues.rb b/Data/Scripts/002_Save data/004_Game_SaveValues.rb index b2e0839c0..1e2b2a3dc 100644 --- a/Data/Scripts/002_Save data/004_Game_SaveValues.rb +++ b/Data/Scripts/002_Save data/004_Game_SaveValues.rb @@ -2,8 +2,8 @@ SaveData.register(:player) do ensure_class :Player - save_value { $Trainer } - load_value { |value| $Trainer = value } + save_value { $player } + load_value { |value| $player = $Trainer = value } new_game_value { # Get the first defined trainer type as a placeholder trainer_type = GameData::TrainerType.keys.first diff --git a/Data/Scripts/003_Game processing/003_Interpreter.rb b/Data/Scripts/003_Game processing/003_Interpreter.rb index f4e604fad..dfc2d0a43 100644 --- a/Data/Scripts/003_Game processing/003_Interpreter.rb +++ b/Data/Scripts/003_Game processing/003_Interpreter.rb @@ -355,7 +355,7 @@ class Interpreter end def pbGetPokemon(id) - return $Trainer.party[pbGet(id)] + return $player.party[pbGet(id)] end def pbSetEventTime(*arg) diff --git a/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb b/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb index f9b06952f..9ee3c4c6a 100644 --- a/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb +++ b/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb @@ -343,7 +343,7 @@ class Interpreter character = get_character(@parameters[1]) result = (character.direction == @parameters[2]) if character when 7 # gold - gold = $Trainer.money + gold = $player.money result = (@parameters[2] == 0) ? (gold >= @parameters[1]) : (gold <= @parameters[1]) # when 8, 9, 10 # item, weapon, armor when 11 # button @@ -496,8 +496,8 @@ class Interpreter when 7 # other case @parameters[4] when 0 then value = $game_map.map_id # map ID - when 1 then value = $Trainer.pokemon_party.length # party members - when 2 then value = $Trainer.money # gold + when 1 then value = $player.pokemon_party.length # party members + when 2 then value = $player.money # gold # when 3 # steps when 4 then value = Graphics.frame_count / Graphics.frame_rate # play time when 5 then value = $game_system.timer / Graphics.frame_rate # timer @@ -560,7 +560,7 @@ class Interpreter def command_125 value = (@parameters[1] == 0) ? @parameters[2] : $game_variables[@parameters[2]] value = -value if @parameters[0] == 1 # Decrease - $Trainer.money += value + $player.money += value return true end @@ -931,8 +931,8 @@ class Interpreter # * Name Input Processing #----------------------------------------------------------------------------- def command_303 - if $Trainer - $Trainer.name = pbEnterPlayerName(_INTL("Your name?"), 1, @parameters[1], $Trainer.name) + if $player + $player.name = pbEnterPlayerName(_INTL("Your name?"), 1, @parameters[1], $player.name) return true end if $game_actors && $data_actors && $data_actors[@parameters[0]] != nil @@ -957,7 +957,7 @@ class Interpreter def command_314 if @parameters[0] == 0 if Settings::HEAL_STORED_POKEMON # No need to heal stored Pokémon - $Trainer.heal_party + $player.heal_party else pbEachPokemon { |pkmn, box| pkmn.heal } # Includes party Pokémon end diff --git a/Data/Scripts/004_Game classes/009_Game_Player.rb b/Data/Scripts/004_Game classes/009_Game_Player.rb index 91c659523..b79c27198 100644 --- a/Data/Scripts/004_Game classes/009_Game_Player.rb +++ b/Data/Scripts/004_Game classes/009_Game_Player.rb @@ -40,7 +40,7 @@ class Game_Player < Game_Character return false if $game_temp.in_menu || $game_temp.in_battle || @move_route_forcing || $game_temp.message_window_showing || pbMapInterpreterRunning? - return false if !$Trainer.has_running_shoes && !$PokemonGlobal.diving && + return false if !$player.has_running_shoes && !$PokemonGlobal.diving && !$PokemonGlobal.surfing && !$PokemonGlobal.bicycle return false if jumping? return false if pbTerrainTag.must_walk @@ -48,7 +48,7 @@ class Game_Player < Game_Character end def set_movement_type(type) - meta = GameData::PlayerMetadata.get($Trainer&.character_ID || 1) + meta = GameData::PlayerMetadata.get($player&.character_ID || 1) new_charset = nil case type when :fishing @@ -491,7 +491,7 @@ end # #=============================================================================== def pbGetPlayerCharset(charset, trainer = nil, force = false) - trainer = $Trainer if !trainer + trainer = $player if !trainer outfit = (trainer) ? trainer.outfit : 0 if $game_player && $game_player.charsetData && !force return nil if $game_player.charsetData[0] == trainer.character_ID && diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index fc7c3b581..029698490 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -353,7 +353,7 @@ end def pbGetMapNameFromId(id) name = pbGetMessage(MessageTypes::MapNames, id) name = pbGetBasicMapNameFromId(id) if nil_or_empty?(name) - name.gsub!(/\\PN/, $Trainer.name) if $Trainer + name.gsub!(/\\PN/, $player.name) if $player return name end @@ -408,7 +408,7 @@ end def pbGetGoldString moneyString="" begin - moneyString=_INTL("${1}",$Trainer.money.to_s_formatted) + moneyString=_INTL("${1}", $player.money.to_s_formatted) rescue if $data_system.respond_to?("words") moneyString=_INTL("{1} {2}",$game_party.gold,$data_system.words.gold) @@ -436,7 +436,7 @@ def pbDisplayGoldWindow(msgwindow) end def pbDisplayCoinsWindow(msgwindow,goldwindow) - coinString=($Trainer) ? $Trainer.coins.to_s_formatted : "0" + coinString = ($player) ? $player.coins.to_s_formatted : "0" coinwindow=Window_AdvancedTextPokemon.new(_INTL("Coins:\n{1}",coinString)) coinwindow.setSkin("Graphics/Windowskins/goldskin") coinwindow.resizeToFit(coinwindow.text,Graphics.width) @@ -452,7 +452,7 @@ def pbDisplayCoinsWindow(msgwindow,goldwindow) end def pbDisplayBattlePointsWindow(msgwindow) - pointsString = ($Trainer) ? $Trainer.battle_points.to_s_formatted : "0" + pointsString = ($player) ? $player.battle_points.to_s_formatted : "0" pointswindow=Window_AdvancedTextPokemon.new(_INTL("Battle Points:\n{1}", pointsString)) pointswindow.setSkin("Graphics/Windowskins/goldskin") pointswindow.resizeToFit(pointswindow.text,Graphics.width) @@ -543,18 +543,18 @@ def pbMessageDisplay(msgwindow,message,letterbyletter=true,commandProc=nil) next $game_actors[m].name } end - text.gsub!(/\\pn/i,$Trainer.name) if $Trainer - text.gsub!(/\\pm/i,_INTL("${1}",$Trainer.money.to_s_formatted)) if $Trainer - text.gsub!(/\\n/i,"\n") - text.gsub!(/\\\[([0-9a-f]{8,8})\]/i) { "" } - text.gsub!(/\\pg/i,"\\b") if $Trainer && $Trainer.male? - text.gsub!(/\\pg/i,"\\r") if $Trainer && $Trainer.female? - text.gsub!(/\\pog/i,"\\r") if $Trainer && $Trainer.male? - text.gsub!(/\\pog/i,"\\b") if $Trainer && $Trainer.female? - text.gsub!(/\\pg/i,"") - text.gsub!(/\\pog/i,"") - text.gsub!(/\\b/i,"") - text.gsub!(/\\r/i,"") + text.gsub!(/\\pn/i, $player.name) if $player + text.gsub!(/\\pm/i, _INTL("${1}", $player.money.to_s_formatted)) if $player + text.gsub!(/\\n/i, "\n") + text.gsub!(/\\\[([0-9a-f]{8,8})\]/i) { "" } + text.gsub!(/\\pg/i, "\\b") if $player && $player.male? + text.gsub!(/\\pg/i, "\\r") if $player && $player.female? + text.gsub!(/\\pog/i, "\\r") if $player && $player.male? + text.gsub!(/\\pog/i, "\\b") if $player && $player.female? + text.gsub!(/\\pg/i, "") + text.gsub!(/\\pog/i, "") + text.gsub!(/\\b/i, "") + text.gsub!(/\\r/i, "") text.gsub!(/\\[Ww]\[([^\]]*)\]/) { w = $1.to_s if w=="" diff --git a/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb b/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb index 95e9974cb..ae36cf3b9 100644 --- a/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb +++ b/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb @@ -208,7 +208,7 @@ GameData::Evolution.register({ :id => :LevelDarkInParty, :parameter => Integer, :level_up_proc => proc { |pkmn, parameter| - next pkmn.level >= parameter && $Trainer.has_pokemon_of_type?(:DARK) + next pkmn.level >= parameter && $player.has_pokemon_of_type?(:DARK) } }) @@ -267,7 +267,7 @@ GameData::Evolution.register({ next false # This is a dummy proc and shouldn't next true }, :after_evolution_proc => proc { |pkmn, new_species, parameter, evo_species| - next false if $Trainer.party_full? + next false if $player.party_full? next false if !$bag.has?(:POKEBALL) PokemonEvolutionScene.pbDuplicatePokemon(pkmn, new_species) $bag.remove(:POKEBALL) @@ -475,7 +475,7 @@ GameData::Evolution.register({ :parameter => :Species, :minimum_level => 1, # Needs any level up :level_up_proc => proc { |pkmn, parameter| - next $Trainer.has_species?(parameter) + next $player.has_species?(parameter) } }) diff --git a/Data/Scripts/010_Data/002_PBS data/006_Item.rb b/Data/Scripts/010_Data/002_PBS data/006_Item.rb index 12478db86..750101b53 100644 --- a/Data/Scripts/010_Data/002_PBS data/006_Item.rb +++ b/Data/Scripts/010_Data/002_PBS data/006_Item.rb @@ -124,7 +124,7 @@ module GameData def is_mail?; return has_flag?("Mail") || has_flag?("IconMail"); end def is_icon_mail?; return has_flag?("IconMail"); end def is_poke_ball?; return has_flag?("PokeBall") || has_flag?("SnagBall"); end - def is_snag_ball?; return has_flag?("SnagBall") || (is_poke_ball? && $Trainer.has_snag_machine); end + def is_snag_ball?; return has_flag?("SnagBall") || (is_poke_ball? && $player.has_snag_machine); end def is_berry?; return has_flag?("Berry"); end def is_key_item?; return has_flag?("KeyItem"); end def is_evolution_stone?; return has_flag?("EvolutionStone"); end diff --git a/Data/Scripts/010_Data/002_PBS data/012_TrainerType.rb b/Data/Scripts/010_Data/002_PBS data/012_TrainerType.rb index cc0287f4d..07ae08512 100644 --- a/Data/Scripts/010_Data/002_PBS data/012_TrainerType.rb +++ b/Data/Scripts/010_Data/002_PBS data/012_TrainerType.rb @@ -57,7 +57,7 @@ module GameData end def self.player_front_sprite_filename(tr_type) - outfit = ($Trainer) ? $Trainer.outfit : 0 + outfit = ($player) ? $player.outfit : 0 return self.check_file(tr_type, "Graphics/Trainers/", sprintf("_%d", outfit)) end @@ -66,7 +66,7 @@ module GameData end def self.player_back_sprite_filename(tr_type) - outfit = ($Trainer) ? $Trainer.outfit : 0 + outfit = ($player) ? $player.outfit : 0 return self.check_file(tr_type, "Graphics/Trainers/", sprintf("_%d", outfit), "_back") end @@ -75,7 +75,7 @@ module GameData end def self.player_map_icon_filename(tr_type) - outfit = ($Trainer) ? $Trainer.outfit : 0 + outfit = ($player) ? $player.outfit : 0 return self.check_file(tr_type, "Graphics/Pictures/mapPlayer", sprintf("_%d", outfit)) end diff --git a/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb b/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb index 7e7c75729..1b2dd3a8d 100644 --- a/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb +++ b/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb @@ -108,7 +108,7 @@ module GameData end # Create trainer object trainer = NPCTrainer.new(tr_name, @trainer_type) - trainer.id = $Trainer.make_foreign_ID + trainer.id = $player.make_foreign_ID trainer.items = @items.clone trainer.lose_text = self.lose_text # Create each Pokémon owned by the trainer diff --git a/Data/Scripts/011_Battle/001_Battler/001_PokeBattle_Battler.rb b/Data/Scripts/011_Battle/001_Battler/001_PokeBattle_Battler.rb index 523945068..b22717f01 100644 --- a/Data/Scripts/011_Battle/001_Battler/001_PokeBattle_Battler.rb +++ b/Data/Scripts/011_Battle/001_Battler/001_PokeBattle_Battler.rb @@ -194,7 +194,7 @@ class PokeBattle_Battler def owned? return false if !@battle.wildBattle? - return $Trainer.owned?(displaySpecies) + return $player.owned?(displaySpecies) end alias owned owned? diff --git a/Data/Scripts/011_Battle/003_Battle/001_PokeBattle_BattleCommon.rb b/Data/Scripts/011_Battle/003_Battle/001_PokeBattle_BattleCommon.rb index 8bc4d2388..a4ab72fc1 100644 --- a/Data/Scripts/011_Battle/003_Battle/001_PokeBattle_BattleCommon.rb +++ b/Data/Scripts/011_Battle/003_Battle/001_PokeBattle_BattleCommon.rb @@ -47,7 +47,7 @@ module PokeBattle_BattleCommon # Record the Pokémon's species as owned in the Pokédex if !pbPlayer.owned?(pkmn.species) pbPlayer.pokedex.set_owned(pkmn.species) - if $Trainer.has_pokedex + if $player.has_pokedex pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.",pkmn.name)) pbPlayer.pokedex.register_last_seen(pkmn) @scene.pbShowPokedex(pkmn.species) @@ -195,7 +195,7 @@ module PokeBattle_BattleCommon # Critical capture check if Settings::ENABLE_CRITICAL_CAPTURES dex_modifier = 0 - numOwned = $Trainer.pokedex.owned_count + numOwned = $player.pokedex.owned_count if numOwned>600 dex_modifier = 5 elsif numOwned>450 diff --git a/Data/Scripts/011_Battle/003_Battle/003_Battle_StartAndEnd.rb b/Data/Scripts/011_Battle/003_Battle/003_Battle_StartAndEnd.rb index ce2afa7cf..bd9971323 100644 --- a/Data/Scripts/011_Battle/003_Battle/003_Battle_StartAndEnd.rb +++ b/Data/Scripts/011_Battle/003_Battle/003_Battle_StartAndEnd.rb @@ -457,16 +457,16 @@ class PokeBattle_Battle # Pass on Pokérus within the party if @internalBattle infected = [] - $Trainer.party.each_with_index do |pkmn,i| + $player.party.each_with_index do |pkmn,i| infected.push(i) if pkmn.pokerusStage==1 end infected.each do |idxParty| - strain = $Trainer.party[idxParty].pokerusStrain - if idxParty>0 && $Trainer.party[idxParty-1].pokerusStage==0 - $Trainer.party[idxParty-1].givePokerus(strain) if rand(3)==0 # 33% + strain = $player.party[idxParty].pokerusStrain + if idxParty > 0 && $player.party[idxParty - 1].pokerusStage == 0 + $player.party[idxParty - 1].givePokerus(strain) if rand(3) == 0 # 33% end - if idxParty<$Trainer.party.length-1 && $Trainer.party[idxParty+1].pokerusStage==0 - $Trainer.party[idxParty+1].givePokerus(strain) if rand(3)==0 # 33% + if idxParty < $player.party.length - 1 && $player.party[idxParty + 1].pokerusStage == 0 + $player.party[idxParty + 1].givePokerus(strain) if rand(3) == 0 # 33% end end end diff --git a/Data/Scripts/011_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb b/Data/Scripts/011_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb index 4e452ed27..1b4d3efb7 100644 --- a/Data/Scripts/011_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb +++ b/Data/Scripts/011_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb @@ -39,7 +39,7 @@ class PokeBattle_FakeBattler def captured=(value); end def owned? - return $Trainer.owned?(pokemon.species) + return $player.owned?(pokemon.species) end def pbThis(lowerCase=false) diff --git a/Data/Scripts/011_Battle/006_Other battle types/008_PokeBattle_BattlePeer.rb b/Data/Scripts/011_Battle/006_Other battle types/008_PokeBattle_BattlePeer.rb index caddffd72..9b1c65f2b 100644 --- a/Data/Scripts/011_Battle/006_Other battle types/008_PokeBattle_BattlePeer.rb +++ b/Data/Scripts/011_Battle/006_Other battle types/008_PokeBattle_BattlePeer.rb @@ -40,7 +40,7 @@ class PokeBattle_RealBattlePeer end def pbGetStorageCreatorName - return pbGetStorageCreator if $Trainer.seen_storage_creator + return pbGetStorageCreator if $player.seen_storage_creator return nil end diff --git a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb index 6f8490e23..7ee8cd3dd 100644 --- a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb +++ b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb @@ -86,7 +86,7 @@ def pbStartOver(gameover=false) pbBugContestStartOver return end - $Trainer.heal_party + $player.heal_party if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0 if gameover pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, you scurry back to a Pokémon Center.")) @@ -108,7 +108,7 @@ def pbStartOver(gameover=false) if $DEBUG pbMessage(_ISPRINTF("Can't find the map 'Map{1:03d}' in the Data folder. The game will resume at the player's position.",homedata[0])) end - $Trainer.heal_party + $player.heal_party return end if gameover @@ -127,7 +127,7 @@ def pbStartOver(gameover=false) $scene.transfer_player if $scene.is_a?(Scene_Map) $game_map.refresh else - $Trainer.heal_party + $player.heal_party end end pbEraseEscapePoint diff --git a/Data/Scripts/012_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb index 53f709a29..cbce42e8f 100644 --- a/Data/Scripts/012_Overworld/001_Overworld.rb +++ b/Data/Scripts/012_Overworld/001_Overworld.rb @@ -3,11 +3,11 @@ #=============================================================================== # Pokérus check Events.onMapUpdate += proc { |_sender,_e| - next if !$Trainer + next if !$player last = $PokemonGlobal.pokerusTime now = pbGetTimeNow if !last || last.year!=now.year || last.month!=now.month || last.day!=now.day - for i in $Trainer.pokemon_party + for i in $player.pokemon_party i.lowerPokerusCount end $PokemonGlobal.pokerusTime = now @@ -18,7 +18,7 @@ Events.onMapUpdate += proc { |_sender,_e| # healed Pokémon has it. def pbPokerus? return false if $game_switches[Settings::SEEN_POKERUS_SWITCH] - for i in $Trainer.party + for i in $player.party return true if i.pokerusStage==1 end return false @@ -78,7 +78,7 @@ Events.onStepTaken += proc { $PokemonGlobal.happinessSteps = 0 if !$PokemonGlobal.happinessSteps $PokemonGlobal.happinessSteps += 1 if $PokemonGlobal.happinessSteps>=128 - for pkmn in $Trainer.able_party + for pkmn in $player.able_party pkmn.changeHappiness("walking") if rand(2)==0 end $PokemonGlobal.happinessSteps = 0 @@ -91,7 +91,7 @@ Events.onStepTakenTransferPossible += proc { |_sender,e| next if handled[0] if $PokemonGlobal.stepcount%4==0 && Settings::POISON_IN_FIELD flashed = false - for i in $Trainer.able_party + for i in $player.able_party if i.status == :POISON && !i.hasAbility?(:IMMUNITY) if !flashed pbFlash(Color.new(255, 0, 0, 128), 8) @@ -107,7 +107,7 @@ Events.onStepTakenTransferPossible += proc { |_sender,e| i.status = :NONE pbMessage(_INTL("{1} fainted...",i.name)) end - if $Trainer.able_pokemon_count == 0 + if $player.able_pokemon_count == 0 handled[0] = true pbCheckAllFainted end @@ -117,7 +117,7 @@ Events.onStepTakenTransferPossible += proc { |_sender,e| } def pbCheckAllFainted - if $Trainer.able_pokemon_count == 0 + if $player.able_pokemon_count == 0 pbMessage(_INTL("You have no more Pokémon that can fight!\1")) pbMessage(_INTL("You blacked out!")) pbBGMFade(1.0) @@ -135,7 +135,7 @@ Events.onStepTakenFieldMovement += proc { |_sender,e| tile_id = map.data[thistile[1],thistile[2],i] next if tile_id == nil next if GameData::TerrainTag.try_get(map.terrain_tags[tile_id]).id != :SootGrass - $Trainer.soot += 1 if event == $game_player && $bag.has?(:SOOTSACK) + $player.soot += 1 if event == $game_player && $bag.has?(:SOOTSACK) # map.data[thistile[1], thistile[2], i] = 0 # $scene.createSingleSpriteset(map.map_id) break @@ -187,7 +187,7 @@ Events.onChangeDirection += proc { } def pbBattleOnStepTaken(repel_active) - return if $Trainer.able_pokemon_count == 0 + return if $player.able_pokemon_count == 0 return if !$PokemonEncounters.encounter_possible_here? encounter_type = $PokemonEncounters.encounter_type return if !encounter_type diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb index 5cda43073..f1cbed3be 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb @@ -192,19 +192,19 @@ Events.onStartBattle += proc { |_sender| # during battle and may need to evolve afterwards $PokemonTemp.party_levels_before_battle = [] $PokemonTemp.party_critical_hits_dealt = [] - for i in 0...$Trainer.party.length - $PokemonTemp.party_levels_before_battle[i] = $Trainer.party[i].level + $player.party.each_with_index do |pkmn, i| + $PokemonTemp.party_levels_before_battle[i] = pkmn.level $PokemonTemp.party_critical_hits_dealt[i] = 0 end } def pbCanDoubleBattle? - return $PokemonGlobal.partner || $Trainer.able_pokemon_count >= 2 + return $PokemonGlobal.partner || $player.able_pokemon_count >= 2 end def pbCanTripleBattle? - return true if $Trainer.able_pokemon_count >= 3 - return $PokemonGlobal.partner && $Trainer.able_pokemon_count >= 2 + return true if $player.able_pokemon_count >= 3 + return $PokemonGlobal.partner && $player.able_pokemon_count >= 2 end #=============================================================================== @@ -214,8 +214,8 @@ def pbWildBattleCore(*args) outcomeVar = $PokemonTemp.battleRules["outcomeVar"] || 1 canLose = $PokemonTemp.battleRules["canLose"] || false # Skip battle if the player has no able Pokémon, or if holding Ctrl in Debug mode - if $Trainer.able_pokemon_count == 0 || ($DEBUG && Input.press?(Input::CTRL)) - pbMessage(_INTL("SKIPPING BATTLE...")) if $Trainer.pokemon_count > 0 + if $player.able_pokemon_count == 0 || ($DEBUG && Input.press?(Input::CTRL)) + pbMessage(_INTL("SKIPPING BATTLE...")) if $player.pokemon_count > 0 pbSet(outcomeVar,1) # Treat it as a win $PokemonTemp.clearBattleRules $PokemonGlobal.nextBattleBGM = nil @@ -249,8 +249,8 @@ def pbWildBattleCore(*args) end raise _INTL("Expected a level after being given {1}, but one wasn't found.",sp) if sp # Calculate who the trainers and their party are - playerTrainers = [$Trainer] - playerParty = $Trainer.party + playerTrainers = [$player] + playerParty = $player.party playerPartyStarts = [0] room_for_partner = (foeParty.length > 1) if !room_for_partner && $PokemonTemp.battleRules["size"] && @@ -263,7 +263,7 @@ def pbWildBattleCore(*args) ally.party = $PokemonGlobal.partner[3] playerTrainers.push(ally) playerParty = [] - $Trainer.party.each { |pkmn| playerParty.push(pkmn) } + $player.party.each { |pkmn| playerParty.push(pkmn) } playerPartyStarts.push(playerParty.length) ally.party.each { |pkmn| playerParty.push(pkmn) } setBattleRule("double") if !$PokemonTemp.battleRules["size"] @@ -352,17 +352,17 @@ def pbTrainerBattleCore(*args) outcomeVar = $PokemonTemp.battleRules["outcomeVar"] || 1 canLose = $PokemonTemp.battleRules["canLose"] || false # Skip battle if the player has no able Pokémon, or if holding Ctrl in Debug mode - if $Trainer.able_pokemon_count == 0 || ($DEBUG && Input.press?(Input::CTRL)) + if $player.able_pokemon_count == 0 || ($DEBUG && Input.press?(Input::CTRL)) pbMessage(_INTL("SKIPPING BATTLE...")) if $DEBUG - pbMessage(_INTL("AFTER WINNING...")) if $DEBUG && $Trainer.able_pokemon_count > 0 - pbSet(outcomeVar,($Trainer.able_pokemon_count == 0) ? 0 : 1) # Treat it as undecided/a win + pbMessage(_INTL("AFTER WINNING...")) if $DEBUG && $player.able_pokemon_count > 0 + pbSet(outcomeVar, ($player.able_pokemon_count == 0) ? 0 : 1) # Treat it as undecided/a win $PokemonTemp.clearBattleRules $PokemonGlobal.nextBattleBGM = nil $PokemonGlobal.nextBattleME = nil $PokemonGlobal.nextBattleCaptureME = nil $PokemonGlobal.nextBattleBack = nil pbMEStop - return ($Trainer.able_pokemon_count == 0) ? 0 : 1 # Treat it as undecided/a win + return ($player.able_pokemon_count == 0) ? 0 : 1 # Treat it as undecided/a win end # Record information about party Pokémon to be used at the end of battle (e.g. # comparing levels for an evolution check) @@ -395,8 +395,8 @@ def pbTrainerBattleCore(*args) end end # Calculate who the player trainer(s) and their party are - playerTrainers = [$Trainer] - playerParty = $Trainer.party + playerTrainers = [$player] + playerParty = $player.party playerPartyStarts = [0] room_for_partner = (foeParty.length > 1) if !room_for_partner && $PokemonTemp.battleRules["size"] && @@ -409,7 +409,7 @@ def pbTrainerBattleCore(*args) ally.party = $PokemonGlobal.partner[3] playerTrainers.push(ally) playerParty = [] - $Trainer.party.each { |pkmn| playerParty.push(pkmn) } + $player.party.each { |pkmn| playerParty.push(pkmn) } playerPartyStarts.push(playerParty.length) ally.party.each { |pkmn| playerParty.push(pkmn) } setBattleRule("double") if !$PokemonTemp.battleRules["size"] @@ -461,8 +461,8 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech=nil, # then trigger and cause the battle to happen against this first trainer and # themselves. if !$PokemonTemp.waitingTrainer && pbMapInterpreterRunning? && - ($Trainer.able_pokemon_count > 1 || - ($Trainer.able_pokemon_count > 0 && $PokemonGlobal.partner)) + ($player.able_pokemon_count > 1 || + ($player.able_pokemon_count > 0 && $PokemonGlobal.partner)) thisEvent = pbMapInterpreter.get_character(0) # Find all other triggered trainer events triggeredEvents = $game_player.pbTriggeredTrainerEvents([2],false) @@ -545,13 +545,13 @@ end # After battles #=============================================================================== def pbAfterBattle(decision,canLose) - $Trainer.party.each do |pkmn| + $player.party.each do |pkmn| pkmn.statusCount = 0 if pkmn.status == :POISON # Bad poison becomes regular pkmn.makeUnmega pkmn.makeUnprimal end if $PokemonGlobal.partner - $Trainer.heal_party + $player.heal_party $PokemonGlobal.partner[3].each do |pkmn| pkmn.heal pkmn.makeUnmega @@ -560,7 +560,7 @@ def pbAfterBattle(decision,canLose) end if decision==2 || decision==5 # if loss or draw if canLose - $Trainer.party.each { |pkmn| pkmn.heal } + $player.party.each { |pkmn| pkmn.heal } (Graphics.frame_rate/4).times { Graphics.update } end end @@ -579,7 +579,7 @@ Events.onEndBattle += proc { |_sender,e| # Check for blacking out or gaining Pickup/Huney Gather items case decision when 1, 4 # Win, capture - $Trainer.pokemon_party.each do |pkmn| + $player.pokemon_party.each do |pkmn| pbPickup(pkmn) pbHoneyGather(pkmn) end @@ -593,7 +593,7 @@ Events.onEndBattle += proc { |_sender,e| } def pbEvolutionCheck - $Trainer.party.each_with_index do |pkmn, i| + $player.party.each_with_index do |pkmn, i| next if !pkmn || pkmn.egg? next if pkmn.fainted? && !Settings::CHECK_EVOLUTION_FOR_FAINTED_POKEMON # Find an evolution diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb b/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb index ac3dfc235..c848aff57 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb @@ -194,8 +194,8 @@ SpecialBattleIntroAnimations.register("vs_animation", 50, # Priority 50 tr_type = foe[0].trainer_type trainer_bar_graphic = sprintf("vsBar_%s", tr_type.to_s) rescue nil trainer_graphic = sprintf("vsTrainer_%s", tr_type.to_s) rescue nil - player_tr_type = $Trainer.trainer_type - outfit = $Trainer.outfit + player_tr_type = $player.trainer_type + outfit = $player.outfit player_bar_graphic = sprintf("vsBar_%s_%d", player_tr_type.to_s, outfit) rescue nil if !pbResolveBitmap("Graphics/Transitions/" + player_bar_graphic) player_bar_graphic = sprintf("vsBar_%s", player_tr_type.to_s) rescue nil @@ -283,7 +283,7 @@ SpecialBattleIntroAnimations.register("vs_animation", 50, # Priority 50 trainer.tone = Tone.new(0, 0, 0) trainername = foe[0].name textpos = [ - [$Trainer.name, Graphics.width / 4, (Graphics.height / 1.5) + 4, 2, + [$player.name, Graphics.width / 4, (Graphics.height / 1.5) + 4, 2, Color.new(248, 248, 248), Color.new(72, 72, 72)], [trainername, (Graphics.width / 4) + (Graphics.width / 2), (Graphics.height / 1.5) + 4, 2, Color.new(248, 248, 248), Color.new(72, 72, 72)] diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb b/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb index 73b428f64..2cae50ea7 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb @@ -104,7 +104,7 @@ class PokemonEncounters raise ArgumentError.new(_INTL("Encounter type {1} does not exist", enc_type)) end return false if $game_system.encounter_disabled - return false if !$Trainer + return false if !$player return false if $DEBUG && Input.press?(Input::CTRL) # Check if enc_type has a defined step chance/encounter table return false if !@step_chances[enc_type] || @step_chances[enc_type] == 0 @@ -126,7 +126,7 @@ class PokemonEncounters encounter_chance *= 1.5 if $PokemonMap.whiteFluteUsed min_steps_needed /= 2 if $PokemonMap.whiteFluteUsed end - first_pkmn = $Trainer.first_pokemon + first_pkmn = $player.first_pokemon if first_pkmn case first_pkmn.item_id when :CLEANSETAG @@ -187,7 +187,7 @@ class PokemonEncounters return true if pbPokeRadarOnShakingGrass # Repel if repel_active - first_pkmn = (Settings::REPEL_COUNTS_FAINTED_POKEMON) ? $Trainer.first_pokemon : $Trainer.first_able_pokemon + first_pkmn = (Settings::REPEL_COUNTS_FAINTED_POKEMON) ? $player.first_pokemon : $player.first_able_pokemon if first_pkmn && enc_data[1] < first_pkmn.level @chance_accumulator = 0 return false @@ -195,7 +195,7 @@ class PokemonEncounters end # Some abilities make wild encounters less likely if the wild Pokémon is # sufficiently weaker than the Pokémon with the ability - first_pkmn = $Trainer.first_pokemon + first_pkmn = $player.first_pokemon if first_pkmn case first_pkmn.ability_id when :INTIMIDATE, :KEENEYE @@ -211,7 +211,7 @@ class PokemonEncounters return false if $PokemonTemp.forceSingleBattle return false if pbInSafari? return true if $PokemonGlobal.partner - return false if $Trainer.able_pokemon_count <= 1 + return false if $player.able_pokemon_count <= 1 return true if $game_player.pbTerrainTag.double_wild_encounters && rand(100) < 30 return false end @@ -276,7 +276,7 @@ class PokemonEncounters # Static/Magnet Pull prefer wild encounters of certain types, if possible. # If they activate, they remove all Pokémon from the encounter table that do # not have the type they favor. If none have that type, nothing is changed. - first_pkmn = $Trainer.first_pokemon + first_pkmn = $player.first_pokemon if first_pkmn favored_type = nil case first_pkmn.ability_id @@ -393,7 +393,7 @@ def pbGenerateWildPokemon(species,level,isRoamer=false) genwildpoke = Pokemon.new(species,level) # Give the wild Pokémon a held item items = genwildpoke.wildHoldItems - first_pkmn = $Trainer.first_pokemon + first_pkmn = $player.first_pokemon chances = [50,5,1] if first_pkmn case first_pkmn.ability_id @@ -417,7 +417,7 @@ def pbGenerateWildPokemon(species,level,isRoamer=false) shiny_retries += 2 if $bag.has?(:SHINYCHARM) if Settings::HIGHER_SHINY_CHANCES_WITH_NUMBER_BATTLED values = [0, 0] - case $Trainer.pokedex.battled_count(species) + case $player.pokedex.battled_count(species) when 0...50 then values = [0, 0] when 50...100 then values = [1, 15] when 100...200 then values = [2, 20] diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/004_Overworld_EncounterModifiers.rb b/Data/Scripts/012_Overworld/002_Battle triggering/004_Overworld_EncounterModifiers.rb index 97783165c..203c76027 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/004_Overworld_EncounterModifiers.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/004_Overworld_EncounterModifiers.rb @@ -7,9 +7,9 @@ # Make all wild Pokémon shiny while a certain Switch is ON (see Settings). Events.onWildPokemonCreate += proc { |_sender, e| - pokemon = e[0] + pkmn = e[0] if $game_switches[Settings::SHINY_WILD_POKEMON_SWITCH] - pokemon.shiny = true + pkmn.shiny = true end } @@ -18,13 +18,13 @@ Events.onWildPokemonCreate += proc { |_sender, e| # This is a simple method, and can/should be modified to account for evolutions # and other such details. Of course, you don't HAVE to use this code. Events.onWildPokemonCreate += proc { |_sender, e| - pokemon = e[0] + pkmn = e[0] if $game_map.map_id == 51 - new_level = pbBalancedLevel($Trainer.party) - 4 + rand(5) # For variety + new_level = pbBalancedLevel($player.party) - 4 + rand(5) # For variety new_level = new_level.clamp(1, GameData::GrowthRate.max_level) - pokemon.level = new_level - pokemon.calc_stats - pokemon.reset_moves + pkmn.level = new_level + pkmn.calc_stats + pkmn.reset_moves end } diff --git a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb index d656070b3..1f7f2d9ad 100644 --- a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb +++ b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb @@ -55,7 +55,7 @@ end def pbCheckHiddenMoveBadge(badge=-1,showmsg=true) return true if badge<0 # No badge requirement return true if $DEBUG - if (Settings::FIELD_MOVES_COUNT_BADGES) ? $Trainer.badge_count >= badge : $Trainer.badges[badge] + if (Settings::FIELD_MOVES_COUNT_BADGES) ? $player.badge_count >= badge : $player.badges[badge] return true end pbMessage(_INTL("Sorry, a new Badge is required.")) if showmsg @@ -187,14 +187,14 @@ end #=============================================================================== def pbCut move = :CUT - movefinder = $Trainer.get_pokemon_with_move(move) + movefinder = $player.get_pokemon_with_move(move) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("This tree looks like it can be cut down.")) return false end pbMessage(_INTL("This tree looks like it can be cut down!\1")) if pbConfirmMessage(_INTL("Would you like to cut it?")) - speciesname = (movefinder) ? movefinder.name : $Trainer.name + speciesname = (movefinder) ? movefinder.name : $player.name pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name)) pbHiddenMoveAnimation(movefinder) return true @@ -300,13 +300,13 @@ def pbDive map_metadata = $game_map.metadata return false if !map_metadata || !map_metadata.dive_map_id move = :DIVE - movefinder = $Trainer.get_pokemon_with_move(move) + movefinder = $player.get_pokemon_with_move(move) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater.")) return false end if pbConfirmMessage(_INTL("The sea is deep here. Would you like to use Dive?")) - speciesname = (movefinder) ? movefinder.name : $Trainer.name + speciesname = (movefinder) ? movefinder.name : $player.name pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name)) pbHiddenMoveAnimation(movefinder) pbFadeOutIn { @@ -337,13 +337,13 @@ def pbSurfacing end return if !surface_map_id move = :DIVE - movefinder = $Trainer.get_pokemon_with_move(move) + movefinder = $player.get_pokemon_with_move(move) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("Light is filtering down from above. A Pokémon may be able to surface here.")) return false end if pbConfirmMessage(_INTL("Light is filtering down from above. Would you like to use Dive?")) - speciesname = (movefinder) ? movefinder.name : $Trainer.name + speciesname = (movefinder) ? movefinder.name : $player.name pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name)) pbHiddenMoveAnimation(movefinder) pbFadeOutIn { @@ -494,7 +494,7 @@ HiddenMoveHandlers::UseMove.add(:FLASH,proc { |move,pokemon| #=============================================================================== def pbCanFly?(pkmn = nil, show_messages = false) return false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLY, show_messages) - return false if !$DEBUG && !pkmn && !$Trainer.get_pokemon_with_move(:FLY) + return false if !$DEBUG && !pkmn && !$player.get_pokemon_with_move(:FLY) if $game_player.has_follower? pbMessage(_INTL("It can't be used when you have someone with you.")) if show_messages return false @@ -508,14 +508,14 @@ end def pbFlyToNewLocation(pkmn = nil, move = :FLY) return false if !$PokemonTemp.flydata - pkmn = $Trainer.get_pokemon_with_move(move) if !pkmn + pkmn = $player.get_pokemon_with_move(move) if !pkmn if !$DEBUG && !pkmn $PokemonTemp.flydata = nil yield if block_given? return false end if !pkmn || !pbHiddenMoveAnimation(pkmn) - name = pkmn&.name || $Trainer.name + name = pkmn&.name || $player.name pbMessage(_INTL("{1} used {2}!", name, GameData::Move.get(move).name)) end pbFadeOutIn { @@ -557,7 +557,7 @@ def pbHeadbuttEffect(event=nil) event = $game_player.pbFacingEvent(true) if !event a = (event.x+(event.x/24).floor+1)*(event.y+(event.y/24).floor+1) a = (a*2/5)%10 # Even 2x as likely as odd, 0 is 1.5x as likely as odd - b = $Trainer.public_ID % 10 # Practically equal odds of each value + b = $player.public_ID % 10 # Practically equal odds of each value chance = 1 # ~50% if a==b # 10% chance = 8 @@ -578,13 +578,13 @@ end def pbHeadbutt(event=nil) move = :HEADBUTT - movefinder = $Trainer.get_pokemon_with_move(move) + movefinder = $player.get_pokemon_with_move(move) if !$DEBUG && !movefinder pbMessage(_INTL("A Pokémon could be in this tree. Maybe a Pokémon could shake it.")) return false end if pbConfirmMessage(_INTL("A Pokémon could be in this tree. Would you like to use Headbutt?")) - speciesname = (movefinder) ? movefinder.name : $Trainer.name + speciesname = (movefinder) ? movefinder.name : $player.name pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name)) pbHiddenMoveAnimation(movefinder) pbHeadbuttEffect(event) @@ -623,13 +623,13 @@ end def pbRockSmash move = :ROCKSMASH - movefinder = $Trainer.get_pokemon_with_move(move) + movefinder = $player.get_pokemon_with_move(move) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it.")) return false end if pbConfirmMessage(_INTL("This rock appears to be breakable. Would you like to use Rock Smash?")) - speciesname = (movefinder) ? movefinder.name : $Trainer.name + speciesname = (movefinder) ? movefinder.name : $player.name pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name)) pbHiddenMoveAnimation(movefinder) return true @@ -670,14 +670,14 @@ def pbStrength return false end move = :STRENGTH - movefinder = $Trainer.get_pokemon_with_move(move) + movefinder = $player.get_pokemon_with_move(move) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside.")) return false end pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside.\1")) if pbConfirmMessage(_INTL("Would you like to use Strength?")) - speciesname = (movefinder) ? movefinder.name : $Trainer.name + speciesname = (movefinder) ? movefinder.name : $player.name pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name)) pbHiddenMoveAnimation(movefinder) pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!",speciesname)) @@ -719,12 +719,12 @@ def pbSurf return false if $game_player.pbFacingEvent return false if $game_player.has_follower? move = :SURF - movefinder = $Trainer.get_pokemon_with_move(move) + movefinder = $player.get_pokemon_with_move(move) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,false) || (!$DEBUG && !movefinder) return false end if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?")) - speciesname = (movefinder) ? movefinder.name : $Trainer.name + speciesname = (movefinder) ? movefinder.name : $player.name pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name)) pbCancelVehicles pbHiddenMoveAnimation(movefinder) @@ -962,13 +962,13 @@ end def pbWaterfall move = :WATERFALL - movefinder = $Trainer.get_pokemon_with_move(move) + movefinder = $player.get_pokemon_with_move(move) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("A wall of water is crashing down with a mighty roar.")) return false end if pbConfirmMessage(_INTL("It's a large waterfall. Would you like to use Waterfall?")) - speciesname = (movefinder) ? movefinder.name : $Trainer.name + speciesname = (movefinder) ? movefinder.name : $player.name pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name)) pbHiddenMoveAnimation(movefinder) pbAscendWaterfall diff --git a/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb b/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb index 641c93f21..6284b7750 100644 --- a/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb +++ b/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb @@ -38,7 +38,7 @@ def pbFishingEnd end def pbFishing(hasEncounter,rodType=1) - speedup = ($Trainer.first_pokemon && [:STICKYHOLD, :SUCTIONCUPS].include?($Trainer.first_pokemon.ability_id)) + speedup = ($player.first_pokemon && [:STICKYHOLD, :SUCTIONCUPS].include?($player.first_pokemon.ability_id)) biteChance = 20+(25*rodType) # 45, 70, 95 biteChance *= 1.5 if speedup # 67.5, 100, 100 hookChance = 100 diff --git a/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb b/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb index 2404d0b10..840680ac3 100644 --- a/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb +++ b/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb @@ -1,4 +1,4 @@ -#=============================================================================== +$player#=============================================================================== # Represents a planted berry. Stored in $PokemonGlobal.eventvars. #=============================================================================== class BerryPlantData @@ -358,7 +358,7 @@ def pbBerryPlant break if !pbConfirmMessage(_INTL("Want to sprinkle some water with the {1}?", GameData::Item.get(item).name)) berry_plant.water - pbMessage(_INTL("{1} watered the plant.\\wtnp[40]", $Trainer.name)) + pbMessage(_INTL("{1} watered the plant.\\wtnp[40]", $player.name)) if Settings::NEW_BERRY_PLANTS pbMessage(_INTL("There! All happy!")) else @@ -419,7 +419,7 @@ def pbBerryPlant GameData::Item.get(berry).name)) else pbMessage(_INTL("{1} planted a {2} in the soft loamy soil.", - $Trainer.name, GameData::Item.get(berry).name)) + $player.name, GameData::Item.get(berry).name)) end end end @@ -449,7 +449,7 @@ def pbPickBerry(berry, qty = 1) end pocket = berry.pocket pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the \\c[1]{4}\\c[0] Pocket.\1", - $Trainer.name, berry_name, pocket, PokemonBag.pocket_names[pocket])) + $player.name, berry_name, pocket, PokemonBag.pocket_names[pocket])) if Settings::NEW_BERRY_PLANTS pbMessage(_INTL("The soil returned to its soft and earthy state.")) else diff --git a/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb b/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb index 63c199410..df0244ccb 100644 --- a/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb +++ b/Data/Scripts/012_Overworld/007_Overworld_DayCare.rb @@ -50,12 +50,12 @@ end def pbDayCareDeposit(index) for i in 0...2 next if $PokemonGlobal.daycare[i][0] - pkmn = $Trainer.party[index] + pkmn = $player.party[index] pkmn.heal pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN) $PokemonGlobal.daycare[i][0] = pkmn $PokemonGlobal.daycare[i][1] = pkmn.level - $Trainer.party.delete_at(index) + $player.party.delete_at(index) $PokemonGlobal.daycareEgg = 0 $PokemonGlobal.daycareEggSteps = 0 return @@ -66,10 +66,10 @@ end def pbDayCareWithdraw(index) if !$PokemonGlobal.daycare[index][0] raise _INTL("There's no Pokémon here...") - elsif $Trainer.party_full? + elsif $player.party_full? raise _INTL("Can't store the Pokémon...") else - $Trainer.party[$Trainer.party.length] = $PokemonGlobal.daycare[index][0] + $player.party[$player.party.length] = $PokemonGlobal.daycare[index][0] $PokemonGlobal.daycare[index][0] = nil $PokemonGlobal.daycare[index][1] = 0 $PokemonGlobal.daycareEgg = 0 @@ -155,7 +155,7 @@ end #=============================================================================== def pbDayCareGenerateEgg return if pbDayCareDeposited != 2 - raise _INTL("Can't store the egg.") if $Trainer.party_full? + raise _INTL("Can't store the egg.") if $player.party_full? pkmn0 = $PokemonGlobal.daycare[0][0] pkmn1 = $PokemonGlobal.daycare[1][0] mother = nil @@ -364,7 +364,7 @@ def pbDayCareGenerateEgg egg.steps_to_hatch = egg.species_data.hatch_steps egg.givePokerus if rand(65536) < Settings::POKERUS_CHANCE # Add egg to party - $Trainer.party[$Trainer.party.length] = egg + $player.party[$player.party.length] = egg end diff --git a/Data/Scripts/013_Items/001_Item_Utilities.rb b/Data/Scripts/013_Items/001_Item_Utilities.rb index fb3dec4c4..1dc32bec0 100644 --- a/Data/Scripts/013_Items/001_Item_Utilities.rb +++ b/Data/Scripts/013_Items/001_Item_Utilities.rb @@ -568,7 +568,7 @@ def pbUseItem(bag,item,bagscene=nil) itm = GameData::Item.get(item) useType = itm.field_use if itm.is_machine? # TM or TR or HM - if $Trainer.pokemon_count == 0 + if $player.pokemon_count == 0 pbMessage(_INTL("There is no Pokémon.")) return 0 end @@ -584,7 +584,7 @@ def pbUseItem(bag,item,bagscene=nil) end return 0 elsif useType==1 # Item is usable on a Pokémon - if $Trainer.pokemon_count == 0 + if $player.pokemon_count == 0 pbMessage(_INTL("There is no Pokémon.")) return 0 end @@ -592,14 +592,14 @@ def pbUseItem(bag,item,bagscene=nil) annot = nil if itm.is_evolution_stone? annot = [] - for pkmn in $Trainer.party + for pkmn in $player.party elig = pkmn.check_evolution_on_use_item(item) annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE")) end end pbFadeOutIn { scene = PokemonParty_Scene.new - screen = PokemonPartyScreen.new(scene,$Trainer.party) + screen = PokemonPartyScreen.new(scene,$player.party) screen.pbStartScene(_INTL("Use on which Pokémon?"),false,annot) loop do scene.pbSetHelpText(_INTL("Use on which Pokémon?")) @@ -608,7 +608,7 @@ def pbUseItem(bag,item,bagscene=nil) ret = false break end - pkmn = $Trainer.party[chosen] + pkmn = $player.party[chosen] if pbCheckUseOnPokemon(item,pkmn,screen) ret = ItemHandlers.triggerUseOnPokemon(item,pkmn,screen) if ret && itm.consumed_after_use? diff --git a/Data/Scripts/013_Items/002_Item_Effects.rb b/Data/Scripts/013_Items/002_Item_Effects.rb index 81a888818..5086dc9ce 100644 --- a/Data/Scripts/013_Items/002_Item_Effects.rb +++ b/Data/Scripts/013_Items/002_Item_Effects.rb @@ -187,12 +187,12 @@ ItemHandlers::UseInField.add(:ESCAPEROPE,proc { |item| }) ItemHandlers::UseInField.add(:SACREDASH,proc { |item| - if $Trainer.pokemon_count == 0 + if $player.pokemon_count == 0 pbMessage(_INTL("There is no Pokémon.")) next false end canrevive = false - for i in $Trainer.pokemon_party + for i in $player.pokemon_party next if !i.fainted? canrevive = true break @@ -204,15 +204,14 @@ ItemHandlers::UseInField.add(:SACREDASH,proc { |item| revived = 0 pbFadeOutIn { scene = PokemonParty_Scene.new - screen = PokemonPartyScreen.new(scene,$Trainer.party) + screen = PokemonPartyScreen.new(scene, $player.party) screen.pbStartScene(_INTL("Using item..."),false) - for i in 0...$Trainer.party.length - if $Trainer.party[i].fainted? - revived += 1 - $Trainer.party[i].heal - screen.pbRefreshSingle(i) - screen.pbDisplay(_INTL("{1}'s HP was restored.",$Trainer.party[i].name)) - end + $player.party.each_with_index do |pkmn, i| + next if !pkmn.fainted? + revived += 1 + pkmn.heal + screen.pbRefreshSingle(i) + screen.pbDisplay(_INTL("{1}'s HP was restored.", pkmn.name)) end if revived==0 screen.pbDisplay(_INTL("It won't have any effect.")) @@ -319,7 +318,7 @@ ItemHandlers::UseInField.add(:TOWNMAP, proc { |item| }) ItemHandlers::UseInField.add(:COINCASE,proc { |item| - pbMessage(_INTL("Coins: {1}", $Trainer.coins.to_s_formatted)) + pbMessage(_INTL("Coins: {1}", $player.coins.to_s_formatted)) next true }) @@ -1262,7 +1261,7 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene| # Fusing chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?")) next false if chosen < 0 - other_pkmn = $Trainer.party[chosen] + other_pkmn = $player.party[chosen] if pkmn == other_pkmn scene.pbDisplay(_INTL("It cannot be fused with itself.")) next false @@ -1281,7 +1280,7 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene| newForm = 2 if other_pkmn.isSpecies?(:ZEKROM) pkmn.setForm(newForm) { pkmn.fused = other_pkmn - $Trainer.remove_pokemon_at_index(chosen) + $player.remove_pokemon_at_index(chosen) scene.pbHardRefresh scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name)) } @@ -1296,13 +1295,13 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERSUSED,proc { |item,pkmn,scene| elsif pkmn.fainted? scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon.")) next false - elsif $Trainer.party_full? + elsif $player.party_full? scene.pbDisplay(_INTL("You have no room to separate the Pokémon.")) next false end # Unfusing pkmn.setForm(0) { - $Trainer.party[$Trainer.party.length] = pkmn.fused + $player.party[$player.party.length] = pkmn.fused pkmn.fused = nil scene.pbHardRefresh scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name)) @@ -1322,7 +1321,7 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene| # Fusing chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?")) next false if chosen < 0 - other_pkmn = $Trainer.party[chosen] + other_pkmn = $player.party[chosen] if pkmn == other_pkmn scene.pbDisplay(_INTL("It cannot be fused with itself.")) next false @@ -1338,7 +1337,7 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene| end pkmn.setForm(1) { pkmn.fused = other_pkmn - $Trainer.remove_pokemon_at_index(chosen) + $player.remove_pokemon_at_index(chosen) scene.pbHardRefresh scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name)) } @@ -1353,13 +1352,13 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZERUSED,proc { |item,pkmn,scene| elsif pkmn.fainted? scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon.")) next false - elsif $Trainer.party_full? + elsif $player.party_full? scene.pbDisplay(_INTL("You have no room to separate the Pokémon.")) next false end # Unfusing pkmn.setForm(0) { - $Trainer.party[$Trainer.party.length] = pkmn.fused + $player.party[$player.party.length] = pkmn.fused pkmn.fused = nil scene.pbHardRefresh scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name)) @@ -1379,7 +1378,7 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene| # Fusing chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?")) next false if chosen < 0 - other_pkmn = $Trainer.party[chosen] + other_pkmn = $player.party[chosen] if pkmn == other_pkmn scene.pbDisplay(_INTL("It cannot be fused with itself.")) next false @@ -1395,7 +1394,7 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene| end pkmn.setForm(2) { pkmn.fused = other_pkmn - $Trainer.remove_pokemon_at_index(chosen) + $player.remove_pokemon_at_index(chosen) scene.pbHardRefresh scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name)) } @@ -1410,13 +1409,13 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZERUSED,proc { |item,pkmn,scene| elsif pkmn.fainted? scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon.")) next false - elsif $Trainer.party_full? + elsif $player.party_full? scene.pbDisplay(_INTL("You have no room to separate the Pokémon.")) next false end # Unfusing pkmn.setForm(0) { - $Trainer.party[$Trainer.party.length] = pkmn.fused + $player.party[$player.party.length] = pkmn.fused pkmn.fused = nil scene.pbHardRefresh scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name)) @@ -1436,7 +1435,7 @@ ItemHandlers::UseOnPokemon.add(:REINSOFUNITY, proc { |item, pkmn, scene| # Fusing chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?")) next false if chosen < 0 - other_pkmn = $Trainer.party[chosen] + other_pkmn = $player.party[chosen] if pkmn == other_pkmn scene.pbDisplay(_INTL("It cannot be fused with itself.")) next false @@ -1456,7 +1455,7 @@ ItemHandlers::UseOnPokemon.add(:REINSOFUNITY, proc { |item, pkmn, scene| newForm = 2 if other_pkmn.isSpecies?(:SPECTRIER) pkmn.setForm(newForm) { pkmn.fused = other_pkmn - $Trainer.remove_pokemon_at_index(chosen) + $player.remove_pokemon_at_index(chosen) scene.pbHardRefresh scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name)) } @@ -1471,13 +1470,13 @@ ItemHandlers::UseOnPokemon.add(:REINSOFUNITYUSED, proc { |item, pkmn, scene| elsif pkmn.fainted? scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon.")) next false - elsif $Trainer.party_full? + elsif $player.party_full? scene.pbDisplay(_INTL("You have no room to separate the Pokémon.")) next false end # Unfusing pkmn.setForm(0) { - $Trainer.party[$Trainer.party.length] = pkmn.fused + $player.party[$player.party.length] = pkmn.fused pkmn.fused = nil scene.pbHardRefresh scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name)) diff --git a/Data/Scripts/013_Items/004_Item_Phone.rb b/Data/Scripts/013_Items/004_Item_Phone.rb index e66978238..96da00d3c 100644 --- a/Data/Scripts/013_Items/004_Item_Phone.rb +++ b/Data/Scripts/013_Items/004_Item_Phone.rb @@ -40,7 +40,7 @@ def pbPhoneDeleteContact(index) end def pbPhoneRegisterBattle(message,event,trainertype,trainername,maxbattles) - return if !$Trainer.has_pokegear # Can't register without a Pokégear + return if !$player.has_pokegear # Can't register without a Pokégear return false if !GameData::TrainerType.exists?(trainertype) trainertype = GameData::TrainerType.get(trainertype).id contact = pbFindPhoneTrainer(trainertype,trainername) @@ -132,7 +132,7 @@ end # Phone-related counters #=============================================================================== Events.onMapUpdate += proc { |_sender,_e| - next if !$Trainer || !$Trainer.has_pokegear + next if !$player || !$player.has_pokegear # Reset time to next phone call if necessary if !$PokemonGlobal.phoneTime || $PokemonGlobal.phoneTime<=0 $PokemonGlobal.phoneTime = 20*60*Graphics.frame_rate diff --git a/Data/Scripts/013_Items/006_Item_Mail.rb b/Data/Scripts/013_Items/006_Item_Mail.rb index a856f5125..ad89b8638 100644 --- a/Data/Scripts/013_Items/006_Item_Mail.rb +++ b/Data/Scripts/013_Items/006_Item_Mail.rb @@ -25,7 +25,7 @@ end def pbStoreMail(pkmn,item,message,poke1=nil,poke2=nil,poke3=nil) raise _INTL("Pokémon already has mail") if pkmn.mail - pkmn.mail = Mail.new(item, message, $Trainer.name, poke1, poke2, poke3) + pkmn.mail = Mail.new(item, message, $player.name, poke1, poke2, poke3) end def pbDisplayMail(mail,_bearer=nil) @@ -99,13 +99,13 @@ def pbWriteMail(item,pkmn,pkmnid,scene) if message!="" # Store mail if a message was written poke1 = poke2 = nil - if $Trainer.party[pkmnid+2] - p = $Trainer.party[pkmnid+2] + if $player.party[pkmnid+2] + p = $player.party[pkmnid+2] poke1 = [p.species,p.gender,p.shiny?,p.form,p.shadowPokemon?] poke1.push(true) if p.egg? end - if $Trainer.party[pkmnid+1] - p = $Trainer.party[pkmnid+1] + if $player.party[pkmnid+1] + p = $player.party[pkmnid+1] poke2 = [p.species,p.gender,p.shiny?,p.form,p.shadowPokemon?] poke2.push(true) if p.egg? end 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 e590438c2..d57fe0278 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb @@ -385,7 +385,7 @@ MultipleForms.register(:GRENINJA,{ MultipleForms.register(:SCATTERBUG,{ "getFormOnCreation" => proc { |pkmn| - next $Trainer.secret_ID % 18 + next $player.secret_ID % 18 } }) diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb index a3147841e..0043f14f4 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb @@ -147,7 +147,7 @@ end # #=============================================================================== def pbRelicStone - if !$Trainer.party.any? { |pkmn| pkmn.purifiable? } + if !$player.party.any? { |pkmn| pkmn.purifiable? } pbMessage(_INTL("You have no Pokémon that can be purified.")) return end @@ -157,7 +157,7 @@ def pbRelicStone pkmn.able? && pkmn.shadowPokemon? && pkmn.heart_gauge == 0 }) if $game_variables[1] >= 0 - pbRelicStoneScreen($Trainer.party[$game_variables[1]]) + pbRelicStoneScreen($player.party[$game_variables[1]]) end end @@ -408,21 +408,21 @@ end # during battle and need to say they're ready to be purified afterwards Events.onStartBattle += proc { |_sender| $PokemonTemp.heart_gauges = [] - $Trainer.party.each_with_index do |pkmn, i| + $player.party.each_with_index do |pkmn, i| $PokemonTemp.heart_gauges[i] = pkmn.heart_gauge end } Events.onEndBattle += proc { |_sender,_e| $PokemonTemp.heart_gauges.each_with_index do |value, i| - pkmn = $Trainer.party[i] + pkmn = $player.party[i] next if !pkmn || !value || value == 0 pkmn.check_ready_to_purify if pkmn.heart_gauge == 0 end } Events.onStepTaken += proc { - for pkmn in $Trainer.able_party + for pkmn in $player.able_party next if pkmn.heart_gauge == 0 stage = pkmn.heartStage pkmn.adjustHeart(-1) diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb index c63f492d6..ca41b46c7 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/004_PokemonStorage.rb @@ -115,7 +115,7 @@ class PokemonStorage end def party - $Trainer.party + $player.party end def party=(_value) @@ -123,7 +123,7 @@ class PokemonStorage end def party_full? - return $Trainer.party_full? + return $player.party_full? end def maxBoxes diff --git a/Data/Scripts/014_Pokemon/001_Pokemon.rb b/Data/Scripts/014_Pokemon/001_Pokemon.rb index 1d0602e30..5616bf4ef 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon.rb @@ -1,6 +1,6 @@ #=============================================================================== # Instances of this class are individual Pokémon. -# The player's party Pokémon are stored in the array $Trainer.party. +# The player's party Pokémon are stored in the array $player.party. #=============================================================================== class Pokemon # @return [Symbol] this Pokémon's species @@ -153,7 +153,7 @@ class Pokemon @ability = nil MultipleForms.call("onSetForm", self, value, oldForm) calc_stats - $Trainer.pokedex.register(self) if $Trainer + $player.pokedex.register(self) if $player end # The same as def form=, but yields to a given block in the middle so that a @@ -166,7 +166,7 @@ class Pokemon yield if block_given? MultipleForms.call("onSetForm", self, value, oldForm) calc_stats - $Trainer.pokedex.register(self) if $Trainer + $player.pokedex.register(self) if $player end def form_simple=(value) @@ -1111,7 +1111,7 @@ class Pokemon # @param owner [Owner, Player, NPCTrainer] Pokémon owner (the player by default) # @param withMoves [Boolean] whether the Pokémon should have moves # @param recheck_form [Boolean] whether to auto-check the form - def initialize(species, level, owner = $Trainer, withMoves = true, recheck_form = true) + def initialize(species, level, owner = $player, withMoves = true, recheck_form = true) species_data = GameData::Species.get(species) @species = species_data.species @form = species_data.base_form diff --git a/Data/Scripts/014_Pokemon/005_Pokemon_Owner.rb b/Data/Scripts/014_Pokemon/005_Pokemon_Owner.rb index e72b58f2d..d671ee5f2 100644 --- a/Data/Scripts/014_Pokemon/005_Pokemon_Owner.rb +++ b/Data/Scripts/014_Pokemon/005_Pokemon_Owner.rb @@ -38,7 +38,7 @@ class Pokemon # @param language [Integer] owner language # @return [Owner] foreign Owner object def self.new_foreign(name = '', gender = 2, language = 2) - return new($Trainer.make_foreign_ID, name, gender, language) + return new($player.make_foreign_ID, name, gender, language) end # @param new_id [Integer] new owner ID diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb index 35731ccee..639fcb6cf 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb @@ -191,13 +191,13 @@ end def pbHatch(pokemon) speciesname = pokemon.speciesName pokemon.name = nil - pokemon.owner = Pokemon::Owner.new_from_trainer($Trainer) + pokemon.owner = Pokemon::Owner.new_from_trainer($player) pokemon.happiness = 120 pokemon.timeEggHatched = pbGetTimeNow pokemon.obtain_method = 1 # hatched from egg pokemon.hatched_map = $game_map.map_id - $Trainer.pokedex.register(pokemon) - $Trainer.pokedex.set_owned(pokemon.species) + $player.pokedex.register(pokemon) + $player.pokedex.set_owned(pokemon.species) pokemon.record_first_moves if !pbHatchAnimation(pokemon) pbMessage(_INTL("Huh?\1")) @@ -213,10 +213,10 @@ def pbHatch(pokemon) end Events.onStepTaken += proc { |_sender,_e| - for egg in $Trainer.party + for egg in $player.party next if egg.steps_to_hatch <= 0 egg.steps_to_hatch -= 1 - for i in $Trainer.pokemon_party + for i in $player.pokemon_party next if ![:FLAMEBODY, :MAGMAARMOR, :STEAMENGINE].include?(i.ability_id) egg.steps_to_hatch -= 1 break diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb index 7153f6b1f..314c4d078 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb @@ -588,8 +588,8 @@ class PokemonEvolutionScene @pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM) @pokemon.calc_stats # See and own evolved species - $Trainer.pokedex.register(@pokemon) - $Trainer.pokedex.set_owned(@newspecies) + $player.pokedex.register(@pokemon) + $player.pokedex.set_owned(@newspecies) # Learn moves upon evolution for evolved species movelist = @pokemon.getMoveList for i in movelist @@ -613,9 +613,9 @@ class PokemonEvolutionScene new_pkmn.calc_stats new_pkmn.heal # Add duplicate Pokémon to party - $Trainer.party.push(new_pkmn) + $player.party.push(new_pkmn) # See and own duplicate Pokémon - $Trainer.pokedex.register(new_pkmn) - $Trainer.pokedex.set_owned(new_species) + $player.pokedex.register(new_pkmn) + $player.pokedex.set_owned(new_species) end end diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb index eb38ca2f5..7585b97e1 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb @@ -198,9 +198,9 @@ end # #=============================================================================== def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0) - myPokemon = $Trainer.party[pokemonIndex] + myPokemon = $player.party[pokemonIndex] opponent = NPCTrainer.new(trainerName,trainerGender) - opponent.id = $Trainer.make_foreign_ID + opponent.id = $player.make_foreign_ID yourPokemon = nil resetmoves = true if newpoke.is_a?(Pokemon) @@ -216,13 +216,13 @@ def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0) yourPokemon.obtain_method = 2 # traded yourPokemon.reset_moves if resetmoves yourPokemon.record_first_moves - $Trainer.pokedex.register(yourPokemon) - $Trainer.pokedex.set_owned(yourPokemon.species) + $player.pokedex.register(yourPokemon) + $player.pokedex.set_owned(yourPokemon.species) pbFadeOutInWithMusic { evo = PokemonTrade_Scene.new - evo.pbStartScreen(myPokemon,yourPokemon,$Trainer.name,opponent.name) + evo.pbStartScreen(myPokemon, yourPokemon, $player.name, opponent.name) evo.pbTrade evo.pbEndScreen } - $Trainer.party[pokemonIndex] = yourPokemon + $player.party[pokemonIndex] = yourPokemon end diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb index 639e1e2b6..8775ad0a2 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb @@ -123,9 +123,9 @@ class HallOfFame_Scene end def saveHallEntry - for i in 0...$Trainer.party.length + $player.party.each do |pkmn| # Clones every pokémon object - @hallEntry.push($Trainer.party[i].clone) if !$Trainer.party[i].egg? || ALLOWEGGS + @hallEntry.push(pkmn.clone) if !pkmn.egg? || ALLOWEGGS end # Update the global variables $PokemonGlobal.hallOfFame.push(@hallEntry) @@ -243,7 +243,7 @@ class HallOfFame_Scene def createTrainerBattler @sprites["trainer"]=IconSprite.new(@viewport) - @sprites["trainer"].setBitmap(GameData::TrainerType.front_sprite_filename($Trainer.trainer_type)) + @sprites["trainer"].setBitmap(GameData::TrainerType.front_sprite_filename($player.trainer_type)) if !SINGLEROW @sprites["trainer"].x=Graphics.width-96 @sprites["trainer"].y=160 @@ -278,12 +278,12 @@ class HallOfFame_Scene totalsec = Graphics.frame_count / Graphics.frame_rate hour = totalsec / 60 / 60 min = totalsec / 60 % 60 - pubid=sprintf("%05d",$Trainer.public_ID) - lefttext= _INTL("Name{1}
",$Trainer.name) + pubid=sprintf("%05d", $player.public_ID) + lefttext= _INTL("Name{1}
", $player.name) lefttext+=_INTL("IDNo.{1}
",pubid) lefttext+=_ISPRINTF("Time{1:02d}:{2:02d}
",hour,min) lefttext+=_INTL("Pokédex{1}/{2}
", - $Trainer.pokedex.owned_count,$Trainer.pokedex.seen_count) + $player.pokedex.owned_count, $player.pokedex.seen_count) @sprites["messagebox"]=Window_AdvancedTextPokemon.new(lefttext) @sprites["messagebox"].viewport=@viewport @sprites["messagebox"].width=192 if @sprites["messagebox"].width<192 diff --git a/Data/Scripts/016_UI/001_UI_PauseMenu.rb b/Data/Scripts/016_UI/001_UI_PauseMenu.rb index 2f753d4c9..162d87898 100644 --- a/Data/Scripts/016_UI/001_UI_PauseMenu.rb +++ b/Data/Scripts/016_UI/001_UI_PauseMenu.rb @@ -93,7 +93,7 @@ class PokemonPauseMenu end def pbStartPokemonMenu - if !$Trainer + if !$player if $DEBUG pbMessage(_INTL("The player trainer was not defined, so the pause menu can't be displayed.")) pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player.")) @@ -114,17 +114,17 @@ class PokemonPauseMenu cmdDebug = -1 cmdQuit = -1 cmdEndGame = -1 - if $Trainer.has_pokedex && $Trainer.pokedex.accessible_dexes.length > 0 + if $player.has_pokedex && $player.pokedex.accessible_dexes.length > 0 commands[cmdPokedex = commands.length] = _INTL("Pokédex") end - commands[cmdPokemon = commands.length] = _INTL("Pokémon") if $Trainer.party_count > 0 + commands[cmdPokemon = commands.length] = _INTL("Pokémon") if $player.party_count > 0 commands[cmdBag = commands.length] = _INTL("Bag") if !pbInBugContest? - if $Trainer.has_pokegear + if $player.has_pokegear commands[cmdPokegear = commands.length] = _INTL("Pokégear") elsif $bag.has?(:TOWNMAP) commands[cmdTownMap = commands.length] = _INTL("Town Map") end - commands[cmdTrainer = commands.length] = $Trainer.name + commands[cmdTrainer = commands.length] = $player.name if pbInSafari? if Settings::SAFARI_STEPS <= 0 @scene.pbShowInfo(_INTL("Balls: {1}",pbSafariState.ballcount)) @@ -161,8 +161,8 @@ class PokemonPauseMenu @scene.pbRefresh } else - if $Trainer.pokedex.accessible_dexes.length == 1 - $PokemonGlobal.pokedexDex = $Trainer.pokedex.accessible_dexes[0] + if $player.pokedex.accessible_dexes.length == 1 + $PokemonGlobal.pokedexDex = $player.pokedex.accessible_dexes[0] pbFadeOutIn { scene = PokemonPokedex_Scene.new screen = PokemonPokedexScreen.new(scene) @@ -183,7 +183,7 @@ class PokemonPauseMenu hiddenmove = nil pbFadeOutIn { sscene = PokemonParty_Scene.new - sscreen = PokemonPartyScreen.new(sscene,$Trainer.party) + sscreen = PokemonPartyScreen.new(sscene, $player.party) hiddenmove = sscreen.pbPokemonScreen (hiddenmove) ? @scene.pbEndScene : @scene.pbRefresh } diff --git a/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb b/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb index 91e135c0a..9731983c3 100644 --- a/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb +++ b/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb @@ -94,7 +94,7 @@ class PokemonPokedexMenuScreen commands = [] commands2 = [] dexnames = Settings.pokedex_names - $Trainer.pokedex.accessible_dexes.each do |dex| + $player.pokedex.accessible_dexes.each do |dex| if dexnames[dex].nil? commands.push(_INTL("Pokédex")) elsif dexnames[dex].is_a?(Array) @@ -102,8 +102,8 @@ class PokemonPokedexMenuScreen else commands.push(dexnames[dex]) end - commands2.push([$Trainer.pokedex.seen_count(dex), - $Trainer.pokedex.owned_count(dex), + commands2.push([$player.pokedex.seen_count(dex), + $player.pokedex.owned_count(dex), pbGetRegionalDexLength(dex)]) end commands.push(_INTL("Exit")) @@ -111,7 +111,7 @@ class PokemonPokedexMenuScreen loop do cmd = @scene.pbScene break if cmd<0 || cmd>=commands2.length # Cancel/Exit - $PokemonGlobal.pokedexDex = $Trainer.pokedex.accessible_dexes[cmd] + $PokemonGlobal.pokedexDex = $player.pokedex.accessible_dexes[cmd] pbFadeOutIn { scene = PokemonPokedex_Scene.new screen = PokemonPokedexScreen.new(scene) diff --git a/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb index 7929ed99d..471c10b32 100644 --- a/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb +++ b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb @@ -38,8 +38,8 @@ class Window_Pokedex < Window_DrawableCommand species = @commands[index][0] indexNumber = @commands[index][4] indexNumber -= 1 if @commands[index][5] - if $Trainer.seen?(species) - if $Trainer.owned?(species) + if $player.seen?(species) + if $player.owned?(species) pbCopyBitmap(self.contents,@pokeballOwn.bitmap,rect.x-6,rect.y+8) else pbCopyBitmap(self.contents,@pokeballSeen.bitmap,rect.x-6,rect.y+8) @@ -315,7 +315,7 @@ class PokemonPokedex_Scene def pbGetPokedexRegion if Settings::USE_CURRENT_REGION_DEX region = pbGetCurrentRegion - region = -1 if region >= $Trainer.pokedex.dexes_count - 1 + region = -1 if region >= $player.pokedex.dexes_count - 1 return region else return $PokemonGlobal.pokedexDex # National Dex -1, regional Dexes 0, 1, etc. @@ -328,7 +328,7 @@ class PokemonPokedex_Scene def pbGetSavePositionIndex index = pbGetPokedexRegion if index==-1 # National Dex (comes after regional Dex indices) - index = $Trainer.pokedex.dexes_count - 1 + index = $player.pokedex.dexes_count - 1 end return index end @@ -336,9 +336,9 @@ class PokemonPokedex_Scene def pbCanAddForModeList?(mode, species) case mode when MODEATOZ - return $Trainer.seen?(species) + return $player.seen?(species) when MODEHEAVIEST, MODELIGHTEST, MODETALLEST, MODESMALLEST - return $Trainer.owned?(species) + return $player.owned?(species) end return true # For MODENUMERICAL end @@ -356,7 +356,7 @@ class PokemonPokedex_Scene regionalSpecies.each_with_index do |species, i| next if !species next if !pbCanAddForModeList?($PokemonGlobal.pokedexMode, species) - _gender, form = $Trainer.pokedex.last_form_seen(species) + _gender, form = $player.pokedex.last_form_seen(species) species_data = GameData::Species.get_species_form(species, form) color = species_data.color type1 = species_data.type1 @@ -374,11 +374,11 @@ class PokemonPokedex_Scene case $PokemonGlobal.pokedexMode when MODENUMERICAL # Hide the Dex number 0 species if unseen - dexlist[0] = nil if dexlist[0][5] && !$Trainer.seen?(dexlist[0][0]) + dexlist[0] = nil if dexlist[0][5] && !$player.seen?(dexlist[0][0]) # Remove unseen species from the end of the list i = dexlist.length-1 loop do break unless i>=0 - break if !dexlist[i] || $Trainer.seen?(dexlist[i][0]) + break if !dexlist[i] || $player.seen?(dexlist[i][0]) dexlist[i] = nil i -= 1 end @@ -414,10 +414,10 @@ class PokemonPokedex_Scene base = Color.new(88,88,80) shadow = Color.new(168,184,184) iconspecies = @sprites["pokedex"].species - iconspecies = nil if !$Trainer.seen?(iconspecies) + iconspecies = nil if !$player.seen?(iconspecies) # Write various bits of text dexname = _INTL("Pokédex") - if $Trainer.pokedex.dexes_count > 1 + if $player.pokedex.dexes_count > 1 thisdex = Settings.pokedex_names[pbGetSavePositionIndex] if thisdex!=nil dexname = (thisdex.is_a?(Array)) ? thisdex[0] : thisdex @@ -432,9 +432,9 @@ class PokemonPokedex_Scene textpos.push([@dexlist.length.to_s,112,334,2,base,shadow]) else textpos.push([_INTL("Seen:"),42,302,0,base,shadow]) - textpos.push([$Trainer.pokedex.seen_count(pbGetPokedexRegion).to_s,182,302,1,base,shadow]) + textpos.push([$player.pokedex.seen_count(pbGetPokedexRegion).to_s,182,302,1,base,shadow]) textpos.push([_INTL("Owned:"),42,334,0,base,shadow]) - textpos.push([$Trainer.pokedex.owned_count(pbGetPokedexRegion).to_s,182,334,1,base,shadow]) + textpos.push([$player.pokedex.owned_count(pbGetPokedexRegion).to_s,182,334,1,base,shadow]) end # Draw all text pbDrawTextPositions(overlay,textpos) @@ -745,7 +745,7 @@ class PokemonPokedex_Scene end def setIconBitmap(species) - gender, form = $Trainer.pokedex.last_form_seen(species) + gender, form = $player.pokedex.last_form_seen(species) @sprites["icon"].setSpeciesBitmap(species, gender, form) end @@ -756,7 +756,7 @@ class PokemonPokedex_Scene if params[1]>=0 scanNameCommand = @nameCommands[params[1]].scan(/./) dexlist = dexlist.find_all { |item| - next false if !$Trainer.seen?(item[0]) + next false if !$player.seen?(item[0]) firstChar = item[1][0,1] next scanNameCommand.any? { |v| v==firstChar } } @@ -766,7 +766,7 @@ class PokemonPokedex_Scene stype1 = (params[2]>=0) ? @typeCommands[params[2]].id : nil stype2 = (params[3]>=0) ? @typeCommands[params[3]].id : nil dexlist = dexlist.find_all { |item| - next false if !$Trainer.owned?(item[0]) + next false if !$player.owned?(item[0]) type1 = item[6] type2 = item[7] if stype1 && stype2 @@ -788,7 +788,7 @@ class PokemonPokedex_Scene minh = (params[4]<0) ? 0 : (params[4]>=@heightCommands.length) ? 999 : @heightCommands[params[4]] maxh = (params[5]<0) ? 999 : (params[5]>=@heightCommands.length) ? 0 : @heightCommands[params[5]] dexlist = dexlist.find_all { |item| - next false if !$Trainer.owned?(item[0]) + next false if !$player.owned?(item[0]) height = item[2] next height>=minh && height<=maxh } @@ -798,7 +798,7 @@ class PokemonPokedex_Scene minw = (params[6]<0) ? 0 : (params[6]>=@weightCommands.length) ? 9999 : @weightCommands[params[6]] maxw = (params[7]<0) ? 9999 : (params[7]>=@weightCommands.length) ? 0 : @weightCommands[params[7]] dexlist = dexlist.find_all { |item| - next false if !$Trainer.owned?(item[0]) + next false if !$player.owned?(item[0]) weight = item[3] next weight>=minw && weight<=maxw } @@ -807,7 +807,7 @@ class PokemonPokedex_Scene if params[8]>=0 scolor = @colorCommands[params[8]].id dexlist = dexlist.find_all { |item| - next false if !$Trainer.seen?(item[0]) + next false if !$player.seen?(item[0]) next item[8] == scolor } end @@ -815,12 +815,12 @@ class PokemonPokedex_Scene if params[9]>=0 sshape = @shapeCommands[params[9]].id dexlist = dexlist.find_all { |item| - next false if !$Trainer.seen?(item[0]) + next false if !$player.seen?(item[0]) next item[9] == sshape } end # Remove all unseen species from the results - dexlist = dexlist.find_all { |item| next $Trainer.seen?(item[0]) } + dexlist = dexlist.find_all { |item| next $player.seen?(item[0]) } case $PokemonGlobal.pokedexMode when MODENUMERICAL then dexlist.sort! { |a,b| a[4]<=>b[4] } when MODEATOZ then dexlist.sort! { |a,b| a[1]<=>b[1] } @@ -1262,7 +1262,7 @@ class PokemonPokedex_Scene break end elsif Input.trigger?(Input::USE) - if $Trainer.seen?(@sprites["pokedex"].species) + if $player.seen?(@sprites["pokedex"].species) pbPlayDecisionSE pbDexEntry(@sprites["pokedex"].index) end diff --git a/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb index 5ba7f6ad5..cbb54e9a3 100644 --- a/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb +++ b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb @@ -72,7 +72,7 @@ class PokemonPokedexInfo_Scene @viewport.z = 99999 dexnum = 0 dexnumshift = false - if $Trainer.pokedex.unlocked?(-1) # National Dex is unlocked + if $player.pokedex.unlocked?(-1) # National Dex is unlocked species_data = GameData::Species.try_get(species) if species_data nationalDexList = [:NONE] @@ -81,8 +81,8 @@ class PokemonPokedexInfo_Scene dexnumshift = true if dexnum > 0 && Settings::DEXES_WITH_OFFSETS.include?(-1) end else - for i in 0...$Trainer.pokedex.dexes_count - 1 # Regional Dexes - next if !$Trainer.pokedex.unlocked?(i) + for i in 0...$player.pokedex.dexes_count - 1 # Regional Dexes + next if !$player.pokedex.unlocked?(i) num = pbGetRegionalNumber(i,species) next if num <= 0 dexnum = num @@ -126,7 +126,7 @@ class PokemonPokedexInfo_Scene def pbUpdateDummyPokemon @species = @dexlist[@index][0] - @gender, @form = $Trainer.pokedex.last_form_seen(@species) + @gender, @form = $player.pokedex.last_form_seen(@species) species_data = GameData::Species.get_species_form(@species, @form) @sprites["infosprite"].setSpeciesBitmap(@species,@gender,@form) if @sprites["formfront"] @@ -153,12 +153,12 @@ class PokemonPokedexInfo_Scene multiple_forms = true if sp.form > 0 if sp.single_gendered? real_gender = (sp.gender_ratio == :AlwaysFemale) ? 1 : 0 - next if !$Trainer.pokedex.seen_form?(@species, real_gender, sp.form) && !Settings::DEX_SHOWS_ALL_FORMS + next if !$player.pokedex.seen_form?(@species, real_gender, sp.form) && !Settings::DEX_SHOWS_ALL_FORMS real_gender = 2 if sp.gender_ratio == :Genderless ret.push([sp.form_name, real_gender, sp.form]) else # Both male and female for real_gender in 0...2 - next if !$Trainer.pokedex.seen_form?(@species, real_gender, sp.form) && !Settings::DEX_SHOWS_ALL_FORMS + next if !$player.pokedex.seen_form?(@species, real_gender, sp.form) && !Settings::DEX_SHOWS_ALL_FORMS ret.push([sp.form_name, real_gender, sp.form]) break if sp.form_name && !sp.form_name.empty? # Only show 1 entry for each non-0 form end @@ -223,12 +223,12 @@ class PokemonPokedexInfo_Scene ] if @show_battled_count textpos.push([_INTL("Number Battled"), 314, 152, 0, base, shadow]) - textpos.push([$Trainer.pokedex.battled_count(@species).to_s, 452, 184, 1, base, shadow]) + textpos.push([$player.pokedex.battled_count(@species).to_s, 452, 184, 1, base, shadow]) else textpos.push([_INTL("Height"), 314, 152, 0, base, shadow]) textpos.push([_INTL("Weight"), 314, 184, 0, base, shadow]) end - if $Trainer.owned?(@species) + if $player.owned?(@species) # Write the category textpos.push([_INTL("{1} Pokémon", species_data.category), 246, 68, 0, base, shadow]) # Write the height and weight @@ -396,7 +396,7 @@ class PokemonPokedexInfo_Scene newindex = @index while newindex>0 newindex -= 1 - if $Trainer.seen?(@dexlist[newindex][0]) + if $player.seen?(@dexlist[newindex][0]) @index = newindex break end @@ -407,7 +407,7 @@ class PokemonPokedexInfo_Scene newindex = @index while newindex<@dexlist.length-1 newindex += 1 - if $Trainer.seen?(@dexlist[newindex][0]) + if $player.seen?(@dexlist[newindex][0]) @index = newindex break end @@ -425,7 +425,7 @@ class PokemonPokedexInfo_Scene oldindex = -1 loop do if oldindex!=index - $Trainer.pokedex.set_last_form_seen(@species, @available[index][1], @available[index][2]) + $player.pokedex.set_last_form_seen(@species, @available[index][1], @available[index][2]) pbUpdateDummyPokemon drawPage(@page) @sprites["uparrow"].visible = (index>0) @@ -564,7 +564,7 @@ class PokemonPokedexInfoScreen region = -1 if Settings::USE_CURRENT_REGION_DEX region = pbGetCurrentRegion - region = -1 if region >= $Trainer.pokedex.dexes_count - 1 + region = -1 if region >= $player.pokedex.dexes_count - 1 else region = $PokemonGlobal.pokedexDex # National Dex -1, regional Dexes 0, 1, etc. end diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb index 8769bbed6..f8fac0268 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016_UI/005_UI_Party.rb @@ -1375,7 +1375,7 @@ end def pbPokemonScreen pbFadeOutIn { sscene = PokemonParty_Scene.new - sscreen = PokemonPartyScreen.new(sscene,$Trainer.party) + sscreen = PokemonPartyScreen.new(sscene, $player.party) sscreen.pbPokemonScreen } end @@ -1390,7 +1390,7 @@ def pbChoosePokemon(variableNumber,nameVarNumber,ableProc=nil,allowIneligible=fa chosen = 0 pbFadeOutIn { scene = PokemonParty_Scene.new - screen = PokemonPartyScreen.new(scene,$Trainer.party) + screen = PokemonPartyScreen.new(scene, $player.party) if ableProc chosen=screen.pbChooseAblePokemon(ableProc,allowIneligible) else @@ -1399,11 +1399,11 @@ def pbChoosePokemon(variableNumber,nameVarNumber,ableProc=nil,allowIneligible=fa screen.pbEndScene end } - pbSet(variableNumber,chosen) + pbSet(variableNumber, chosen) if chosen>=0 - pbSet(nameVarNumber,$Trainer.party[chosen].name) + pbSet(nameVarNumber, $player.party[chosen].name) else - pbSet(nameVarNumber,"") + pbSet(nameVarNumber, "") end end @@ -1420,7 +1420,7 @@ def pbChooseTradablePokemon(variableNumber,nameVarNumber,ableProc=nil,allowIneli chosen = 0 pbFadeOutIn { scene = PokemonParty_Scene.new - screen = PokemonPartyScreen.new(scene,$Trainer.party) + screen = PokemonPartyScreen.new(scene, $player.party) if ableProc chosen=screen.pbChooseTradablePokemon(ableProc,allowIneligible) else @@ -1429,11 +1429,11 @@ def pbChooseTradablePokemon(variableNumber,nameVarNumber,ableProc=nil,allowIneli screen.pbEndScene end } - pbSet(variableNumber,chosen) + pbSet(variableNumber, chosen) if chosen>=0 - pbSet(nameVarNumber,$Trainer.party[chosen].name) + pbSet(nameVarNumber, $player.party[chosen].name) else - pbSet(nameVarNumber,"") + pbSet(nameVarNumber, "") end end diff --git a/Data/Scripts/016_UI/006_UI_Summary.rb b/Data/Scripts/016_UI/006_UI_Summary.rb index 47a5319aa..bbe1a8937 100644 --- a/Data/Scripts/016_UI/006_UI_Summary.rb +++ b/Data/Scripts/016_UI/006_UI_Summary.rb @@ -394,12 +394,12 @@ class PokemonSummary_Scene # Write the Regional/National Dex number dexnum = 0 dexnumshift = false - if $Trainer.pokedex.unlocked?(-1) # National Dex is unlocked + if $player.pokedex.unlocked?(-1) # National Dex is unlocked dexnum = @nationalDexList.index(@pokemon.species_data.species) || 0 dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(-1) else - for i in 0...$Trainer.pokedex.dexes_count - 1 - next if !$Trainer.pokedex.unlocked?(i) + for i in 0...$player.pokedex.dexes_count - 1 + next if !$player.pokedex.unlocked?(i) num = pbGetRegionalNumber(i,@pokemon.species) next if num<=0 dexnum = num @@ -1189,7 +1189,7 @@ class PokemonSummary_Scene if !@pokemon.egg? commands[cmdGiveItem = commands.length] = _INTL("Give item") commands[cmdTakeItem = commands.length] = _INTL("Take item") if @pokemon.hasItem? - commands[cmdPokedex = commands.length] = _INTL("View Pokédex") if $Trainer.has_pokedex + commands[cmdPokedex = commands.length] = _INTL("View Pokédex") if $player.has_pokedex end commands[cmdMark = commands.length] = _INTL("Mark") commands[commands.length] = _INTL("Cancel") @@ -1207,7 +1207,7 @@ class PokemonSummary_Scene elsif cmdTakeItem>=0 && command==cmdTakeItem dorefresh = pbTakeItemFromPokemon(@pokemon,self) elsif cmdPokedex>=0 && command==cmdPokedex - $Trainer.pokedex.register_last_seen(@pokemon) + $player.pokedex.register_last_seen(@pokemon) pbFadeOutIn { scene = PokemonPokedexInfo_Scene.new screen = PokemonPokedexInfoScreen.new(scene) diff --git a/Data/Scripts/016_UI/007_UI_Bag.rb b/Data/Scripts/016_UI/007_UI_Bag.rb index 143db4189..077686df1 100644 --- a/Data/Scripts/016_UI/007_UI_Bag.rb +++ b/Data/Scripts/016_UI/007_UI_Bag.rb @@ -258,7 +258,7 @@ class PokemonBag_Scene @sprites["background"].setBitmap(sprintf("Graphics/Pictures/Bag/bg_#{@bag.last_viewed_pocket}")) # Set the bag sprite fbagexists = pbResolveBitmap(sprintf("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}_f")) - if $Trainer.female? && fbagexists + if $player.female? && fbagexists @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}_f") else @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}") @@ -469,14 +469,14 @@ class PokemonBagScreen commands = [] # Generate command list commands[cmdRead = commands.length] = _INTL("Read") if itm.is_mail? - if ItemHandlers.hasOutHandler(item) || (itm.is_machine? && $Trainer.party.length>0) + if ItemHandlers.hasOutHandler(item) || (itm.is_machine? && $player.party.length>0) if ItemHandlers.hasUseText(item) commands[cmdUse = commands.length] = ItemHandlers.getUseText(item) else commands[cmdUse = commands.length] = _INTL("Use") end end - commands[cmdGive = commands.length] = _INTL("Give") if $Trainer.pokemon_party.length > 0 && itm.can_hold? + commands[cmdGive = commands.length] = _INTL("Give") if $player.pokemon_party.length > 0 && itm.can_hold? commands[cmdToss = commands.length] = _INTL("Toss") if !itm.is_important? || $DEBUG if @bag.registered?(item) commands[cmdRegister = commands.length] = _INTL("Deselect") @@ -499,14 +499,14 @@ class PokemonBagScreen @scene.pbRefresh next elsif cmdGive>=0 && command==cmdGive # Give item to Pokémon - if $Trainer.pokemon_count == 0 + if $player.pokemon_count == 0 @scene.pbDisplay(_INTL("There is no Pokémon.")) elsif itm.is_important? @scene.pbDisplay(_INTL("The {1} can't be held.",itemname)) else pbFadeOutIn { sscene = PokemonParty_Scene.new - sscreen = PokemonPartyScreen.new(sscene,$Trainer.party) + sscreen = PokemonPartyScreen.new(sscene, $player.party) sscreen.pbPokemonGiveScreen(item) @scene.pbRefresh } diff --git a/Data/Scripts/016_UI/008_UI_Pokegear.rb b/Data/Scripts/016_UI/008_UI_Pokegear.rb index 6902b4d0d..230d86798 100644 --- a/Data/Scripts/016_UI/008_UI_Pokegear.rb +++ b/Data/Scripts/016_UI/008_UI_Pokegear.rb @@ -11,7 +11,7 @@ class PokegearButton < SpriteWrapper @image = command[0] @name = command[1] @selected = false - if $Trainer.female? && pbResolveBitmap(sprintf("Graphics/Pictures/Pokegear/icon_button_f")) + if $player.female? && pbResolveBitmap(sprintf("Graphics/Pictures/Pokegear/icon_button_f")) @button = AnimatedBitmap.new("Graphics/Pictures/Pokegear/icon_button_f") else @button = AnimatedBitmap.new("Graphics/Pictures/Pokegear/icon_button") @@ -70,7 +70,7 @@ class PokemonPokegear_Scene @viewport.z = 99999 @sprites = {} @sprites["background"] = IconSprite.new(0,0,@viewport) - if $Trainer.female? && pbResolveBitmap(sprintf("Graphics/Pictures/Pokegear/bg_f")) + if $player.female? && pbResolveBitmap(sprintf("Graphics/Pictures/Pokegear/bg_f")) @sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg_f") else @sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg") diff --git a/Data/Scripts/016_UI/009_UI_RegionMap.rb b/Data/Scripts/016_UI/009_UI_RegionMap.rb index 2b5659b25..164c950bf 100644 --- a/Data/Scripts/016_UI/009_UI_RegionMap.rb +++ b/Data/Scripts/016_UI/009_UI_RegionMap.rb @@ -126,7 +126,7 @@ class PokemonRegionMap_Scene @sprites["mapbottom"].mapdetails = pbGetMapDetails(@map_x, @map_y) if playerpos && mapindex == playerpos[0] @sprites["player"] = IconSprite.new(0, 0, @viewport) - @sprites["player"].setBitmap(GameData::TrainerType.player_map_icon_filename($Trainer.trainer_type)) + @sprites["player"].setBitmap(GameData::TrainerType.player_map_icon_filename($player.trainer_type)) @sprites["player"].x = point_x_to_screen_x(@map_x) @sprites["player"].y = point_y_to_screen_y(@map_y) end diff --git a/Data/Scripts/016_UI/012_UI_TrainerCard.rb b/Data/Scripts/016_UI/012_UI_TrainerCard.rb index 60a3f488c..1c599f624 100644 --- a/Data/Scripts/016_UI/012_UI_TrainerCard.rb +++ b/Data/Scripts/016_UI/012_UI_TrainerCard.rb @@ -11,14 +11,14 @@ class PokemonTrainerCard_Scene @viewport.z = 99999 @sprites = {} background = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/bg_f")) - if $Trainer.female? && background + if $player.female? && background addBackgroundPlane(@sprites,"bg","Trainer Card/bg_f",@viewport) else addBackgroundPlane(@sprites,"bg","Trainer Card/bg",@viewport) end cardexists = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/card_f")) @sprites["card"] = IconSprite.new(0,0,@viewport) - if $Trainer.female? && cardexists + if $player.female? && cardexists @sprites["card"].setBitmap("Graphics/Pictures/Trainer Card/card_f") else @sprites["card"].setBitmap("Graphics/Pictures/Trainer Card/card") @@ -26,7 +26,7 @@ class PokemonTrainerCard_Scene @sprites["overlay"] = BitmapSprite.new(Graphics.width,Graphics.height,@viewport) pbSetSystemFont(@sprites["overlay"].bitmap) @sprites["trainer"] = IconSprite.new(336,112,@viewport) - @sprites["trainer"].setBitmap(GameData::TrainerType.player_front_sprite_filename($Trainer.trainer_type)) + @sprites["trainer"].setBitmap(GameData::TrainerType.player_front_sprite_filename($player.trainer_type)) @sprites["trainer"].x -= (@sprites["trainer"].bitmap.width-128)/2 @sprites["trainer"].y -= (@sprites["trainer"].bitmap.height-128) @sprites["trainer"].z = 2 @@ -50,13 +50,13 @@ class PokemonTrainerCard_Scene $PokemonGlobal.startTime.year) textPositions = [ [_INTL("Name"),34,58,0,baseColor,shadowColor], - [$Trainer.name,302,58,1,baseColor,shadowColor], + [$player.name,302,58,1,baseColor,shadowColor], [_INTL("ID No."),332,58,0,baseColor,shadowColor], - [sprintf("%05d",$Trainer.public_ID),468,58,1,baseColor,shadowColor], + [sprintf("%05d",$player.public_ID),468,58,1,baseColor,shadowColor], [_INTL("Money"),34,106,0,baseColor,shadowColor], - [_INTL("${1}",$Trainer.money.to_s_formatted),302,106,1,baseColor,shadowColor], + [_INTL("${1}",$player.money.to_s_formatted),302,106,1,baseColor,shadowColor], [_INTL("Pokédex"),34,154,0,baseColor,shadowColor], - [sprintf("%d/%d",$Trainer.pokedex.owned_count,$Trainer.pokedex.seen_count),302,154,1,baseColor,shadowColor], + [sprintf("%d/%d",$player.pokedex.owned_count,$player.pokedex.seen_count),302,154,1,baseColor,shadowColor], [_INTL("Time"),34,202,0,baseColor,shadowColor], [time,302,202,1,baseColor,shadowColor], [_INTL("Started"),34,250,0,baseColor,shadowColor], @@ -67,7 +67,7 @@ class PokemonTrainerCard_Scene region = pbGetCurrentRegion(0) # Get the current region imagePositions = [] for i in 0...8 - if $Trainer.badges[i+region*8] + if $player.badges[i+region*8] imagePositions.push(["Graphics/Pictures/Trainer Card/icon_badges",x,310,i*32,region*32,32,32]) end x += 48 diff --git a/Data/Scripts/016_UI/014_UI_Save.rb b/Data/Scripts/016_UI/014_UI_Save.rb index 2d98e128a..5dd3de5c8 100644 --- a/Data/Scripts/016_UI/014_UI_Save.rb +++ b/Data/Scripts/016_UI/014_UI_Save.rb @@ -2,7 +2,7 @@ def pbEmergencySave oldscene = $scene $scene = nil pbMessage(_INTL("The script is taking too long. The game will restart.")) - return if !$Trainer + return if !$player if SaveData.exists? File.open(SaveData::FILE_PATH, 'rb') do |r| File.open(SaveData::FILE_PATH + '.bak', 'wb') do |w| @@ -32,18 +32,18 @@ class PokemonSave_Scene hour = totalsec / 60 / 60 min = totalsec / 60 % 60 mapname=$game_map.name - textColor = ["0070F8,78B8E8","E82010,F8A8B8","0070F8,78B8E8"][$Trainer.gender] + textColor = ["0070F8,78B8E8","E82010,F8A8B8","0070F8,78B8E8"][$player.gender] locationColor = "209808,90F090" # green loctext=_INTL("{2}",locationColor,mapname) - loctext+=_INTL("Player{2}
",textColor,$Trainer.name) + loctext+=_INTL("Player{2}
",textColor,$player.name) if hour>0 loctext+=_INTL("Time{2}h {3}m
",textColor,hour,min) else loctext+=_INTL("Time{2}m
",textColor,min) end - loctext+=_INTL("Badges{2}
",textColor,$Trainer.badge_count) - if $Trainer.has_pokedex - loctext+=_INTL("Pokédex{2}/{3}",textColor,$Trainer.pokedex.owned_count,$Trainer.pokedex.seen_count) + loctext+=_INTL("Badges{2}
",textColor,$player.badge_count) + if $player.has_pokedex + loctext+=_INTL("Pokédex{2}/{3}",textColor,$player.pokedex.owned_count,$player.pokedex.seen_count) end @sprites["locwindow"]=Window_AdvancedTextPokemon.new(loctext) @sprites["locwindow"].viewport=@viewport @@ -97,7 +97,7 @@ class PokemonSaveScreen $PokemonTemp.begunNewGame = false pbSEPlay('GUI save choice') if Game.save - pbMessage(_INTL("\\se[]{1} saved the game.\\me[GUI save game]\\wtnp[30]", $Trainer.name)) + pbMessage(_INTL("\\se[]{1} saved the game.\\me[GUI save game]\\wtnp[30]", $player.name)) ret = true else pbMessage(_INTL("\\se[]Save failed.\\wtnp[30]")) diff --git a/Data/Scripts/016_UI/016_UI_ReadyMenu.rb b/Data/Scripts/016_UI/016_UI_ReadyMenu.rb index 98f8c743c..0489ccf23 100644 --- a/Data/Scripts/016_UI/016_UI_ReadyMenu.rb +++ b/Data/Scripts/016_UI/016_UI_ReadyMenu.rb @@ -21,7 +21,7 @@ class ReadyMenuButton < SpriteWrapper self.bitmap = @contents pbSetSystemFont(self.bitmap) if @command[2] - @icon = PokemonIconSprite.new($Trainer.party[@command[3]],viewport) + @icon = PokemonIconSprite.new($player.party[@command[3]], viewport) @icon.setOffset(PictureOrigin::Center) else @icon = ItemIconSprite.new(0,0,@command[0],viewport) @@ -256,7 +256,7 @@ class PokemonReadyMenu break if command==-1 if command[0]==0 # Use a move move = commands[0][command[1]][0] - user = $Trainer.party[commands[0][command[1]][3]] + user = $player.party[commands[0][command[1]][3]] if move == :FLY ret = nil pbFadeOutInWithUpdate(99999,@scene.sprites) { @@ -306,7 +306,7 @@ def pbUseKeyItem :WATERFALL, :WHIRLPOOL] real_moves = [] moves.each do |move| - $Trainer.pokemon_party.each_with_index do |pkmn, i| + $player.pokemon_party.each_with_index do |pkmn, i| next if !pkmn.hasMove?(move) real_moves.push([move, i]) if pbCanUseHiddenMove?(pkmn, move, false) end diff --git a/Data/Scripts/016_UI/019_UI_PC.rb b/Data/Scripts/016_UI/019_UI_PC.rb index 8f2587fa4..f1fe594d9 100644 --- a/Data/Scripts/016_UI/019_UI_PC.rb +++ b/Data/Scripts/016_UI/019_UI_PC.rb @@ -7,11 +7,11 @@ class TrainerPC end def name - return _INTL("{1}'s PC",$Trainer.name) + return _INTL("{1}'s PC", $player.name) end def access - pbMessage(_INTL("\\se[PC access]Accessed {1}'s PC.",$Trainer.name)) + pbMessage(_INTL("\\se[PC access]Accessed {1}'s PC.", $player.name)) pbTrainerPCMenu end end @@ -25,7 +25,7 @@ class StorageSystemPC end def name - if $Trainer.seen_storage_creator + if $player.seen_storage_creator return _INTL("{1}'s PC",pbGetStorageCreator) else return _INTL("Someone's PC") @@ -201,7 +201,7 @@ def pbPCMailbox when 2 # Give pbFadeOutIn { sscene = PokemonParty_Scene.new - sscreen = PokemonPartyScreen.new(sscene,$Trainer.party) + sscreen = PokemonPartyScreen.new(sscene, $player.party) sscreen.pbPokemonGiveMailScreen(mailIndex) } end @@ -229,13 +229,13 @@ def pbTrainerPCMenu end def pbTrainerPC - pbMessage(_INTL("\\se[PC open]{1} booted up the PC.",$Trainer.name)) + pbMessage(_INTL("\\se[PC open]{1} booted up the PC.", $player.name)) pbTrainerPCMenu pbSEPlay("PC close") end def pbPokeCenterPC - pbMessage(_INTL("\\se[PC open]{1} booted up the PC.",$Trainer.name)) + pbMessage(_INTL("\\se[PC open]{1} booted up the PC.", $player.name)) command = 0 loop do commands = PokemonPCList.getCommandList diff --git a/Data/Scripts/016_UI/020_UI_PokeMart.rb b/Data/Scripts/016_UI/020_UI_PokeMart.rb index 064b13f74..6dc04cc16 100644 --- a/Data/Scripts/016_UI/020_UI_PokeMart.rb +++ b/Data/Scripts/016_UI/020_UI_PokeMart.rb @@ -3,7 +3,7 @@ #=============================================================================== class PokemonMartAdapter def getMoney - return $Trainer.money + return $player.money end def getMoneyString @@ -11,7 +11,7 @@ class PokemonMartAdapter end def setMoney(value) - $Trainer.money=value + $player.money = value end def getInventory diff --git a/Data/Scripts/016_UI/022_UI_PurifyChamber.rb b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb index c25cd871d..0bf128e3a 100644 --- a/Data/Scripts/016_UI/022_UI_PurifyChamber.rb +++ b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb @@ -1299,7 +1299,7 @@ end # #=============================================================================== def pbPurifyChamber - $Trainer.seen_purify_chamber = true + $player.seen_purify_chamber = true pbFadeOutIn { scene = PurifyChamberScene.new screen = PurifyChamberScreen.new(scene) @@ -1312,7 +1312,7 @@ end #=============================================================================== class PurifyChamberPC def shouldShow? - return $Trainer.seen_purify_chamber + return $player.seen_purify_chamber end def name diff --git a/Data/Scripts/016_UI/023_UI_MysteryGift.rb b/Data/Scripts/016_UI/023_UI_MysteryGift.rb index 3fa8f04da..ace713f31 100644 --- a/Data/Scripts/016_UI/023_UI_MysteryGift.rb +++ b/Data/Scripts/016_UI/023_UI_MysteryGift.rb @@ -194,18 +194,18 @@ def pbManageMysteryGifts newgift=pbEditMysteryGift(gift[1],gift[2],gift[0],gift[3]) master[command]=newgift if newgift elsif cmd==2 # Receive - if !$Trainer + if !$player pbMessage(_INTL("There is no save file loaded. Cannot receive any gifts.")) next end replaced=false - for i in 0...$Trainer.mystery_gifts.length - if $Trainer.mystery_gifts[i][0]==gift[0] - $Trainer.mystery_gifts[i]=gift + for i in 0...$player.mystery_gifts.length + if $player.mystery_gifts[i][0]==gift[0] + $player.mystery_gifts[i]=gift replaced=true end end - $Trainer.mystery_gifts.push(gift) if !replaced + $player.mystery_gifts.push(gift) if !replaced pbReceiveMysteryGift(gift[0]) elsif cmd==3 # Delete master.delete_at(command) if pbConfirmMessage(_INTL("Are you sure you want to delete this gift?")) @@ -355,7 +355,7 @@ end # Collecting a Mystery Gift from the deliveryman. #=============================================================================== def pbNextMysteryGiftID - for i in $Trainer.mystery_gifts + for i in $player.mystery_gifts return i[0] if i.length>1 end return 0 @@ -363,8 +363,8 @@ end def pbReceiveMysteryGift(id) index=-1 - for i in 0...$Trainer.mystery_gifts.length - if $Trainer.mystery_gifts[i][0]==id && $Trainer.mystery_gifts[i].length>1 + for i in 0...$player.mystery_gifts.length + if $player.mystery_gifts[i][0]==id && $player.mystery_gifts[i].length>1 index=i break end @@ -373,7 +373,7 @@ def pbReceiveMysteryGift(id) pbMessage(_INTL("Couldn't find an unclaimed Mystery Gift with ID {1}.",id)) return false end - gift=$Trainer.mystery_gifts[index] + gift=$player.mystery_gifts[index] if gift[1]==0 # Pokémon gift[2].personalID = rand(2**16) | rand(2**16) << 16 gift[2].calc_stats @@ -389,8 +389,8 @@ def pbReceiveMysteryGift(id) gift[2].obtain_level=gift[2].level end if pbAddPokemonSilent(gift[2]) - pbMessage(_INTL("\\me[Pkmn get]{1} received {2}!",$Trainer.name,gift[2].name)) - $Trainer.mystery_gifts[index]=[id] + pbMessage(_INTL("\\me[Pkmn get]{1} received {2}!",$player.name,gift[2].name)) + $player.mystery_gifts[index]=[id] return true end elsif gift[1]>0 # Item @@ -412,7 +412,7 @@ def pbReceiveMysteryGift(id) else pbMessage(_INTL("\\me[Item get]You obtained a \\c[1]{1}\\c[0]!\\wtnp[30]",itemname)) end - $Trainer.mystery_gifts[index]=[id] + $player.mystery_gifts[index]=[id] return true end end diff --git a/Data/Scripts/016_UI/024_UI_TextEntry.rb b/Data/Scripts/016_UI/024_UI_TextEntry.rb index 666dd3a00..d6376f255 100644 --- a/Data/Scripts/016_UI/024_UI_TextEntry.rb +++ b/Data/Scripts/016_UI/024_UI_TextEntry.rb @@ -120,7 +120,7 @@ class PokemonEntryScene addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport) case subject when 1 # Player - meta = GameData::PlayerMetadata.get($Trainer.character_ID) + meta = GameData::PlayerMetadata.get($player.character_ID) if meta @sprites["shadow"]=IconSprite.new(0,0,@viewport) @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @@ -405,7 +405,7 @@ class PokemonEntryScene2 @sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg") case subject when 1 # Player - meta = GameData::PlayerMetadata.get($Trainer.character_ID) + meta = GameData::PlayerMetadata.get($player.character_ID) if meta @sprites["shadow"] = IconSprite.new(0, 0, @viewport) @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") diff --git a/Data/Scripts/017_Minigames/001_Minigame_Duel.rb b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb index 29346159a..382d35c94 100644 --- a/Data/Scripts/017_Minigames/001_Minigame_Duel.rb +++ b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb @@ -49,10 +49,10 @@ class PokemonDuel @viewport.z = 99999 @sprites = {} @sprites["player"] = IconSprite.new(-128 - 32, 96, @viewport) - @sprites["player"].setBitmap(GameData::TrainerType.front_sprite_filename($Trainer.trainer_type)) + @sprites["player"].setBitmap(GameData::TrainerType.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($Trainer.name, false) + @sprites["playerwindow"] = DuelWindow.new($player.name, false) @sprites["playerwindow"].x = -@sprites["playerwindow"].width @sprites["playerwindow"].viewport = @viewport @sprites["opponentwindow"] = DuelWindow.new(opponent.name, true) diff --git a/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb index 1d79b4645..1c83500c7 100644 --- a/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb +++ b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb @@ -723,7 +723,7 @@ class TriadScreen count += item[1] # Add item count to total count end @board = [] - @playerName = $Trainer ? $Trainer.name : "Trainer" + @playerName = $player ? $player.name : "Trainer" @opponentName = opponentName type_keys = GameData::Type.keys for i in 0...@width*@height @@ -781,7 +781,7 @@ class TriadScreen total = triad.north + triad.south + triad.east + triad.west # Add random species and its total point count candidates.push([card, total]) - if candidates.length < 200 && $Trainer.owned?(card_data.species) + if candidates.length < 200 && $player.owned?(card_data.species) # Add again if player owns the species candidates.push([card, total]) end @@ -1059,7 +1059,7 @@ def pbBuyTriads commands = [] realcommands = [] GameData::Species.each_species do |s| - next if !$Trainer.owned?(s.species) + next if !$player.owned?(s.species) price = TriadCard.new(s.id).price commands.push([price, s.name, _INTL("{1} - ${2}", s.name, price.to_s_formatted), s.id]) end @@ -1107,11 +1107,11 @@ def pbBuyTriads itemname = commands[cmdwindow.index][1] cmdwindow.active = false cmdwindow.update - if $Trainer.money99 params = ChooseNumberParams.new params.setRange(1,maxafford) @@ -1122,7 +1122,7 @@ def pbBuyTriads next if quantity<=0 price *= quantity next if !pbConfirmMessage(_INTL("{1}, and you want {2}. That will be ${3}. OK?",itemname,quantity,price.to_s_formatted)) - if $Trainer.money= Settings::MAX_COINS + if $player.coins >= Settings::MAX_COINS pbMessage(_INTL("You've gathered {1} Coins. You cannot gather any more.", Settings::MAX_COINS.to_s_formatted)) - $Trainer.coins = Settings::MAX_COINS # As a precaution + $player.coins = Settings::MAX_COINS # As a precaution @quit=true -# elsif !pbConfirmMessage(_INTL("Play Voltorb Flip Lv. {1}?",@level)) && $Trainer.coins