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

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