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

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