mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
Renamed $Trainer to $player
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user