Renamed $Trainer to $player

This commit is contained in:
Maruno17
2021-10-20 22:57:43 +01:00
parent fbddb9034f
commit e49cd8d498
71 changed files with 470 additions and 470 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -355,7 +355,7 @@ class Interpreter
end
def pbGetPokemon(id)
return $Trainer.party[pbGet(id)]
return $player.party[pbGet(id)]
end
def pbSetEventTime(*arg)

View File

@@ -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

View File

@@ -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 &&

View File

@@ -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<ar>{1}</ar>",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<ar>{1}</ar>", 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) { "<c2="+$1+">" }
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,"<c3=3050C8,D0D0C8>")
text.gsub!(/\\r/i,"<c3=E00808,D0D0C8>")
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) { "<c2=" + $1 + ">" }
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, "<c3=3050C8,D0D0C8>")
text.gsub!(/\\r/i, "<c3=E00808,D0D0C8>")
text.gsub!(/\\[Ww]\[([^\]]*)\]/) {
w = $1.to_s
if w==""

View File

@@ -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)
}
})

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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?

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)]

View File

@@ -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]

View File

@@ -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
}

View File

@@ -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

View File

@@ -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

View File

@@ -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 <icon=bagPocket{3}>\\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

View File

@@ -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

View File

@@ -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?

View File

@@ -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))

View File

@@ -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

View File

@@ -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

View File

@@ -385,7 +385,7 @@ MultipleForms.register(:GRENINJA,{
MultipleForms.register(:SCATTERBUG,{
"getFormOnCreation" => proc { |pkmn|
next $Trainer.secret_ID % 18
next $player.secret_ID % 18
}
})

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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<r>{1}<br>",$Trainer.name)
pubid=sprintf("%05d", $player.public_ID)
lefttext= _INTL("Name<r>{1}<br>", $player.name)
lefttext+=_INTL("IDNo.<r>{1}<br>",pubid)
lefttext+=_ISPRINTF("Time<r>{1:02d}:{2:02d}<br>",hour,min)
lefttext+=_INTL("Pokédex<r>{1}/{2}<br>",
$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

View File

@@ -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
}

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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
}

View File

@@ -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")

View File

@@ -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

View File

@@ -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

View File

@@ -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("<ac><c3={1}>{2}</c3></ac>",locationColor,mapname)
loctext+=_INTL("Player<r><c3={1}>{2}</c3><br>",textColor,$Trainer.name)
loctext+=_INTL("Player<r><c3={1}>{2}</c3><br>",textColor,$player.name)
if hour>0
loctext+=_INTL("Time<r><c3={1}>{2}h {3}m</c3><br>",textColor,hour,min)
else
loctext+=_INTL("Time<r><c3={1}>{2}m</c3><br>",textColor,min)
end
loctext+=_INTL("Badges<r><c3={1}>{2}</c3><br>",textColor,$Trainer.badge_count)
if $Trainer.has_pokedex
loctext+=_INTL("Pokédex<r><c3={1}>{2}/{3}</c3>",textColor,$Trainer.pokedex.owned_count,$Trainer.pokedex.seen_count)
loctext+=_INTL("Badges<r><c3={1}>{2}</c3><br>",textColor,$player.badge_count)
if $player.has_pokedex
loctext+=_INTL("Pokédex<r><c3={1}>{2}/{3}</c3>",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]"))

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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")

View File

@@ -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)

View File

@@ -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.money<price
if $player.money<price
pbMessage(_INTL("You don't have enough money."))
next
end
maxafford = (price<=0) ? 99 : $Trainer.money/price
maxafford = (price<=0) ? 99 : $player.money/price
maxafford = 99 if maxafford>99
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<price
if $player.money<price
pbMessage(_INTL("You don't have enough money."))
next
end
@@ -1131,7 +1131,7 @@ def pbBuyTriads
next
end
$PokemonGlobal.triads.add(item, quantity)
$Trainer.money -= price
$player.money -= price
goldwindow.text = _INTL("Money:\r\n{1}",pbGetGoldString)
pbMessage(_INTL("Here you are! Thank you!\\se[Mart buy item]"))
end
@@ -1222,7 +1222,7 @@ def pbSellTriads
price /= 4
price *= quantity
if pbConfirmMessage(_INTL("I can pay ${1}. Would that be OK?",price.to_s_formatted))
$Trainer.money += price
$player.money += price
goldwindow.text = _INTL("Money:\r\n{1}",pbGetGoldString)
$PokemonGlobal.triads.remove(item,quantity)
pbMessage(_INTL("Turned over the {1} card and received ${2}.\\se[Mart buy item]",itemname,price.to_s_formatted))

View File

