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

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