mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Renamed $Trainer to $player
This commit is contained in:
@@ -214,7 +214,7 @@ module Settings
|
|||||||
# The names of the Pokédex lists, in the order they are defined in the PBS
|
# 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
|
# 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).
|
# 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
|
# 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
|
# 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
|
# page while viewing that Dex list will be the region map of the region the
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
SaveData.register(:player) do
|
SaveData.register(:player) do
|
||||||
ensure_class :Player
|
ensure_class :Player
|
||||||
save_value { $Trainer }
|
save_value { $player }
|
||||||
load_value { |value| $Trainer = value }
|
load_value { |value| $player = $Trainer = value }
|
||||||
new_game_value {
|
new_game_value {
|
||||||
# Get the first defined trainer type as a placeholder
|
# Get the first defined trainer type as a placeholder
|
||||||
trainer_type = GameData::TrainerType.keys.first
|
trainer_type = GameData::TrainerType.keys.first
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ class Interpreter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbGetPokemon(id)
|
def pbGetPokemon(id)
|
||||||
return $Trainer.party[pbGet(id)]
|
return $player.party[pbGet(id)]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbSetEventTime(*arg)
|
def pbSetEventTime(*arg)
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ class Interpreter
|
|||||||
character = get_character(@parameters[1])
|
character = get_character(@parameters[1])
|
||||||
result = (character.direction == @parameters[2]) if character
|
result = (character.direction == @parameters[2]) if character
|
||||||
when 7 # gold
|
when 7 # gold
|
||||||
gold = $Trainer.money
|
gold = $player.money
|
||||||
result = (@parameters[2] == 0) ? (gold >= @parameters[1]) : (gold <= @parameters[1])
|
result = (@parameters[2] == 0) ? (gold >= @parameters[1]) : (gold <= @parameters[1])
|
||||||
# when 8, 9, 10 # item, weapon, armor
|
# when 8, 9, 10 # item, weapon, armor
|
||||||
when 11 # button
|
when 11 # button
|
||||||
@@ -496,8 +496,8 @@ class Interpreter
|
|||||||
when 7 # other
|
when 7 # other
|
||||||
case @parameters[4]
|
case @parameters[4]
|
||||||
when 0 then value = $game_map.map_id # map ID
|
when 0 then value = $game_map.map_id # map ID
|
||||||
when 1 then value = $Trainer.pokemon_party.length # party members
|
when 1 then value = $player.pokemon_party.length # party members
|
||||||
when 2 then value = $Trainer.money # gold
|
when 2 then value = $player.money # gold
|
||||||
# when 3 # steps
|
# when 3 # steps
|
||||||
when 4 then value = Graphics.frame_count / Graphics.frame_rate # play time
|
when 4 then value = Graphics.frame_count / Graphics.frame_rate # play time
|
||||||
when 5 then value = $game_system.timer / Graphics.frame_rate # timer
|
when 5 then value = $game_system.timer / Graphics.frame_rate # timer
|
||||||
@@ -560,7 +560,7 @@ class Interpreter
|
|||||||
def command_125
|
def command_125
|
||||||
value = (@parameters[1] == 0) ? @parameters[2] : $game_variables[@parameters[2]]
|
value = (@parameters[1] == 0) ? @parameters[2] : $game_variables[@parameters[2]]
|
||||||
value = -value if @parameters[0] == 1 # Decrease
|
value = -value if @parameters[0] == 1 # Decrease
|
||||||
$Trainer.money += value
|
$player.money += value
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -931,8 +931,8 @@ class Interpreter
|
|||||||
# * Name Input Processing
|
# * Name Input Processing
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
def command_303
|
def command_303
|
||||||
if $Trainer
|
if $player
|
||||||
$Trainer.name = pbEnterPlayerName(_INTL("Your name?"), 1, @parameters[1], $Trainer.name)
|
$player.name = pbEnterPlayerName(_INTL("Your name?"), 1, @parameters[1], $player.name)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
if $game_actors && $data_actors && $data_actors[@parameters[0]] != nil
|
if $game_actors && $data_actors && $data_actors[@parameters[0]] != nil
|
||||||
@@ -957,7 +957,7 @@ class Interpreter
|
|||||||
def command_314
|
def command_314
|
||||||
if @parameters[0] == 0
|
if @parameters[0] == 0
|
||||||
if Settings::HEAL_STORED_POKEMON # No need to heal stored Pokémon
|
if Settings::HEAL_STORED_POKEMON # No need to heal stored Pokémon
|
||||||
$Trainer.heal_party
|
$player.heal_party
|
||||||
else
|
else
|
||||||
pbEachPokemon { |pkmn, box| pkmn.heal } # Includes party Pokémon
|
pbEachPokemon { |pkmn, box| pkmn.heal } # Includes party Pokémon
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class Game_Player < Game_Character
|
|||||||
return false if $game_temp.in_menu || $game_temp.in_battle ||
|
return false if $game_temp.in_menu || $game_temp.in_battle ||
|
||||||
@move_route_forcing || $game_temp.message_window_showing ||
|
@move_route_forcing || $game_temp.message_window_showing ||
|
||||||
pbMapInterpreterRunning?
|
pbMapInterpreterRunning?
|
||||||
return false if !$Trainer.has_running_shoes && !$PokemonGlobal.diving &&
|
return false if !$player.has_running_shoes && !$PokemonGlobal.diving &&
|
||||||
!$PokemonGlobal.surfing && !$PokemonGlobal.bicycle
|
!$PokemonGlobal.surfing && !$PokemonGlobal.bicycle
|
||||||
return false if jumping?
|
return false if jumping?
|
||||||
return false if pbTerrainTag.must_walk
|
return false if pbTerrainTag.must_walk
|
||||||
@@ -48,7 +48,7 @@ class Game_Player < Game_Character
|
|||||||
end
|
end
|
||||||
|
|
||||||
def set_movement_type(type)
|
def set_movement_type(type)
|
||||||
meta = GameData::PlayerMetadata.get($Trainer&.character_ID || 1)
|
meta = GameData::PlayerMetadata.get($player&.character_ID || 1)
|
||||||
new_charset = nil
|
new_charset = nil
|
||||||
case type
|
case type
|
||||||
when :fishing
|
when :fishing
|
||||||
@@ -491,7 +491,7 @@ end
|
|||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbGetPlayerCharset(charset, trainer = nil, force = false)
|
def pbGetPlayerCharset(charset, trainer = nil, force = false)
|
||||||
trainer = $Trainer if !trainer
|
trainer = $player if !trainer
|
||||||
outfit = (trainer) ? trainer.outfit : 0
|
outfit = (trainer) ? trainer.outfit : 0
|
||||||
if $game_player && $game_player.charsetData && !force
|
if $game_player && $game_player.charsetData && !force
|
||||||
return nil if $game_player.charsetData[0] == trainer.character_ID &&
|
return nil if $game_player.charsetData[0] == trainer.character_ID &&
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ end
|
|||||||
def pbGetMapNameFromId(id)
|
def pbGetMapNameFromId(id)
|
||||||
name = pbGetMessage(MessageTypes::MapNames, id)
|
name = pbGetMessage(MessageTypes::MapNames, id)
|
||||||
name = pbGetBasicMapNameFromId(id) if nil_or_empty?(name)
|
name = pbGetBasicMapNameFromId(id) if nil_or_empty?(name)
|
||||||
name.gsub!(/\\PN/, $Trainer.name) if $Trainer
|
name.gsub!(/\\PN/, $player.name) if $player
|
||||||
return name
|
return name
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -408,7 +408,7 @@ end
|
|||||||
def pbGetGoldString
|
def pbGetGoldString
|
||||||
moneyString=""
|
moneyString=""
|
||||||
begin
|
begin
|
||||||
moneyString=_INTL("${1}",$Trainer.money.to_s_formatted)
|
moneyString=_INTL("${1}", $player.money.to_s_formatted)
|
||||||
rescue
|
rescue
|
||||||
if $data_system.respond_to?("words")
|
if $data_system.respond_to?("words")
|
||||||
moneyString=_INTL("{1} {2}",$game_party.gold,$data_system.words.gold)
|
moneyString=_INTL("{1} {2}",$game_party.gold,$data_system.words.gold)
|
||||||
@@ -436,7 +436,7 @@ def pbDisplayGoldWindow(msgwindow)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbDisplayCoinsWindow(msgwindow,goldwindow)
|
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=Window_AdvancedTextPokemon.new(_INTL("Coins:\n<ar>{1}</ar>",coinString))
|
||||||
coinwindow.setSkin("Graphics/Windowskins/goldskin")
|
coinwindow.setSkin("Graphics/Windowskins/goldskin")
|
||||||
coinwindow.resizeToFit(coinwindow.text,Graphics.width)
|
coinwindow.resizeToFit(coinwindow.text,Graphics.width)
|
||||||
@@ -452,7 +452,7 @@ def pbDisplayCoinsWindow(msgwindow,goldwindow)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbDisplayBattlePointsWindow(msgwindow)
|
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=Window_AdvancedTextPokemon.new(_INTL("Battle Points:\n<ar>{1}</ar>", pointsString))
|
||||||
pointswindow.setSkin("Graphics/Windowskins/goldskin")
|
pointswindow.setSkin("Graphics/Windowskins/goldskin")
|
||||||
pointswindow.resizeToFit(pointswindow.text,Graphics.width)
|
pointswindow.resizeToFit(pointswindow.text,Graphics.width)
|
||||||
@@ -543,14 +543,14 @@ def pbMessageDisplay(msgwindow,message,letterbyletter=true,commandProc=nil)
|
|||||||
next $game_actors[m].name
|
next $game_actors[m].name
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
text.gsub!(/\\pn/i,$Trainer.name) if $Trainer
|
text.gsub!(/\\pn/i, $player.name) if $player
|
||||||
text.gsub!(/\\pm/i,_INTL("${1}",$Trainer.money.to_s_formatted)) if $Trainer
|
text.gsub!(/\\pm/i, _INTL("${1}", $player.money.to_s_formatted)) if $player
|
||||||
text.gsub!(/\\n/i, "\n")
|
text.gsub!(/\\n/i, "\n")
|
||||||
text.gsub!(/\\\[([0-9a-f]{8,8})\]/i) { "<c2=" + $1 + ">" }
|
text.gsub!(/\\\[([0-9a-f]{8,8})\]/i) { "<c2=" + $1 + ">" }
|
||||||
text.gsub!(/\\pg/i,"\\b") if $Trainer && $Trainer.male?
|
text.gsub!(/\\pg/i, "\\b") if $player && $player.male?
|
||||||
text.gsub!(/\\pg/i,"\\r") if $Trainer && $Trainer.female?
|
text.gsub!(/\\pg/i, "\\r") if $player && $player.female?
|
||||||
text.gsub!(/\\pog/i,"\\r") if $Trainer && $Trainer.male?
|
text.gsub!(/\\pog/i, "\\r") if $player && $player.male?
|
||||||
text.gsub!(/\\pog/i,"\\b") if $Trainer && $Trainer.female?
|
text.gsub!(/\\pog/i, "\\b") if $player && $player.female?
|
||||||
text.gsub!(/\\pg/i, "")
|
text.gsub!(/\\pg/i, "")
|
||||||
text.gsub!(/\\pog/i, "")
|
text.gsub!(/\\pog/i, "")
|
||||||
text.gsub!(/\\b/i, "<c3=3050C8,D0D0C8>")
|
text.gsub!(/\\b/i, "<c3=3050C8,D0D0C8>")
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ GameData::Evolution.register({
|
|||||||
:id => :LevelDarkInParty,
|
:id => :LevelDarkInParty,
|
||||||
:parameter => Integer,
|
:parameter => Integer,
|
||||||
:level_up_proc => proc { |pkmn, parameter|
|
: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
|
next false # This is a dummy proc and shouldn't next true
|
||||||
},
|
},
|
||||||
:after_evolution_proc => proc { |pkmn, new_species, parameter, evo_species|
|
: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)
|
next false if !$bag.has?(:POKEBALL)
|
||||||
PokemonEvolutionScene.pbDuplicatePokemon(pkmn, new_species)
|
PokemonEvolutionScene.pbDuplicatePokemon(pkmn, new_species)
|
||||||
$bag.remove(:POKEBALL)
|
$bag.remove(:POKEBALL)
|
||||||
@@ -475,7 +475,7 @@ GameData::Evolution.register({
|
|||||||
:parameter => :Species,
|
:parameter => :Species,
|
||||||
:minimum_level => 1, # Needs any level up
|
:minimum_level => 1, # Needs any level up
|
||||||
:level_up_proc => proc { |pkmn, parameter|
|
:level_up_proc => proc { |pkmn, parameter|
|
||||||
next $Trainer.has_species?(parameter)
|
next $player.has_species?(parameter)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ module GameData
|
|||||||
def is_mail?; return has_flag?("Mail") || has_flag?("IconMail"); end
|
def is_mail?; return has_flag?("Mail") || has_flag?("IconMail"); end
|
||||||
def is_icon_mail?; return 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_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_berry?; return has_flag?("Berry"); end
|
||||||
def is_key_item?; return has_flag?("KeyItem"); end
|
def is_key_item?; return has_flag?("KeyItem"); end
|
||||||
def is_evolution_stone?; return has_flag?("EvolutionStone"); end
|
def is_evolution_stone?; return has_flag?("EvolutionStone"); end
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ module GameData
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.player_front_sprite_filename(tr_type)
|
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))
|
return self.check_file(tr_type, "Graphics/Trainers/", sprintf("_%d", outfit))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ module GameData
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.player_back_sprite_filename(tr_type)
|
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")
|
return self.check_file(tr_type, "Graphics/Trainers/", sprintf("_%d", outfit), "_back")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ module GameData
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.player_map_icon_filename(tr_type)
|
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))
|
return self.check_file(tr_type, "Graphics/Pictures/mapPlayer", sprintf("_%d", outfit))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ module GameData
|
|||||||
end
|
end
|
||||||
# Create trainer object
|
# Create trainer object
|
||||||
trainer = NPCTrainer.new(tr_name, @trainer_type)
|
trainer = NPCTrainer.new(tr_name, @trainer_type)
|
||||||
trainer.id = $Trainer.make_foreign_ID
|
trainer.id = $player.make_foreign_ID
|
||||||
trainer.items = @items.clone
|
trainer.items = @items.clone
|
||||||
trainer.lose_text = self.lose_text
|
trainer.lose_text = self.lose_text
|
||||||
# Create each Pokémon owned by the trainer
|
# Create each Pokémon owned by the trainer
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ class PokeBattle_Battler
|
|||||||
|
|
||||||
def owned?
|
def owned?
|
||||||
return false if !@battle.wildBattle?
|
return false if !@battle.wildBattle?
|
||||||
return $Trainer.owned?(displaySpecies)
|
return $player.owned?(displaySpecies)
|
||||||
end
|
end
|
||||||
alias owned owned?
|
alias owned owned?
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ module PokeBattle_BattleCommon
|
|||||||
# Record the Pokémon's species as owned in the Pokédex
|
# Record the Pokémon's species as owned in the Pokédex
|
||||||
if !pbPlayer.owned?(pkmn.species)
|
if !pbPlayer.owned?(pkmn.species)
|
||||||
pbPlayer.pokedex.set_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))
|
pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.",pkmn.name))
|
||||||
pbPlayer.pokedex.register_last_seen(pkmn)
|
pbPlayer.pokedex.register_last_seen(pkmn)
|
||||||
@scene.pbShowPokedex(pkmn.species)
|
@scene.pbShowPokedex(pkmn.species)
|
||||||
@@ -195,7 +195,7 @@ module PokeBattle_BattleCommon
|
|||||||
# Critical capture check
|
# Critical capture check
|
||||||
if Settings::ENABLE_CRITICAL_CAPTURES
|
if Settings::ENABLE_CRITICAL_CAPTURES
|
||||||
dex_modifier = 0
|
dex_modifier = 0
|
||||||
numOwned = $Trainer.pokedex.owned_count
|
numOwned = $player.pokedex.owned_count
|
||||||
if numOwned>600
|
if numOwned>600
|
||||||
dex_modifier = 5
|
dex_modifier = 5
|
||||||
elsif numOwned>450
|
elsif numOwned>450
|
||||||
|
|||||||
@@ -457,16 +457,16 @@ class PokeBattle_Battle
|
|||||||
# Pass on Pokérus within the party
|
# Pass on Pokérus within the party
|
||||||
if @internalBattle
|
if @internalBattle
|
||||||
infected = []
|
infected = []
|
||||||
$Trainer.party.each_with_index do |pkmn,i|
|
$player.party.each_with_index do |pkmn,i|
|
||||||
infected.push(i) if pkmn.pokerusStage==1
|
infected.push(i) if pkmn.pokerusStage==1
|
||||||
end
|
end
|
||||||
infected.each do |idxParty|
|
infected.each do |idxParty|
|
||||||
strain = $Trainer.party[idxParty].pokerusStrain
|
strain = $player.party[idxParty].pokerusStrain
|
||||||
if idxParty>0 && $Trainer.party[idxParty-1].pokerusStage==0
|
if idxParty > 0 && $player.party[idxParty - 1].pokerusStage == 0
|
||||||
$Trainer.party[idxParty-1].givePokerus(strain) if rand(3)==0 # 33%
|
$player.party[idxParty - 1].givePokerus(strain) if rand(3) == 0 # 33%
|
||||||
end
|
end
|
||||||
if idxParty<$Trainer.party.length-1 && $Trainer.party[idxParty+1].pokerusStage==0
|
if idxParty < $player.party.length - 1 && $player.party[idxParty + 1].pokerusStage == 0
|
||||||
$Trainer.party[idxParty+1].givePokerus(strain) if rand(3)==0 # 33%
|
$player.party[idxParty + 1].givePokerus(strain) if rand(3) == 0 # 33%
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class PokeBattle_FakeBattler
|
|||||||
def captured=(value); end
|
def captured=(value); end
|
||||||
|
|
||||||
def owned?
|
def owned?
|
||||||
return $Trainer.owned?(pokemon.species)
|
return $player.owned?(pokemon.species)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbThis(lowerCase=false)
|
def pbThis(lowerCase=false)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class PokeBattle_RealBattlePeer
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbGetStorageCreatorName
|
def pbGetStorageCreatorName
|
||||||
return pbGetStorageCreator if $Trainer.seen_storage_creator
|
return pbGetStorageCreator if $player.seen_storage_creator
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ def pbStartOver(gameover=false)
|
|||||||
pbBugContestStartOver
|
pbBugContestStartOver
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
$Trainer.heal_party
|
$player.heal_party
|
||||||
if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0
|
if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0
|
||||||
if gameover
|
if gameover
|
||||||
pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, you scurry back to a Pokémon Center."))
|
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
|
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]))
|
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
|
end
|
||||||
$Trainer.heal_party
|
$player.heal_party
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if gameover
|
if gameover
|
||||||
@@ -127,7 +127,7 @@ def pbStartOver(gameover=false)
|
|||||||
$scene.transfer_player if $scene.is_a?(Scene_Map)
|
$scene.transfer_player if $scene.is_a?(Scene_Map)
|
||||||
$game_map.refresh
|
$game_map.refresh
|
||||||
else
|
else
|
||||||
$Trainer.heal_party
|
$player.heal_party
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
pbEraseEscapePoint
|
pbEraseEscapePoint
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Pokérus check
|
# Pokérus check
|
||||||
Events.onMapUpdate += proc { |_sender,_e|
|
Events.onMapUpdate += proc { |_sender,_e|
|
||||||
next if !$Trainer
|
next if !$player
|
||||||
last = $PokemonGlobal.pokerusTime
|
last = $PokemonGlobal.pokerusTime
|
||||||
now = pbGetTimeNow
|
now = pbGetTimeNow
|
||||||
if !last || last.year!=now.year || last.month!=now.month || last.day!=now.day
|
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
|
i.lowerPokerusCount
|
||||||
end
|
end
|
||||||
$PokemonGlobal.pokerusTime = now
|
$PokemonGlobal.pokerusTime = now
|
||||||
@@ -18,7 +18,7 @@ Events.onMapUpdate += proc { |_sender,_e|
|
|||||||
# healed Pokémon has it.
|
# healed Pokémon has it.
|
||||||
def pbPokerus?
|
def pbPokerus?
|
||||||
return false if $game_switches[Settings::SEEN_POKERUS_SWITCH]
|
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
|
return true if i.pokerusStage==1
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
@@ -78,7 +78,7 @@ Events.onStepTaken += proc {
|
|||||||
$PokemonGlobal.happinessSteps = 0 if !$PokemonGlobal.happinessSteps
|
$PokemonGlobal.happinessSteps = 0 if !$PokemonGlobal.happinessSteps
|
||||||
$PokemonGlobal.happinessSteps += 1
|
$PokemonGlobal.happinessSteps += 1
|
||||||
if $PokemonGlobal.happinessSteps>=128
|
if $PokemonGlobal.happinessSteps>=128
|
||||||
for pkmn in $Trainer.able_party
|
for pkmn in $player.able_party
|
||||||
pkmn.changeHappiness("walking") if rand(2)==0
|
pkmn.changeHappiness("walking") if rand(2)==0
|
||||||
end
|
end
|
||||||
$PokemonGlobal.happinessSteps = 0
|
$PokemonGlobal.happinessSteps = 0
|
||||||
@@ -91,7 +91,7 @@ Events.onStepTakenTransferPossible += proc { |_sender,e|
|
|||||||
next if handled[0]
|
next if handled[0]
|
||||||
if $PokemonGlobal.stepcount%4==0 && Settings::POISON_IN_FIELD
|
if $PokemonGlobal.stepcount%4==0 && Settings::POISON_IN_FIELD
|
||||||
flashed = false
|
flashed = false
|
||||||
for i in $Trainer.able_party
|
for i in $player.able_party
|
||||||
if i.status == :POISON && !i.hasAbility?(:IMMUNITY)
|
if i.status == :POISON && !i.hasAbility?(:IMMUNITY)
|
||||||
if !flashed
|
if !flashed
|
||||||
pbFlash(Color.new(255, 0, 0, 128), 8)
|
pbFlash(Color.new(255, 0, 0, 128), 8)
|
||||||
@@ -107,7 +107,7 @@ Events.onStepTakenTransferPossible += proc { |_sender,e|
|
|||||||
i.status = :NONE
|
i.status = :NONE
|
||||||
pbMessage(_INTL("{1} fainted...",i.name))
|
pbMessage(_INTL("{1} fainted...",i.name))
|
||||||
end
|
end
|
||||||
if $Trainer.able_pokemon_count == 0
|
if $player.able_pokemon_count == 0
|
||||||
handled[0] = true
|
handled[0] = true
|
||||||
pbCheckAllFainted
|
pbCheckAllFainted
|
||||||
end
|
end
|
||||||
@@ -117,7 +117,7 @@ Events.onStepTakenTransferPossible += proc { |_sender,e|
|
|||||||
}
|
}
|
||||||
|
|
||||||
def pbCheckAllFainted
|
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 have no more Pokémon that can fight!\1"))
|
||||||
pbMessage(_INTL("You blacked out!"))
|
pbMessage(_INTL("You blacked out!"))
|
||||||
pbBGMFade(1.0)
|
pbBGMFade(1.0)
|
||||||
@@ -135,7 +135,7 @@ Events.onStepTakenFieldMovement += proc { |_sender,e|
|
|||||||
tile_id = map.data[thistile[1],thistile[2],i]
|
tile_id = map.data[thistile[1],thistile[2],i]
|
||||||
next if tile_id == nil
|
next if tile_id == nil
|
||||||
next if GameData::TerrainTag.try_get(map.terrain_tags[tile_id]).id != :SootGrass
|
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
|
# map.data[thistile[1], thistile[2], i] = 0
|
||||||
# $scene.createSingleSpriteset(map.map_id)
|
# $scene.createSingleSpriteset(map.map_id)
|
||||||
break
|
break
|
||||||
@@ -187,7 +187,7 @@ Events.onChangeDirection += proc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def pbBattleOnStepTaken(repel_active)
|
def pbBattleOnStepTaken(repel_active)
|
||||||
return if $Trainer.able_pokemon_count == 0
|
return if $player.able_pokemon_count == 0
|
||||||
return if !$PokemonEncounters.encounter_possible_here?
|
return if !$PokemonEncounters.encounter_possible_here?
|
||||||
encounter_type = $PokemonEncounters.encounter_type
|
encounter_type = $PokemonEncounters.encounter_type
|
||||||
return if !encounter_type
|
return if !encounter_type
|
||||||
|
|||||||
@@ -192,19 +192,19 @@ Events.onStartBattle += proc { |_sender|
|
|||||||
# during battle and may need to evolve afterwards
|
# during battle and may need to evolve afterwards
|
||||||
$PokemonTemp.party_levels_before_battle = []
|
$PokemonTemp.party_levels_before_battle = []
|
||||||
$PokemonTemp.party_critical_hits_dealt = []
|
$PokemonTemp.party_critical_hits_dealt = []
|
||||||
for i in 0...$Trainer.party.length
|
$player.party.each_with_index do |pkmn, i|
|
||||||
$PokemonTemp.party_levels_before_battle[i] = $Trainer.party[i].level
|
$PokemonTemp.party_levels_before_battle[i] = pkmn.level
|
||||||
$PokemonTemp.party_critical_hits_dealt[i] = 0
|
$PokemonTemp.party_critical_hits_dealt[i] = 0
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
def pbCanDoubleBattle?
|
def pbCanDoubleBattle?
|
||||||
return $PokemonGlobal.partner || $Trainer.able_pokemon_count >= 2
|
return $PokemonGlobal.partner || $player.able_pokemon_count >= 2
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbCanTripleBattle?
|
def pbCanTripleBattle?
|
||||||
return true if $Trainer.able_pokemon_count >= 3
|
return true if $player.able_pokemon_count >= 3
|
||||||
return $PokemonGlobal.partner && $Trainer.able_pokemon_count >= 2
|
return $PokemonGlobal.partner && $player.able_pokemon_count >= 2
|
||||||
end
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -214,8 +214,8 @@ def pbWildBattleCore(*args)
|
|||||||
outcomeVar = $PokemonTemp.battleRules["outcomeVar"] || 1
|
outcomeVar = $PokemonTemp.battleRules["outcomeVar"] || 1
|
||||||
canLose = $PokemonTemp.battleRules["canLose"] || false
|
canLose = $PokemonTemp.battleRules["canLose"] || false
|
||||||
# Skip battle if the player has no able Pokémon, or if holding Ctrl in Debug mode
|
# 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 $Trainer.pokemon_count > 0
|
pbMessage(_INTL("SKIPPING BATTLE...")) if $player.pokemon_count > 0
|
||||||
pbSet(outcomeVar,1) # Treat it as a win
|
pbSet(outcomeVar,1) # Treat it as a win
|
||||||
$PokemonTemp.clearBattleRules
|
$PokemonTemp.clearBattleRules
|
||||||
$PokemonGlobal.nextBattleBGM = nil
|
$PokemonGlobal.nextBattleBGM = nil
|
||||||
@@ -249,8 +249,8 @@ def pbWildBattleCore(*args)
|
|||||||
end
|
end
|
||||||
raise _INTL("Expected a level after being given {1}, but one wasn't found.",sp) if sp
|
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
|
# Calculate who the trainers and their party are
|
||||||
playerTrainers = [$Trainer]
|
playerTrainers = [$player]
|
||||||
playerParty = $Trainer.party
|
playerParty = $player.party
|
||||||
playerPartyStarts = [0]
|
playerPartyStarts = [0]
|
||||||
room_for_partner = (foeParty.length > 1)
|
room_for_partner = (foeParty.length > 1)
|
||||||
if !room_for_partner && $PokemonTemp.battleRules["size"] &&
|
if !room_for_partner && $PokemonTemp.battleRules["size"] &&
|
||||||
@@ -263,7 +263,7 @@ def pbWildBattleCore(*args)
|
|||||||
ally.party = $PokemonGlobal.partner[3]
|
ally.party = $PokemonGlobal.partner[3]
|
||||||
playerTrainers.push(ally)
|
playerTrainers.push(ally)
|
||||||
playerParty = []
|
playerParty = []
|
||||||
$Trainer.party.each { |pkmn| playerParty.push(pkmn) }
|
$player.party.each { |pkmn| playerParty.push(pkmn) }
|
||||||
playerPartyStarts.push(playerParty.length)
|
playerPartyStarts.push(playerParty.length)
|
||||||
ally.party.each { |pkmn| playerParty.push(pkmn) }
|
ally.party.each { |pkmn| playerParty.push(pkmn) }
|
||||||
setBattleRule("double") if !$PokemonTemp.battleRules["size"]
|
setBattleRule("double") if !$PokemonTemp.battleRules["size"]
|
||||||
@@ -352,17 +352,17 @@ def pbTrainerBattleCore(*args)
|
|||||||
outcomeVar = $PokemonTemp.battleRules["outcomeVar"] || 1
|
outcomeVar = $PokemonTemp.battleRules["outcomeVar"] || 1
|
||||||
canLose = $PokemonTemp.battleRules["canLose"] || false
|
canLose = $PokemonTemp.battleRules["canLose"] || false
|
||||||
# Skip battle if the player has no able Pokémon, or if holding Ctrl in Debug mode
|
# 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("SKIPPING BATTLE...")) if $DEBUG
|
||||||
pbMessage(_INTL("AFTER WINNING...")) if $DEBUG && $Trainer.able_pokemon_count > 0
|
pbMessage(_INTL("AFTER WINNING...")) if $DEBUG && $player.able_pokemon_count > 0
|
||||||
pbSet(outcomeVar,($Trainer.able_pokemon_count == 0) ? 0 : 1) # Treat it as undecided/a win
|
pbSet(outcomeVar, ($player.able_pokemon_count == 0) ? 0 : 1) # Treat it as undecided/a win
|
||||||
$PokemonTemp.clearBattleRules
|
$PokemonTemp.clearBattleRules
|
||||||
$PokemonGlobal.nextBattleBGM = nil
|
$PokemonGlobal.nextBattleBGM = nil
|
||||||
$PokemonGlobal.nextBattleME = nil
|
$PokemonGlobal.nextBattleME = nil
|
||||||
$PokemonGlobal.nextBattleCaptureME = nil
|
$PokemonGlobal.nextBattleCaptureME = nil
|
||||||
$PokemonGlobal.nextBattleBack = nil
|
$PokemonGlobal.nextBattleBack = nil
|
||||||
pbMEStop
|
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
|
end
|
||||||
# Record information about party Pokémon to be used at the end of battle (e.g.
|
# Record information about party Pokémon to be used at the end of battle (e.g.
|
||||||
# comparing levels for an evolution check)
|
# comparing levels for an evolution check)
|
||||||
@@ -395,8 +395,8 @@ def pbTrainerBattleCore(*args)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Calculate who the player trainer(s) and their party are
|
# Calculate who the player trainer(s) and their party are
|
||||||
playerTrainers = [$Trainer]
|
playerTrainers = [$player]
|
||||||
playerParty = $Trainer.party
|
playerParty = $player.party
|
||||||
playerPartyStarts = [0]
|
playerPartyStarts = [0]
|
||||||
room_for_partner = (foeParty.length > 1)
|
room_for_partner = (foeParty.length > 1)
|
||||||
if !room_for_partner && $PokemonTemp.battleRules["size"] &&
|
if !room_for_partner && $PokemonTemp.battleRules["size"] &&
|
||||||
@@ -409,7 +409,7 @@ def pbTrainerBattleCore(*args)
|
|||||||
ally.party = $PokemonGlobal.partner[3]
|
ally.party = $PokemonGlobal.partner[3]
|
||||||
playerTrainers.push(ally)
|
playerTrainers.push(ally)
|
||||||
playerParty = []
|
playerParty = []
|
||||||
$Trainer.party.each { |pkmn| playerParty.push(pkmn) }
|
$player.party.each { |pkmn| playerParty.push(pkmn) }
|
||||||
playerPartyStarts.push(playerParty.length)
|
playerPartyStarts.push(playerParty.length)
|
||||||
ally.party.each { |pkmn| playerParty.push(pkmn) }
|
ally.party.each { |pkmn| playerParty.push(pkmn) }
|
||||||
setBattleRule("double") if !$PokemonTemp.battleRules["size"]
|
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
|
# then trigger and cause the battle to happen against this first trainer and
|
||||||
# themselves.
|
# themselves.
|
||||||
if !$PokemonTemp.waitingTrainer && pbMapInterpreterRunning? &&
|
if !$PokemonTemp.waitingTrainer && pbMapInterpreterRunning? &&
|
||||||
($Trainer.able_pokemon_count > 1 ||
|
($player.able_pokemon_count > 1 ||
|
||||||
($Trainer.able_pokemon_count > 0 && $PokemonGlobal.partner))
|
($player.able_pokemon_count > 0 && $PokemonGlobal.partner))
|
||||||
thisEvent = pbMapInterpreter.get_character(0)
|
thisEvent = pbMapInterpreter.get_character(0)
|
||||||
# Find all other triggered trainer events
|
# Find all other triggered trainer events
|
||||||
triggeredEvents = $game_player.pbTriggeredTrainerEvents([2],false)
|
triggeredEvents = $game_player.pbTriggeredTrainerEvents([2],false)
|
||||||
@@ -545,13 +545,13 @@ end
|
|||||||
# After battles
|
# After battles
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbAfterBattle(decision,canLose)
|
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.statusCount = 0 if pkmn.status == :POISON # Bad poison becomes regular
|
||||||
pkmn.makeUnmega
|
pkmn.makeUnmega
|
||||||
pkmn.makeUnprimal
|
pkmn.makeUnprimal
|
||||||
end
|
end
|
||||||
if $PokemonGlobal.partner
|
if $PokemonGlobal.partner
|
||||||
$Trainer.heal_party
|
$player.heal_party
|
||||||
$PokemonGlobal.partner[3].each do |pkmn|
|
$PokemonGlobal.partner[3].each do |pkmn|
|
||||||
pkmn.heal
|
pkmn.heal
|
||||||
pkmn.makeUnmega
|
pkmn.makeUnmega
|
||||||
@@ -560,7 +560,7 @@ def pbAfterBattle(decision,canLose)
|
|||||||
end
|
end
|
||||||
if decision==2 || decision==5 # if loss or draw
|
if decision==2 || decision==5 # if loss or draw
|
||||||
if canLose
|
if canLose
|
||||||
$Trainer.party.each { |pkmn| pkmn.heal }
|
$player.party.each { |pkmn| pkmn.heal }
|
||||||
(Graphics.frame_rate/4).times { Graphics.update }
|
(Graphics.frame_rate/4).times { Graphics.update }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -579,7 +579,7 @@ Events.onEndBattle += proc { |_sender,e|
|
|||||||
# Check for blacking out or gaining Pickup/Huney Gather items
|
# Check for blacking out or gaining Pickup/Huney Gather items
|
||||||
case decision
|
case decision
|
||||||
when 1, 4 # Win, capture
|
when 1, 4 # Win, capture
|
||||||
$Trainer.pokemon_party.each do |pkmn|
|
$player.pokemon_party.each do |pkmn|
|
||||||
pbPickup(pkmn)
|
pbPickup(pkmn)
|
||||||
pbHoneyGather(pkmn)
|
pbHoneyGather(pkmn)
|
||||||
end
|
end
|
||||||
@@ -593,7 +593,7 @@ Events.onEndBattle += proc { |_sender,e|
|
|||||||
}
|
}
|
||||||
|
|
||||||
def pbEvolutionCheck
|
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 || pkmn.egg?
|
||||||
next if pkmn.fainted? && !Settings::CHECK_EVOLUTION_FOR_FAINTED_POKEMON
|
next if pkmn.fainted? && !Settings::CHECK_EVOLUTION_FOR_FAINTED_POKEMON
|
||||||
# Find an evolution
|
# Find an evolution
|
||||||
|
|||||||
@@ -194,8 +194,8 @@ SpecialBattleIntroAnimations.register("vs_animation", 50, # Priority 50
|
|||||||
tr_type = foe[0].trainer_type
|
tr_type = foe[0].trainer_type
|
||||||
trainer_bar_graphic = sprintf("vsBar_%s", tr_type.to_s) rescue nil
|
trainer_bar_graphic = sprintf("vsBar_%s", tr_type.to_s) rescue nil
|
||||||
trainer_graphic = sprintf("vsTrainer_%s", tr_type.to_s) rescue nil
|
trainer_graphic = sprintf("vsTrainer_%s", tr_type.to_s) rescue nil
|
||||||
player_tr_type = $Trainer.trainer_type
|
player_tr_type = $player.trainer_type
|
||||||
outfit = $Trainer.outfit
|
outfit = $player.outfit
|
||||||
player_bar_graphic = sprintf("vsBar_%s_%d", player_tr_type.to_s, outfit) rescue nil
|
player_bar_graphic = sprintf("vsBar_%s_%d", player_tr_type.to_s, outfit) rescue nil
|
||||||
if !pbResolveBitmap("Graphics/Transitions/" + player_bar_graphic)
|
if !pbResolveBitmap("Graphics/Transitions/" + player_bar_graphic)
|
||||||
player_bar_graphic = sprintf("vsBar_%s", player_tr_type.to_s) rescue nil
|
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)
|
trainer.tone = Tone.new(0, 0, 0)
|
||||||
trainername = foe[0].name
|
trainername = foe[0].name
|
||||||
textpos = [
|
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)],
|
Color.new(248, 248, 248), Color.new(72, 72, 72)],
|
||||||
[trainername, (Graphics.width / 4) + (Graphics.width / 2), (Graphics.height / 1.5) + 4, 2,
|
[trainername, (Graphics.width / 4) + (Graphics.width / 2), (Graphics.height / 1.5) + 4, 2,
|
||||||
Color.new(248, 248, 248), Color.new(72, 72, 72)]
|
Color.new(248, 248, 248), Color.new(72, 72, 72)]
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class PokemonEncounters
|
|||||||
raise ArgumentError.new(_INTL("Encounter type {1} does not exist", enc_type))
|
raise ArgumentError.new(_INTL("Encounter type {1} does not exist", enc_type))
|
||||||
end
|
end
|
||||||
return false if $game_system.encounter_disabled
|
return false if $game_system.encounter_disabled
|
||||||
return false if !$Trainer
|
return false if !$player
|
||||||
return false if $DEBUG && Input.press?(Input::CTRL)
|
return false if $DEBUG && Input.press?(Input::CTRL)
|
||||||
# Check if enc_type has a defined step chance/encounter table
|
# Check if enc_type has a defined step chance/encounter table
|
||||||
return false if !@step_chances[enc_type] || @step_chances[enc_type] == 0
|
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
|
encounter_chance *= 1.5 if $PokemonMap.whiteFluteUsed
|
||||||
min_steps_needed /= 2 if $PokemonMap.whiteFluteUsed
|
min_steps_needed /= 2 if $PokemonMap.whiteFluteUsed
|
||||||
end
|
end
|
||||||
first_pkmn = $Trainer.first_pokemon
|
first_pkmn = $player.first_pokemon
|
||||||
if first_pkmn
|
if first_pkmn
|
||||||
case first_pkmn.item_id
|
case first_pkmn.item_id
|
||||||
when :CLEANSETAG
|
when :CLEANSETAG
|
||||||
@@ -187,7 +187,7 @@ class PokemonEncounters
|
|||||||
return true if pbPokeRadarOnShakingGrass
|
return true if pbPokeRadarOnShakingGrass
|
||||||
# Repel
|
# Repel
|
||||||
if repel_active
|
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
|
if first_pkmn && enc_data[1] < first_pkmn.level
|
||||||
@chance_accumulator = 0
|
@chance_accumulator = 0
|
||||||
return false
|
return false
|
||||||
@@ -195,7 +195,7 @@ class PokemonEncounters
|
|||||||
end
|
end
|
||||||
# Some abilities make wild encounters less likely if the wild Pokémon is
|
# Some abilities make wild encounters less likely if the wild Pokémon is
|
||||||
# sufficiently weaker than the Pokémon with the ability
|
# sufficiently weaker than the Pokémon with the ability
|
||||||
first_pkmn = $Trainer.first_pokemon
|
first_pkmn = $player.first_pokemon
|
||||||
if first_pkmn
|
if first_pkmn
|
||||||
case first_pkmn.ability_id
|
case first_pkmn.ability_id
|
||||||
when :INTIMIDATE, :KEENEYE
|
when :INTIMIDATE, :KEENEYE
|
||||||
@@ -211,7 +211,7 @@ class PokemonEncounters
|
|||||||
return false if $PokemonTemp.forceSingleBattle
|
return false if $PokemonTemp.forceSingleBattle
|
||||||
return false if pbInSafari?
|
return false if pbInSafari?
|
||||||
return true if $PokemonGlobal.partner
|
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 true if $game_player.pbTerrainTag.double_wild_encounters && rand(100) < 30
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -276,7 +276,7 @@ class PokemonEncounters
|
|||||||
# Static/Magnet Pull prefer wild encounters of certain types, if possible.
|
# 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
|
# 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.
|
# 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
|
if first_pkmn
|
||||||
favored_type = nil
|
favored_type = nil
|
||||||
case first_pkmn.ability_id
|
case first_pkmn.ability_id
|
||||||
@@ -393,7 +393,7 @@ def pbGenerateWildPokemon(species,level,isRoamer=false)
|
|||||||
genwildpoke = Pokemon.new(species,level)
|
genwildpoke = Pokemon.new(species,level)
|
||||||
# Give the wild Pokémon a held item
|
# Give the wild Pokémon a held item
|
||||||
items = genwildpoke.wildHoldItems
|
items = genwildpoke.wildHoldItems
|
||||||
first_pkmn = $Trainer.first_pokemon
|
first_pkmn = $player.first_pokemon
|
||||||
chances = [50,5,1]
|
chances = [50,5,1]
|
||||||
if first_pkmn
|
if first_pkmn
|
||||||
case first_pkmn.ability_id
|
case first_pkmn.ability_id
|
||||||
@@ -417,7 +417,7 @@ def pbGenerateWildPokemon(species,level,isRoamer=false)
|
|||||||
shiny_retries += 2 if $bag.has?(:SHINYCHARM)
|
shiny_retries += 2 if $bag.has?(:SHINYCHARM)
|
||||||
if Settings::HIGHER_SHINY_CHANCES_WITH_NUMBER_BATTLED
|
if Settings::HIGHER_SHINY_CHANCES_WITH_NUMBER_BATTLED
|
||||||
values = [0, 0]
|
values = [0, 0]
|
||||||
case $Trainer.pokedex.battled_count(species)
|
case $player.pokedex.battled_count(species)
|
||||||
when 0...50 then values = [0, 0]
|
when 0...50 then values = [0, 0]
|
||||||
when 50...100 then values = [1, 15]
|
when 50...100 then values = [1, 15]
|
||||||
when 100...200 then values = [2, 20]
|
when 100...200 then values = [2, 20]
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
|
|
||||||
# Make all wild Pokémon shiny while a certain Switch is ON (see Settings).
|
# Make all wild Pokémon shiny while a certain Switch is ON (see Settings).
|
||||||
Events.onWildPokemonCreate += proc { |_sender, e|
|
Events.onWildPokemonCreate += proc { |_sender, e|
|
||||||
pokemon = e[0]
|
pkmn = e[0]
|
||||||
if $game_switches[Settings::SHINY_WILD_POKEMON_SWITCH]
|
if $game_switches[Settings::SHINY_WILD_POKEMON_SWITCH]
|
||||||
pokemon.shiny = true
|
pkmn.shiny = true
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -18,13 +18,13 @@ Events.onWildPokemonCreate += proc { |_sender, e|
|
|||||||
# This is a simple method, and can/should be modified to account for evolutions
|
# 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.
|
# and other such details. Of course, you don't HAVE to use this code.
|
||||||
Events.onWildPokemonCreate += proc { |_sender, e|
|
Events.onWildPokemonCreate += proc { |_sender, e|
|
||||||
pokemon = e[0]
|
pkmn = e[0]
|
||||||
if $game_map.map_id == 51
|
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)
|
new_level = new_level.clamp(1, GameData::GrowthRate.max_level)
|
||||||
pokemon.level = new_level
|
pkmn.level = new_level
|
||||||
pokemon.calc_stats
|
pkmn.calc_stats
|
||||||
pokemon.reset_moves
|
pkmn.reset_moves
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ end
|
|||||||
def pbCheckHiddenMoveBadge(badge=-1,showmsg=true)
|
def pbCheckHiddenMoveBadge(badge=-1,showmsg=true)
|
||||||
return true if badge<0 # No badge requirement
|
return true if badge<0 # No badge requirement
|
||||||
return true if $DEBUG
|
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
|
return true
|
||||||
end
|
end
|
||||||
pbMessage(_INTL("Sorry, a new Badge is required.")) if showmsg
|
pbMessage(_INTL("Sorry, a new Badge is required.")) if showmsg
|
||||||
@@ -187,14 +187,14 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbCut
|
def pbCut
|
||||||
move = :CUT
|
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)
|
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT,false) || (!$DEBUG && !movefinder)
|
||||||
pbMessage(_INTL("This tree looks like it can be cut down."))
|
pbMessage(_INTL("This tree looks like it can be cut down."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
pbMessage(_INTL("This tree looks like it can be cut down!\1"))
|
pbMessage(_INTL("This tree looks like it can be cut down!\1"))
|
||||||
if pbConfirmMessage(_INTL("Would you like to cut it?"))
|
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))
|
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||||
pbHiddenMoveAnimation(movefinder)
|
pbHiddenMoveAnimation(movefinder)
|
||||||
return true
|
return true
|
||||||
@@ -300,13 +300,13 @@ def pbDive
|
|||||||
map_metadata = $game_map.metadata
|
map_metadata = $game_map.metadata
|
||||||
return false if !map_metadata || !map_metadata.dive_map_id
|
return false if !map_metadata || !map_metadata.dive_map_id
|
||||||
move = :DIVE
|
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)
|
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."))
|
pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if pbConfirmMessage(_INTL("The sea is deep here. Would you like to use Dive?"))
|
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))
|
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||||
pbHiddenMoveAnimation(movefinder)
|
pbHiddenMoveAnimation(movefinder)
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
@@ -337,13 +337,13 @@ def pbSurfacing
|
|||||||
end
|
end
|
||||||
return if !surface_map_id
|
return if !surface_map_id
|
||||||
move = :DIVE
|
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)
|
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."))
|
pbMessage(_INTL("Light is filtering down from above. A Pokémon may be able to surface here."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if pbConfirmMessage(_INTL("Light is filtering down from above. Would you like to use Dive?"))
|
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))
|
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||||
pbHiddenMoveAnimation(movefinder)
|
pbHiddenMoveAnimation(movefinder)
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
@@ -494,7 +494,7 @@ HiddenMoveHandlers::UseMove.add(:FLASH,proc { |move,pokemon|
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbCanFly?(pkmn = nil, show_messages = false)
|
def pbCanFly?(pkmn = nil, show_messages = false)
|
||||||
return false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLY, show_messages)
|
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?
|
if $game_player.has_follower?
|
||||||
pbMessage(_INTL("It can't be used when you have someone with you.")) if show_messages
|
pbMessage(_INTL("It can't be used when you have someone with you.")) if show_messages
|
||||||
return false
|
return false
|
||||||
@@ -508,14 +508,14 @@ end
|
|||||||
|
|
||||||
def pbFlyToNewLocation(pkmn = nil, move = :FLY)
|
def pbFlyToNewLocation(pkmn = nil, move = :FLY)
|
||||||
return false if !$PokemonTemp.flydata
|
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
|
if !$DEBUG && !pkmn
|
||||||
$PokemonTemp.flydata = nil
|
$PokemonTemp.flydata = nil
|
||||||
yield if block_given?
|
yield if block_given?
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if !pkmn || !pbHiddenMoveAnimation(pkmn)
|
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))
|
pbMessage(_INTL("{1} used {2}!", name, GameData::Move.get(move).name))
|
||||||
end
|
end
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
@@ -557,7 +557,7 @@ def pbHeadbuttEffect(event=nil)
|
|||||||
event = $game_player.pbFacingEvent(true) if !event
|
event = $game_player.pbFacingEvent(true) if !event
|
||||||
a = (event.x+(event.x/24).floor+1)*(event.y+(event.y/24).floor+1)
|
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
|
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%
|
chance = 1 # ~50%
|
||||||
if a==b # 10%
|
if a==b # 10%
|
||||||
chance = 8
|
chance = 8
|
||||||
@@ -578,13 +578,13 @@ end
|
|||||||
|
|
||||||
def pbHeadbutt(event=nil)
|
def pbHeadbutt(event=nil)
|
||||||
move = :HEADBUTT
|
move = :HEADBUTT
|
||||||
movefinder = $Trainer.get_pokemon_with_move(move)
|
movefinder = $player.get_pokemon_with_move(move)
|
||||||
if !$DEBUG && !movefinder
|
if !$DEBUG && !movefinder
|
||||||
pbMessage(_INTL("A Pokémon could be in this tree. Maybe a Pokémon could shake it."))
|
pbMessage(_INTL("A Pokémon could be in this tree. Maybe a Pokémon could shake it."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if pbConfirmMessage(_INTL("A Pokémon could be in this tree. Would you like to use Headbutt?"))
|
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))
|
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||||
pbHiddenMoveAnimation(movefinder)
|
pbHiddenMoveAnimation(movefinder)
|
||||||
pbHeadbuttEffect(event)
|
pbHeadbuttEffect(event)
|
||||||
@@ -623,13 +623,13 @@ end
|
|||||||
|
|
||||||
def pbRockSmash
|
def pbRockSmash
|
||||||
move = :ROCKSMASH
|
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)
|
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."))
|
pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if pbConfirmMessage(_INTL("This rock appears to be breakable. Would you like to use Rock Smash?"))
|
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))
|
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||||
pbHiddenMoveAnimation(movefinder)
|
pbHiddenMoveAnimation(movefinder)
|
||||||
return true
|
return true
|
||||||
@@ -670,14 +670,14 @@ def pbStrength
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
move = :STRENGTH
|
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)
|
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."))
|
pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside.\1"))
|
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?"))
|
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))
|
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||||
pbHiddenMoveAnimation(movefinder)
|
pbHiddenMoveAnimation(movefinder)
|
||||||
pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!",speciesname))
|
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.pbFacingEvent
|
||||||
return false if $game_player.has_follower?
|
return false if $game_player.has_follower?
|
||||||
move = :SURF
|
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)
|
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,false) || (!$DEBUG && !movefinder)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?"))
|
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))
|
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||||
pbCancelVehicles
|
pbCancelVehicles
|
||||||
pbHiddenMoveAnimation(movefinder)
|
pbHiddenMoveAnimation(movefinder)
|
||||||
@@ -962,13 +962,13 @@ end
|
|||||||
|
|
||||||
def pbWaterfall
|
def pbWaterfall
|
||||||
move = :WATERFALL
|
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)
|
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL,false) || (!$DEBUG && !movefinder)
|
||||||
pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
|
pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if pbConfirmMessage(_INTL("It's a large waterfall. Would you like to use Waterfall?"))
|
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))
|
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
|
||||||
pbHiddenMoveAnimation(movefinder)
|
pbHiddenMoveAnimation(movefinder)
|
||||||
pbAscendWaterfall
|
pbAscendWaterfall
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ def pbFishingEnd
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbFishing(hasEncounter,rodType=1)
|
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 = 20+(25*rodType) # 45, 70, 95
|
||||||
biteChance *= 1.5 if speedup # 67.5, 100, 100
|
biteChance *= 1.5 if speedup # 67.5, 100, 100
|
||||||
hookChance = 100
|
hookChance = 100
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#===============================================================================
|
$player#===============================================================================
|
||||||
# Represents a planted berry. Stored in $PokemonGlobal.eventvars.
|
# Represents a planted berry. Stored in $PokemonGlobal.eventvars.
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class BerryPlantData
|
class BerryPlantData
|
||||||
@@ -358,7 +358,7 @@ def pbBerryPlant
|
|||||||
break if !pbConfirmMessage(_INTL("Want to sprinkle some water with the {1}?",
|
break if !pbConfirmMessage(_INTL("Want to sprinkle some water with the {1}?",
|
||||||
GameData::Item.get(item).name))
|
GameData::Item.get(item).name))
|
||||||
berry_plant.water
|
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
|
if Settings::NEW_BERRY_PLANTS
|
||||||
pbMessage(_INTL("There! All happy!"))
|
pbMessage(_INTL("There! All happy!"))
|
||||||
else
|
else
|
||||||
@@ -419,7 +419,7 @@ def pbBerryPlant
|
|||||||
GameData::Item.get(berry).name))
|
GameData::Item.get(berry).name))
|
||||||
else
|
else
|
||||||
pbMessage(_INTL("{1} planted a {2} in the soft loamy soil.",
|
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
|
end
|
||||||
end
|
end
|
||||||
@@ -449,7 +449,7 @@ def pbPickBerry(berry, qty = 1)
|
|||||||
end
|
end
|
||||||
pocket = berry.pocket
|
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",
|
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
|
if Settings::NEW_BERRY_PLANTS
|
||||||
pbMessage(_INTL("The soil returned to its soft and earthy state."))
|
pbMessage(_INTL("The soil returned to its soft and earthy state."))
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -50,12 +50,12 @@ end
|
|||||||
def pbDayCareDeposit(index)
|
def pbDayCareDeposit(index)
|
||||||
for i in 0...2
|
for i in 0...2
|
||||||
next if $PokemonGlobal.daycare[i][0]
|
next if $PokemonGlobal.daycare[i][0]
|
||||||
pkmn = $Trainer.party[index]
|
pkmn = $player.party[index]
|
||||||
pkmn.heal
|
pkmn.heal
|
||||||
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
||||||
$PokemonGlobal.daycare[i][0] = pkmn
|
$PokemonGlobal.daycare[i][0] = pkmn
|
||||||
$PokemonGlobal.daycare[i][1] = pkmn.level
|
$PokemonGlobal.daycare[i][1] = pkmn.level
|
||||||
$Trainer.party.delete_at(index)
|
$player.party.delete_at(index)
|
||||||
$PokemonGlobal.daycareEgg = 0
|
$PokemonGlobal.daycareEgg = 0
|
||||||
$PokemonGlobal.daycareEggSteps = 0
|
$PokemonGlobal.daycareEggSteps = 0
|
||||||
return
|
return
|
||||||
@@ -66,10 +66,10 @@ end
|
|||||||
def pbDayCareWithdraw(index)
|
def pbDayCareWithdraw(index)
|
||||||
if !$PokemonGlobal.daycare[index][0]
|
if !$PokemonGlobal.daycare[index][0]
|
||||||
raise _INTL("There's no Pokémon here...")
|
raise _INTL("There's no Pokémon here...")
|
||||||
elsif $Trainer.party_full?
|
elsif $player.party_full?
|
||||||
raise _INTL("Can't store the Pokémon...")
|
raise _INTL("Can't store the Pokémon...")
|
||||||
else
|
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][0] = nil
|
||||||
$PokemonGlobal.daycare[index][1] = 0
|
$PokemonGlobal.daycare[index][1] = 0
|
||||||
$PokemonGlobal.daycareEgg = 0
|
$PokemonGlobal.daycareEgg = 0
|
||||||
@@ -155,7 +155,7 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbDayCareGenerateEgg
|
def pbDayCareGenerateEgg
|
||||||
return if pbDayCareDeposited != 2
|
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]
|
pkmn0 = $PokemonGlobal.daycare[0][0]
|
||||||
pkmn1 = $PokemonGlobal.daycare[1][0]
|
pkmn1 = $PokemonGlobal.daycare[1][0]
|
||||||
mother = nil
|
mother = nil
|
||||||
@@ -364,7 +364,7 @@ def pbDayCareGenerateEgg
|
|||||||
egg.steps_to_hatch = egg.species_data.hatch_steps
|
egg.steps_to_hatch = egg.species_data.hatch_steps
|
||||||
egg.givePokerus if rand(65536) < Settings::POKERUS_CHANCE
|
egg.givePokerus if rand(65536) < Settings::POKERUS_CHANCE
|
||||||
# Add egg to party
|
# Add egg to party
|
||||||
$Trainer.party[$Trainer.party.length] = egg
|
$player.party[$player.party.length] = egg
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -568,7 +568,7 @@ def pbUseItem(bag,item,bagscene=nil)
|
|||||||
itm = GameData::Item.get(item)
|
itm = GameData::Item.get(item)
|
||||||
useType = itm.field_use
|
useType = itm.field_use
|
||||||
if itm.is_machine? # TM or TR or HM
|
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."))
|
pbMessage(_INTL("There is no Pokémon."))
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
@@ -584,7 +584,7 @@ def pbUseItem(bag,item,bagscene=nil)
|
|||||||
end
|
end
|
||||||
return 0
|
return 0
|
||||||
elsif useType==1 # Item is usable on a Pokémon
|
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."))
|
pbMessage(_INTL("There is no Pokémon."))
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
@@ -592,14 +592,14 @@ def pbUseItem(bag,item,bagscene=nil)
|
|||||||
annot = nil
|
annot = nil
|
||||||
if itm.is_evolution_stone?
|
if itm.is_evolution_stone?
|
||||||
annot = []
|
annot = []
|
||||||
for pkmn in $Trainer.party
|
for pkmn in $player.party
|
||||||
elig = pkmn.check_evolution_on_use_item(item)
|
elig = pkmn.check_evolution_on_use_item(item)
|
||||||
annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE"))
|
annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
scene = PokemonParty_Scene.new
|
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)
|
screen.pbStartScene(_INTL("Use on which Pokémon?"),false,annot)
|
||||||
loop do
|
loop do
|
||||||
scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
|
scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
|
||||||
@@ -608,7 +608,7 @@ def pbUseItem(bag,item,bagscene=nil)
|
|||||||
ret = false
|
ret = false
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
pkmn = $Trainer.party[chosen]
|
pkmn = $player.party[chosen]
|
||||||
if pbCheckUseOnPokemon(item,pkmn,screen)
|
if pbCheckUseOnPokemon(item,pkmn,screen)
|
||||||
ret = ItemHandlers.triggerUseOnPokemon(item,pkmn,screen)
|
ret = ItemHandlers.triggerUseOnPokemon(item,pkmn,screen)
|
||||||
if ret && itm.consumed_after_use?
|
if ret && itm.consumed_after_use?
|
||||||
|
|||||||
@@ -187,12 +187,12 @@ ItemHandlers::UseInField.add(:ESCAPEROPE,proc { |item|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseInField.add(:SACREDASH,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."))
|
pbMessage(_INTL("There is no Pokémon."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
canrevive = false
|
canrevive = false
|
||||||
for i in $Trainer.pokemon_party
|
for i in $player.pokemon_party
|
||||||
next if !i.fainted?
|
next if !i.fainted?
|
||||||
canrevive = true
|
canrevive = true
|
||||||
break
|
break
|
||||||
@@ -204,15 +204,14 @@ ItemHandlers::UseInField.add(:SACREDASH,proc { |item|
|
|||||||
revived = 0
|
revived = 0
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
scene = PokemonParty_Scene.new
|
scene = PokemonParty_Scene.new
|
||||||
screen = PokemonPartyScreen.new(scene,$Trainer.party)
|
screen = PokemonPartyScreen.new(scene, $player.party)
|
||||||
screen.pbStartScene(_INTL("Using item..."),false)
|
screen.pbStartScene(_INTL("Using item..."),false)
|
||||||
for i in 0...$Trainer.party.length
|
$player.party.each_with_index do |pkmn, i|
|
||||||
if $Trainer.party[i].fainted?
|
next if !pkmn.fainted?
|
||||||
revived += 1
|
revived += 1
|
||||||
$Trainer.party[i].heal
|
pkmn.heal
|
||||||
screen.pbRefreshSingle(i)
|
screen.pbRefreshSingle(i)
|
||||||
screen.pbDisplay(_INTL("{1}'s HP was restored.",$Trainer.party[i].name))
|
screen.pbDisplay(_INTL("{1}'s HP was restored.", pkmn.name))
|
||||||
end
|
|
||||||
end
|
end
|
||||||
if revived==0
|
if revived==0
|
||||||
screen.pbDisplay(_INTL("It won't have any effect."))
|
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|
|
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
|
next true
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1262,7 +1261,7 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
|
|||||||
# Fusing
|
# Fusing
|
||||||
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
||||||
next false if chosen < 0
|
next false if chosen < 0
|
||||||
other_pkmn = $Trainer.party[chosen]
|
other_pkmn = $player.party[chosen]
|
||||||
if pkmn == other_pkmn
|
if pkmn == other_pkmn
|
||||||
scene.pbDisplay(_INTL("It cannot be fused with itself."))
|
scene.pbDisplay(_INTL("It cannot be fused with itself."))
|
||||||
next false
|
next false
|
||||||
@@ -1281,7 +1280,7 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
|
|||||||
newForm = 2 if other_pkmn.isSpecies?(:ZEKROM)
|
newForm = 2 if other_pkmn.isSpecies?(:ZEKROM)
|
||||||
pkmn.setForm(newForm) {
|
pkmn.setForm(newForm) {
|
||||||
pkmn.fused = other_pkmn
|
pkmn.fused = other_pkmn
|
||||||
$Trainer.remove_pokemon_at_index(chosen)
|
$player.remove_pokemon_at_index(chosen)
|
||||||
scene.pbHardRefresh
|
scene.pbHardRefresh
|
||||||
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
||||||
}
|
}
|
||||||
@@ -1296,13 +1295,13 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERSUSED,proc { |item,pkmn,scene|
|
|||||||
elsif pkmn.fainted?
|
elsif pkmn.fainted?
|
||||||
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
|
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
|
||||||
next false
|
next false
|
||||||
elsif $Trainer.party_full?
|
elsif $player.party_full?
|
||||||
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
|
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
# Unfusing
|
# Unfusing
|
||||||
pkmn.setForm(0) {
|
pkmn.setForm(0) {
|
||||||
$Trainer.party[$Trainer.party.length] = pkmn.fused
|
$player.party[$player.party.length] = pkmn.fused
|
||||||
pkmn.fused = nil
|
pkmn.fused = nil
|
||||||
scene.pbHardRefresh
|
scene.pbHardRefresh
|
||||||
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
||||||
@@ -1322,7 +1321,7 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
|
|||||||
# Fusing
|
# Fusing
|
||||||
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
||||||
next false if chosen < 0
|
next false if chosen < 0
|
||||||
other_pkmn = $Trainer.party[chosen]
|
other_pkmn = $player.party[chosen]
|
||||||
if pkmn == other_pkmn
|
if pkmn == other_pkmn
|
||||||
scene.pbDisplay(_INTL("It cannot be fused with itself."))
|
scene.pbDisplay(_INTL("It cannot be fused with itself."))
|
||||||
next false
|
next false
|
||||||
@@ -1338,7 +1337,7 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
|
|||||||
end
|
end
|
||||||
pkmn.setForm(1) {
|
pkmn.setForm(1) {
|
||||||
pkmn.fused = other_pkmn
|
pkmn.fused = other_pkmn
|
||||||
$Trainer.remove_pokemon_at_index(chosen)
|
$player.remove_pokemon_at_index(chosen)
|
||||||
scene.pbHardRefresh
|
scene.pbHardRefresh
|
||||||
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
||||||
}
|
}
|
||||||
@@ -1353,13 +1352,13 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZERUSED,proc { |item,pkmn,scene|
|
|||||||
elsif pkmn.fainted?
|
elsif pkmn.fainted?
|
||||||
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
|
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
|
||||||
next false
|
next false
|
||||||
elsif $Trainer.party_full?
|
elsif $player.party_full?
|
||||||
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
|
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
# Unfusing
|
# Unfusing
|
||||||
pkmn.setForm(0) {
|
pkmn.setForm(0) {
|
||||||
$Trainer.party[$Trainer.party.length] = pkmn.fused
|
$player.party[$player.party.length] = pkmn.fused
|
||||||
pkmn.fused = nil
|
pkmn.fused = nil
|
||||||
scene.pbHardRefresh
|
scene.pbHardRefresh
|
||||||
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
||||||
@@ -1379,7 +1378,7 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
|
|||||||
# Fusing
|
# Fusing
|
||||||
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
||||||
next false if chosen < 0
|
next false if chosen < 0
|
||||||
other_pkmn = $Trainer.party[chosen]
|
other_pkmn = $player.party[chosen]
|
||||||
if pkmn == other_pkmn
|
if pkmn == other_pkmn
|
||||||
scene.pbDisplay(_INTL("It cannot be fused with itself."))
|
scene.pbDisplay(_INTL("It cannot be fused with itself."))
|
||||||
next false
|
next false
|
||||||
@@ -1395,7 +1394,7 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
|
|||||||
end
|
end
|
||||||
pkmn.setForm(2) {
|
pkmn.setForm(2) {
|
||||||
pkmn.fused = other_pkmn
|
pkmn.fused = other_pkmn
|
||||||
$Trainer.remove_pokemon_at_index(chosen)
|
$player.remove_pokemon_at_index(chosen)
|
||||||
scene.pbHardRefresh
|
scene.pbHardRefresh
|
||||||
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
||||||
}
|
}
|
||||||
@@ -1410,13 +1409,13 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZERUSED,proc { |item,pkmn,scene|
|
|||||||
elsif pkmn.fainted?
|
elsif pkmn.fainted?
|
||||||
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
|
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
|
||||||
next false
|
next false
|
||||||
elsif $Trainer.party_full?
|
elsif $player.party_full?
|
||||||
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
|
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
# Unfusing
|
# Unfusing
|
||||||
pkmn.setForm(0) {
|
pkmn.setForm(0) {
|
||||||
$Trainer.party[$Trainer.party.length] = pkmn.fused
|
$player.party[$player.party.length] = pkmn.fused
|
||||||
pkmn.fused = nil
|
pkmn.fused = nil
|
||||||
scene.pbHardRefresh
|
scene.pbHardRefresh
|
||||||
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
||||||
@@ -1436,7 +1435,7 @@ ItemHandlers::UseOnPokemon.add(:REINSOFUNITY, proc { |item, pkmn, scene|
|
|||||||
# Fusing
|
# Fusing
|
||||||
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
||||||
next false if chosen < 0
|
next false if chosen < 0
|
||||||
other_pkmn = $Trainer.party[chosen]
|
other_pkmn = $player.party[chosen]
|
||||||
if pkmn == other_pkmn
|
if pkmn == other_pkmn
|
||||||
scene.pbDisplay(_INTL("It cannot be fused with itself."))
|
scene.pbDisplay(_INTL("It cannot be fused with itself."))
|
||||||
next false
|
next false
|
||||||
@@ -1456,7 +1455,7 @@ ItemHandlers::UseOnPokemon.add(:REINSOFUNITY, proc { |item, pkmn, scene|
|
|||||||
newForm = 2 if other_pkmn.isSpecies?(:SPECTRIER)
|
newForm = 2 if other_pkmn.isSpecies?(:SPECTRIER)
|
||||||
pkmn.setForm(newForm) {
|
pkmn.setForm(newForm) {
|
||||||
pkmn.fused = other_pkmn
|
pkmn.fused = other_pkmn
|
||||||
$Trainer.remove_pokemon_at_index(chosen)
|
$player.remove_pokemon_at_index(chosen)
|
||||||
scene.pbHardRefresh
|
scene.pbHardRefresh
|
||||||
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
||||||
}
|
}
|
||||||
@@ -1471,13 +1470,13 @@ ItemHandlers::UseOnPokemon.add(:REINSOFUNITYUSED, proc { |item, pkmn, scene|
|
|||||||
elsif pkmn.fainted?
|
elsif pkmn.fainted?
|
||||||
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
|
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
|
||||||
next false
|
next false
|
||||||
elsif $Trainer.party_full?
|
elsif $player.party_full?
|
||||||
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
|
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
# Unfusing
|
# Unfusing
|
||||||
pkmn.setForm(0) {
|
pkmn.setForm(0) {
|
||||||
$Trainer.party[$Trainer.party.length] = pkmn.fused
|
$player.party[$player.party.length] = pkmn.fused
|
||||||
pkmn.fused = nil
|
pkmn.fused = nil
|
||||||
scene.pbHardRefresh
|
scene.pbHardRefresh
|
||||||
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def pbPhoneDeleteContact(index)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbPhoneRegisterBattle(message,event,trainertype,trainername,maxbattles)
|
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)
|
return false if !GameData::TrainerType.exists?(trainertype)
|
||||||
trainertype = GameData::TrainerType.get(trainertype).id
|
trainertype = GameData::TrainerType.get(trainertype).id
|
||||||
contact = pbFindPhoneTrainer(trainertype,trainername)
|
contact = pbFindPhoneTrainer(trainertype,trainername)
|
||||||
@@ -132,7 +132,7 @@ end
|
|||||||
# Phone-related counters
|
# Phone-related counters
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
Events.onMapUpdate += proc { |_sender,_e|
|
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
|
# Reset time to next phone call if necessary
|
||||||
if !$PokemonGlobal.phoneTime || $PokemonGlobal.phoneTime<=0
|
if !$PokemonGlobal.phoneTime || $PokemonGlobal.phoneTime<=0
|
||||||
$PokemonGlobal.phoneTime = 20*60*Graphics.frame_rate
|
$PokemonGlobal.phoneTime = 20*60*Graphics.frame_rate
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ end
|
|||||||
|
|
||||||
def pbStoreMail(pkmn,item,message,poke1=nil,poke2=nil,poke3=nil)
|
def pbStoreMail(pkmn,item,message,poke1=nil,poke2=nil,poke3=nil)
|
||||||
raise _INTL("Pokémon already has mail") if pkmn.mail
|
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
|
end
|
||||||
|
|
||||||
def pbDisplayMail(mail,_bearer=nil)
|
def pbDisplayMail(mail,_bearer=nil)
|
||||||
@@ -99,13 +99,13 @@ def pbWriteMail(item,pkmn,pkmnid,scene)
|
|||||||
if message!=""
|
if message!=""
|
||||||
# Store mail if a message was written
|
# Store mail if a message was written
|
||||||
poke1 = poke2 = nil
|
poke1 = poke2 = nil
|
||||||
if $Trainer.party[pkmnid+2]
|
if $player.party[pkmnid+2]
|
||||||
p = $Trainer.party[pkmnid+2]
|
p = $player.party[pkmnid+2]
|
||||||
poke1 = [p.species,p.gender,p.shiny?,p.form,p.shadowPokemon?]
|
poke1 = [p.species,p.gender,p.shiny?,p.form,p.shadowPokemon?]
|
||||||
poke1.push(true) if p.egg?
|
poke1.push(true) if p.egg?
|
||||||
end
|
end
|
||||||
if $Trainer.party[pkmnid+1]
|
if $player.party[pkmnid+1]
|
||||||
p = $Trainer.party[pkmnid+1]
|
p = $player.party[pkmnid+1]
|
||||||
poke2 = [p.species,p.gender,p.shiny?,p.form,p.shadowPokemon?]
|
poke2 = [p.species,p.gender,p.shiny?,p.form,p.shadowPokemon?]
|
||||||
poke2.push(true) if p.egg?
|
poke2.push(true) if p.egg?
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ MultipleForms.register(:GRENINJA,{
|
|||||||
|
|
||||||
MultipleForms.register(:SCATTERBUG,{
|
MultipleForms.register(:SCATTERBUG,{
|
||||||
"getFormOnCreation" => proc { |pkmn|
|
"getFormOnCreation" => proc { |pkmn|
|
||||||
next $Trainer.secret_ID % 18
|
next $player.secret_ID % 18
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ end
|
|||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbRelicStone
|
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."))
|
pbMessage(_INTL("You have no Pokémon that can be purified."))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -157,7 +157,7 @@ def pbRelicStone
|
|||||||
pkmn.able? && pkmn.shadowPokemon? && pkmn.heart_gauge == 0
|
pkmn.able? && pkmn.shadowPokemon? && pkmn.heart_gauge == 0
|
||||||
})
|
})
|
||||||
if $game_variables[1] >= 0
|
if $game_variables[1] >= 0
|
||||||
pbRelicStoneScreen($Trainer.party[$game_variables[1]])
|
pbRelicStoneScreen($player.party[$game_variables[1]])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -408,21 +408,21 @@ end
|
|||||||
# during battle and need to say they're ready to be purified afterwards
|
# during battle and need to say they're ready to be purified afterwards
|
||||||
Events.onStartBattle += proc { |_sender|
|
Events.onStartBattle += proc { |_sender|
|
||||||
$PokemonTemp.heart_gauges = []
|
$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
|
$PokemonTemp.heart_gauges[i] = pkmn.heart_gauge
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.onEndBattle += proc { |_sender,_e|
|
Events.onEndBattle += proc { |_sender,_e|
|
||||||
$PokemonTemp.heart_gauges.each_with_index do |value, i|
|
$PokemonTemp.heart_gauges.each_with_index do |value, i|
|
||||||
pkmn = $Trainer.party[i]
|
pkmn = $player.party[i]
|
||||||
next if !pkmn || !value || value == 0
|
next if !pkmn || !value || value == 0
|
||||||
pkmn.check_ready_to_purify if pkmn.heart_gauge == 0
|
pkmn.check_ready_to_purify if pkmn.heart_gauge == 0
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.onStepTaken += proc {
|
Events.onStepTaken += proc {
|
||||||
for pkmn in $Trainer.able_party
|
for pkmn in $player.able_party
|
||||||
next if pkmn.heart_gauge == 0
|
next if pkmn.heart_gauge == 0
|
||||||
stage = pkmn.heartStage
|
stage = pkmn.heartStage
|
||||||
pkmn.adjustHeart(-1)
|
pkmn.adjustHeart(-1)
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class PokemonStorage
|
|||||||
end
|
end
|
||||||
|
|
||||||
def party
|
def party
|
||||||
$Trainer.party
|
$player.party
|
||||||
end
|
end
|
||||||
|
|
||||||
def party=(_value)
|
def party=(_value)
|
||||||
@@ -123,7 +123,7 @@ class PokemonStorage
|
|||||||
end
|
end
|
||||||
|
|
||||||
def party_full?
|
def party_full?
|
||||||
return $Trainer.party_full?
|
return $player.party_full?
|
||||||
end
|
end
|
||||||
|
|
||||||
def maxBoxes
|
def maxBoxes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Instances of this class are individual Pokémon.
|
# 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
|
class Pokemon
|
||||||
# @return [Symbol] this Pokémon's species
|
# @return [Symbol] this Pokémon's species
|
||||||
@@ -153,7 +153,7 @@ class Pokemon
|
|||||||
@ability = nil
|
@ability = nil
|
||||||
MultipleForms.call("onSetForm", self, value, oldForm)
|
MultipleForms.call("onSetForm", self, value, oldForm)
|
||||||
calc_stats
|
calc_stats
|
||||||
$Trainer.pokedex.register(self) if $Trainer
|
$player.pokedex.register(self) if $player
|
||||||
end
|
end
|
||||||
|
|
||||||
# The same as def form=, but yields to a given block in the middle so that a
|
# 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?
|
yield if block_given?
|
||||||
MultipleForms.call("onSetForm", self, value, oldForm)
|
MultipleForms.call("onSetForm", self, value, oldForm)
|
||||||
calc_stats
|
calc_stats
|
||||||
$Trainer.pokedex.register(self) if $Trainer
|
$player.pokedex.register(self) if $player
|
||||||
end
|
end
|
||||||
|
|
||||||
def form_simple=(value)
|
def form_simple=(value)
|
||||||
@@ -1111,7 +1111,7 @@ class Pokemon
|
|||||||
# @param owner [Owner, Player, NPCTrainer] Pokémon owner (the player by default)
|
# @param owner [Owner, Player, NPCTrainer] Pokémon owner (the player by default)
|
||||||
# @param withMoves [Boolean] whether the Pokémon should have moves
|
# @param withMoves [Boolean] whether the Pokémon should have moves
|
||||||
# @param recheck_form [Boolean] whether to auto-check the form
|
# @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_data = GameData::Species.get(species)
|
||||||
@species = species_data.species
|
@species = species_data.species
|
||||||
@form = species_data.base_form
|
@form = species_data.base_form
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class Pokemon
|
|||||||
# @param language [Integer] owner language
|
# @param language [Integer] owner language
|
||||||
# @return [Owner] foreign Owner object
|
# @return [Owner] foreign Owner object
|
||||||
def self.new_foreign(name = '', gender = 2, language = 2)
|
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
|
end
|
||||||
|
|
||||||
# @param new_id [Integer] new owner ID
|
# @param new_id [Integer] new owner ID
|
||||||
|
|||||||
@@ -191,13 +191,13 @@ end
|
|||||||
def pbHatch(pokemon)
|
def pbHatch(pokemon)
|
||||||
speciesname = pokemon.speciesName
|
speciesname = pokemon.speciesName
|
||||||
pokemon.name = nil
|
pokemon.name = nil
|
||||||
pokemon.owner = Pokemon::Owner.new_from_trainer($Trainer)
|
pokemon.owner = Pokemon::Owner.new_from_trainer($player)
|
||||||
pokemon.happiness = 120
|
pokemon.happiness = 120
|
||||||
pokemon.timeEggHatched = pbGetTimeNow
|
pokemon.timeEggHatched = pbGetTimeNow
|
||||||
pokemon.obtain_method = 1 # hatched from egg
|
pokemon.obtain_method = 1 # hatched from egg
|
||||||
pokemon.hatched_map = $game_map.map_id
|
pokemon.hatched_map = $game_map.map_id
|
||||||
$Trainer.pokedex.register(pokemon)
|
$player.pokedex.register(pokemon)
|
||||||
$Trainer.pokedex.set_owned(pokemon.species)
|
$player.pokedex.set_owned(pokemon.species)
|
||||||
pokemon.record_first_moves
|
pokemon.record_first_moves
|
||||||
if !pbHatchAnimation(pokemon)
|
if !pbHatchAnimation(pokemon)
|
||||||
pbMessage(_INTL("Huh?\1"))
|
pbMessage(_INTL("Huh?\1"))
|
||||||
@@ -213,10 +213,10 @@ def pbHatch(pokemon)
|
|||||||
end
|
end
|
||||||
|
|
||||||
Events.onStepTaken += proc { |_sender,_e|
|
Events.onStepTaken += proc { |_sender,_e|
|
||||||
for egg in $Trainer.party
|
for egg in $player.party
|
||||||
next if egg.steps_to_hatch <= 0
|
next if egg.steps_to_hatch <= 0
|
||||||
egg.steps_to_hatch -= 1
|
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)
|
next if ![:FLAMEBODY, :MAGMAARMOR, :STEAMENGINE].include?(i.ability_id)
|
||||||
egg.steps_to_hatch -= 1
|
egg.steps_to_hatch -= 1
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -588,8 +588,8 @@ class PokemonEvolutionScene
|
|||||||
@pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM)
|
@pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM)
|
||||||
@pokemon.calc_stats
|
@pokemon.calc_stats
|
||||||
# See and own evolved species
|
# See and own evolved species
|
||||||
$Trainer.pokedex.register(@pokemon)
|
$player.pokedex.register(@pokemon)
|
||||||
$Trainer.pokedex.set_owned(@newspecies)
|
$player.pokedex.set_owned(@newspecies)
|
||||||
# Learn moves upon evolution for evolved species
|
# Learn moves upon evolution for evolved species
|
||||||
movelist = @pokemon.getMoveList
|
movelist = @pokemon.getMoveList
|
||||||
for i in movelist
|
for i in movelist
|
||||||
@@ -613,9 +613,9 @@ class PokemonEvolutionScene
|
|||||||
new_pkmn.calc_stats
|
new_pkmn.calc_stats
|
||||||
new_pkmn.heal
|
new_pkmn.heal
|
||||||
# Add duplicate Pokémon to party
|
# Add duplicate Pokémon to party
|
||||||
$Trainer.party.push(new_pkmn)
|
$player.party.push(new_pkmn)
|
||||||
# See and own duplicate Pokémon
|
# See and own duplicate Pokémon
|
||||||
$Trainer.pokedex.register(new_pkmn)
|
$player.pokedex.register(new_pkmn)
|
||||||
$Trainer.pokedex.set_owned(new_species)
|
$player.pokedex.set_owned(new_species)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -198,9 +198,9 @@ end
|
|||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
|
def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
|
||||||
myPokemon = $Trainer.party[pokemonIndex]
|
myPokemon = $player.party[pokemonIndex]
|
||||||
opponent = NPCTrainer.new(trainerName,trainerGender)
|
opponent = NPCTrainer.new(trainerName,trainerGender)
|
||||||
opponent.id = $Trainer.make_foreign_ID
|
opponent.id = $player.make_foreign_ID
|
||||||
yourPokemon = nil
|
yourPokemon = nil
|
||||||
resetmoves = true
|
resetmoves = true
|
||||||
if newpoke.is_a?(Pokemon)
|
if newpoke.is_a?(Pokemon)
|
||||||
@@ -216,13 +216,13 @@ def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
|
|||||||
yourPokemon.obtain_method = 2 # traded
|
yourPokemon.obtain_method = 2 # traded
|
||||||
yourPokemon.reset_moves if resetmoves
|
yourPokemon.reset_moves if resetmoves
|
||||||
yourPokemon.record_first_moves
|
yourPokemon.record_first_moves
|
||||||
$Trainer.pokedex.register(yourPokemon)
|
$player.pokedex.register(yourPokemon)
|
||||||
$Trainer.pokedex.set_owned(yourPokemon.species)
|
$player.pokedex.set_owned(yourPokemon.species)
|
||||||
pbFadeOutInWithMusic {
|
pbFadeOutInWithMusic {
|
||||||
evo = PokemonTrade_Scene.new
|
evo = PokemonTrade_Scene.new
|
||||||
evo.pbStartScreen(myPokemon,yourPokemon,$Trainer.name,opponent.name)
|
evo.pbStartScreen(myPokemon, yourPokemon, $player.name, opponent.name)
|
||||||
evo.pbTrade
|
evo.pbTrade
|
||||||
evo.pbEndScreen
|
evo.pbEndScreen
|
||||||
}
|
}
|
||||||
$Trainer.party[pokemonIndex] = yourPokemon
|
$player.party[pokemonIndex] = yourPokemon
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -123,9 +123,9 @@ class HallOfFame_Scene
|
|||||||
end
|
end
|
||||||
|
|
||||||
def saveHallEntry
|
def saveHallEntry
|
||||||
for i in 0...$Trainer.party.length
|
$player.party.each do |pkmn|
|
||||||
# Clones every pokémon object
|
# 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
|
end
|
||||||
# Update the global variables
|
# Update the global variables
|
||||||
$PokemonGlobal.hallOfFame.push(@hallEntry)
|
$PokemonGlobal.hallOfFame.push(@hallEntry)
|
||||||
@@ -243,7 +243,7 @@ class HallOfFame_Scene
|
|||||||
|
|
||||||
def createTrainerBattler
|
def createTrainerBattler
|
||||||
@sprites["trainer"]=IconSprite.new(@viewport)
|
@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
|
if !SINGLEROW
|
||||||
@sprites["trainer"].x=Graphics.width-96
|
@sprites["trainer"].x=Graphics.width-96
|
||||||
@sprites["trainer"].y=160
|
@sprites["trainer"].y=160
|
||||||
@@ -278,12 +278,12 @@ class HallOfFame_Scene
|
|||||||
totalsec = Graphics.frame_count / Graphics.frame_rate
|
totalsec = Graphics.frame_count / Graphics.frame_rate
|
||||||
hour = totalsec / 60 / 60
|
hour = totalsec / 60 / 60
|
||||||
min = totalsec / 60 % 60
|
min = totalsec / 60 % 60
|
||||||
pubid=sprintf("%05d",$Trainer.public_ID)
|
pubid=sprintf("%05d", $player.public_ID)
|
||||||
lefttext= _INTL("Name<r>{1}<br>",$Trainer.name)
|
lefttext= _INTL("Name<r>{1}<br>", $player.name)
|
||||||
lefttext+=_INTL("IDNo.<r>{1}<br>",pubid)
|
lefttext+=_INTL("IDNo.<r>{1}<br>",pubid)
|
||||||
lefttext+=_ISPRINTF("Time<r>{1:02d}:{2:02d}<br>",hour,min)
|
lefttext+=_ISPRINTF("Time<r>{1:02d}:{2:02d}<br>",hour,min)
|
||||||
lefttext+=_INTL("Pokédex<r>{1}/{2}<br>",
|
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"]=Window_AdvancedTextPokemon.new(lefttext)
|
||||||
@sprites["messagebox"].viewport=@viewport
|
@sprites["messagebox"].viewport=@viewport
|
||||||
@sprites["messagebox"].width=192 if @sprites["messagebox"].width<192
|
@sprites["messagebox"].width=192 if @sprites["messagebox"].width<192
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class PokemonPauseMenu
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbStartPokemonMenu
|
def pbStartPokemonMenu
|
||||||
if !$Trainer
|
if !$player
|
||||||
if $DEBUG
|
if $DEBUG
|
||||||
pbMessage(_INTL("The player trainer was not defined, so the pause menu can't be displayed."))
|
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."))
|
pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player."))
|
||||||
@@ -114,17 +114,17 @@ class PokemonPauseMenu
|
|||||||
cmdDebug = -1
|
cmdDebug = -1
|
||||||
cmdQuit = -1
|
cmdQuit = -1
|
||||||
cmdEndGame = -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")
|
commands[cmdPokedex = commands.length] = _INTL("Pokédex")
|
||||||
end
|
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?
|
commands[cmdBag = commands.length] = _INTL("Bag") if !pbInBugContest?
|
||||||
if $Trainer.has_pokegear
|
if $player.has_pokegear
|
||||||
commands[cmdPokegear = commands.length] = _INTL("Pokégear")
|
commands[cmdPokegear = commands.length] = _INTL("Pokégear")
|
||||||
elsif $bag.has?(:TOWNMAP)
|
elsif $bag.has?(:TOWNMAP)
|
||||||
commands[cmdTownMap = commands.length] = _INTL("Town Map")
|
commands[cmdTownMap = commands.length] = _INTL("Town Map")
|
||||||
end
|
end
|
||||||
commands[cmdTrainer = commands.length] = $Trainer.name
|
commands[cmdTrainer = commands.length] = $player.name
|
||||||
if pbInSafari?
|
if pbInSafari?
|
||||||
if Settings::SAFARI_STEPS <= 0
|
if Settings::SAFARI_STEPS <= 0
|
||||||
@scene.pbShowInfo(_INTL("Balls: {1}",pbSafariState.ballcount))
|
@scene.pbShowInfo(_INTL("Balls: {1}",pbSafariState.ballcount))
|
||||||
@@ -161,8 +161,8 @@ class PokemonPauseMenu
|
|||||||
@scene.pbRefresh
|
@scene.pbRefresh
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if $Trainer.pokedex.accessible_dexes.length == 1
|
if $player.pokedex.accessible_dexes.length == 1
|
||||||
$PokemonGlobal.pokedexDex = $Trainer.pokedex.accessible_dexes[0]
|
$PokemonGlobal.pokedexDex = $player.pokedex.accessible_dexes[0]
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
scene = PokemonPokedex_Scene.new
|
scene = PokemonPokedex_Scene.new
|
||||||
screen = PokemonPokedexScreen.new(scene)
|
screen = PokemonPokedexScreen.new(scene)
|
||||||
@@ -183,7 +183,7 @@ class PokemonPauseMenu
|
|||||||
hiddenmove = nil
|
hiddenmove = nil
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
sscene = PokemonParty_Scene.new
|
sscene = PokemonParty_Scene.new
|
||||||
sscreen = PokemonPartyScreen.new(sscene,$Trainer.party)
|
sscreen = PokemonPartyScreen.new(sscene, $player.party)
|
||||||
hiddenmove = sscreen.pbPokemonScreen
|
hiddenmove = sscreen.pbPokemonScreen
|
||||||
(hiddenmove) ? @scene.pbEndScene : @scene.pbRefresh
|
(hiddenmove) ? @scene.pbEndScene : @scene.pbRefresh
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class PokemonPokedexMenuScreen
|
|||||||
commands = []
|
commands = []
|
||||||
commands2 = []
|
commands2 = []
|
||||||
dexnames = Settings.pokedex_names
|
dexnames = Settings.pokedex_names
|
||||||
$Trainer.pokedex.accessible_dexes.each do |dex|
|
$player.pokedex.accessible_dexes.each do |dex|
|
||||||
if dexnames[dex].nil?
|
if dexnames[dex].nil?
|
||||||
commands.push(_INTL("Pokédex"))
|
commands.push(_INTL("Pokédex"))
|
||||||
elsif dexnames[dex].is_a?(Array)
|
elsif dexnames[dex].is_a?(Array)
|
||||||
@@ -102,8 +102,8 @@ class PokemonPokedexMenuScreen
|
|||||||
else
|
else
|
||||||
commands.push(dexnames[dex])
|
commands.push(dexnames[dex])
|
||||||
end
|
end
|
||||||
commands2.push([$Trainer.pokedex.seen_count(dex),
|
commands2.push([$player.pokedex.seen_count(dex),
|
||||||
$Trainer.pokedex.owned_count(dex),
|
$player.pokedex.owned_count(dex),
|
||||||
pbGetRegionalDexLength(dex)])
|
pbGetRegionalDexLength(dex)])
|
||||||
end
|
end
|
||||||
commands.push(_INTL("Exit"))
|
commands.push(_INTL("Exit"))
|
||||||
@@ -111,7 +111,7 @@ class PokemonPokedexMenuScreen
|
|||||||
loop do
|
loop do
|
||||||
cmd = @scene.pbScene
|
cmd = @scene.pbScene
|
||||||
break if cmd<0 || cmd>=commands2.length # Cancel/Exit
|
break if cmd<0 || cmd>=commands2.length # Cancel/Exit
|
||||||
$PokemonGlobal.pokedexDex = $Trainer.pokedex.accessible_dexes[cmd]
|
$PokemonGlobal.pokedexDex = $player.pokedex.accessible_dexes[cmd]
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
scene = PokemonPokedex_Scene.new
|
scene = PokemonPokedex_Scene.new
|
||||||
screen = PokemonPokedexScreen.new(scene)
|
screen = PokemonPokedexScreen.new(scene)
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ class Window_Pokedex < Window_DrawableCommand
|
|||||||
species = @commands[index][0]
|
species = @commands[index][0]
|
||||||
indexNumber = @commands[index][4]
|
indexNumber = @commands[index][4]
|
||||||
indexNumber -= 1 if @commands[index][5]
|
indexNumber -= 1 if @commands[index][5]
|
||||||
if $Trainer.seen?(species)
|
if $player.seen?(species)
|
||||||
if $Trainer.owned?(species)
|
if $player.owned?(species)
|
||||||
pbCopyBitmap(self.contents,@pokeballOwn.bitmap,rect.x-6,rect.y+8)
|
pbCopyBitmap(self.contents,@pokeballOwn.bitmap,rect.x-6,rect.y+8)
|
||||||
else
|
else
|
||||||
pbCopyBitmap(self.contents,@pokeballSeen.bitmap,rect.x-6,rect.y+8)
|
pbCopyBitmap(self.contents,@pokeballSeen.bitmap,rect.x-6,rect.y+8)
|
||||||
@@ -315,7 +315,7 @@ class PokemonPokedex_Scene
|
|||||||
def pbGetPokedexRegion
|
def pbGetPokedexRegion
|
||||||
if Settings::USE_CURRENT_REGION_DEX
|
if Settings::USE_CURRENT_REGION_DEX
|
||||||
region = pbGetCurrentRegion
|
region = pbGetCurrentRegion
|
||||||
region = -1 if region >= $Trainer.pokedex.dexes_count - 1
|
region = -1 if region >= $player.pokedex.dexes_count - 1
|
||||||
return region
|
return region
|
||||||
else
|
else
|
||||||
return $PokemonGlobal.pokedexDex # National Dex -1, regional Dexes 0, 1, etc.
|
return $PokemonGlobal.pokedexDex # National Dex -1, regional Dexes 0, 1, etc.
|
||||||
@@ -328,7 +328,7 @@ class PokemonPokedex_Scene
|
|||||||
def pbGetSavePositionIndex
|
def pbGetSavePositionIndex
|
||||||
index = pbGetPokedexRegion
|
index = pbGetPokedexRegion
|
||||||
if index==-1 # National Dex (comes after regional Dex indices)
|
if index==-1 # National Dex (comes after regional Dex indices)
|
||||||
index = $Trainer.pokedex.dexes_count - 1
|
index = $player.pokedex.dexes_count - 1
|
||||||
end
|
end
|
||||||
return index
|
return index
|
||||||
end
|
end
|
||||||
@@ -336,9 +336,9 @@ class PokemonPokedex_Scene
|
|||||||
def pbCanAddForModeList?(mode, species)
|
def pbCanAddForModeList?(mode, species)
|
||||||
case mode
|
case mode
|
||||||
when MODEATOZ
|
when MODEATOZ
|
||||||
return $Trainer.seen?(species)
|
return $player.seen?(species)
|
||||||
when MODEHEAVIEST, MODELIGHTEST, MODETALLEST, MODESMALLEST
|
when MODEHEAVIEST, MODELIGHTEST, MODETALLEST, MODESMALLEST
|
||||||
return $Trainer.owned?(species)
|
return $player.owned?(species)
|
||||||
end
|
end
|
||||||
return true # For MODENUMERICAL
|
return true # For MODENUMERICAL
|
||||||
end
|
end
|
||||||
@@ -356,7 +356,7 @@ class PokemonPokedex_Scene
|
|||||||
regionalSpecies.each_with_index do |species, i|
|
regionalSpecies.each_with_index do |species, i|
|
||||||
next if !species
|
next if !species
|
||||||
next if !pbCanAddForModeList?($PokemonGlobal.pokedexMode, 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)
|
species_data = GameData::Species.get_species_form(species, form)
|
||||||
color = species_data.color
|
color = species_data.color
|
||||||
type1 = species_data.type1
|
type1 = species_data.type1
|
||||||
@@ -374,11 +374,11 @@ class PokemonPokedex_Scene
|
|||||||
case $PokemonGlobal.pokedexMode
|
case $PokemonGlobal.pokedexMode
|
||||||
when MODENUMERICAL
|
when MODENUMERICAL
|
||||||
# Hide the Dex number 0 species if unseen
|
# 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
|
# Remove unseen species from the end of the list
|
||||||
i = dexlist.length-1
|
i = dexlist.length-1
|
||||||
loop do break unless i>=0
|
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
|
dexlist[i] = nil
|
||||||
i -= 1
|
i -= 1
|
||||||
end
|
end
|
||||||
@@ -414,10 +414,10 @@ class PokemonPokedex_Scene
|
|||||||
base = Color.new(88,88,80)
|
base = Color.new(88,88,80)
|
||||||
shadow = Color.new(168,184,184)
|
shadow = Color.new(168,184,184)
|
||||||
iconspecies = @sprites["pokedex"].species
|
iconspecies = @sprites["pokedex"].species
|
||||||
iconspecies = nil if !$Trainer.seen?(iconspecies)
|
iconspecies = nil if !$player.seen?(iconspecies)
|
||||||
# Write various bits of text
|
# Write various bits of text
|
||||||
dexname = _INTL("Pokédex")
|
dexname = _INTL("Pokédex")
|
||||||
if $Trainer.pokedex.dexes_count > 1
|
if $player.pokedex.dexes_count > 1
|
||||||
thisdex = Settings.pokedex_names[pbGetSavePositionIndex]
|
thisdex = Settings.pokedex_names[pbGetSavePositionIndex]
|
||||||
if thisdex!=nil
|
if thisdex!=nil
|
||||||
dexname = (thisdex.is_a?(Array)) ? thisdex[0] : thisdex
|
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])
|
textpos.push([@dexlist.length.to_s,112,334,2,base,shadow])
|
||||||
else
|
else
|
||||||
textpos.push([_INTL("Seen:"),42,302,0,base,shadow])
|
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([_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
|
end
|
||||||
# Draw all text
|
# Draw all text
|
||||||
pbDrawTextPositions(overlay,textpos)
|
pbDrawTextPositions(overlay,textpos)
|
||||||
@@ -745,7 +745,7 @@ class PokemonPokedex_Scene
|
|||||||
end
|
end
|
||||||
|
|
||||||
def setIconBitmap(species)
|
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)
|
@sprites["icon"].setSpeciesBitmap(species, gender, form)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -756,7 +756,7 @@ class PokemonPokedex_Scene
|
|||||||
if params[1]>=0
|
if params[1]>=0
|
||||||
scanNameCommand = @nameCommands[params[1]].scan(/./)
|
scanNameCommand = @nameCommands[params[1]].scan(/./)
|
||||||
dexlist = dexlist.find_all { |item|
|
dexlist = dexlist.find_all { |item|
|
||||||
next false if !$Trainer.seen?(item[0])
|
next false if !$player.seen?(item[0])
|
||||||
firstChar = item[1][0,1]
|
firstChar = item[1][0,1]
|
||||||
next scanNameCommand.any? { |v| v==firstChar }
|
next scanNameCommand.any? { |v| v==firstChar }
|
||||||
}
|
}
|
||||||
@@ -766,7 +766,7 @@ class PokemonPokedex_Scene
|
|||||||
stype1 = (params[2]>=0) ? @typeCommands[params[2]].id : nil
|
stype1 = (params[2]>=0) ? @typeCommands[params[2]].id : nil
|
||||||
stype2 = (params[3]>=0) ? @typeCommands[params[3]].id : nil
|
stype2 = (params[3]>=0) ? @typeCommands[params[3]].id : nil
|
||||||
dexlist = dexlist.find_all { |item|
|
dexlist = dexlist.find_all { |item|
|
||||||
next false if !$Trainer.owned?(item[0])
|
next false if !$player.owned?(item[0])
|
||||||
type1 = item[6]
|
type1 = item[6]
|
||||||
type2 = item[7]
|
type2 = item[7]
|
||||||
if stype1 && stype2
|
if stype1 && stype2
|
||||||
@@ -788,7 +788,7 @@ class PokemonPokedex_Scene
|
|||||||
minh = (params[4]<0) ? 0 : (params[4]>=@heightCommands.length) ? 999 : @heightCommands[params[4]]
|
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]]
|
maxh = (params[5]<0) ? 999 : (params[5]>=@heightCommands.length) ? 0 : @heightCommands[params[5]]
|
||||||
dexlist = dexlist.find_all { |item|
|
dexlist = dexlist.find_all { |item|
|
||||||
next false if !$Trainer.owned?(item[0])
|
next false if !$player.owned?(item[0])
|
||||||
height = item[2]
|
height = item[2]
|
||||||
next height>=minh && height<=maxh
|
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]]
|
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]]
|
maxw = (params[7]<0) ? 9999 : (params[7]>=@weightCommands.length) ? 0 : @weightCommands[params[7]]
|
||||||
dexlist = dexlist.find_all { |item|
|
dexlist = dexlist.find_all { |item|
|
||||||
next false if !$Trainer.owned?(item[0])
|
next false if !$player.owned?(item[0])
|
||||||
weight = item[3]
|
weight = item[3]
|
||||||
next weight>=minw && weight<=maxw
|
next weight>=minw && weight<=maxw
|
||||||
}
|
}
|
||||||
@@ -807,7 +807,7 @@ class PokemonPokedex_Scene
|
|||||||
if params[8]>=0
|
if params[8]>=0
|
||||||
scolor = @colorCommands[params[8]].id
|
scolor = @colorCommands[params[8]].id
|
||||||
dexlist = dexlist.find_all { |item|
|
dexlist = dexlist.find_all { |item|
|
||||||
next false if !$Trainer.seen?(item[0])
|
next false if !$player.seen?(item[0])
|
||||||
next item[8] == scolor
|
next item[8] == scolor
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -815,12 +815,12 @@ class PokemonPokedex_Scene
|
|||||||
if params[9]>=0
|
if params[9]>=0
|
||||||
sshape = @shapeCommands[params[9]].id
|
sshape = @shapeCommands[params[9]].id
|
||||||
dexlist = dexlist.find_all { |item|
|
dexlist = dexlist.find_all { |item|
|
||||||
next false if !$Trainer.seen?(item[0])
|
next false if !$player.seen?(item[0])
|
||||||
next item[9] == sshape
|
next item[9] == sshape
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
# Remove all unseen species from the results
|
# 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
|
case $PokemonGlobal.pokedexMode
|
||||||
when MODENUMERICAL then dexlist.sort! { |a,b| a[4]<=>b[4] }
|
when MODENUMERICAL then dexlist.sort! { |a,b| a[4]<=>b[4] }
|
||||||
when MODEATOZ then dexlist.sort! { |a,b| a[1]<=>b[1] }
|
when MODEATOZ then dexlist.sort! { |a,b| a[1]<=>b[1] }
|
||||||
@@ -1262,7 +1262,7 @@ class PokemonPokedex_Scene
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
elsif Input.trigger?(Input::USE)
|
elsif Input.trigger?(Input::USE)
|
||||||
if $Trainer.seen?(@sprites["pokedex"].species)
|
if $player.seen?(@sprites["pokedex"].species)
|
||||||
pbPlayDecisionSE
|
pbPlayDecisionSE
|
||||||
pbDexEntry(@sprites["pokedex"].index)
|
pbDexEntry(@sprites["pokedex"].index)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
@viewport.z = 99999
|
@viewport.z = 99999
|
||||||
dexnum = 0
|
dexnum = 0
|
||||||
dexnumshift = false
|
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)
|
species_data = GameData::Species.try_get(species)
|
||||||
if species_data
|
if species_data
|
||||||
nationalDexList = [:NONE]
|
nationalDexList = [:NONE]
|
||||||
@@ -81,8 +81,8 @@ class PokemonPokedexInfo_Scene
|
|||||||
dexnumshift = true if dexnum > 0 && Settings::DEXES_WITH_OFFSETS.include?(-1)
|
dexnumshift = true if dexnum > 0 && Settings::DEXES_WITH_OFFSETS.include?(-1)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
for i in 0...$Trainer.pokedex.dexes_count - 1 # Regional Dexes
|
for i in 0...$player.pokedex.dexes_count - 1 # Regional Dexes
|
||||||
next if !$Trainer.pokedex.unlocked?(i)
|
next if !$player.pokedex.unlocked?(i)
|
||||||
num = pbGetRegionalNumber(i,species)
|
num = pbGetRegionalNumber(i,species)
|
||||||
next if num <= 0
|
next if num <= 0
|
||||||
dexnum = num
|
dexnum = num
|
||||||
@@ -126,7 +126,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
|
|
||||||
def pbUpdateDummyPokemon
|
def pbUpdateDummyPokemon
|
||||||
@species = @dexlist[@index][0]
|
@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)
|
species_data = GameData::Species.get_species_form(@species, @form)
|
||||||
@sprites["infosprite"].setSpeciesBitmap(@species,@gender,@form)
|
@sprites["infosprite"].setSpeciesBitmap(@species,@gender,@form)
|
||||||
if @sprites["formfront"]
|
if @sprites["formfront"]
|
||||||
@@ -153,12 +153,12 @@ class PokemonPokedexInfo_Scene
|
|||||||
multiple_forms = true if sp.form > 0
|
multiple_forms = true if sp.form > 0
|
||||||
if sp.single_gendered?
|
if sp.single_gendered?
|
||||||
real_gender = (sp.gender_ratio == :AlwaysFemale) ? 1 : 0
|
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
|
real_gender = 2 if sp.gender_ratio == :Genderless
|
||||||
ret.push([sp.form_name, real_gender, sp.form])
|
ret.push([sp.form_name, real_gender, sp.form])
|
||||||
else # Both male and female
|
else # Both male and female
|
||||||
for real_gender in 0...2
|
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])
|
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
|
break if sp.form_name && !sp.form_name.empty? # Only show 1 entry for each non-0 form
|
||||||
end
|
end
|
||||||
@@ -223,12 +223,12 @@ class PokemonPokedexInfo_Scene
|
|||||||
]
|
]
|
||||||
if @show_battled_count
|
if @show_battled_count
|
||||||
textpos.push([_INTL("Number Battled"), 314, 152, 0, base, shadow])
|
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
|
else
|
||||||
textpos.push([_INTL("Height"), 314, 152, 0, base, shadow])
|
textpos.push([_INTL("Height"), 314, 152, 0, base, shadow])
|
||||||
textpos.push([_INTL("Weight"), 314, 184, 0, base, shadow])
|
textpos.push([_INTL("Weight"), 314, 184, 0, base, shadow])
|
||||||
end
|
end
|
||||||
if $Trainer.owned?(@species)
|
if $player.owned?(@species)
|
||||||
# Write the category
|
# Write the category
|
||||||
textpos.push([_INTL("{1} Pokémon", species_data.category), 246, 68, 0, base, shadow])
|
textpos.push([_INTL("{1} Pokémon", species_data.category), 246, 68, 0, base, shadow])
|
||||||
# Write the height and weight
|
# Write the height and weight
|
||||||
@@ -396,7 +396,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
newindex = @index
|
newindex = @index
|
||||||
while newindex>0
|
while newindex>0
|
||||||
newindex -= 1
|
newindex -= 1
|
||||||
if $Trainer.seen?(@dexlist[newindex][0])
|
if $player.seen?(@dexlist[newindex][0])
|
||||||
@index = newindex
|
@index = newindex
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -407,7 +407,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
newindex = @index
|
newindex = @index
|
||||||
while newindex<@dexlist.length-1
|
while newindex<@dexlist.length-1
|
||||||
newindex += 1
|
newindex += 1
|
||||||
if $Trainer.seen?(@dexlist[newindex][0])
|
if $player.seen?(@dexlist[newindex][0])
|
||||||
@index = newindex
|
@index = newindex
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -425,7 +425,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
oldindex = -1
|
oldindex = -1
|
||||||
loop do
|
loop do
|
||||||
if oldindex!=index
|
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
|
pbUpdateDummyPokemon
|
||||||
drawPage(@page)
|
drawPage(@page)
|
||||||
@sprites["uparrow"].visible = (index>0)
|
@sprites["uparrow"].visible = (index>0)
|
||||||
@@ -564,7 +564,7 @@ class PokemonPokedexInfoScreen
|
|||||||
region = -1
|
region = -1
|
||||||
if Settings::USE_CURRENT_REGION_DEX
|
if Settings::USE_CURRENT_REGION_DEX
|
||||||
region = pbGetCurrentRegion
|
region = pbGetCurrentRegion
|
||||||
region = -1 if region >= $Trainer.pokedex.dexes_count - 1
|
region = -1 if region >= $player.pokedex.dexes_count - 1
|
||||||
else
|
else
|
||||||
region = $PokemonGlobal.pokedexDex # National Dex -1, regional Dexes 0, 1, etc.
|
region = $PokemonGlobal.pokedexDex # National Dex -1, regional Dexes 0, 1, etc.
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1375,7 +1375,7 @@ end
|
|||||||
def pbPokemonScreen
|
def pbPokemonScreen
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
sscene = PokemonParty_Scene.new
|
sscene = PokemonParty_Scene.new
|
||||||
sscreen = PokemonPartyScreen.new(sscene,$Trainer.party)
|
sscreen = PokemonPartyScreen.new(sscene, $player.party)
|
||||||
sscreen.pbPokemonScreen
|
sscreen.pbPokemonScreen
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -1390,7 +1390,7 @@ def pbChoosePokemon(variableNumber,nameVarNumber,ableProc=nil,allowIneligible=fa
|
|||||||
chosen = 0
|
chosen = 0
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
scene = PokemonParty_Scene.new
|
scene = PokemonParty_Scene.new
|
||||||
screen = PokemonPartyScreen.new(scene,$Trainer.party)
|
screen = PokemonPartyScreen.new(scene, $player.party)
|
||||||
if ableProc
|
if ableProc
|
||||||
chosen=screen.pbChooseAblePokemon(ableProc,allowIneligible)
|
chosen=screen.pbChooseAblePokemon(ableProc,allowIneligible)
|
||||||
else
|
else
|
||||||
@@ -1401,7 +1401,7 @@ def pbChoosePokemon(variableNumber,nameVarNumber,ableProc=nil,allowIneligible=fa
|
|||||||
}
|
}
|
||||||
pbSet(variableNumber, chosen)
|
pbSet(variableNumber, chosen)
|
||||||
if chosen>=0
|
if chosen>=0
|
||||||
pbSet(nameVarNumber,$Trainer.party[chosen].name)
|
pbSet(nameVarNumber, $player.party[chosen].name)
|
||||||
else
|
else
|
||||||
pbSet(nameVarNumber, "")
|
pbSet(nameVarNumber, "")
|
||||||
end
|
end
|
||||||
@@ -1420,7 +1420,7 @@ def pbChooseTradablePokemon(variableNumber,nameVarNumber,ableProc=nil,allowIneli
|
|||||||
chosen = 0
|
chosen = 0
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
scene = PokemonParty_Scene.new
|
scene = PokemonParty_Scene.new
|
||||||
screen = PokemonPartyScreen.new(scene,$Trainer.party)
|
screen = PokemonPartyScreen.new(scene, $player.party)
|
||||||
if ableProc
|
if ableProc
|
||||||
chosen=screen.pbChooseTradablePokemon(ableProc,allowIneligible)
|
chosen=screen.pbChooseTradablePokemon(ableProc,allowIneligible)
|
||||||
else
|
else
|
||||||
@@ -1431,7 +1431,7 @@ def pbChooseTradablePokemon(variableNumber,nameVarNumber,ableProc=nil,allowIneli
|
|||||||
}
|
}
|
||||||
pbSet(variableNumber, chosen)
|
pbSet(variableNumber, chosen)
|
||||||
if chosen>=0
|
if chosen>=0
|
||||||
pbSet(nameVarNumber,$Trainer.party[chosen].name)
|
pbSet(nameVarNumber, $player.party[chosen].name)
|
||||||
else
|
else
|
||||||
pbSet(nameVarNumber, "")
|
pbSet(nameVarNumber, "")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -394,12 +394,12 @@ class PokemonSummary_Scene
|
|||||||
# Write the Regional/National Dex number
|
# Write the Regional/National Dex number
|
||||||
dexnum = 0
|
dexnum = 0
|
||||||
dexnumshift = false
|
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
|
dexnum = @nationalDexList.index(@pokemon.species_data.species) || 0
|
||||||
dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(-1)
|
dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(-1)
|
||||||
else
|
else
|
||||||
for i in 0...$Trainer.pokedex.dexes_count - 1
|
for i in 0...$player.pokedex.dexes_count - 1
|
||||||
next if !$Trainer.pokedex.unlocked?(i)
|
next if !$player.pokedex.unlocked?(i)
|
||||||
num = pbGetRegionalNumber(i,@pokemon.species)
|
num = pbGetRegionalNumber(i,@pokemon.species)
|
||||||
next if num<=0
|
next if num<=0
|
||||||
dexnum = num
|
dexnum = num
|
||||||
@@ -1189,7 +1189,7 @@ class PokemonSummary_Scene
|
|||||||
if !@pokemon.egg?
|
if !@pokemon.egg?
|
||||||
commands[cmdGiveItem = commands.length] = _INTL("Give item")
|
commands[cmdGiveItem = commands.length] = _INTL("Give item")
|
||||||
commands[cmdTakeItem = commands.length] = _INTL("Take item") if @pokemon.hasItem?
|
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
|
end
|
||||||
commands[cmdMark = commands.length] = _INTL("Mark")
|
commands[cmdMark = commands.length] = _INTL("Mark")
|
||||||
commands[commands.length] = _INTL("Cancel")
|
commands[commands.length] = _INTL("Cancel")
|
||||||
@@ -1207,7 +1207,7 @@ class PokemonSummary_Scene
|
|||||||
elsif cmdTakeItem>=0 && command==cmdTakeItem
|
elsif cmdTakeItem>=0 && command==cmdTakeItem
|
||||||
dorefresh = pbTakeItemFromPokemon(@pokemon,self)
|
dorefresh = pbTakeItemFromPokemon(@pokemon,self)
|
||||||
elsif cmdPokedex>=0 && command==cmdPokedex
|
elsif cmdPokedex>=0 && command==cmdPokedex
|
||||||
$Trainer.pokedex.register_last_seen(@pokemon)
|
$player.pokedex.register_last_seen(@pokemon)
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
scene = PokemonPokedexInfo_Scene.new
|
scene = PokemonPokedexInfo_Scene.new
|
||||||
screen = PokemonPokedexInfoScreen.new(scene)
|
screen = PokemonPokedexInfoScreen.new(scene)
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ class PokemonBag_Scene
|
|||||||
@sprites["background"].setBitmap(sprintf("Graphics/Pictures/Bag/bg_#{@bag.last_viewed_pocket}"))
|
@sprites["background"].setBitmap(sprintf("Graphics/Pictures/Bag/bg_#{@bag.last_viewed_pocket}"))
|
||||||
# Set the bag sprite
|
# Set the bag sprite
|
||||||
fbagexists = pbResolveBitmap(sprintf("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}_f"))
|
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")
|
@sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}_f")
|
||||||
else
|
else
|
||||||
@sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}")
|
@sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}")
|
||||||
@@ -469,14 +469,14 @@ class PokemonBagScreen
|
|||||||
commands = []
|
commands = []
|
||||||
# Generate command list
|
# Generate command list
|
||||||
commands[cmdRead = commands.length] = _INTL("Read") if itm.is_mail?
|
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)
|
if ItemHandlers.hasUseText(item)
|
||||||
commands[cmdUse = commands.length] = ItemHandlers.getUseText(item)
|
commands[cmdUse = commands.length] = ItemHandlers.getUseText(item)
|
||||||
else
|
else
|
||||||
commands[cmdUse = commands.length] = _INTL("Use")
|
commands[cmdUse = commands.length] = _INTL("Use")
|
||||||
end
|
end
|
||||||
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
|
commands[cmdToss = commands.length] = _INTL("Toss") if !itm.is_important? || $DEBUG
|
||||||
if @bag.registered?(item)
|
if @bag.registered?(item)
|
||||||
commands[cmdRegister = commands.length] = _INTL("Deselect")
|
commands[cmdRegister = commands.length] = _INTL("Deselect")
|
||||||
@@ -499,14 +499,14 @@ class PokemonBagScreen
|
|||||||
@scene.pbRefresh
|
@scene.pbRefresh
|
||||||
next
|
next
|
||||||
elsif cmdGive>=0 && command==cmdGive # Give item to Pokémon
|
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."))
|
@scene.pbDisplay(_INTL("There is no Pokémon."))
|
||||||
elsif itm.is_important?
|
elsif itm.is_important?
|
||||||
@scene.pbDisplay(_INTL("The {1} can't be held.",itemname))
|
@scene.pbDisplay(_INTL("The {1} can't be held.",itemname))
|
||||||
else
|
else
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
sscene = PokemonParty_Scene.new
|
sscene = PokemonParty_Scene.new
|
||||||
sscreen = PokemonPartyScreen.new(sscene,$Trainer.party)
|
sscreen = PokemonPartyScreen.new(sscene, $player.party)
|
||||||
sscreen.pbPokemonGiveScreen(item)
|
sscreen.pbPokemonGiveScreen(item)
|
||||||
@scene.pbRefresh
|
@scene.pbRefresh
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class PokegearButton < SpriteWrapper
|
|||||||
@image = command[0]
|
@image = command[0]
|
||||||
@name = command[1]
|
@name = command[1]
|
||||||
@selected = false
|
@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")
|
@button = AnimatedBitmap.new("Graphics/Pictures/Pokegear/icon_button_f")
|
||||||
else
|
else
|
||||||
@button = AnimatedBitmap.new("Graphics/Pictures/Pokegear/icon_button")
|
@button = AnimatedBitmap.new("Graphics/Pictures/Pokegear/icon_button")
|
||||||
@@ -70,7 +70,7 @@ class PokemonPokegear_Scene
|
|||||||
@viewport.z = 99999
|
@viewport.z = 99999
|
||||||
@sprites = {}
|
@sprites = {}
|
||||||
@sprites["background"] = IconSprite.new(0,0,@viewport)
|
@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")
|
@sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg_f")
|
||||||
else
|
else
|
||||||
@sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg")
|
@sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg")
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class PokemonRegionMap_Scene
|
|||||||
@sprites["mapbottom"].mapdetails = pbGetMapDetails(@map_x, @map_y)
|
@sprites["mapbottom"].mapdetails = pbGetMapDetails(@map_x, @map_y)
|
||||||
if playerpos && mapindex == playerpos[0]
|
if playerpos && mapindex == playerpos[0]
|
||||||
@sprites["player"] = IconSprite.new(0, 0, @viewport)
|
@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"].x = point_x_to_screen_x(@map_x)
|
||||||
@sprites["player"].y = point_y_to_screen_y(@map_y)
|
@sprites["player"].y = point_y_to_screen_y(@map_y)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ class PokemonTrainerCard_Scene
|
|||||||
@viewport.z = 99999
|
@viewport.z = 99999
|
||||||
@sprites = {}
|
@sprites = {}
|
||||||
background = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/bg_f"))
|
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)
|
addBackgroundPlane(@sprites,"bg","Trainer Card/bg_f",@viewport)
|
||||||
else
|
else
|
||||||
addBackgroundPlane(@sprites,"bg","Trainer Card/bg",@viewport)
|
addBackgroundPlane(@sprites,"bg","Trainer Card/bg",@viewport)
|
||||||
end
|
end
|
||||||
cardexists = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/card_f"))
|
cardexists = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/card_f"))
|
||||||
@sprites["card"] = IconSprite.new(0,0,@viewport)
|
@sprites["card"] = IconSprite.new(0,0,@viewport)
|
||||||
if $Trainer.female? && cardexists
|
if $player.female? && cardexists
|
||||||
@sprites["card"].setBitmap("Graphics/Pictures/Trainer Card/card_f")
|
@sprites["card"].setBitmap("Graphics/Pictures/Trainer Card/card_f")
|
||||||
else
|
else
|
||||||
@sprites["card"].setBitmap("Graphics/Pictures/Trainer Card/card")
|
@sprites["card"].setBitmap("Graphics/Pictures/Trainer Card/card")
|
||||||
@@ -26,7 +26,7 @@ class PokemonTrainerCard_Scene
|
|||||||
@sprites["overlay"] = BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
|
@sprites["overlay"] = BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
|
||||||
pbSetSystemFont(@sprites["overlay"].bitmap)
|
pbSetSystemFont(@sprites["overlay"].bitmap)
|
||||||
@sprites["trainer"] = IconSprite.new(336,112,@viewport)
|
@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"].x -= (@sprites["trainer"].bitmap.width-128)/2
|
||||||
@sprites["trainer"].y -= (@sprites["trainer"].bitmap.height-128)
|
@sprites["trainer"].y -= (@sprites["trainer"].bitmap.height-128)
|
||||||
@sprites["trainer"].z = 2
|
@sprites["trainer"].z = 2
|
||||||
@@ -50,13 +50,13 @@ class PokemonTrainerCard_Scene
|
|||||||
$PokemonGlobal.startTime.year)
|
$PokemonGlobal.startTime.year)
|
||||||
textPositions = [
|
textPositions = [
|
||||||
[_INTL("Name"),34,58,0,baseColor,shadowColor],
|
[_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],
|
[_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("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],
|
[_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],
|
[_INTL("Time"),34,202,0,baseColor,shadowColor],
|
||||||
[time,302,202,1,baseColor,shadowColor],
|
[time,302,202,1,baseColor,shadowColor],
|
||||||
[_INTL("Started"),34,250,0,baseColor,shadowColor],
|
[_INTL("Started"),34,250,0,baseColor,shadowColor],
|
||||||
@@ -67,7 +67,7 @@ class PokemonTrainerCard_Scene
|
|||||||
region = pbGetCurrentRegion(0) # Get the current region
|
region = pbGetCurrentRegion(0) # Get the current region
|
||||||
imagePositions = []
|
imagePositions = []
|
||||||
for i in 0...8
|
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])
|
imagePositions.push(["Graphics/Pictures/Trainer Card/icon_badges",x,310,i*32,region*32,32,32])
|
||||||
end
|
end
|
||||||
x += 48
|
x += 48
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ def pbEmergencySave
|
|||||||
oldscene = $scene
|
oldscene = $scene
|
||||||
$scene = nil
|
$scene = nil
|
||||||
pbMessage(_INTL("The script is taking too long. The game will restart."))
|
pbMessage(_INTL("The script is taking too long. The game will restart."))
|
||||||
return if !$Trainer
|
return if !$player
|
||||||
if SaveData.exists?
|
if SaveData.exists?
|
||||||
File.open(SaveData::FILE_PATH, 'rb') do |r|
|
File.open(SaveData::FILE_PATH, 'rb') do |r|
|
||||||
File.open(SaveData::FILE_PATH + '.bak', 'wb') do |w|
|
File.open(SaveData::FILE_PATH + '.bak', 'wb') do |w|
|
||||||
@@ -32,18 +32,18 @@ class PokemonSave_Scene
|
|||||||
hour = totalsec / 60 / 60
|
hour = totalsec / 60 / 60
|
||||||
min = totalsec / 60 % 60
|
min = totalsec / 60 % 60
|
||||||
mapname=$game_map.name
|
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
|
locationColor = "209808,90F090" # green
|
||||||
loctext=_INTL("<ac><c3={1}>{2}</c3></ac>",locationColor,mapname)
|
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
|
if hour>0
|
||||||
loctext+=_INTL("Time<r><c3={1}>{2}h {3}m</c3><br>",textColor,hour,min)
|
loctext+=_INTL("Time<r><c3={1}>{2}h {3}m</c3><br>",textColor,hour,min)
|
||||||
else
|
else
|
||||||
loctext+=_INTL("Time<r><c3={1}>{2}m</c3><br>",textColor,min)
|
loctext+=_INTL("Time<r><c3={1}>{2}m</c3><br>",textColor,min)
|
||||||
end
|
end
|
||||||
loctext+=_INTL("Badges<r><c3={1}>{2}</c3><br>",textColor,$Trainer.badge_count)
|
loctext+=_INTL("Badges<r><c3={1}>{2}</c3><br>",textColor,$player.badge_count)
|
||||||
if $Trainer.has_pokedex
|
if $player.has_pokedex
|
||||||
loctext+=_INTL("Pokédex<r><c3={1}>{2}/{3}</c3>",textColor,$Trainer.pokedex.owned_count,$Trainer.pokedex.seen_count)
|
loctext+=_INTL("Pokédex<r><c3={1}>{2}/{3}</c3>",textColor,$player.pokedex.owned_count,$player.pokedex.seen_count)
|
||||||
end
|
end
|
||||||
@sprites["locwindow"]=Window_AdvancedTextPokemon.new(loctext)
|
@sprites["locwindow"]=Window_AdvancedTextPokemon.new(loctext)
|
||||||
@sprites["locwindow"].viewport=@viewport
|
@sprites["locwindow"].viewport=@viewport
|
||||||
@@ -97,7 +97,7 @@ class PokemonSaveScreen
|
|||||||
$PokemonTemp.begunNewGame = false
|
$PokemonTemp.begunNewGame = false
|
||||||
pbSEPlay('GUI save choice')
|
pbSEPlay('GUI save choice')
|
||||||
if Game.save
|
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
|
ret = true
|
||||||
else
|
else
|
||||||
pbMessage(_INTL("\\se[]Save failed.\\wtnp[30]"))
|
pbMessage(_INTL("\\se[]Save failed.\\wtnp[30]"))
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class ReadyMenuButton < SpriteWrapper
|
|||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
pbSetSystemFont(self.bitmap)
|
pbSetSystemFont(self.bitmap)
|
||||||
if @command[2]
|
if @command[2]
|
||||||
@icon = PokemonIconSprite.new($Trainer.party[@command[3]],viewport)
|
@icon = PokemonIconSprite.new($player.party[@command[3]], viewport)
|
||||||
@icon.setOffset(PictureOrigin::Center)
|
@icon.setOffset(PictureOrigin::Center)
|
||||||
else
|
else
|
||||||
@icon = ItemIconSprite.new(0,0,@command[0],viewport)
|
@icon = ItemIconSprite.new(0,0,@command[0],viewport)
|
||||||
@@ -256,7 +256,7 @@ class PokemonReadyMenu
|
|||||||
break if command==-1
|
break if command==-1
|
||||||
if command[0]==0 # Use a move
|
if command[0]==0 # Use a move
|
||||||
move = commands[0][command[1]][0]
|
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
|
if move == :FLY
|
||||||
ret = nil
|
ret = nil
|
||||||
pbFadeOutInWithUpdate(99999,@scene.sprites) {
|
pbFadeOutInWithUpdate(99999,@scene.sprites) {
|
||||||
@@ -306,7 +306,7 @@ def pbUseKeyItem
|
|||||||
:WATERFALL, :WHIRLPOOL]
|
:WATERFALL, :WHIRLPOOL]
|
||||||
real_moves = []
|
real_moves = []
|
||||||
moves.each do |move|
|
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)
|
next if !pkmn.hasMove?(move)
|
||||||
real_moves.push([move, i]) if pbCanUseHiddenMove?(pkmn, move, false)
|
real_moves.push([move, i]) if pbCanUseHiddenMove?(pkmn, move, false)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ class TrainerPC
|
|||||||
end
|
end
|
||||||
|
|
||||||
def name
|
def name
|
||||||
return _INTL("{1}'s PC",$Trainer.name)
|
return _INTL("{1}'s PC", $player.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def access
|
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
|
pbTrainerPCMenu
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -25,7 +25,7 @@ class StorageSystemPC
|
|||||||
end
|
end
|
||||||
|
|
||||||
def name
|
def name
|
||||||
if $Trainer.seen_storage_creator
|
if $player.seen_storage_creator
|
||||||
return _INTL("{1}'s PC",pbGetStorageCreator)
|
return _INTL("{1}'s PC",pbGetStorageCreator)
|
||||||
else
|
else
|
||||||
return _INTL("Someone's PC")
|
return _INTL("Someone's PC")
|
||||||
@@ -201,7 +201,7 @@ def pbPCMailbox
|
|||||||
when 2 # Give
|
when 2 # Give
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
sscene = PokemonParty_Scene.new
|
sscene = PokemonParty_Scene.new
|
||||||
sscreen = PokemonPartyScreen.new(sscene,$Trainer.party)
|
sscreen = PokemonPartyScreen.new(sscene, $player.party)
|
||||||
sscreen.pbPokemonGiveMailScreen(mailIndex)
|
sscreen.pbPokemonGiveMailScreen(mailIndex)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -229,13 +229,13 @@ def pbTrainerPCMenu
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbTrainerPC
|
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
|
pbTrainerPCMenu
|
||||||
pbSEPlay("PC close")
|
pbSEPlay("PC close")
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbPokeCenterPC
|
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
|
command = 0
|
||||||
loop do
|
loop do
|
||||||
commands = PokemonPCList.getCommandList
|
commands = PokemonPCList.getCommandList
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PokemonMartAdapter
|
class PokemonMartAdapter
|
||||||
def getMoney
|
def getMoney
|
||||||
return $Trainer.money
|
return $player.money
|
||||||
end
|
end
|
||||||
|
|
||||||
def getMoneyString
|
def getMoneyString
|
||||||
@@ -11,7 +11,7 @@ class PokemonMartAdapter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def setMoney(value)
|
def setMoney(value)
|
||||||
$Trainer.money=value
|
$player.money = value
|
||||||
end
|
end
|
||||||
|
|
||||||
def getInventory
|
def getInventory
|
||||||
|
|||||||
@@ -1299,7 +1299,7 @@ end
|
|||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbPurifyChamber
|
def pbPurifyChamber
|
||||||
$Trainer.seen_purify_chamber = true
|
$player.seen_purify_chamber = true
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
scene = PurifyChamberScene.new
|
scene = PurifyChamberScene.new
|
||||||
screen = PurifyChamberScreen.new(scene)
|
screen = PurifyChamberScreen.new(scene)
|
||||||
@@ -1312,7 +1312,7 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PurifyChamberPC
|
class PurifyChamberPC
|
||||||
def shouldShow?
|
def shouldShow?
|
||||||
return $Trainer.seen_purify_chamber
|
return $player.seen_purify_chamber
|
||||||
end
|
end
|
||||||
|
|
||||||
def name
|
def name
|
||||||
|
|||||||
@@ -194,18 +194,18 @@ def pbManageMysteryGifts
|
|||||||
newgift=pbEditMysteryGift(gift[1],gift[2],gift[0],gift[3])
|
newgift=pbEditMysteryGift(gift[1],gift[2],gift[0],gift[3])
|
||||||
master[command]=newgift if newgift
|
master[command]=newgift if newgift
|
||||||
elsif cmd==2 # Receive
|
elsif cmd==2 # Receive
|
||||||
if !$Trainer
|
if !$player
|
||||||
pbMessage(_INTL("There is no save file loaded. Cannot receive any gifts."))
|
pbMessage(_INTL("There is no save file loaded. Cannot receive any gifts."))
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
replaced=false
|
replaced=false
|
||||||
for i in 0...$Trainer.mystery_gifts.length
|
for i in 0...$player.mystery_gifts.length
|
||||||
if $Trainer.mystery_gifts[i][0]==gift[0]
|
if $player.mystery_gifts[i][0]==gift[0]
|
||||||
$Trainer.mystery_gifts[i]=gift
|
$player.mystery_gifts[i]=gift
|
||||||
replaced=true
|
replaced=true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
$Trainer.mystery_gifts.push(gift) if !replaced
|
$player.mystery_gifts.push(gift) if !replaced
|
||||||
pbReceiveMysteryGift(gift[0])
|
pbReceiveMysteryGift(gift[0])
|
||||||
elsif cmd==3 # Delete
|
elsif cmd==3 # Delete
|
||||||
master.delete_at(command) if pbConfirmMessage(_INTL("Are you sure you want to delete this gift?"))
|
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.
|
# Collecting a Mystery Gift from the deliveryman.
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbNextMysteryGiftID
|
def pbNextMysteryGiftID
|
||||||
for i in $Trainer.mystery_gifts
|
for i in $player.mystery_gifts
|
||||||
return i[0] if i.length>1
|
return i[0] if i.length>1
|
||||||
end
|
end
|
||||||
return 0
|
return 0
|
||||||
@@ -363,8 +363,8 @@ end
|
|||||||
|
|
||||||
def pbReceiveMysteryGift(id)
|
def pbReceiveMysteryGift(id)
|
||||||
index=-1
|
index=-1
|
||||||
for i in 0...$Trainer.mystery_gifts.length
|
for i in 0...$player.mystery_gifts.length
|
||||||
if $Trainer.mystery_gifts[i][0]==id && $Trainer.mystery_gifts[i].length>1
|
if $player.mystery_gifts[i][0]==id && $player.mystery_gifts[i].length>1
|
||||||
index=i
|
index=i
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -373,7 +373,7 @@ def pbReceiveMysteryGift(id)
|
|||||||
pbMessage(_INTL("Couldn't find an unclaimed Mystery Gift with ID {1}.",id))
|
pbMessage(_INTL("Couldn't find an unclaimed Mystery Gift with ID {1}.",id))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
gift=$Trainer.mystery_gifts[index]
|
gift=$player.mystery_gifts[index]
|
||||||
if gift[1]==0 # Pokémon
|
if gift[1]==0 # Pokémon
|
||||||
gift[2].personalID = rand(2**16) | rand(2**16) << 16
|
gift[2].personalID = rand(2**16) | rand(2**16) << 16
|
||||||
gift[2].calc_stats
|
gift[2].calc_stats
|
||||||
@@ -389,8 +389,8 @@ def pbReceiveMysteryGift(id)
|
|||||||
gift[2].obtain_level=gift[2].level
|
gift[2].obtain_level=gift[2].level
|
||||||
end
|
end
|
||||||
if pbAddPokemonSilent(gift[2])
|
if pbAddPokemonSilent(gift[2])
|
||||||
pbMessage(_INTL("\\me[Pkmn get]{1} received {2}!",$Trainer.name,gift[2].name))
|
pbMessage(_INTL("\\me[Pkmn get]{1} received {2}!",$player.name,gift[2].name))
|
||||||
$Trainer.mystery_gifts[index]=[id]
|
$player.mystery_gifts[index]=[id]
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
elsif gift[1]>0 # Item
|
elsif gift[1]>0 # Item
|
||||||
@@ -412,7 +412,7 @@ def pbReceiveMysteryGift(id)
|
|||||||
else
|
else
|
||||||
pbMessage(_INTL("\\me[Item get]You obtained a \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
|
pbMessage(_INTL("\\me[Item get]You obtained a \\c[1]{1}\\c[0]!\\wtnp[30]",itemname))
|
||||||
end
|
end
|
||||||
$Trainer.mystery_gifts[index]=[id]
|
$player.mystery_gifts[index]=[id]
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ class PokemonEntryScene
|
|||||||
addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport)
|
addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport)
|
||||||
case subject
|
case subject
|
||||||
when 1 # Player
|
when 1 # Player
|
||||||
meta = GameData::PlayerMetadata.get($Trainer.character_ID)
|
meta = GameData::PlayerMetadata.get($player.character_ID)
|
||||||
if meta
|
if meta
|
||||||
@sprites["shadow"]=IconSprite.new(0,0,@viewport)
|
@sprites["shadow"]=IconSprite.new(0,0,@viewport)
|
||||||
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow")
|
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow")
|
||||||
@@ -405,7 +405,7 @@ class PokemonEntryScene2
|
|||||||
@sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg")
|
@sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg")
|
||||||
case subject
|
case subject
|
||||||
when 1 # Player
|
when 1 # Player
|
||||||
meta = GameData::PlayerMetadata.get($Trainer.character_ID)
|
meta = GameData::PlayerMetadata.get($player.character_ID)
|
||||||
if meta
|
if meta
|
||||||
@sprites["shadow"] = IconSprite.new(0, 0, @viewport)
|
@sprites["shadow"] = IconSprite.new(0, 0, @viewport)
|
||||||
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow")
|
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow")
|
||||||
|
|||||||
@@ -49,10 +49,10 @@ class PokemonDuel
|
|||||||
@viewport.z = 99999
|
@viewport.z = 99999
|
||||||
@sprites = {}
|
@sprites = {}
|
||||||
@sprites["player"] = IconSprite.new(-128 - 32, 96, @viewport)
|
@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"] = IconSprite.new(Graphics.width + 32, 96, @viewport)
|
||||||
@sprites["opponent"].setBitmap(GameData::TrainerType.front_sprite_filename(opponent.trainer_type))
|
@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"].x = -@sprites["playerwindow"].width
|
||||||
@sprites["playerwindow"].viewport = @viewport
|
@sprites["playerwindow"].viewport = @viewport
|
||||||
@sprites["opponentwindow"] = DuelWindow.new(opponent.name, true)
|
@sprites["opponentwindow"] = DuelWindow.new(opponent.name, true)
|
||||||
|
|||||||
@@ -723,7 +723,7 @@ class TriadScreen
|
|||||||
count += item[1] # Add item count to total count
|
count += item[1] # Add item count to total count
|
||||||
end
|
end
|
||||||
@board = []
|
@board = []
|
||||||
@playerName = $Trainer ? $Trainer.name : "Trainer"
|
@playerName = $player ? $player.name : "Trainer"
|
||||||
@opponentName = opponentName
|
@opponentName = opponentName
|
||||||
type_keys = GameData::Type.keys
|
type_keys = GameData::Type.keys
|
||||||
for i in 0...@width*@height
|
for i in 0...@width*@height
|
||||||
@@ -781,7 +781,7 @@ class TriadScreen
|
|||||||
total = triad.north + triad.south + triad.east + triad.west
|
total = triad.north + triad.south + triad.east + triad.west
|
||||||
# Add random species and its total point count
|
# Add random species and its total point count
|
||||||
candidates.push([card, total])
|
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
|
# Add again if player owns the species
|
||||||
candidates.push([card, total])
|
candidates.push([card, total])
|
||||||
end
|
end
|
||||||
@@ -1059,7 +1059,7 @@ def pbBuyTriads
|
|||||||
commands = []
|
commands = []
|
||||||
realcommands = []
|
realcommands = []
|
||||||
GameData::Species.each_species do |s|
|
GameData::Species.each_species do |s|
|
||||||
next if !$Trainer.owned?(s.species)
|
next if !$player.owned?(s.species)
|
||||||
price = TriadCard.new(s.id).price
|
price = TriadCard.new(s.id).price
|
||||||
commands.push([price, s.name, _INTL("{1} - ${2}", s.name, price.to_s_formatted), s.id])
|
commands.push([price, s.name, _INTL("{1} - ${2}", s.name, price.to_s_formatted), s.id])
|
||||||
end
|
end
|
||||||
@@ -1107,11 +1107,11 @@ def pbBuyTriads
|
|||||||
itemname = commands[cmdwindow.index][1]
|
itemname = commands[cmdwindow.index][1]
|
||||||
cmdwindow.active = false
|
cmdwindow.active = false
|
||||||
cmdwindow.update
|
cmdwindow.update
|
||||||
if $Trainer.money<price
|
if $player.money<price
|
||||||
pbMessage(_INTL("You don't have enough money."))
|
pbMessage(_INTL("You don't have enough money."))
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
maxafford = (price<=0) ? 99 : $Trainer.money/price
|
maxafford = (price<=0) ? 99 : $player.money/price
|
||||||
maxafford = 99 if maxafford>99
|
maxafford = 99 if maxafford>99
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
params.setRange(1,maxafford)
|
params.setRange(1,maxafford)
|
||||||
@@ -1122,7 +1122,7 @@ def pbBuyTriads
|
|||||||
next if quantity<=0
|
next if quantity<=0
|
||||||
price *= quantity
|
price *= quantity
|
||||||
next if !pbConfirmMessage(_INTL("{1}, and you want {2}. That will be ${3}. OK?",itemname,quantity,price.to_s_formatted))
|
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."))
|
pbMessage(_INTL("You don't have enough money."))
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
@@ -1131,7 +1131,7 @@ def pbBuyTriads
|
|||||||
next
|
next
|
||||||
end
|
end
|
||||||
$PokemonGlobal.triads.add(item, quantity)
|
$PokemonGlobal.triads.add(item, quantity)
|
||||||
$Trainer.money -= price
|
$player.money -= price
|
||||||
goldwindow.text = _INTL("Money:\r\n{1}",pbGetGoldString)
|
goldwindow.text = _INTL("Money:\r\n{1}",pbGetGoldString)
|
||||||
pbMessage(_INTL("Here you are! Thank you!\\se[Mart buy item]"))
|
pbMessage(_INTL("Here you are! Thank you!\\se[Mart buy item]"))
|
||||||
end
|
end
|
||||||
@@ -1222,7 +1222,7 @@ def pbSellTriads
|
|||||||
price /= 4
|
price /= 4
|
||||||
price *= quantity
|
price *= quantity
|
||||||
if pbConfirmMessage(_INTL("I can pay ${1}. Would that be OK?",price.to_s_formatted))
|
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)
|
goldwindow.text = _INTL("Money:\r\n{1}",pbGetGoldString)
|
||||||
$PokemonGlobal.triads.remove(item,quantity)
|
$PokemonGlobal.triads.remove(item,quantity)
|
||||||
pbMessage(_INTL("Turned over the {1} card and received ${2}.\\se[Mart buy item]",itemname,price.to_s_formatted))
|
pbMessage(_INTL("Turned over the {1} card and received ${2}.\\se[Mart buy item]",itemname,price.to_s_formatted))
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ class SlotMachineScene
|
|||||||
@sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/insert"))
|
@sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/insert"))
|
||||||
@sprites["window1"].src_rect.set(0,0,152,208)
|
@sprites["window1"].src_rect.set(0,0,152,208)
|
||||||
@sprites["window2"]=IconSprite.new(358,96,@viewport)
|
@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)
|
@sprites["payout"]=SlotMachineScore.new(438,66,0)
|
||||||
@wager=0
|
@wager=0
|
||||||
update
|
update
|
||||||
@@ -289,7 +289,7 @@ class SlotMachineScene
|
|||||||
if @sprites["credit"].score == Settings::MAX_COINS
|
if @sprites["credit"].score == Settings::MAX_COINS
|
||||||
pbMessage(_INTL("You've got {1} Coins.", Settings::MAX_COINS.to_s_formatted))
|
pbMessage(_INTL("You've got {1} Coins.", Settings::MAX_COINS.to_s_formatted))
|
||||||
break
|
break
|
||||||
elsif $Trainer.coins==0
|
elsif $player.coins==0
|
||||||
pbMessage(_INTL("You've run out of Coins.\nGame over!"))
|
pbMessage(_INTL("You've run out of Coins.\nGame over!"))
|
||||||
break
|
break
|
||||||
elsif @gameRunning # Reels are spinning
|
elsif @gameRunning # Reels are spinning
|
||||||
@@ -361,7 +361,7 @@ class SlotMachineScene
|
|||||||
end
|
end
|
||||||
frame = (frame+1)%(Graphics.frame_rate*4)
|
frame = (frame+1)%(Graphics.frame_rate*4)
|
||||||
end
|
end
|
||||||
$Trainer.coins = @sprites["credit"].score
|
$player.coins = @sprites["credit"].score
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbEndScene
|
def pbEndScene
|
||||||
@@ -390,9 +390,9 @@ end
|
|||||||
def pbSlotMachine(difficulty=1)
|
def pbSlotMachine(difficulty=1)
|
||||||
if !$bag.has?(:COINCASE)
|
if !$bag.has?(:COINCASE)
|
||||||
pbMessage(_INTL("It's a Slot Machine."))
|
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!"))
|
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!"))
|
pbMessage(_INTL("Your Coin Case is full!"))
|
||||||
else
|
else
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
|
|||||||
@@ -108,11 +108,11 @@ class VoltorbFlip
|
|||||||
@sprites["curtainL"].visible=false
|
@sprites["curtainL"].visible=false
|
||||||
@sprites["curtainR"].visible=false
|
@sprites["curtainR"].visible=false
|
||||||
@sprites["curtain"].opacity=100
|
@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))
|
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
|
@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
|
# @quit=true
|
||||||
else
|
else
|
||||||
@sprites["curtain"].opacity=0
|
@sprites["curtain"].opacity=0
|
||||||
@@ -366,11 +366,11 @@ class VoltorbFlip
|
|||||||
pbMessage(_INTL("\\me[Voltorb Flip win]Game clear!\\wtnp[40]"))
|
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("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("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
|
# Update level text
|
||||||
@sprites["level"].bitmap.clear
|
@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)
|
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
|
@points=0
|
||||||
pbUpdateCoins
|
pbUpdateCoins
|
||||||
@sprites["curtain"].opacity=0
|
@sprites["curtain"].opacity=0
|
||||||
@@ -413,8 +413,8 @@ class VoltorbFlip
|
|||||||
@quit=true
|
@quit=true
|
||||||
end
|
end
|
||||||
elsif pbConfirmMessage(_INTL("If you quit now, you will recieve {1} Coin(s). Will you quit?",@points.to_s_formatted))
|
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))
|
pbMessage(_INTL("{1} received {2} Coin(s)!",$player.name,@points.to_s_formatted))
|
||||||
$Trainer.coins+=@points
|
$player.coins+=@points
|
||||||
@points=0
|
@points=0
|
||||||
pbUpdateCoins
|
pbUpdateCoins
|
||||||
@sprites["curtain"].opacity=0
|
@sprites["curtain"].opacity=0
|
||||||
@@ -479,7 +479,7 @@ class VoltorbFlip
|
|||||||
def pbUpdateCoins
|
def pbUpdateCoins
|
||||||
# Update coins display
|
# Update coins display
|
||||||
@sprites["totalCoins"].bitmap.clear
|
@sprites["totalCoins"].bitmap.clear
|
||||||
pbCreateCoins($Trainer.coins,44)
|
pbCreateCoins($player.coins,44)
|
||||||
pbDrawImagePositions(@sprites["totalCoins"].bitmap,@coins)
|
pbDrawImagePositions(@sprites["totalCoins"].bitmap,@coins)
|
||||||
# Update points display
|
# Update points display
|
||||||
@sprites["currentCoins"].bitmap.clear
|
@sprites["currentCoins"].bitmap.clear
|
||||||
@@ -616,7 +616,7 @@ end
|
|||||||
def pbVoltorbFlip
|
def pbVoltorbFlip
|
||||||
if !$bag.has?(:COINCASE)
|
if !$bag.has?(:COINCASE)
|
||||||
pbMessage(_INTL("You can't play unless you have a Coin Case."))
|
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!"))
|
pbMessage(_INTL("Your Coin Case is full!"))
|
||||||
else
|
else
|
||||||
scene=VoltorbFlip.new
|
scene=VoltorbFlip.new
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ def pbLottery(winnum,nameVar=2,positionVar=3,matchedVar=4)
|
|||||||
winpoke=nil
|
winpoke=nil
|
||||||
winpos=0
|
winpos=0
|
||||||
winmatched=0
|
winmatched=0
|
||||||
for i in $Trainer.party
|
for i in $player.party
|
||||||
thismatched=0
|
thismatched=0
|
||||||
id=i.owner.public_id
|
id=i.owner.public_id
|
||||||
for j in 0...5
|
for j in 0...5
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ class BattleChallengeData
|
|||||||
|
|
||||||
def setParty(value)
|
def setParty(value)
|
||||||
if @inProgress
|
if @inProgress
|
||||||
$Trainer.party = value
|
$player.party = value
|
||||||
@party = value
|
@party = value
|
||||||
else
|
else
|
||||||
@party = value
|
@party = value
|
||||||
@@ -226,8 +226,8 @@ class BattleChallengeData
|
|||||||
@trainers.push(newtrainer) if !found
|
@trainers.push(newtrainer) if !found
|
||||||
end
|
end
|
||||||
@start = [$game_map.map_id, $game_player.x, $game_player.y]
|
@start = [$game_map.map_id, $game_player.x, $game_player.y]
|
||||||
@oldParty = $Trainer.party
|
@oldParty = $player.party
|
||||||
$Trainer.party = @party if @party
|
$player.party = @party if @party
|
||||||
Game.save(safe: true)
|
Game.save(safe: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -270,12 +270,12 @@ class BattleChallengeData
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbCancel
|
def pbCancel
|
||||||
$Trainer.party = @oldParty if @oldParty
|
$player.party = @oldParty if @oldParty
|
||||||
reset
|
reset
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbEnd
|
def pbEnd
|
||||||
$Trainer.party = @oldParty
|
$player.party = @oldParty
|
||||||
return if !@inProgress
|
return if !@inProgress
|
||||||
save = (@decision != 0)
|
save = (@decision != 0)
|
||||||
reset
|
reset
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ end
|
|||||||
|
|
||||||
# Used in events
|
# Used in events
|
||||||
def pbHasEligible?(*arg)
|
def pbHasEligible?(*arg)
|
||||||
return pbBattleChallenge.rules.ruleset.hasValidTeam?($Trainer.party)
|
return pbBattleChallenge.rules.ruleset.hasValidTeam?($player.party)
|
||||||
end
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -39,7 +39,7 @@ def pbEntryScreen(*arg)
|
|||||||
retval = false
|
retval = false
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
scene = PokemonParty_Scene.new
|
scene = PokemonParty_Scene.new
|
||||||
screen = PokemonPartyScreen.new(scene, $Trainer.party)
|
screen = PokemonPartyScreen.new(scene, $player.party)
|
||||||
ret = screen.pbPokemonMultipleEntryScreenEx(pbBattleChallenge.rules.ruleset)
|
ret = screen.pbPokemonMultipleEntryScreenEx(pbBattleChallenge.rules.ruleset)
|
||||||
# Set party
|
# Set party
|
||||||
pbBattleChallenge.setParty(ret) if ret
|
pbBattleChallenge.setParty(ret) if ret
|
||||||
|
|||||||
@@ -47,16 +47,16 @@ def pbOrganizedBattleEx(opponent, challengedata, endspeech, endspeechwin)
|
|||||||
pbMEStop
|
pbMEStop
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
$Trainer.heal_party
|
$player.heal_party
|
||||||
# Remember original data, to be restored after battle
|
# Remember original data, to be restored after battle
|
||||||
challengedata = PokemonChallengeRules.new if !challengedata
|
challengedata = PokemonChallengeRules.new if !challengedata
|
||||||
oldlevels = challengedata.adjustLevels($Trainer.party, opponent.party)
|
oldlevels = challengedata.adjustLevels($player.party, opponent.party)
|
||||||
olditems = $Trainer.party.transform { |p| p.item_id }
|
olditems = $player.party.transform { |p| p.item_id }
|
||||||
olditems2 = opponent.party.transform { |p| p.item_id }
|
olditems2 = opponent.party.transform { |p| p.item_id }
|
||||||
# Create the battle scene (the visual side of it)
|
# Create the battle scene (the visual side of it)
|
||||||
scene = pbNewBattleScene
|
scene = pbNewBattleScene
|
||||||
# Create the battle class (the mechanics side of it)
|
# 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.internalBattle = false
|
||||||
battle.endSpeeches = [endspeech]
|
battle.endSpeeches = [endspeech]
|
||||||
battle.endSpeechesWin = [endspeechwin]
|
battle.endSpeechesWin = [endspeechwin]
|
||||||
@@ -71,9 +71,9 @@ def pbOrganizedBattleEx(opponent, challengedata, endspeech, endspeechwin)
|
|||||||
}
|
}
|
||||||
Input.update
|
Input.update
|
||||||
# Restore both parties to their original levels
|
# 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
|
# 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.heal
|
||||||
pkmn.makeUnmega
|
pkmn.makeUnmega
|
||||||
pkmn.makeUnprimal
|
pkmn.makeUnprimal
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ def pbSafariBattle(species,level)
|
|||||||
pkmn = pbGenerateWildPokemon(species,level)
|
pkmn = pbGenerateWildPokemon(species,level)
|
||||||
foeParty = [pkmn]
|
foeParty = [pkmn]
|
||||||
# Calculate who the trainer is
|
# Calculate who the trainer is
|
||||||
playerTrainer = $Trainer
|
playerTrainer = $player
|
||||||
# Create the battle scene (the visual side of it)
|
# Create the battle scene (the visual side of it)
|
||||||
scene = pbNewBattleScene
|
scene = pbNewBattleScene
|
||||||
# Create the battle class (the mechanics side of it)
|
# Create the battle class (the mechanics side of it)
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class BugContestState
|
|||||||
def pbGetPlaceInfo(place)
|
def pbGetPlaceInfo(place)
|
||||||
cont=@places[place][0]
|
cont=@places[place][0]
|
||||||
if cont<0
|
if cont<0
|
||||||
$game_variables[1]=$Trainer.name
|
$game_variables[1]=$player.name
|
||||||
else
|
else
|
||||||
$game_variables[1]=ContestantNames[cont]
|
$game_variables[1]=ContestantNames[cont]
|
||||||
end
|
end
|
||||||
@@ -171,9 +171,9 @@ class BugContestState
|
|||||||
@lastContest=nil
|
@lastContest=nil
|
||||||
@timer=Graphics.frame_count
|
@timer=Graphics.frame_count
|
||||||
@places=[]
|
@places=[]
|
||||||
chosenpkmn=$Trainer.party[@chosenPokemon]
|
chosenpkmn=$player.party[@chosenPokemon]
|
||||||
for i in 0...$Trainer.party.length
|
for i in 0...$player.party.length
|
||||||
@otherparty.push($Trainer.party[i]) if i!=@chosenPokemon
|
@otherparty.push($player.party[i]) if i!=@chosenPokemon
|
||||||
end
|
end
|
||||||
@contestants=[]
|
@contestants=[]
|
||||||
[5,ContestantNames.length].min.times do
|
[5,ContestantNames.length].min.times do
|
||||||
@@ -185,7 +185,7 @@ class BugContestState
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
$Trainer.party=[chosenpkmn]
|
$player.party=[chosenpkmn]
|
||||||
@decision=0
|
@decision=0
|
||||||
@ended=false
|
@ended=false
|
||||||
end
|
end
|
||||||
@@ -200,7 +200,7 @@ class BugContestState
|
|||||||
def pbEnd(interrupted=false)
|
def pbEnd(interrupted=false)
|
||||||
return if !@inProgress
|
return if !@inProgress
|
||||||
for poke in @otherparty
|
for poke in @otherparty
|
||||||
$Trainer.party.push(poke)
|
$player.party.push(poke)
|
||||||
end
|
end
|
||||||
if !interrupted
|
if !interrupted
|
||||||
if @lastPokemon
|
if @lastPokemon
|
||||||
@@ -329,7 +329,7 @@ Events.onMapChanging += proc { |_sender,e|
|
|||||||
}
|
}
|
||||||
|
|
||||||
def pbBugContestStartOver
|
def pbBugContestStartOver
|
||||||
$Trainer.party.each do |pkmn|
|
$player.party.each do |pkmn|
|
||||||
pkmn.heal
|
pkmn.heal
|
||||||
pkmn.makeUnmega
|
pkmn.makeUnmega
|
||||||
pkmn.makeUnprimal
|
pkmn.makeUnprimal
|
||||||
@@ -354,8 +354,8 @@ def pbBugContestBattle(species,level)
|
|||||||
pkmn = pbGenerateWildPokemon(species,level)
|
pkmn = pbGenerateWildPokemon(species,level)
|
||||||
foeParty = [pkmn]
|
foeParty = [pkmn]
|
||||||
# Calculate who the trainers and their party are
|
# Calculate who the trainers and their party are
|
||||||
playerTrainer = [$Trainer]
|
playerTrainer = [$player]
|
||||||
playerParty = $Trainer.party
|
playerParty = $player.party
|
||||||
playerPartyStarts = [0]
|
playerPartyStarts = [0]
|
||||||
# Create the battle scene (the visual side of it)
|
# Create the battle scene (the visual side of it)
|
||||||
scene = pbNewBattleScene
|
scene = pbNewBattleScene
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Unused
|
# Unused
|
||||||
def pbGetPlayerGraphic
|
def pbGetPlayerGraphic
|
||||||
id = $Trainer.character_ID
|
id = $player.character_ID
|
||||||
return "" if id < 1
|
return "" if id < 1
|
||||||
meta = GameData::PlayerMetadata.get(id)
|
meta = GameData::PlayerMetadata.get(id)
|
||||||
return "" if !meta
|
return "" if !meta
|
||||||
@@ -223,24 +223,24 @@ def pbChangePlayer(id)
|
|||||||
return false if id < 1
|
return false if id < 1
|
||||||
meta = GameData::PlayerMetadata.get(id)
|
meta = GameData::PlayerMetadata.get(id)
|
||||||
return false if !meta
|
return false if !meta
|
||||||
$Trainer.character_ID = id
|
$player.character_ID = id
|
||||||
$Trainer.trainer_type = meta.trainer_type
|
$player.trainer_type = meta.trainer_type
|
||||||
$game_player.character_name = meta.walk_charset
|
$game_player.character_name = meta.walk_charset
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbTrainerName(name = nil, outfit = 0)
|
def pbTrainerName(name = nil, outfit = 0)
|
||||||
pbChangePlayer(1) if $Trainer.character_ID < 1
|
pbChangePlayer(1) if $player.character_ID < 1
|
||||||
if name.nil?
|
if name.nil?
|
||||||
name = pbEnterPlayerName(_INTL("Your name?"), 0, Settings::MAX_PLAYER_NAME_SIZE)
|
name = pbEnterPlayerName(_INTL("Your name?"), 0, Settings::MAX_PLAYER_NAME_SIZE)
|
||||||
if name.nil? || name.empty?
|
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
|
trainer_type = (player_metadata) ? player_metadata.trainer_type : nil
|
||||||
gender = pbGetTrainerTypeGender(trainer_type)
|
gender = pbGetTrainerTypeGender(trainer_type)
|
||||||
name = pbSuggestTrainerName(gender)
|
name = pbSuggestTrainerName(gender)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
$Trainer.name = name
|
$player.name = name
|
||||||
$Trainer.outfit = outfit
|
$player.outfit = outfit
|
||||||
$PokemonTemp.begunNewGame = true
|
$PokemonTemp.begunNewGame = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -406,7 +406,7 @@ end
|
|||||||
|
|
||||||
def pbMoveTutorAnnotations(move, movelist = nil)
|
def pbMoveTutorAnnotations(move, movelist = nil)
|
||||||
ret = []
|
ret = []
|
||||||
$Trainer.party.each_with_index do |pkmn, i|
|
$player.party.each_with_index do |pkmn, i|
|
||||||
if pkmn.egg?
|
if pkmn.egg?
|
||||||
ret[i] = _INTL("NOT ABLE")
|
ret[i] = _INTL("NOT ABLE")
|
||||||
elsif pkmn.hasMove?(move)
|
elsif pkmn.hasMove?(move)
|
||||||
@@ -439,12 +439,12 @@ def pbMoveTutorChoose(move,movelist=nil,bymachine=false,oneusemachine=false)
|
|||||||
movename = GameData::Move.get(move).name
|
movename = GameData::Move.get(move).name
|
||||||
annot = pbMoveTutorAnnotations(move,movelist)
|
annot = pbMoveTutorAnnotations(move,movelist)
|
||||||
scene = PokemonParty_Scene.new
|
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)
|
screen.pbStartScene(_INTL("Teach which Pokémon?"),false,annot)
|
||||||
loop do
|
loop do
|
||||||
chosen = screen.pbChoosePokemon
|
chosen = screen.pbChoosePokemon
|
||||||
break if chosen<0
|
break if chosen<0
|
||||||
pokemon = $Trainer.party[chosen]
|
pokemon = $player.party[chosen]
|
||||||
if pokemon.egg?
|
if pokemon.egg?
|
||||||
pbMessage(_INTL("Eggs can't be taught any moves.")) { screen.pbUpdate }
|
pbMessage(_INTL("Eggs can't be taught any moves.")) { screen.pbUpdate }
|
||||||
elsif pokemon.shadowPokemon?
|
elsif pokemon.shadowPokemon?
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Nicknaming and storing Pokémon
|
# Nicknaming and storing Pokémon
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbBoxesFull?
|
def pbBoxesFull?
|
||||||
return ($Trainer.party_full? && $PokemonStorage.full?)
|
return ($player.party_full? && $PokemonStorage.full?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbNickname(pkmn)
|
def pbNickname(pkmn)
|
||||||
@@ -20,13 +20,13 @@ def pbStorePokemon(pkmn)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
pkmn.record_first_moves
|
pkmn.record_first_moves
|
||||||
if $Trainer.party_full?
|
if $player.party_full?
|
||||||
oldcurbox = $PokemonStorage.currentBox
|
oldcurbox = $PokemonStorage.currentBox
|
||||||
storedbox = $PokemonStorage.pbStoreCaught(pkmn)
|
storedbox = $PokemonStorage.pbStoreCaught(pkmn)
|
||||||
curboxname = $PokemonStorage[oldcurbox].name
|
curboxname = $PokemonStorage[oldcurbox].name
|
||||||
boxname = $PokemonStorage[storedbox].name
|
boxname = $PokemonStorage[storedbox].name
|
||||||
creator = nil
|
creator = nil
|
||||||
creator = pbGetStorageCreator if $Trainer.seen_storage_creator
|
creator = pbGetStorageCreator if $player.seen_storage_creator
|
||||||
if storedbox != oldcurbox
|
if storedbox != oldcurbox
|
||||||
if creator
|
if creator
|
||||||
pbMessage(_INTL("Box \"{1}\" on {2}'s PC was full.\1", curboxname, 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))
|
pbMessage(_INTL("It was stored in box \"{1}.\"", boxname))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
$Trainer.party[$Trainer.party.length] = pkmn
|
$player.party[$player.party.length] = pkmn
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -53,8 +53,8 @@ def pbNicknameAndStore(pkmn)
|
|||||||
pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!"))
|
pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!"))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
$Trainer.pokedex.set_seen(pkmn.species)
|
$player.pokedex.set_seen(pkmn.species)
|
||||||
$Trainer.pokedex.set_owned(pkmn.species)
|
$player.pokedex.set_owned(pkmn.species)
|
||||||
pbNickname(pkmn)
|
pbNickname(pkmn)
|
||||||
pbStorePokemon(pkmn)
|
pbStorePokemon(pkmn)
|
||||||
end
|
end
|
||||||
@@ -71,22 +71,22 @@ def pbAddPokemon(pkmn, level = 1, see_form = true)
|
|||||||
end
|
end
|
||||||
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
|
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
|
||||||
species_name = pkmn.speciesName
|
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)
|
pbNicknameAndStore(pkmn)
|
||||||
$Trainer.pokedex.register(pkmn) if see_form
|
$player.pokedex.register(pkmn) if see_form
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbAddPokemonSilent(pkmn, level = 1, see_form = true)
|
def pbAddPokemonSilent(pkmn, level = 1, see_form = true)
|
||||||
return false if !pkmn || pbBoxesFull?
|
return false if !pkmn || pbBoxesFull?
|
||||||
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
|
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
|
||||||
$Trainer.pokedex.register(pkmn) if see_form
|
$player.pokedex.register(pkmn) if see_form
|
||||||
$Trainer.pokedex.set_owned(pkmn.species)
|
$player.pokedex.set_owned(pkmn.species)
|
||||||
pkmn.record_first_moves
|
pkmn.record_first_moves
|
||||||
if $Trainer.party_full?
|
if $player.party_full?
|
||||||
$PokemonStorage.pbStoreCaught(pkmn)
|
$PokemonStorage.pbStoreCaught(pkmn)
|
||||||
else
|
else
|
||||||
$Trainer.party[$Trainer.party.length] = pkmn
|
$player.party[$player.party.length] = pkmn
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -95,27 +95,27 @@ end
|
|||||||
# Giving Pokémon/eggs to the player (can only add to party)
|
# Giving Pokémon/eggs to the player (can only add to party)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbAddToParty(pkmn, level = 1, see_form = true)
|
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)
|
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
|
||||||
species_name = pkmn.speciesName
|
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)
|
pbNicknameAndStore(pkmn)
|
||||||
$Trainer.pokedex.register(pkmn) if see_form
|
$player.pokedex.register(pkmn) if see_form
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbAddToPartySilent(pkmn, level = nil, see_form = true)
|
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)
|
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
|
||||||
$Trainer.pokedex.register(pkmn) if see_form
|
$player.pokedex.register(pkmn) if see_form
|
||||||
$Trainer.pokedex.set_owned(pkmn.species)
|
$player.pokedex.set_owned(pkmn.species)
|
||||||
pkmn.record_first_moves
|
pkmn.record_first_moves
|
||||||
$Trainer.party[$Trainer.party.length] = pkmn
|
$player.party[$player.party.length] = pkmn
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbAddForeignPokemon(pkmn, level = 1, owner_name = nil, nickname = nil, owner_gender = 0, see_form = true)
|
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)
|
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
|
||||||
# Set original trainer to a foreign one
|
# Set original trainer to a foreign one
|
||||||
pkmn.owner = Pokemon::Owner.new_foreign(owner_name || "", owner_gender)
|
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
|
# Recalculate stats
|
||||||
pkmn.calc_stats
|
pkmn.calc_stats
|
||||||
if owner_name
|
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
|
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
|
end
|
||||||
pbStorePokemon(pkmn)
|
pbStorePokemon(pkmn)
|
||||||
$Trainer.pokedex.register(pkmn) if see_form
|
$player.pokedex.register(pkmn) if see_form
|
||||||
$Trainer.pokedex.set_owned(pkmn.species)
|
$player.pokedex.set_owned(pkmn.species)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbGenerateEgg(pkmn, text = "")
|
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)
|
pkmn = Pokemon.new(pkmn, Settings::EGG_LEVEL) if !pkmn.is_a?(Pokemon)
|
||||||
# Set egg's details
|
# Set egg's details
|
||||||
pkmn.name = _INTL("Egg")
|
pkmn.name = _INTL("Egg")
|
||||||
@@ -143,7 +143,7 @@ def pbGenerateEgg(pkmn, text = "")
|
|||||||
pkmn.obtain_text = text
|
pkmn.obtain_text = text
|
||||||
pkmn.calc_stats
|
pkmn.calc_stats
|
||||||
# Add egg to party
|
# Add egg to party
|
||||||
$Trainer.party[$Trainer.party.length] = pkmn
|
$player.party[$player.party.length] = pkmn
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
alias pbAddEgg pbGenerateEgg
|
alias pbAddEgg pbGenerateEgg
|
||||||
@@ -154,7 +154,7 @@ alias pbGenEgg pbGenerateEgg
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Returns the first unfainted, non-egg Pokémon in the player's party.
|
# Returns the first unfainted, non-egg Pokémon in the player's party.
|
||||||
def pbFirstAblePokemon(variable_ID)
|
def pbFirstAblePokemon(variable_ID)
|
||||||
$Trainer.party.each_with_index do |pkmn, i|
|
$player.party.each_with_index do |pkmn, i|
|
||||||
next if !pkmn.able?
|
next if !pkmn.able?
|
||||||
pbSet(variable_ID, i)
|
pbSet(variable_ID, i)
|
||||||
return pkmn
|
return pkmn
|
||||||
|
|||||||
@@ -564,13 +564,13 @@ DebugMenuCommands.register("demoparty", {
|
|||||||
for id in species
|
for id in species
|
||||||
party.push(id) if GameData::Species.exists?(id)
|
party.push(id) if GameData::Species.exists?(id)
|
||||||
end
|
end
|
||||||
$Trainer.party.clear
|
$player.party.clear
|
||||||
# Generate Pokémon of each species at level 20
|
# Generate Pokémon of each species at level 20
|
||||||
party.each do |species|
|
party.each do |species|
|
||||||
pkmn = Pokemon.new(species, 20)
|
pkmn = Pokemon.new(species, 20)
|
||||||
$Trainer.party.push(pkmn)
|
$player.party.push(pkmn)
|
||||||
$Trainer.pokedex.register(pkmn)
|
$player.pokedex.register(pkmn)
|
||||||
$Trainer.pokedex.set_owned(species)
|
$player.pokedex.set_owned(species)
|
||||||
case species
|
case species
|
||||||
when :PIDGEOTTO
|
when :PIDGEOTTO
|
||||||
pkmn.learn_move(:FLY)
|
pkmn.learn_move(:FLY)
|
||||||
@@ -602,7 +602,7 @@ DebugMenuCommands.register("healparty", {
|
|||||||
"name" => _INTL("Heal Party"),
|
"name" => _INTL("Heal Party"),
|
||||||
"description" => _INTL("Fully heal the HP/status/PP of all Pokémon in the party."),
|
"description" => _INTL("Fully heal the HP/status/PP of all Pokémon in the party."),
|
||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
$Trainer.party.each { |pkmn| pkmn.heal }
|
$player.party.each { |pkmn| pkmn.heal }
|
||||||
pbMessage(_INTL("Your Pokémon were fully healed."))
|
pbMessage(_INTL("Your Pokémon were fully healed."))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -612,7 +612,7 @@ DebugMenuCommands.register("quickhatch", {
|
|||||||
"name" => _INTL("Quick Hatch"),
|
"name" => _INTL("Quick Hatch"),
|
||||||
"description" => _INTL("Make all eggs in the party require just one more step to hatch."),
|
"description" => _INTL("Make all eggs in the party require just one more step to hatch."),
|
||||||
"effect" => proc {
|
"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."))
|
pbMessage(_INTL("All eggs in your party now require one step to hatch."))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -632,15 +632,15 @@ DebugMenuCommands.register("fillboxes", {
|
|||||||
if f == 0
|
if f == 0
|
||||||
if species_data.single_gendered?
|
if species_data.single_gendered?
|
||||||
g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0
|
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
|
else # Both male and female
|
||||||
$Trainer.pokedex.register(sp, 0, f, false)
|
$player.pokedex.register(sp, 0, f, false)
|
||||||
$Trainer.pokedex.register(sp, 1, f, false)
|
$player.pokedex.register(sp, 1, f, false)
|
||||||
end
|
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?
|
elsif species_data.real_form_name && !species_data.real_form_name.empty?
|
||||||
g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0
|
g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0
|
||||||
$Trainer.pokedex.register(sp, g, f, false)
|
$player.pokedex.register(sp, g, f, false)
|
||||||
end
|
end
|
||||||
# Add Pokémon (if form 0, i.e. one of each species)
|
# Add Pokémon (if form 0, i.e. one of each species)
|
||||||
next if f != 0
|
next if f != 0
|
||||||
@@ -651,7 +651,7 @@ DebugMenuCommands.register("fillboxes", {
|
|||||||
added += 1
|
added += 1
|
||||||
$PokemonStorage[(added - 1) / box_qty, (added - 1) % box_qty] = Pokemon.new(sp, 50)
|
$PokemonStorage[(added - 1) / box_qty, (added - 1) % box_qty] = Pokemon.new(sp, 50)
|
||||||
end
|
end
|
||||||
$Trainer.pokedex.refresh_accessible_dexes
|
$player.pokedex.refresh_accessible_dexes
|
||||||
pbMessage(_INTL("Storage boxes were filled with one Pokémon of each species."))
|
pbMessage(_INTL("Storage boxes were filled with one Pokémon of each species."))
|
||||||
if !completed
|
if !completed
|
||||||
pbMessage(_INTL("Note: The number of storage spaces ({1} boxes of {2}) is less than the number of species.",
|
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("Give all"))
|
||||||
badgecmds.push(_INTL("Remove all"))
|
badgecmds.push(_INTL("Remove all"))
|
||||||
for i in 0...24
|
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
|
end
|
||||||
badgecmd = pbShowCommands(nil, badgecmds, -1, badgecmd)
|
badgecmd = pbShowCommands(nil, badgecmds, -1, badgecmd)
|
||||||
break if badgecmd < 0
|
break if badgecmd < 0
|
||||||
if badgecmd == 0 # Give all
|
if badgecmd == 0 # Give all
|
||||||
24.times { |i| $Trainer.badges[i] = true }
|
24.times { |i| $player.badges[i] = true }
|
||||||
elsif badgecmd == 1 # Remove all
|
elsif badgecmd == 1 # Remove all
|
||||||
24.times { |i| $Trainer.badges[i] = false }
|
24.times { |i| $player.badges[i] = false }
|
||||||
else
|
else
|
||||||
$Trainer.badges[badgecmd - 2] = !$Trainer.badges[badgecmd - 2]
|
$player.badges[badgecmd - 2] = !$player.badges[badgecmd - 2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@@ -729,9 +729,9 @@ DebugMenuCommands.register("setmoney", {
|
|||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
params.setRange(0, Settings::MAX_MONEY)
|
params.setRange(0, Settings::MAX_MONEY)
|
||||||
params.setDefaultValue($Trainer.money)
|
params.setDefaultValue($player.money)
|
||||||
$Trainer.money = pbMessageChooseNumber(_INTL("Set the player's money."), params)
|
$player.money = pbMessageChooseNumber(_INTL("Set the player's money."), params)
|
||||||
pbMessage(_INTL("You now have ${1}.", $Trainer.money.to_s_formatted))
|
pbMessage(_INTL("You now have ${1}.", $player.money.to_s_formatted))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -742,9 +742,9 @@ DebugMenuCommands.register("setcoins", {
|
|||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
params.setRange(0, Settings::MAX_COINS)
|
params.setRange(0, Settings::MAX_COINS)
|
||||||
params.setDefaultValue($Trainer.coins)
|
params.setDefaultValue($player.coins)
|
||||||
$Trainer.coins = pbMessageChooseNumber(_INTL("Set the player's Coin amount."), params)
|
$player.coins = pbMessageChooseNumber(_INTL("Set the player's Coin amount."), params)
|
||||||
pbMessage(_INTL("You now have {1} Coins.", $Trainer.coins.to_s_formatted))
|
pbMessage(_INTL("You now have {1} Coins.", $player.coins.to_s_formatted))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -755,9 +755,9 @@ DebugMenuCommands.register("setbp", {
|
|||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
params.setRange(0, Settings::MAX_BATTLE_POINTS)
|
params.setRange(0, Settings::MAX_BATTLE_POINTS)
|
||||||
params.setDefaultValue($Trainer.battle_points)
|
params.setDefaultValue($player.battle_points)
|
||||||
$Trainer.battle_points = pbMessageChooseNumber(_INTL("Set the player's BP amount."), params)
|
$player.battle_points = pbMessageChooseNumber(_INTL("Set the player's BP amount."), params)
|
||||||
pbMessage(_INTL("You now have {1} BP.", $Trainer.battle_points.to_s_formatted))
|
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"),
|
"name" => _INTL("Toggle Running Shoes"),
|
||||||
"description" => _INTL("Toggle possession of running shoes."),
|
"description" => _INTL("Toggle possession of running shoes."),
|
||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
$Trainer.has_running_shoes = !$Trainer.has_running_shoes
|
$player.has_running_shoes = !$player.has_running_shoes
|
||||||
pbMessage(_INTL("Gave Running Shoes.")) if $Trainer.has_running_shoes
|
pbMessage(_INTL("Gave Running Shoes.")) if $player.has_running_shoes
|
||||||
pbMessage(_INTL("Lost Running Shoes.")) if !$Trainer.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"),
|
"name" => _INTL("Toggle Pokégear"),
|
||||||
"description" => _INTL("Toggle possession of the Pokégear."),
|
"description" => _INTL("Toggle possession of the Pokégear."),
|
||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
$Trainer.has_pokegear = !$Trainer.has_pokegear
|
$player.has_pokegear = !$player.has_pokegear
|
||||||
pbMessage(_INTL("Gave Pokégear.")) if $Trainer.has_pokegear
|
pbMessage(_INTL("Gave Pokégear.")) if $player.has_pokegear
|
||||||
pbMessage(_INTL("Lost Pokégear.")) if !$Trainer.has_pokegear
|
pbMessage(_INTL("Lost Pokégear.")) if !$player.has_pokegear
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -791,23 +791,23 @@ DebugMenuCommands.register("dexlists", {
|
|||||||
dexescmd = 0
|
dexescmd = 0
|
||||||
loop do
|
loop do
|
||||||
dexescmds = []
|
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
|
dex_names = Settings.pokedex_names
|
||||||
for i in 0...dex_names.length
|
for i in 0...dex_names.length
|
||||||
name = (dex_names[i].is_a?(Array)) ? dex_names[i][0] : dex_names[i]
|
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))
|
dexescmds.push(_INTL("{1} {2}", unlocked ? "[Y]" : "[ ]", name))
|
||||||
end
|
end
|
||||||
dexescmd = pbShowCommands(nil, dexescmds, -1, dexescmd)
|
dexescmd = pbShowCommands(nil, dexescmds, -1, dexescmd)
|
||||||
break if dexescmd < 0
|
break if dexescmd < 0
|
||||||
dexindex = dexescmd - 1
|
dexindex = dexescmd - 1
|
||||||
if dexindex < 0 # Toggle Pokédex ownership
|
if dexindex < 0 # Toggle Pokédex ownership
|
||||||
$Trainer.has_pokedex = !$Trainer.has_pokedex
|
$player.has_pokedex = !$player.has_pokedex
|
||||||
else # Toggle Regional Dex accessibility
|
else # Toggle Regional Dex accessibility
|
||||||
if $Trainer.pokedex.unlocked?(dexindex)
|
if $player.pokedex.unlocked?(dexindex)
|
||||||
$Trainer.pokedex.lock(dexindex)
|
$player.pokedex.lock(dexindex)
|
||||||
else
|
else
|
||||||
$Trainer.pokedex.unlock(dexindex)
|
$player.pokedex.unlock(dexindex)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -823,7 +823,7 @@ DebugMenuCommands.register("setplayer", {
|
|||||||
cmds = []
|
cmds = []
|
||||||
ids = []
|
ids = []
|
||||||
GameData::PlayerMetadata.each do |player|
|
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)
|
cmds.push(player.id.to_s)
|
||||||
ids.push(player.id)
|
ids.push(player.id)
|
||||||
end
|
end
|
||||||
@@ -844,12 +844,12 @@ DebugMenuCommands.register("changeoutfit", {
|
|||||||
"name" => _INTL("Set Player Outfit"),
|
"name" => _INTL("Set Player Outfit"),
|
||||||
"description" => _INTL("Edit the player's outfit number."),
|
"description" => _INTL("Edit the player's outfit number."),
|
||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
oldoutfit = $Trainer.outfit
|
oldoutfit = $player.outfit
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
params.setRange(0, 99)
|
params.setRange(0, 99)
|
||||||
params.setDefaultValue(oldoutfit)
|
params.setDefaultValue(oldoutfit)
|
||||||
$Trainer.outfit = pbMessageChooseNumber(_INTL("Set the player's outfit."), params)
|
$player.outfit = pbMessageChooseNumber(_INTL("Set the player's outfit."), params)
|
||||||
pbMessage(_INTL("Player's outfit was changed.")) if $Trainer.outfit != oldoutfit
|
pbMessage(_INTL("Player's outfit was changed.")) if $player.outfit != oldoutfit
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -858,17 +858,17 @@ DebugMenuCommands.register("renameplayer", {
|
|||||||
"name" => _INTL("Set Player Name"),
|
"name" => _INTL("Set Player Name"),
|
||||||
"description" => _INTL("Rename the player."),
|
"description" => _INTL("Rename the player."),
|
||||||
"effect" => proc {
|
"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?"))
|
if nil_or_empty?(trname) && pbConfirmMessage(_INTL("Give yourself a default name?"))
|
||||||
trainertype = $Trainer.trainer_type
|
trainertype = $player.trainer_type
|
||||||
gender = pbGetTrainerTypeGender(trainertype)
|
gender = pbGetTrainerTypeGender(trainertype)
|
||||||
trname = pbSuggestTrainerName(gender)
|
trname = pbSuggestTrainerName(gender)
|
||||||
end
|
end
|
||||||
if nil_or_empty?(trname)
|
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
|
else
|
||||||
$Trainer.name = trname
|
$player.name = trname
|
||||||
pbMessage(_INTL("The player's name was changed to {1}.", $Trainer.name))
|
pbMessage(_INTL("The player's name was changed to {1}.", $player.name))
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -878,8 +878,8 @@ DebugMenuCommands.register("randomid", {
|
|||||||
"name" => _INTL("Randomize Player ID"),
|
"name" => _INTL("Randomize Player ID"),
|
||||||
"description" => _INTL("Generate a random new ID for the player."),
|
"description" => _INTL("Generate a random new ID for the player."),
|
||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
$Trainer.id = rand(2 ** 16) | rand(2 ** 16) << 16
|
$player.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))
|
pbMessage(_INTL("The player's ID was changed to {1} (full ID: {2}).", $player.public_ID, $player.id))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ def pbDebugDayCare
|
|||||||
when 0 # Withdraw Pokémon 1
|
when 0 # Withdraw Pokémon 1
|
||||||
if !$PokemonGlobal.daycare[0][0]
|
if !$PokemonGlobal.daycare[0][0]
|
||||||
pbPlayBuzzerSE
|
pbPlayBuzzerSE
|
||||||
elsif $Trainer.party_full?
|
elsif $player.party_full?
|
||||||
pbPlayBuzzerSE
|
pbPlayBuzzerSE
|
||||||
pbMessage(_INTL("Party is full, can't withdraw Pokémon."))
|
pbMessage(_INTL("Party is full, can't withdraw Pokémon."))
|
||||||
else
|
else
|
||||||
@@ -303,7 +303,7 @@ def pbDebugDayCare
|
|||||||
when 1 # Withdraw Pokémon 2
|
when 1 # Withdraw Pokémon 2
|
||||||
if !$PokemonGlobal.daycare[1][0]
|
if !$PokemonGlobal.daycare[1][0]
|
||||||
pbPlayBuzzerSE
|
pbPlayBuzzerSE
|
||||||
elsif $Trainer.party_full?
|
elsif $player.party_full?
|
||||||
pbPlayBuzzerSE
|
pbPlayBuzzerSE
|
||||||
pbMessage(_INTL("Party is full, can't withdraw Pokémon."))
|
pbMessage(_INTL("Party is full, can't withdraw Pokémon."))
|
||||||
else
|
else
|
||||||
@@ -315,7 +315,7 @@ def pbDebugDayCare
|
|||||||
when 2 # Deposit Pokémon
|
when 2 # Deposit Pokémon
|
||||||
if pbDayCareDeposited==2
|
if pbDayCareDeposited==2
|
||||||
pbPlayBuzzerSE
|
pbPlayBuzzerSE
|
||||||
elsif $Trainer.party.length==0
|
elsif $player.party.length == 0
|
||||||
pbPlayBuzzerSE
|
pbPlayBuzzerSE
|
||||||
pbMessage(_INTL("Party is empty, can't deposit Pokémon."))
|
pbMessage(_INTL("Party is empty, can't deposit Pokémon."))
|
||||||
else
|
else
|
||||||
@@ -344,7 +344,7 @@ def pbDebugDayCare
|
|||||||
when 4 # Collect egg
|
when 4 # Collect egg
|
||||||
if $PokemonGlobal.daycareEgg!=1
|
if $PokemonGlobal.daycareEgg!=1
|
||||||
pbPlayBuzzerSE
|
pbPlayBuzzerSE
|
||||||
elsif $Trainer.party_full?
|
elsif $player.party_full?
|
||||||
pbPlayBuzzerSE
|
pbPlayBuzzerSE
|
||||||
pbMessage(_INTL("Party is full, can't collect the egg."))
|
pbMessage(_INTL("Party is full, can't collect the egg."))
|
||||||
else
|
else
|
||||||
@@ -352,7 +352,7 @@ def pbDebugDayCare
|
|||||||
pbDayCareGenerateEgg
|
pbDayCareGenerateEgg
|
||||||
$PokemonGlobal.daycareEgg = 0
|
$PokemonGlobal.daycareEgg = 0
|
||||||
$PokemonGlobal.daycareEggSteps = 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
|
refresh = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -643,7 +643,7 @@ PokemonDebugMenuCommands.register("setitem", {
|
|||||||
if item && item != pkmn.item_id
|
if item && item != pkmn.item_id
|
||||||
pkmn.item = item
|
pkmn.item = item
|
||||||
if GameData::Item.get(item).is_mail?
|
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
|
end
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
@@ -783,7 +783,7 @@ PokemonDebugMenuCommands.register("setgender", {
|
|||||||
when 2 # Reset
|
when 2 # Reset
|
||||||
pkmn.gender = nil
|
pkmn.gender = nil
|
||||||
end
|
end
|
||||||
$Trainer.pokedex.register(pkmn) if !settingUpBattle
|
$player.pokedex.register(pkmn) if !settingUpBattle
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -811,7 +811,7 @@ PokemonDebugMenuCommands.register("speciesform", {
|
|||||||
if species && species != pkmn.species
|
if species && species != pkmn.species
|
||||||
pkmn.species = species
|
pkmn.species = species
|
||||||
pkmn.calc_stats
|
pkmn.calc_stats
|
||||||
$Trainer.pokedex.register(pkmn) if !settingUpBattle
|
$player.pokedex.register(pkmn) if !settingUpBattle
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
when 1 # Set form
|
when 1 # Set form
|
||||||
@@ -838,7 +838,7 @@ PokemonDebugMenuCommands.register("speciesform", {
|
|||||||
pkmn.forced_form = f
|
pkmn.forced_form = f
|
||||||
end
|
end
|
||||||
pkmn.form = f
|
pkmn.form = f
|
||||||
$Trainer.pokedex.register(pkmn) if !settingUpBattle
|
$player.pokedex.register(pkmn) if !settingUpBattle
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -998,7 +998,7 @@ PokemonDebugMenuCommands.register("ownership", {
|
|||||||
gender = [_INTL("Male"), _INTL("Female"), _INTL("Unknown")][pkmn.owner.gender]
|
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),
|
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)
|
_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, [
|
cmd = screen.pbShowCommands(msg, [
|
||||||
_INTL("Make player's"),
|
_INTL("Make player's"),
|
||||||
_INTL("Set OT's name"),
|
_INTL("Set OT's name"),
|
||||||
@@ -1008,7 +1008,7 @@ PokemonDebugMenuCommands.register("ownership", {
|
|||||||
break if cmd < 0
|
break if cmd < 0
|
||||||
case cmd
|
case cmd
|
||||||
when 0 # Make player's
|
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
|
when 1 # Set OT's name
|
||||||
pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, Settings::MAX_PLAYER_NAME_SIZE)
|
pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, Settings::MAX_PLAYER_NAME_SIZE)
|
||||||
when 2 # Set OT's gender
|
when 2 # Set OT's gender
|
||||||
@@ -1016,7 +1016,7 @@ PokemonDebugMenuCommands.register("ownership", {
|
|||||||
[_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender)
|
[_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender)
|
||||||
pkmn.owner.gender = cmd2 if cmd2 >= 0
|
pkmn.owner.gender = cmd2 if cmd2 >= 0
|
||||||
when 3 # Random foreign ID
|
when 3 # Random foreign ID
|
||||||
pkmn.owner.id = $Trainer.make_foreign_ID
|
pkmn.owner.id = $player.make_foreign_ID
|
||||||
when 4 # Set foreign ID
|
when 4 # Set foreign ID
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
params.setRange(0, 65535)
|
params.setRange(0, 65535)
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ module Compiler
|
|||||||
['pbHasItem?', '$bag.has?'],
|
['pbHasItem?', '$bag.has?'],
|
||||||
['pbCanStore?', '$bag.can_add?'],
|
['pbCanStore?', '$bag.can_add?'],
|
||||||
['pbStoreItem', '$bag.add'],
|
['pbStoreItem', '$bag.add'],
|
||||||
['pbStoreAllOrNone', '$bag.add_all']
|
['pbStoreAllOrNone', '$bag.add_all'],
|
||||||
|
['$Trainer', '$player']
|
||||||
]
|
]
|
||||||
|
|
||||||
module_function
|
module_function
|
||||||
@@ -858,7 +859,7 @@ module Compiler
|
|||||||
ret = false
|
ret = false
|
||||||
SCRIPT_REPLACEMENTS.each { |pair| ret = true if script.gsub!(pair[0], pair[1]) }
|
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!(/\$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
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -882,7 +883,7 @@ module Compiler
|
|||||||
def fix_event_use(event,_mapID,mapData)
|
def fix_event_use(event,_mapID,mapData)
|
||||||
return nil if event_is_empty?(event)
|
return nil if event_is_empty?(event)
|
||||||
changed = false
|
changed = false
|
||||||
trainerMoneyRE = /^\s*\$Trainer\.money\s*(<|<=|>|>=)\s*(\d+)\s*$/
|
trainerMoneyRE = /^\s*\$player\.money\s*(<|<=|>|>=)\s*(\d+)\s*$/
|
||||||
itemBallRE = /^\s*(Kernel\.)?pbItemBall/
|
itemBallRE = /^\s*(Kernel\.)?pbItemBall/
|
||||||
# Rewrite event if it looks like a door
|
# Rewrite event if it looks like a door
|
||||||
changed = true if update_door_event(event,mapData)
|
changed = true if update_door_event(event,mapData)
|
||||||
@@ -917,7 +918,7 @@ module Compiler
|
|||||||
end
|
end
|
||||||
script.gsub!(/\s+/,"")
|
script.gsub!(/\s+/,"")
|
||||||
# Using old method of recovering
|
# Using old method of recovering
|
||||||
if script=="foriin$Trainer.partyi.healend"
|
if script=="foriin$player.partyi.healend"
|
||||||
for j in i..lastScript
|
for j in i..lastScript
|
||||||
list.delete_at(i)
|
list.delete_at(i)
|
||||||
end
|
end
|
||||||
@@ -925,7 +926,7 @@ module Compiler
|
|||||||
RPG::EventCommand.new(314,list[i].indent,[0]) # Recover All
|
RPG::EventCommand.new(314,list[i].indent,[0]) # Recover All
|
||||||
)
|
)
|
||||||
changed=true
|
changed=true
|
||||||
elsif script=="pbFadeOutIn(99999){foriin$Trainer.partyi.healend}"
|
elsif script=="pbFadeOutIn(99999){foriin$player.partyi.healend}"
|
||||||
oldIndent = list[i].indent
|
oldIndent = list[i].indent
|
||||||
for j in i..lastScript
|
for j in i..lastScript
|
||||||
list.delete_at(i)
|
list.delete_at(i)
|
||||||
@@ -1249,7 +1250,7 @@ module Compiler
|
|||||||
when 111 # Conditional Branch
|
when 111 # Conditional Branch
|
||||||
if list[i].parameters[0]==12 # script
|
if list[i].parameters[0]==12 # script
|
||||||
script = list[i].parameters[1]
|
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
|
# Checking money directly
|
||||||
operator = $1
|
operator = $1
|
||||||
amount = $2.to_i
|
amount = $2.to_i
|
||||||
|
|||||||
Reference in New Issue
Block a user