@@ -269,7 +269,7 @@ class SlotMachineScene
@sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/insert"))
@sprites["window1"].src_rect.set(0,0,152,208)
@sprites["window2"]=IconSprite.new(358,96,@viewport)
@sprites["credit"]=SlotMachineScore.new(360,66,$Trainer.coins)
@sprites["credit"]=SlotMachineScore.new(360,66,$player.coins)
@sprites["payout"]=SlotMachineScore.new(438,66,0)
@wager=0
update
@@ -289,7 +289,7 @@ class SlotMachineScene
if @sprites["credit"].score == Settings::MAX_COINS
pbMessage(_INTL("You've got {1} Coins.", Settings::MAX_COINS.to_s_formatted))
break
elsif $Trainer.coins==0
elsif $player.coins==0
pbMessage(_INTL("You've run out of Coins.\nGame over!"))
break
elsif @gameRunning # Reels are spinning
@@ -361,7 +361,7 @@ class SlotMachineScene
end
frame = (frame+1)%(Graphics.frame_rate*4)
end
$Trainer.coins = @sprites["credit"].score
$player.coins = @sprites["credit"].score
end
def pbEndScene
@@ -390,9 +390,9 @@ end
def pbSlotMachine(difficulty=1)
if !$bag.has?(:COINCASE)
pbMessage(_INTL("It's a Slot Machine."))
elsif $Trainer.coins == 0
elsif $player.coins == 0
pbMessage(_INTL("You don't have any Coins to play!"))
elsif $Trainer.coins == Settings::MAX_COINS
elsif $player.coins == Settings::MAX_COINS
pbMessage(_INTL("Your Coin Case is full!"))
else
pbFadeOutIn {

View File

@@ -108,11 +108,11 @@ class VoltorbFlip
@sprites["curtainL"].visible=false
@sprites["curtainR"].visible=false
@sprites["curtain"].opacity=100
if $Trainer.coins >= 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<Settings::MAX_COINS
# elsif !pbConfirmMessage(_INTL("Play Voltorb Flip Lv. {1}?",@level)) && $player.coins<Settings::MAX_COINS
# @quit=true
else
@sprites["curtain"].opacity=0
@@ -366,11 +366,11 @@ class VoltorbFlip
pbMessage(_INTL("\\me[Voltorb Flip win]Game clear!\\wtnp[40]"))
# pbMessage(_INTL("You've found all of the hidden x2 and x3 cards."))
# pbMessage(_INTL("This means you've found all the Coins in this game, so the game is now over."))
pbMessage(_INTL("\\se[Voltorb Flip gain coins]{1} received {2} Coins!",$Trainer.name,@points.to_s_formatted))
pbMessage(_INTL("\\se[Voltorb Flip gain coins]{1} received {2} Coins!",$player.name,@points.to_s_formatted))
# Update level text
@sprites["level"].bitmap.clear
pbDrawShadowText(@sprites["level"].bitmap,8,150,118,28,_INTL("Level {1}",@level.to_s),Color.new(60,60,60),Color.new(150,190,170),1)
$Trainer.coins+=@points
$player.coins+=@points
@points=0
pbUpdateCoins
@sprites["curtain"].opacity=0
@@ -413,8 +413,8 @@ class VoltorbFlip
@quit=true
end
elsif pbConfirmMessage(_INTL("If you quit now, you will recieve {1} Coin(s). Will you quit?",@points.to_s_formatted))
pbMessage(_INTL("{1} received {2} Coin(s)!",$Trainer.name,@points.to_s_formatted))
$Trainer.coins+=@points
pbMessage(_INTL("{1} received {2} Coin(s)!",$player.name,@points.to_s_formatted))
$player.coins+=@points
@points=0
pbUpdateCoins
@sprites["curtain"].opacity=0
@@ -479,7 +479,7 @@ class VoltorbFlip
def pbUpdateCoins
# Update coins display
@sprites["totalCoins"].bitmap.clear
pbCreateCoins($Trainer.coins,44)
pbCreateCoins($player.coins,44)
pbDrawImagePositions(@sprites["totalCoins"].bitmap,@coins)
# Update points display
@sprites["currentCoins"].bitmap.clear
@@ -616,7 +616,7 @@ end
def pbVoltorbFlip
if !$bag.has?(:COINCASE)
pbMessage(_INTL("You can't play unless you have a Coin Case."))
elsif $Trainer.coins == Settings::MAX_COINS
elsif $player.coins == Settings::MAX_COINS
pbMessage(_INTL("Your Coin Case is full!"))
else
scene=VoltorbFlip.new

View File

@@ -16,7 +16,7 @@ def pbLottery(winnum,nameVar=2,positionVar=3,matchedVar=4)
winpoke=nil
winpos=0
winmatched=0
for i in $Trainer.party
for i in $player.party
thismatched=0
id=i.owner.public_id
for j in 0...5

View File

@@ -198,7 +198,7 @@ class BattleChallengeData
def setParty(value)
if @inProgress
$Trainer.party = value
$player.party = value
@party = value
else
@party = value
@@ -226,8 +226,8 @@ class BattleChallengeData
@trainers.push(newtrainer) if !found
end
@start = [$game_map.map_id, $game_player.x, $game_player.y]
@oldParty = $Trainer.party
$Trainer.party = @party if @party
@oldParty = $player.party
$player.party = @party if @party
Game.save(safe: true)
end
@@ -270,12 +270,12 @@ class BattleChallengeData
end
def pbCancel
$Trainer.party = @oldParty if @oldParty
$player.party = @oldParty if @oldParty
reset
end
def pbEnd
$Trainer.party = @oldParty
$player.party = @oldParty
return if !@inProgress
save = (@decision != 0)
reset

View File

@@ -12,7 +12,7 @@ end
# Used in events
def pbHasEligible?(*arg)
return pbBattleChallenge.rules.ruleset.hasValidTeam?($Trainer.party)
return pbBattleChallenge.rules.ruleset.hasValidTeam?($player.party)
end
#===============================================================================
@@ -39,7 +39,7 @@ def pbEntryScreen(*arg)
retval = false
pbFadeOutIn {
scene = PokemonParty_Scene.new
screen = PokemonPartyScreen.new(scene, $Trainer.party)
screen = PokemonPartyScreen.new(scene, $player.party)
ret = screen.pbPokemonMultipleEntryScreenEx(pbBattleChallenge.rules.ruleset)
# Set party
pbBattleChallenge.setParty(ret) if ret

View File

@@ -47,16 +47,16 @@ def pbOrganizedBattleEx(opponent, challengedata, endspeech, endspeechwin)
pbMEStop
return true
end
$Trainer.heal_party
$player.heal_party
# Remember original data, to be restored after battle
challengedata = PokemonChallengeRules.new if !challengedata
oldlevels = challengedata.adjustLevels($Trainer.party, opponent.party)
olditems = $Trainer.party.transform { |p| p.item_id }
oldlevels = challengedata.adjustLevels($player.party, opponent.party)
olditems = $player.party.transform { |p| p.item_id }
olditems2 = opponent.party.transform { |p| p.item_id }
# Create the battle scene (the visual side of it)
scene = pbNewBattleScene
# Create the battle class (the mechanics side of it)
battle = challengedata.createBattle(scene, $Trainer, opponent)
battle = challengedata.createBattle(scene, $player, opponent)
battle.internalBattle = false
battle.endSpeeches = [endspeech]
battle.endSpeechesWin = [endspeechwin]
@@ -71,9 +71,9 @@ def pbOrganizedBattleEx(opponent, challengedata, endspeech, endspeechwin)
}
Input.update
# Restore both parties to their original levels
challengedata.unadjustLevels($Trainer.party, opponent.party, oldlevels)
challengedata.unadjustLevels($player.party, opponent.party, oldlevels)
# Heal both parties and restore their original items
$Trainer.party.each_with_index do |pkmn, i|
$player.party.each_with_index do |pkmn, i|
pkmn.heal
pkmn.makeUnmega
pkmn.makeUnprimal

View File

@@ -101,7 +101,7 @@ def pbSafariBattle(species,level)
pkmn = pbGenerateWildPokemon(species,level)
foeParty = [pkmn]
# Calculate who the trainer is
playerTrainer = $Trainer
playerTrainer = $player
# Create the battle scene (the visual side of it)
scene = pbNewBattleScene
# Create the battle class (the mechanics side of it)

View File

@@ -131,7 +131,7 @@ class BugContestState
def pbGetPlaceInfo(place)
cont=@places[place][0]
if cont<0
$game_variables[1]=$Trainer.name
$game_variables[1]=$player.name
else
$game_variables[1]=ContestantNames[cont]
end
@@ -171,9 +171,9 @@ class BugContestState
@lastContest=nil
@timer=Graphics.frame_count
@places=[]
chosenpkmn=$Trainer.party[@chosenPokemon]
for i in 0...$Trainer.party.length
@otherparty.push($Trainer.party[i]) if i!=@chosenPokemon
chosenpkmn=$player.party[@chosenPokemon]
for i in 0...$player.party.length
@otherparty.push($player.party[i]) if i!=@chosenPokemon
end
@contestants=[]
[5,ContestantNames.length].min.times do
@@ -185,7 +185,7 @@ class BugContestState
end
end
end
$Trainer.party=[chosenpkmn]
$player.party=[chosenpkmn]
@decision=0
@ended=false
end
@@ -200,7 +200,7 @@ class BugContestState
def pbEnd(interrupted=false)
return if !@inProgress
for poke in @otherparty
$Trainer.party.push(poke)
$player.party.push(poke)
end
if !interrupted
if @lastPokemon
@@ -329,7 +329,7 @@ Events.onMapChanging += proc { |_sender,e|
}
def pbBugContestStartOver
$Trainer.party.each do |pkmn|
$player.party.each do |pkmn|
pkmn.heal
pkmn.makeUnmega
pkmn.makeUnprimal
@@ -354,8 +354,8 @@ def pbBugContestBattle(species,level)
pkmn = pbGenerateWildPokemon(species,level)
foeParty = [pkmn]
# Calculate who the trainers and their party are
playerTrainer = [$Trainer]
playerParty = $Trainer.party
playerTrainer = [$player]
playerParty = $player.party
playerPartyStarts = [0]
# Create the battle scene (the visual side of it)
scene = pbNewBattleScene

View File

@@ -208,7 +208,7 @@ end
#===============================================================================
# Unused
def pbGetPlayerGraphic
id = $Trainer.character_ID
id = $player.character_ID
return "" if id < 1
meta = GameData::PlayerMetadata.get(id)
return "" if !meta
@@ -223,24 +223,24 @@ def pbChangePlayer(id)
return false if id < 1
meta = GameData::PlayerMetadata.get(id)
return false if !meta
$Trainer.character_ID = id
$Trainer.trainer_type = meta.trainer_type
$player.character_ID = id
$player.trainer_type = meta.trainer_type
$game_player.character_name = meta.walk_charset
end
def pbTrainerName(name = nil, outfit = 0)
pbChangePlayer(1) if $Trainer.character_ID < 1
pbChangePlayer(1) if $player.character_ID < 1
if name.nil?
name = pbEnterPlayerName(_INTL("Your name?"), 0, Settings::MAX_PLAYER_NAME_SIZE)
if name.nil? || name.empty?
player_metadata = GameData::PlayerMetadata.get($Trainer.character_ID)
player_metadata = GameData::PlayerMetadata.get($player.character_ID)
trainer_type = (player_metadata) ? player_metadata.trainer_type : nil
gender = pbGetTrainerTypeGender(trainer_type)
name = pbSuggestTrainerName(gender)
end
end
$Trainer.name = name
$Trainer.outfit = outfit
$player.name = name
$player.outfit = outfit
$PokemonTemp.begunNewGame = true
end
@@ -406,7 +406,7 @@ end
def pbMoveTutorAnnotations(move, movelist = nil)
ret = []
$Trainer.party.each_with_index do |pkmn, i|
$player.party.each_with_index do |pkmn, i|
if pkmn.egg?
ret[i] = _INTL("NOT ABLE")
elsif pkmn.hasMove?(move)
@@ -439,12 +439,12 @@ def pbMoveTutorChoose(move,movelist=nil,bymachine=false,oneusemachine=false)
movename = GameData::Move.get(move).name
annot = pbMoveTutorAnnotations(move,movelist)
scene = PokemonParty_Scene.new
screen = PokemonPartyScreen.new(scene,$Trainer.party)
screen = PokemonPartyScreen.new(scene,$player.party)
screen.pbStartScene(_INTL("Teach which Pokémon?"),false,annot)
loop do
chosen = screen.pbChoosePokemon
break if chosen<0
pokemon = $Trainer.party[chosen]
pokemon = $player.party[chosen]
if pokemon.egg?
pbMessage(_INTL("Eggs can't be taught any moves.")) { screen.pbUpdate }
elsif pokemon.shadowPokemon?

View File

@@ -2,7 +2,7 @@
# Nicknaming and storing Pokémon
#===============================================================================
def pbBoxesFull?
return ($Trainer.party_full? && $PokemonStorage.full?)
return ($player.party_full? && $PokemonStorage.full?)
end
def pbNickname(pkmn)
@@ -20,13 +20,13 @@ def pbStorePokemon(pkmn)
return
end
pkmn.record_first_moves
if $Trainer.party_full?
if $player.party_full?
oldcurbox = $PokemonStorage.currentBox
storedbox = $PokemonStorage.pbStoreCaught(pkmn)
curboxname = $PokemonStorage[oldcurbox].name
boxname = $PokemonStorage[storedbox].name
creator = nil
creator = pbGetStorageCreator if $Trainer.seen_storage_creator
creator = pbGetStorageCreator if $player.seen_storage_creator
if storedbox != oldcurbox
if creator
pbMessage(_INTL("Box \"{1}\" on {2}'s PC was full.\1", curboxname, creator))
@@ -43,7 +43,7 @@ def pbStorePokemon(pkmn)
pbMessage(_INTL("It was stored in box \"{1}.\"", boxname))
end
else
$Trainer.party[$Trainer.party.length] = pkmn
$player.party[$player.party.length] = pkmn
end
end
@@ -53,8 +53,8 @@ def pbNicknameAndStore(pkmn)
pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!"))
return
end
$Trainer.pokedex.set_seen(pkmn.species)
$Trainer.pokedex.set_owned(pkmn.species)
$player.pokedex.set_seen(pkmn.species)
$player.pokedex.set_owned(pkmn.species)
pbNickname(pkmn)
pbStorePokemon(pkmn)
end
@@ -71,22 +71,22 @@ def pbAddPokemon(pkmn, level = 1, see_form = true)
end
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
species_name = pkmn.speciesName
pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $Trainer.name, species_name))
pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $player.name, species_name))
pbNicknameAndStore(pkmn)
$Trainer.pokedex.register(pkmn) if see_form
$player.pokedex.register(pkmn) if see_form
return true
end
def pbAddPokemonSilent(pkmn, level = 1, see_form = true)
return false if !pkmn || pbBoxesFull?
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
$Trainer.pokedex.register(pkmn) if see_form
$Trainer.pokedex.set_owned(pkmn.species)
$player.pokedex.register(pkmn) if see_form
$player.pokedex.set_owned(pkmn.species)
pkmn.record_first_moves
if $Trainer.party_full?
if $player.party_full?
$PokemonStorage.pbStoreCaught(pkmn)
else
$Trainer.party[$Trainer.party.length] = pkmn
$player.party[$player.party.length] = pkmn
end
return true
end
@@ -95,27 +95,27 @@ end
# Giving Pokémon/eggs to the player (can only add to party)
#===============================================================================
def pbAddToParty(pkmn, level = 1, see_form = true)
return false if !pkmn || $Trainer.party_full?
return false if !pkmn || $player.party_full?
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
species_name = pkmn.speciesName
pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $Trainer.name, species_name))
pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $player.name, species_name))
pbNicknameAndStore(pkmn)
$Trainer.pokedex.register(pkmn) if see_form
$player.pokedex.register(pkmn) if see_form
return true
end
def pbAddToPartySilent(pkmn, level = nil, see_form = true)
return false if !pkmn || $Trainer.party_full?
return false if !pkmn || $player.party_full?
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
$Trainer.pokedex.register(pkmn) if see_form
$Trainer.pokedex.set_owned(pkmn.species)
$player.pokedex.register(pkmn) if see_form
$player.pokedex.set_owned(pkmn.species)
pkmn.record_first_moves
$Trainer.party[$Trainer.party.length] = pkmn
$player.party[$player.party.length] = pkmn
return true
end
def pbAddForeignPokemon(pkmn, level = 1, owner_name = nil, nickname = nil, owner_gender = 0, see_form = true)
return false if !pkmn || $Trainer.party_full?
return false if !pkmn || $player.party_full?
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
# Set original trainer to a foreign one
pkmn.owner = Pokemon::Owner.new_foreign(owner_name || "", owner_gender)
@@ -124,18 +124,18 @@ def pbAddForeignPokemon(pkmn, level = 1, owner_name = nil, nickname = nil, owner
# Recalculate stats
pkmn.calc_stats
if owner_name
pbMessage(_INTL("\\me[Pkmn get]{1} received a Pokémon from {2}.\1", $Trainer.name, owner_name))
pbMessage(_INTL("\\me[Pkmn get]{1} received a Pokémon from {2}.\1", $player.name, owner_name))
else
pbMessage(_INTL("\\me[Pkmn get]{1} received a Pokémon.\1", $Trainer.name))
pbMessage(_INTL("\\me[Pkmn get]{1} received a Pokémon.\1", $player.name))
end
pbStorePokemon(pkmn)
$Trainer.pokedex.register(pkmn) if see_form
$Trainer.pokedex.set_owned(pkmn.species)
$player.pokedex.register(pkmn) if see_form
$player.pokedex.set_owned(pkmn.species)
return true
end
def pbGenerateEgg(pkmn, text = "")
return false if !pkmn || $Trainer.party_full?
return false if !pkmn || $player.party_full?
pkmn = Pokemon.new(pkmn, Settings::EGG_LEVEL) if !pkmn.is_a?(Pokemon)
# Set egg's details
pkmn.name = _INTL("Egg")
@@ -143,7 +143,7 @@ def pbGenerateEgg(pkmn, text = "")
pkmn.obtain_text = text
pkmn.calc_stats
# Add egg to party
$Trainer.party[$Trainer.party.length] = pkmn
$player.party[$player.party.length] = pkmn
return true
end
alias pbAddEgg pbGenerateEgg
@@ -154,7 +154,7 @@ alias pbGenEgg pbGenerateEgg
#===============================================================================
# Returns the first unfainted, non-egg Pokémon in the player's party.
def pbFirstAblePokemon(variable_ID)
$Trainer.party.each_with_index do |pkmn, i|
$player.party.each_with_index do |pkmn, i|
next if !pkmn.able?
pbSet(variable_ID, i)
return pkmn

View File

@@ -564,13 +564,13 @@ DebugMenuCommands.register("demoparty", {
for id in species
party.push(id) if GameData::Species.exists?(id)
end
$Trainer.party.clear
$player.party.clear
# Generate Pokémon of each species at level 20
party.each do |species|
pkmn = Pokemon.new(species, 20)
$Trainer.party.push(pkmn)
$Trainer.pokedex.register(pkmn)
$Trainer.pokedex.set_owned(species)
$player.party.push(pkmn)
$player.pokedex.register(pkmn)
$player.pokedex.set_owned(species)
case species
when :PIDGEOTTO
pkmn.learn_move(:FLY)
@@ -602,7 +602,7 @@ DebugMenuCommands.register("healparty", {
"name" => _INTL("Heal Party"),
"description" => _INTL("Fully heal the HP/status/PP of all Pokémon in the party."),
"effect" => proc {
$Trainer.party.each { |pkmn| pkmn.heal }
$player.party.each { |pkmn| pkmn.heal }
pbMessage(_INTL("Your Pokémon were fully healed."))
}
})
@@ -612,7 +612,7 @@ DebugMenuCommands.register("quickhatch", {
"name" => _INTL("Quick Hatch"),
"description" => _INTL("Make all eggs in the party require just one more step to hatch."),
"effect" => proc {
$Trainer.party.each { |pkmn| pkmn.steps_to_hatch = 1 if pkmn.egg? }
$player.party.each { |pkmn| pkmn.steps_to_hatch = 1 if pkmn.egg? }
pbMessage(_INTL("All eggs in your party now require one step to hatch."))
}
})
@@ -632,15 +632,15 @@ DebugMenuCommands.register("fillboxes", {
if f == 0
if species_data.single_gendered?
g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0
$Trainer.pokedex.register(sp, g, f, false)
$player.pokedex.register(sp, g, f, false)
else # Both male and female
$Trainer.pokedex.register(sp, 0, f, false)
$Trainer.pokedex.register(sp, 1, f, false)
$player.pokedex.register(sp, 0, f, false)
$player.pokedex.register(sp, 1, f, false)
end
$Trainer.pokedex.set_owned(sp, false)
$player.pokedex.set_owned(sp, false)
elsif species_data.real_form_name && !species_data.real_form_name.empty?
g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0
$Trainer.pokedex.register(sp, g, f, false)
$player.pokedex.register(sp, g, f, false)
end
# Add Pokémon (if form 0, i.e. one of each species)
next if f != 0
@@ -651,7 +651,7 @@ DebugMenuCommands.register("fillboxes", {
added += 1
$PokemonStorage[(added - 1) / box_qty, (added - 1) % box_qty] = Pokemon.new(sp, 50)
end
$Trainer.pokedex.refresh_accessible_dexes
$player.pokedex.refresh_accessible_dexes
pbMessage(_INTL("Storage boxes were filled with one Pokémon of each species."))
if !completed
pbMessage(_INTL("Note: The number of storage spaces ({1} boxes of {2}) is less than the number of species.",
@@ -707,16 +707,16 @@ DebugMenuCommands.register("setbadges", {
badgecmds.push(_INTL("Give all"))
badgecmds.push(_INTL("Remove all"))
for i in 0...24
badgecmds.push(_INTL("{1} Badge {2}", $Trainer.badges[i] ? "[Y]" : "[ ]", i + 1))
badgecmds.push(_INTL("{1} Badge {2}", $player.badges[i] ? "[Y]" : "[ ]", i + 1))
end
badgecmd = pbShowCommands(nil, badgecmds, -1, badgecmd)
break if badgecmd < 0
if badgecmd == 0 # Give all
24.times { |i| $Trainer.badges[i] = true }
24.times { |i| $player.badges[i] = true }
elsif badgecmd == 1 # Remove all
24.times { |i| $Trainer.badges[i] = false }
24.times { |i| $player.badges[i] = false }
else
$Trainer.badges[badgecmd - 2] = !$Trainer.badges[badgecmd - 2]
$player.badges[badgecmd - 2] = !$player.badges[badgecmd - 2]
end
end
}
@@ -729,9 +729,9 @@ DebugMenuCommands.register("setmoney", {
"effect" => proc {
params = ChooseNumberParams.new
params.setRange(0, Settings::MAX_MONEY)
params.setDefaultValue($Trainer.money)
$Trainer.money = pbMessageChooseNumber(_INTL("Set the player's money."), params)
pbMessage(_INTL("You now have ${1}.", $Trainer.money.to_s_formatted))
params.setDefaultValue($player.money)
$player.money = pbMessageChooseNumber(_INTL("Set the player's money."), params)
pbMessage(_INTL("You now have ${1}.", $player.money.to_s_formatted))
}
})
@@ -742,9 +742,9 @@ DebugMenuCommands.register("setcoins", {
"effect" => proc {
params = ChooseNumberParams.new
params.setRange(0, Settings::MAX_COINS)
params.setDefaultValue($Trainer.coins)
$Trainer.coins = pbMessageChooseNumber(_INTL("Set the player's Coin amount."), params)
pbMessage(_INTL("You now have {1} Coins.", $Trainer.coins.to_s_formatted))
params.setDefaultValue($player.coins)
$player.coins = pbMessageChooseNumber(_INTL("Set the player's Coin amount."), params)
pbMessage(_INTL("You now have {1} Coins.", $player.coins.to_s_formatted))
}
})
@@ -755,9 +755,9 @@ DebugMenuCommands.register("setbp", {
"effect" => proc {
params = ChooseNumberParams.new
params.setRange(0, Settings::MAX_BATTLE_POINTS)
params.setDefaultValue($Trainer.battle_points)
$Trainer.battle_points = pbMessageChooseNumber(_INTL("Set the player's BP amount."), params)
pbMessage(_INTL("You now have {1} BP.", $Trainer.battle_points.to_s_formatted))
params.setDefaultValue($player.battle_points)
$player.battle_points = pbMessageChooseNumber(_INTL("Set the player's BP amount."), params)
pbMessage(_INTL("You now have {1} BP.", $player.battle_points.to_s_formatted))
}
})
@@ -766,9 +766,9 @@ DebugMenuCommands.register("toggleshoes", {
"name" => _INTL("Toggle Running Shoes"),
"description" => _INTL("Toggle possession of running shoes."),
"effect" => proc {
$Trainer.has_running_shoes = !$Trainer.has_running_shoes
pbMessage(_INTL("Gave Running Shoes.")) if $Trainer.has_running_shoes
pbMessage(_INTL("Lost Running Shoes.")) if !$Trainer.has_running_shoes
$player.has_running_shoes = !$player.has_running_shoes
pbMessage(_INTL("Gave Running Shoes.")) if $player.has_running_shoes
pbMessage(_INTL("Lost Running Shoes.")) if !$player.has_running_shoes
}
})
@@ -777,9 +777,9 @@ DebugMenuCommands.register("togglepokegear", {
"name" => _INTL("Toggle Pokégear"),
"description" => _INTL("Toggle possession of the Pokégear."),
"effect" => proc {
$Trainer.has_pokegear = !$Trainer.has_pokegear
pbMessage(_INTL("Gave Pokégear.")) if $Trainer.has_pokegear
pbMessage(_INTL("Lost Pokégear.")) if !$Trainer.has_pokegear
$player.has_pokegear = !$player.has_pokegear
pbMessage(_INTL("Gave Pokégear.")) if $player.has_pokegear
pbMessage(_INTL("Lost Pokégear.")) if !$player.has_pokegear
}
})
@@ -791,23 +791,23 @@ DebugMenuCommands.register("dexlists", {
dexescmd = 0
loop do
dexescmds = []
dexescmds.push(_INTL("Have Pokédex: {1}", $Trainer.has_pokedex ? "[YES]" : "[NO]"))
dexescmds.push(_INTL("Have Pokédex: {1}", $player.has_pokedex ? "[YES]" : "[NO]"))
dex_names = Settings.pokedex_names
for i in 0...dex_names.length
name = (dex_names[i].is_a?(Array)) ? dex_names[i][0] : dex_names[i]
unlocked = $Trainer.pokedex.unlocked?(i)
unlocked = $player.pokedex.unlocked?(i)
dexescmds.push(_INTL("{1} {2}", unlocked ? "[Y]" : "[ ]", name))
end
dexescmd = pbShowCommands(nil, dexescmds, -1, dexescmd)
break if dexescmd < 0
dexindex = dexescmd - 1
if dexindex < 0 # Toggle Pokédex ownership
$Trainer.has_pokedex = !$Trainer.has_pokedex
$player.has_pokedex = !$player.has_pokedex
else # Toggle Regional Dex accessibility
if $Trainer.pokedex.unlocked?(dexindex)
$Trainer.pokedex.lock(dexindex)
if $player.pokedex.unlocked?(dexindex)
$player.pokedex.lock(dexindex)
else
$Trainer.pokedex.unlock(dexindex)
$player.pokedex.unlock(dexindex)
end
end
end
@@ -823,7 +823,7 @@ DebugMenuCommands.register("setplayer", {
cmds = []
ids = []
GameData::PlayerMetadata.each do |player|
index = cmds.length if player.id == $Trainer.character_ID
index = cmds.length if player.id == $player.character_ID
cmds.push(player.id.to_s)
ids.push(player.id)
end
@@ -844,12 +844,12 @@ DebugMenuCommands.register("changeoutfit", {
"name" => _INTL("Set Player Outfit"),
"description" => _INTL("Edit the player's outfit number."),
"effect" => proc {
oldoutfit = $Trainer.outfit
oldoutfit = $player.outfit
params = ChooseNumberParams.new
params.setRange(0, 99)
params.setDefaultValue(oldoutfit)
$Trainer.outfit = pbMessageChooseNumber(_INTL("Set the player's outfit."), params)
pbMessage(_INTL("Player's outfit was changed.")) if $Trainer.outfit != oldoutfit
$player.outfit = pbMessageChooseNumber(_INTL("Set the player's outfit."), params)
pbMessage(_INTL("Player's outfit was changed.")) if $player.outfit != oldoutfit
}
})
@@ -858,17 +858,17 @@ DebugMenuCommands.register("renameplayer", {
"name" => _INTL("Set Player Name"),
"description" => _INTL("Rename the player."),
"effect" => proc {
trname = pbEnterPlayerName("Your name?", 0, Settings::MAX_PLAYER_NAME_SIZE, $Trainer.name)
trname = pbEnterPlayerName("Your name?", 0, Settings::MAX_PLAYER_NAME_SIZE, $player.name)
if nil_or_empty?(trname) && pbConfirmMessage(_INTL("Give yourself a default name?"))
trainertype = $Trainer.trainer_type
trainertype = $player.trainer_type
gender = pbGetTrainerTypeGender(trainertype)
trname = pbSuggestTrainerName(gender)
end
if nil_or_empty?(trname)
pbMessage(_INTL("The player's name remained {1}.", $Trainer.name))
pbMessage(_INTL("The player's name remained {1}.", $player.name))
else
$Trainer.name = trname
pbMessage(_INTL("The player's name was changed to {1}.", $Trainer.name))
$player.name = trname
pbMessage(_INTL("The player's name was changed to {1}.", $player.name))
end
}
})
@@ -878,8 +878,8 @@ DebugMenuCommands.register("randomid", {
"name" => _INTL("Randomize Player ID"),
"description" => _INTL("Generate a random new ID for the player."),
"effect" => proc {
$Trainer.id = rand(2 ** 16) | rand(2 ** 16) << 16
pbMessage(_INTL("The player's ID was changed to {1} (full ID: {2}).", $Trainer.public_ID, $Trainer.id))
$player.id = rand(2 ** 16) | rand(2 ** 16) << 16
pbMessage(_INTL("The player's ID was changed to {1} (full ID: {2}).", $player.public_ID, $player.id))
}
})

View File

@@ -291,7 +291,7 @@ def pbDebugDayCare
when 0 # Withdraw Pokémon 1
if !$PokemonGlobal.daycare[0][0]
pbPlayBuzzerSE
elsif $Trainer.party_full?
elsif $player.party_full?
pbPlayBuzzerSE
pbMessage(_INTL("Party is full, can't withdraw Pokémon."))
else
@@ -303,7 +303,7 @@ def pbDebugDayCare
when 1 # Withdraw Pokémon 2
if !$PokemonGlobal.daycare[1][0]
pbPlayBuzzerSE
elsif $Trainer.party_full?
elsif $player.party_full?
pbPlayBuzzerSE
pbMessage(_INTL("Party is full, can't withdraw Pokémon."))
else
@@ -315,7 +315,7 @@ def pbDebugDayCare
when 2 # Deposit Pokémon
if pbDayCareDeposited==2
pbPlayBuzzerSE
elsif $Trainer.party.length==0
elsif $player.party.length == 0
pbPlayBuzzerSE
pbMessage(_INTL("Party is empty, can't deposit Pokémon."))
else
@@ -344,7 +344,7 @@ def pbDebugDayCare
when 4 # Collect egg
if $PokemonGlobal.daycareEgg!=1
pbPlayBuzzerSE
elsif $Trainer.party_full?
elsif $player.party_full?
pbPlayBuzzerSE
pbMessage(_INTL("Party is full, can't collect the egg."))
else
@@ -352,7 +352,7 @@ def pbDebugDayCare
pbDayCareGenerateEgg
$PokemonGlobal.daycareEgg = 0
$PokemonGlobal.daycareEggSteps = 0
pbMessage(_INTL("Collected the {1} egg.", $Trainer.last_party.speciesName))
pbMessage(_INTL("Collected the {1} egg.", $player.last_party.speciesName))
refresh = true
end
end

View File

@@ -643,7 +643,7 @@ PokemonDebugMenuCommands.register("setitem", {
if item && item != pkmn.item_id
pkmn.item = item
if GameData::Item.get(item).is_mail?
pkmn.mail = Mail.new(item, _INTL("Text"), $Trainer.name)
pkmn.mail = Mail.new(item, _INTL("Text"), $player.name)
end
screen.pbRefreshSingle(pkmnid)
end
@@ -783,7 +783,7 @@ PokemonDebugMenuCommands.register("setgender", {
when 2 # Reset
pkmn.gender = nil
end
$Trainer.pokedex.register(pkmn) if !settingUpBattle
$player.pokedex.register(pkmn) if !settingUpBattle
screen.pbRefreshSingle(pkmnid)
end
end
@@ -811,7 +811,7 @@ PokemonDebugMenuCommands.register("speciesform", {
if species && species != pkmn.species
pkmn.species = species
pkmn.calc_stats
$Trainer.pokedex.register(pkmn) if !settingUpBattle
$player.pokedex.register(pkmn) if !settingUpBattle
screen.pbRefreshSingle(pkmnid)
end
when 1 # Set form
@@ -838,7 +838,7 @@ PokemonDebugMenuCommands.register("speciesform", {
pkmn.forced_form = f
end
pkmn.form = f
$Trainer.pokedex.register(pkmn) if !settingUpBattle
$player.pokedex.register(pkmn) if !settingUpBattle
screen.pbRefreshSingle(pkmnid)
end
end
@@ -998,7 +998,7 @@ PokemonDebugMenuCommands.register("ownership", {
gender = [_INTL("Male"), _INTL("Female"), _INTL("Unknown")][pkmn.owner.gender]
msg = [_INTL("Player's Pokémon\n{1}\n{2}\n{3} ({4})", pkmn.owner.name, gender, pkmn.owner.public_id, pkmn.owner.id),
_INTL("Foreign Pokémon\n{1}\n{2}\n{3} ({4})", pkmn.owner.name, gender, pkmn.owner.public_id, pkmn.owner.id)
][pkmn.foreign?($Trainer) ? 1 : 0]
][pkmn.foreign?($player) ? 1 : 0]
cmd = screen.pbShowCommands(msg, [
_INTL("Make player's"),
_INTL("Set OT's name"),
@@ -1008,7 +1008,7 @@ PokemonDebugMenuCommands.register("ownership", {
break if cmd < 0
case cmd
when 0 # Make player's
pkmn.owner = Pokemon::Owner.new_from_trainer($Trainer)
pkmn.owner = Pokemon::Owner.new_from_trainer($player)
when 1 # Set OT's name
pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, Settings::MAX_PLAYER_NAME_SIZE)
when 2 # Set OT's gender
@@ -1016,7 +1016,7 @@ PokemonDebugMenuCommands.register("ownership", {
[_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender)
pkmn.owner.gender = cmd2 if cmd2 >= 0
when 3 # Random foreign ID
pkmn.owner.id = $Trainer.make_foreign_ID
pkmn.owner.id = $player.make_foreign_ID
when 4 # Set foreign ID
params = ChooseNumberParams.new
params.setRange(0, 65535)

View File

@@ -16,7 +16,8 @@ module Compiler
['pbHasItem?', '$bag.has?'],
['pbCanStore?', '$bag.can_add?'],
['pbStoreItem', '$bag.add'],
['pbStoreAllOrNone', '$bag.add_all']
['pbStoreAllOrNone', '$bag.add_all'],
['$Trainer', '$player']
]
module_function
@@ -858,7 +859,7 @@ module Compiler
ret = false
SCRIPT_REPLACEMENTS.each { |pair| ret = true if script.gsub!(pair[0], pair[1]) }
ret = true if script.gsub!(/\$game_variables\[(\d+)\](?!\s*(?:\=|\!|<|>))/) { |m| "pbGet(" + $~[1] + ")" }
ret = true if script.gsub!(/\$Trainer\.party\[\s*pbGet\((\d+)\)\s*\]/) { |m| "pbGetPokemon(" + $~[1] + ")" }
ret = true if script.gsub!(/\$player\.party\[\s*pbGet\((\d+)\)\s*\]/) { |m| "pbGetPokemon(" + $~[1] + ")" }
return ret
end
@@ -882,7 +883,7 @@ module Compiler
def fix_event_use(event,_mapID,mapData)
return nil if event_is_empty?(event)
changed = false
trainerMoneyRE = /^\s*\$Trainer\.money\s*(<|<=|>|>=)\s*(\d+)\s*$/
trainerMoneyRE = /^\s*\$player\.money\s*(<|<=|>|>=)\s*(\d+)\s*$/
itemBallRE = /^\s*(Kernel\.)?pbItemBall/
# Rewrite event if it looks like a door
changed = true if update_door_event(event,mapData)
@@ -917,7 +918,7 @@ module Compiler
end
script.gsub!(/\s+/,"")
# Using old method of recovering
if script=="foriin$Trainer.partyi.healend"
if script=="foriin$player.partyi.healend"
for j in i..lastScript
list.delete_at(i)
end
@@ -925,7 +926,7 @@ module Compiler
RPG::EventCommand.new(314,list[i].indent,[0]) # Recover All
)
changed=true
elsif script=="pbFadeOutIn(99999){foriin$Trainer.partyi.healend}"
elsif script=="pbFadeOutIn(99999){foriin$player.partyi.healend}"
oldIndent = list[i].indent
for j in i..lastScript
list.delete_at(i)
@@ -1249,7 +1250,7 @@ module Compiler
when 111 # Conditional Branch
if list[i].parameters[0]==12 # script
script = list[i].parameters[1]
if script[trainerMoneyRE] # Compares $Trainer.money with a value
if script[trainerMoneyRE] # Compares $player.money with a value
# Checking money directly
operator = $1
amount = $2.to_i