Renames $Trainer to $player

This commit is contained in:
chardub
2025-04-24 19:57:12 -04:00
parent 95ef337de8
commit 7de024dafd
34 changed files with 391 additions and 391 deletions

View File

@@ -20,7 +20,7 @@ module Compiler
["pbCanStore?", "$bag.can_add?"], ["pbCanStore?", "$bag.can_add?"],
["pbStoreItem", "$bag.add"], ["pbStoreItem", "$bag.add"],
["pbStoreAllOrNone", "$bag.add_all"], ["pbStoreAllOrNone", "$bag.add_all"],
["$Trainer", "$player"], ["$player", "$player"],
["$SaveVersion", "$save_engine_version"], ["$SaveVersion", "$save_engine_version"],
["$game_version", "$save_game_version"], ["$game_version", "$save_game_version"],
["$MapFactory", "$map_factory"], ["$MapFactory", "$map_factory"],

View File

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

View File

@@ -1,6 +1,6 @@
def getPokemonPositionInParty(pokemon) def getPokemonPositionInParty(pokemon)
for i in 0..$Trainer.party.length for i in 0..$player.party.length
if $Trainer.party[i] == pokemon if $player.party[i] == pokemon
return i return i
end end
end end
@@ -15,11 +15,11 @@ def pbDNASplicing(pokemon, scene, item = :DNASPLICERS)
dexNumber = pokemon.species_data.id_number dexNumber = pokemon.species_data.id_number
if (pokemon.species_data.id_number <= NB_POKEMON) if (pokemon.species_data.id_number <= NB_POKEMON)
if pokemon.fused != nil if pokemon.fused != nil
if $Trainer.party.length >= 6 if $player.party.length >= 6
scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name)) scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
return false return false
else else
$Trainer.party[$Trainer.party.length] = pokemon.fused $player.party[$player.party.length] = pokemon.fused
pokemon.fused = nil pokemon.fused = nil
pokemon.form = 0 pokemon.form = 0
scene.pbHardRefresh scene.pbHardRefresh
@@ -29,7 +29,7 @@ def pbDNASplicing(pokemon, scene, item = :DNASPLICERS)
else else
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?")) chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
if chosen >= 0 if chosen >= 0
poke2 = $Trainer.party[chosen] poke2 = $player.party[chosen]
if (poke2.species_data.id_number <= NB_POKEMON) && poke2 != pokemon if (poke2.species_data.id_number <= NB_POKEMON) && poke2 != pokemon
# check if fainted # check if fainted
@@ -152,13 +152,13 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
bodyPoke = getBasePokemonID(pokemon.species_data.id_number, true) bodyPoke = getBasePokemonID(pokemon.species_data.id_number, true)
headPoke = getBasePokemonID(pokemon.species_data.id_number, false) headPoke = getBasePokemonID(pokemon.species_data.id_number, false)
if (pokemon.foreign?($Trainer)) # && !canunfuse if (pokemon.foreign?($player)) # && !canunfuse
scene.pbDisplay(_INTL("You can't unfuse a Pokémon obtained in a trade!")) scene.pbDisplay(_INTL("You can't unfuse a Pokémon obtained in a trade!"))
return false return false
else else
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be unfused?", pokemon.name)) if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be unfused?", pokemon.name))
keepInParty = 0 keepInParty = 0
if $Trainer.party.length >= 6 && !pcPosition if $player.party.length >= 6 && !pcPosition
message = "Your party is full! Keep which Pokémon in party?" message = "Your party is full! Keep which Pokémon in party?"
message = "Your party is full! Keep which Pokémon in party? The other will be released." if isOnPinkanIsland() message = "Your party is full! Keep which Pokémon in party? The other will be released." if isOnPinkanIsland()
@@ -249,7 +249,7 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
poke2.debug_shiny = false poke2.debug_shiny = false
end end
if $Trainer.party.length >= 6 if $player.party.length >= 6
if (keepInParty == 0) if (keepInParty == 0)
if isOnPinkanIsland() if isOnPinkanIsland()
scene.pbDisplay(_INTL("{1} was released.", poke2.name)) scene.pbDisplay(_INTL("{1} was released.", poke2.name))
@@ -289,10 +289,10 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
end end
# On ajoute les poke au pokedex # On ajoute les poke au pokedex
$Trainer.pokedex.set_seen(poke1.species) $player.pokedex.set_seen(poke1.species)
$Trainer.pokedex.set_owned(poke1.species) $player.pokedex.set_owned(poke1.species)
$Trainer.pokedex.set_seen(poke2.species) $player.pokedex.set_seen(poke2.species)
$Trainer.pokedex.set_owned(poke2.species) $player.pokedex.set_owned(poke2.species)
pokemon.species = poke1.species pokemon.species = poke1.species
pokemon.level = poke1.level pokemon.level = poke1.level

View File

@@ -326,9 +326,9 @@ def addNewTripleFusion(pokemon1, pokemon2, pokemon3, level = 1)
pokemon = TripleFusion.new(pokemon1, pokemon2, pokemon3, level) pokemon = TripleFusion.new(pokemon1, pokemon2, pokemon3, level)
pokemon.calc_stats pokemon.calc_stats
pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $Trainer.name, pokemon.name)) pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $player.name, pokemon.name))
pbNicknameAndStore(pokemon) pbNicknameAndStore(pokemon)
#$Trainer.pokedex.register(pokemon) #$player.pokedex.register(pokemon)
return true return true
end end

View File

@@ -1,5 +1,5 @@
def has_species_or_fusion?(species, form = -1) def has_species_or_fusion?(species, form = -1)
return $Trainer.pokemon_party.any? { |p| p && p.isSpecies?(species) || p.isFusionOf(species) } return $player.pokemon_party.any? { |p| p && p.isSpecies?(species) || p.isFusionOf(species) }
end end
# frozen_string_literal: true # frozen_string_literal: true

View File

@@ -54,7 +54,7 @@ def isOutdoor()
end end
def qmarkMaskCheck() def qmarkMaskCheck()
if $Trainer.seen_qmarks_sprite if $player.seen_qmarks_sprite
unless hasHat?(HAT_QMARKS) unless hasHat?(HAT_QMARKS)
obtainHat(HAT_QMARKS) obtainHat(HAT_QMARKS)
obtainClothes(CLOTHES_GLITCH) obtainClothes(CLOTHES_GLITCH)
@@ -77,7 +77,7 @@ def giveJigglypuffScribbles(possible_versions = [1,2,3,4])
return if !scribbles_id return if !scribbles_id
if !hasHat?(scribbles_id) if !hasHat?(scribbles_id)
$Trainer.unlocked_hats << scribbles_id $player.unlocked_hats << scribbles_id
end end
putOnHat(scribbles_id,true,true) putOnHat(scribbles_id,true,true)
end end
@@ -481,7 +481,7 @@ def Kernel.setRocketPassword(variableNum)
end end
def obtainBadgeMessage(badgeName) def obtainBadgeMessage(badgeName)
Kernel.pbMessage(_INTL("\\me[Badge get]{1} obtained the {2}!", $Trainer.name, badgeName)) Kernel.pbMessage(_INTL("\\me[Badge get]{1} obtained the {2}!", $player.name, badgeName))
end end

View File

@@ -26,7 +26,7 @@ end
def playPokeFluteAnimation def playPokeFluteAnimation
# return if $Trainer.outfit != 0 # return if $player.outfit != 0
# $game_player.setDefaultCharName("players/pokeflute", 0, false) # $game_player.setDefaultCharName("players/pokeflute", 0, false)
# Graphics.update # Graphics.update
# Input.update # Input.update
@@ -34,7 +34,7 @@ def playPokeFluteAnimation
end end
def restoreDefaultCharacterSprite(charset_number = 0) def restoreDefaultCharacterSprite(charset_number = 0)
meta = GameData::Metadata.get_player($Trainer.character_ID) meta = GameData::Metadata.get_player($player.character_ID)
$game_player.setDefaultCharName(nil, 0, false) $game_player.setDefaultCharName(nil, 0, false)
$game_player.character_name = meta[1] $game_player.character_name = meta[1]
Graphics.update Graphics.update

View File

@@ -58,25 +58,25 @@ def purchaseDyeKitMenu(hats_kit_price=0,clothes_kit_price=0)
choice = optionsMenu(commands,commands.length) choice = optionsMenu(commands,commands.length)
case commands[choice] case commands[choice]
when command_hats when command_hats
if $Trainer.money < hats_kit_price if $player.money < hats_kit_price
pbCallBub(2,@event_id) pbCallBub(2,@event_id)
pbMessage("Oh, you don't have enough money...") pbMessage("Oh, you don't have enough money...")
return return
end end
pbMessage("\\G\\PN purchased the dye kit.") pbMessage("\\G\\PN purchased the dye kit.")
$Trainer.money -= hats_kit_price $player.money -= hats_kit_price
pbSEPlay("SlotsCoin") pbSEPlay("SlotsCoin")
Kernel.pbReceiveItem(:HATSDYEKIT) Kernel.pbReceiveItem(:HATSDYEKIT)
pbCallBub(2,@event_id) pbCallBub(2,@event_id)
pbMessage("\\GHere you go! Have fun dyeing your hats!") pbMessage("\\GHere you go! Have fun dyeing your hats!")
when command_clothes when command_clothes
if $Trainer.money < clothes_kit_price if $player.money < clothes_kit_price
pbCallBub(2,@event_id) pbCallBub(2,@event_id)
pbMessage("Oh, you don't have enough money...") pbMessage("Oh, you don't have enough money...")
return return
end end
pbMessage("\\G\\PN purchased the dye kit.") pbMessage("\\G\\PN purchased the dye kit.")
$Trainer.money -= clothes_kit_price $player.money -= clothes_kit_price
pbSEPlay("SlotsCoin") pbSEPlay("SlotsCoin")
Kernel.pbReceiveItem(:CLOTHESDYEKIT) Kernel.pbReceiveItem(:CLOTHESDYEKIT)
pbCallBub(2,@event_id) pbCallBub(2,@event_id)
@@ -89,7 +89,7 @@ end
def promptCaughtPokemonAction(pokemon) def promptCaughtPokemonAction(pokemon)
pickedOption = false pickedOption = false
return pbStorePokemon(pokemon) if !$Trainer.party_full? return pbStorePokemon(pokemon) if !$player.party_full?
return promptKeepOrRelease(pokemon) if isOnPinkanIsland() && !$game_switches[SWITCH_PINKAN_FINISHED] return promptKeepOrRelease(pokemon) if isOnPinkanIsland() && !$game_switches[SWITCH_PINKAN_FINISHED]
while !pickedOption while !pickedOption
command = pbMessage(_INTL("\\ts[]Your team is full!"), command = pbMessage(_INTL("\\ts[]Your team is full!"),
@@ -137,13 +137,13 @@ def swapCaughtPokemon(caughtPokemon)
}) })
index = pbGet(1) index = pbGet(1)
return false if index == -1 return false if index == -1
$PokemonStorage.pbStoreCaught($Trainer.party[index]) $PokemonStorage.pbStoreCaught($player.party[index])
pbRemovePokemonAt(index) pbRemovePokemonAt(index)
pbStorePokemon(caughtPokemon) pbStorePokemon(caughtPokemon)
tmp = $Trainer.party[index] tmp = $player.party[index]
$Trainer.party[index] = $Trainer.party[-1] $player.party[index] = $player.party[-1]
$Trainer.party[-1] = tmp $player.party[-1] = tmp
return true return true
end end
@@ -155,13 +155,13 @@ def swapReleaseCaughtPokemon(caughtPokemon)
}) })
index = pbGet(1) index = pbGet(1)
return false if index == -1 return false if index == -1
releasedPokemon = $Trainer.party[index] releasedPokemon = $player.party[index]
pbMessage("#{releasedPokemon.name} was released.") pbMessage("#{releasedPokemon.name} was released.")
pbRemovePokemonAt(index) pbRemovePokemonAt(index)
pbStorePokemon(caughtPokemon) pbStorePokemon(caughtPokemon)
tmp = $Trainer.party[index] tmp = $player.party[index]
$Trainer.party[index] = $Trainer.party[-1] $player.party[index] = $player.party[-1]
$Trainer.party[-1] = tmp $player.party[-1] = tmp
return true return true
end end

View File

@@ -1,44 +1,44 @@
# frozen_string_literal: true # frozen_string_literal: true
def unlock_easter_egg_hats() def unlock_easter_egg_hats()
if $Trainer.name == "Ash" if $player.name == "Ash"
$Trainer.hat = HAT_ASH $player.hat = HAT_ASH
$Trainer.unlock_hat(HAT_ASH) $player.unlock_hat(HAT_ASH)
end end
if $Trainer.name == "Frogman" if $player.name == "Frogman"
$Trainer.hat = HAT_FROG $player.hat = HAT_FROG
$Trainer.unlock_hat(HAT_FROG) $player.unlock_hat(HAT_FROG)
end end
end end
def setupStartingOutfit() def setupStartingOutfit()
$Trainer.hat = nil $player.hat = nil
$Trainer.clothes = STARTING_OUTFIT $player.clothes = STARTING_OUTFIT
unlock_easter_egg_hats() unlock_easter_egg_hats()
gender = pbGet(VAR_TRAINER_GENDER) gender = pbGet(VAR_TRAINER_GENDER)
if gender == GENDER_FEMALE if gender == GENDER_FEMALE
$Trainer.unlock_clothes(DEFAULT_OUTFIT_FEMALE, true) $player.unlock_clothes(DEFAULT_OUTFIT_FEMALE, true)
$Trainer.unlock_hat(DEFAULT_OUTFIT_FEMALE, true) $player.unlock_hat(DEFAULT_OUTFIT_FEMALE, true)
$Trainer.hair = "3_" + DEFAULT_OUTFIT_FEMALE if !$Trainer.hair # when migrating old savefiles $player.hair = "3_" + DEFAULT_OUTFIT_FEMALE if !$player.hair # when migrating old savefiles
elsif gender == GENDER_MALE elsif gender == GENDER_MALE
$Trainer.unlock_clothes(DEFAULT_OUTFIT_MALE, true) $player.unlock_clothes(DEFAULT_OUTFIT_MALE, true)
$Trainer.unlock_hat(DEFAULT_OUTFIT_MALE, true) $player.unlock_hat(DEFAULT_OUTFIT_MALE, true)
echoln $Trainer.hair echoln $player.hair
$Trainer.hair = ("3_" + DEFAULT_OUTFIT_MALE) if !$Trainer.hair # when migrating old savefiles $player.hair = ("3_" + DEFAULT_OUTFIT_MALE) if !$player.hair # when migrating old savefiles
echoln $Trainer.hair echoln $player.hair
end end
$Trainer.unlock_hair(DEFAULT_OUTFIT_MALE, true) $player.unlock_hair(DEFAULT_OUTFIT_MALE, true)
$Trainer.unlock_hair(DEFAULT_OUTFIT_FEMALE, true) $player.unlock_hair(DEFAULT_OUTFIT_FEMALE, true)
$Trainer.unlock_clothes(STARTING_OUTFIT, true) $player.unlock_clothes(STARTING_OUTFIT, true)
end end
def give_date_specific_hats() def give_date_specific_hats()
current_date = Time.new current_date = Time.new
# Christmas # Christmas
if (current_date.day == 24 || current_date.day == 25) && current_date.month == 12 if (current_date.day == 24 || current_date.day == 25) && current_date.month == 12
if !$Trainer.unlocked_hats.include?(HAT_SANTA) if !$player.unlocked_hats.include?(HAT_SANTA)
pbCallBub(2, @event_id, true) pbCallBub(2, @event_id, true)
pbMessage("Hi! We're giving out a special hat today for the holidays season. Enjoy!") pbMessage("Hi! We're giving out a special hat today for the holidays season. Enjoy!")
obtainHat(HAT_SANTA) obtainHat(HAT_SANTA)
@@ -47,7 +47,7 @@ def give_date_specific_hats()
# April's fool # April's fool
if (current_date.day == 1 && current_date.month == 4) if (current_date.day == 1 && current_date.month == 4)
if !$Trainer.unlocked_hats.include?(HAT_CLOWN) if !$player.unlocked_hats.include?(HAT_CLOWN)
pbCallBub(2, @event_id, true) pbCallBub(2, @event_id, true)
pbMessage("Hi! We're giving out this fun accessory for this special day. Enjoy!") pbMessage("Hi! We're giving out this fun accessory for this special day. Enjoy!")
obtainHat(HAT_CLOWN) obtainHat(HAT_CLOWN)

View File

@@ -21,8 +21,8 @@ end
def changeSpeciesSpecific(pokemon, newSpecies) def changeSpeciesSpecific(pokemon, newSpecies)
pokemon.species = newSpecies pokemon.species = newSpecies
$Trainer.pokedex.set_seen(newSpecies) $player.pokedex.set_seen(newSpecies)
$Trainer.pokedex.set_owned(newSpecies) $player.pokedex.set_owned(newSpecies)
end end
@@ -163,8 +163,8 @@ def changeOricorioForm(pokemon, form = nil)
body_number = getDexNumberForSpecies(body_id) body_number = getDexNumberForSpecies(body_id)
newForm = pokemon.isFusion? ? getSpeciesIdForFusion(head_number, body_number) : head_id newForm = pokemon.isFusion? ? getSpeciesIdForFusion(head_number, body_number) : head_id
$Trainer.pokedex.set_seen(newForm) $player.pokedex.set_seen(newForm)
$Trainer.pokedex.set_owned(newForm) $player.pokedex.set_owned(newForm)
pokemon.species = newForm pokemon.species = newForm
return true return true
@@ -182,7 +182,7 @@ def changeOricorioFlower(form = 1)
$PokemonGlobal.stepcount += 1 $PokemonGlobal.stepcount += 1
end end
end end
return if !($Trainer.has_species_or_fusion?(:ORICORIO_1) || $Trainer.has_species_or_fusion?(:ORICORIO_2) || $Trainer.has_species_or_fusion?(:ORICORIO_3) || $Trainer.has_species_or_fusion?(:ORICORIO_4)) return if !($player.has_species_or_fusion?(:ORICORIO_1) || $player.has_species_or_fusion?(:ORICORIO_2) || $player.has_species_or_fusion?(:ORICORIO_3) || $player.has_species_or_fusion?(:ORICORIO_4))
message = "" message = ""
form_name = "" form_name = ""
if form == 1 if form == 1
@@ -210,7 +210,7 @@ def changeOricorioFlower(form = 1)
Kernel.isPartPokemon(poke, :ORICORIO_4)) Kernel.isPartPokemon(poke, :ORICORIO_4))
}) })
if (pbGet(1) != -1) if (pbGet(1) != -1)
poke = $Trainer.party[pbGet(1)] poke = $player.party[pbGet(1)]
if changeOricorioForm(poke, form) if changeOricorioForm(poke, form)
pbMessage(_INTL("{1} switched to the {2} style", poke.name, form_name)) pbMessage(_INTL("{1} switched to the {2} style", poke.name, form_name))
pbSet(1, poke.name) pbSet(1, poke.name)
@@ -231,17 +231,17 @@ def oricorioEventPickFlower(flower_color)
$game_switches[SWITCH_ORICORIO_QUEST_PINK] = true $game_switches[SWITCH_ORICORIO_QUEST_PINK] = true
pbMessage(_INTL("It's a flower with pink nectar.")) pbMessage(_INTL("It's a flower with pink nectar."))
pbSEPlay("MiningAllFound") pbSEPlay("MiningAllFound")
pbMessage(_INTL("{1} picked some of the pink flowers.", $Trainer.name)) pbMessage(_INTL("{1} picked some of the pink flowers.", $player.name))
elsif flower_color == :RED && quest_progression == 1 elsif flower_color == :RED && quest_progression == 1
$game_switches[SWITCH_ORICORIO_QUEST_RED] = true $game_switches[SWITCH_ORICORIO_QUEST_RED] = true
pbMessage(_INTL("It's a flower with red nectar.")) pbMessage(_INTL("It's a flower with red nectar."))
pbSEPlay("MiningAllFound") pbSEPlay("MiningAllFound")
pbMessage(_INTL("{1} picked some of the red flowers.", $Trainer.name)) pbMessage(_INTL("{1} picked some of the red flowers.", $player.name))
elsif flower_color == :BLUE && quest_progression == 2 elsif flower_color == :BLUE && quest_progression == 2
$game_switches[SWITCH_ORICORIO_QUEST_BLUE] = true $game_switches[SWITCH_ORICORIO_QUEST_BLUE] = true
pbMessage(_INTL("It's a flower with blue nectar.")) pbMessage(_INTL("It's a flower with blue nectar."))
pbSEPlay("MiningAllFound") pbSEPlay("MiningAllFound")
pbMessage(_INTL("{1} picked some of the blue flowers.", $Trainer.name)) pbMessage(_INTL("{1} picked some of the blue flowers.", $player.name))
end end
end end

View File

@@ -74,7 +74,7 @@ def fixFinishedRocketQuests()
end end
def fix_broken_TR_quests() def fix_broken_TR_quests()
for trainer_quest in $Trainer.quests for trainer_quest in $player.quests
if trainer_quest.id == 0 # tr quests were all set to ID 0 instead of their real ID in v 6.4.0 if trainer_quest.id == 0 # tr quests were all set to ID 0 instead of their real ID in v 6.4.0
for rocket_quest_id in TR_QUESTS.keys for rocket_quest_id in TR_QUESTS.keys
rocket_quest = TR_QUESTS[rocket_quest_id] rocket_quest = TR_QUESTS[rocket_quest_id]
@@ -88,7 +88,7 @@ def fix_broken_TR_quests()
end end
def failAllIncompleteRocketQuests() def failAllIncompleteRocketQuests()
for trainer_quest in $Trainer.quests for trainer_quest in $player.quests
finishTRQuest("tr_cerulean_1", :FAILURE) if trainer_quest.id == "tr_cerulean_1" && !pbCompletedQuest?("tr_cerulean_1") finishTRQuest("tr_cerulean_1", :FAILURE) if trainer_quest.id == "tr_cerulean_1" && !pbCompletedQuest?("tr_cerulean_1")
finishTRQuest("tr_cerulean_2", :FAILURE) if trainer_quest.id == "tr_cerulean_2" && !pbCompletedQuest?("tr_cerulean_2") finishTRQuest("tr_cerulean_2", :FAILURE) if trainer_quest.id == "tr_cerulean_2" && !pbCompletedQuest?("tr_cerulean_2")
finishTRQuest("tr_cerulean_3", :FAILURE) if trainer_quest.id == "tr_cerulean_3" && !pbCompletedQuest?("tr_cerulean_3") finishTRQuest("tr_cerulean_3", :FAILURE) if trainer_quest.id == "tr_cerulean_3" && !pbCompletedQuest?("tr_cerulean_3")

View File

@@ -24,9 +24,9 @@ end
# Get difficulty for displaying in-game # Get difficulty for displaying in-game
def getDisplayDifficulty def getDisplayDifficulty
if $game_switches[SWITCH_GAME_DIFFICULTY_EASY] || $Trainer.lowest_difficulty <= 0 if $game_switches[SWITCH_GAME_DIFFICULTY_EASY] || $player.lowest_difficulty <= 0
return getDisplayDifficultyFromIndex(0) return getDisplayDifficultyFromIndex(0)
elsif $Trainer.lowest_difficulty <= 1 elsif $player.lowest_difficulty <= 1
return getDisplayDifficultyFromIndex(1) return getDisplayDifficultyFromIndex(1)
elsif $game_switches[SWITCH_GAME_DIFFICULTY_HARD] elsif $game_switches[SWITCH_GAME_DIFFICULTY_HARD]
return getDisplayDifficultyFromIndex(2) return getDisplayDifficultyFromIndex(2)
@@ -81,7 +81,7 @@ end
def setDifficulty(index) def setDifficulty(index)
$Trainer.selected_difficulty = index $player.selected_difficulty = index
case index case index
when 0 # EASY when 0 # EASY
$game_switches[SWITCH_GAME_DIFFICULTY_EASY] = true $game_switches[SWITCH_GAME_DIFFICULTY_EASY] = true

View File

@@ -334,7 +334,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 "regionaldexes.txt". The last name is for the National Dex and is added # file "regionaldexes.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). This # 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, which # array's order is also the order of $player.pokedex.unlocked_dexes, which
# records which Dexes have been unlocked (the first is unlocked by default). # 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 page while # 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 player is # viewing that Dex list will be the region map of the region the player is

View File

@@ -103,7 +103,7 @@ HiddenMoveHandlers::UseMove.add(:MORNINGSUN,proc{|move,pokemon|
pbFadeOutIn(99999){ pbFadeOutIn(99999){
pbSkipTime(9) pbSkipTime(9)
newTime = pbGetTimeNow.strftime("%I:%M %p") newTime = pbGetTimeNow.strftime("%I:%M %p")
Kernel.pbMessage(_INTL("{1} waited until morning...",$Trainer.name)) Kernel.pbMessage(_INTL("{1} waited until morning...",$player.name))
Kernel.pbMessage(_INTL("The time is now {1}",newTime)) Kernel.pbMessage(_INTL("The time is now {1}",newTime))
$game_screen.weather(:None,0,0) $game_screen.weather(:None,0,0)
$game_map.refresh $game_map.refresh
@@ -126,7 +126,7 @@ HiddenMoveHandlers::UseMove.add(:MOONLIGHT,proc{|move,pokemon|
pbFadeOutIn(99999){ pbFadeOutIn(99999){
pbSkipTime(21) pbSkipTime(21)
newTime = pbGetTimeNow.strftime("%I:%M %p") newTime = pbGetTimeNow.strftime("%I:%M %p")
Kernel.pbMessage(_INTL("{1} waited until night...",$Trainer.name)) Kernel.pbMessage(_INTL("{1} waited until night...",$player.name))
Kernel.pbMessage(_INTL("The time is now {1}",newTime)) Kernel.pbMessage(_INTL("The time is now {1}",newTime))
$game_screen.weather(:None,0,0) $game_screen.weather(:None,0,0)
$game_map.refresh $game_map.refresh

View File

@@ -12,7 +12,7 @@ ItemHandlers::UseFromBag.add(:LANTERN, proc { |item|
}) })
ItemHandlers::UseInField.add(:LANTERN, proc { |item| ItemHandlers::UseInField.add(:LANTERN, proc { |item|
Kernel.pbMessage(_INTL("#{$Trainer.name} used the lantern.")) Kernel.pbMessage(_INTL("#{$player.name} used the lantern."))
if useLantern() if useLantern()
next 1 next 1
else else
@@ -56,7 +56,7 @@ ItemHandlers::UseInField.add(:TELEPORTER, proc { |item|
def useTeleporter() def useTeleporter()
if HiddenMoveHandlers.triggerCanUseMove(:TELEPORT, 0, true) if HiddenMoveHandlers.triggerCanUseMove(:TELEPORT, 0, true)
Kernel.pbMessage(_INTL("Teleport to where?", $Trainer.name)) Kernel.pbMessage(_INTL("Teleport to where?", $player.name))
ret = pbBetterRegionMap(-1, true, true) ret = pbBetterRegionMap(-1, true, true)
return false unless ret return false unless ret
############################################### ###############################################
@@ -74,7 +74,7 @@ def useTeleporter()
if !$PokemonTemp.flydata if !$PokemonTemp.flydata
return false return false
else else
Kernel.pbMessage(_INTL("{1} used the teleporter!", $Trainer.name)) Kernel.pbMessage(_INTL("{1} used the teleporter!", $player.name))
pbFadeOutIn(99999) { pbFadeOutIn(99999) {
Kernel.pbCancelVehicles Kernel.pbCancelVehicles
$game_temp.player_new_map_id = $PokemonTemp.flydata[0] $game_temp.player_new_map_id = $PokemonTemp.flydata[0]
@@ -285,7 +285,7 @@ def useSleepingBag()
pbSet(UnrealTime::EXTRA_SECONDS, currentSecondsValue + timeAdded) pbSet(UnrealTime::EXTRA_SECONDS, currentSecondsValue + timeAdded)
pbSEPlay("Sleep", 100) pbSEPlay("Sleep", 100)
pbFadeOutIn { pbFadeOutIn {
Kernel.pbMessage(_INTL("{1} slept for a while...", $Trainer.name)) Kernel.pbMessage(_INTL("{1} slept for a while...", $player.name))
} }
time = pbGetTimeNow.strftime("%I:%M %p") time = pbGetTimeNow.strftime("%I:%M %p")
newDay = getDayOfTheWeek() newDay = getDayOfTheWeek()
@@ -384,31 +384,31 @@ def useFavoriteOutfit()
switchToFavoriteOutfit() switchToFavoriteOutfit()
elsif options[choice] == cmd_mark_favorite elsif options[choice] == cmd_mark_favorite
pbSEPlay("shiny", 80, 100) pbSEPlay("shiny", 80, 100)
$Trainer.favorite_clothes= $Trainer.clothes $player.favorite_clothes= $player.clothes
$Trainer.favorite_hat = $Trainer.hat $player.favorite_hat = $player.hat
$Trainer.favorite_hat2=$Trainer.hat2 $player.favorite_hat2=$player.hat2
pbMessage(_INTL("Your favorite outfit was updated!")) pbMessage(_INTL("Your favorite outfit was updated!"))
end end
end end
def switchToFavoriteOutfit() def switchToFavoriteOutfit()
if !$Trainer.favorite_clothes && !$Trainer.favorite_hat && !$Trainer.favorite_hat2 if !$player.favorite_clothes && !$player.favorite_hat && !$player.favorite_hat2
pbMessage(_INTL("You can mark clothes and hats as your favorites in the outfits menu and use this to quickly switch to them!")) pbMessage(_INTL("You can mark clothes and hats as your favorites in the outfits menu and use this to quickly switch to them!"))
return 0 return 0
end end
if isWearingFavoriteOutfit() if isWearingFavoriteOutfit()
if (Kernel.pbConfirmMessage("Remove your favorite outfit?")) if (Kernel.pbConfirmMessage("Remove your favorite outfit?"))
last_worn_clothes_is_favorite = $Trainer.last_worn_outfit == $Trainer.favorite_clothes last_worn_clothes_is_favorite = $player.last_worn_outfit == $player.favorite_clothes
last_worn_hat_is_favorite = $Trainer.last_worn_hat == $Trainer.favorite_hat last_worn_hat_is_favorite = $player.last_worn_hat == $player.favorite_hat
last_worn_hat2_is_favorite = $Trainer.last_worn_hat2 == $Trainer.favorite_hat2 last_worn_hat2_is_favorite = $player.last_worn_hat2 == $player.favorite_hat2
if (last_worn_clothes_is_favorite && last_worn_hat_is_favorite && last_worn_hat2_is_favorite) if (last_worn_clothes_is_favorite && last_worn_hat_is_favorite && last_worn_hat2_is_favorite)
$Trainer.last_worn_outfit = getDefaultClothes() $player.last_worn_outfit = getDefaultClothes()
end end
playOutfitChangeAnimation() playOutfitChangeAnimation()
putOnClothes($Trainer.last_worn_outfit, true) #if $Trainer.favorite_clothes putOnClothes($player.last_worn_outfit, true) #if $player.favorite_clothes
putOnHat($Trainer.last_worn_hat, true,false) #if $Trainer.favorite_hat putOnHat($player.last_worn_hat, true,false) #if $player.favorite_hat
putOnHat($Trainer.last_worn_hat2, true,true) #if $Trainer.favorite_hat2 putOnHat($player.last_worn_hat2, true,true) #if $player.favorite_hat2
else else
return 0 return 0
@@ -416,12 +416,12 @@ def switchToFavoriteOutfit()
else else
if (Kernel.pbConfirmMessage("Put on your favorite outfit?")) if (Kernel.pbConfirmMessage("Put on your favorite outfit?"))
echoln "favorite clothes: #{$Trainer.favorite_clothes}, favorite hat: #{$Trainer.favorite_hat}, favorite hat2: #{$Trainer.favorite_hat2}" echoln "favorite clothes: #{$player.favorite_clothes}, favorite hat: #{$player.favorite_hat}, favorite hat2: #{$player.favorite_hat2}"
playOutfitChangeAnimation() playOutfitChangeAnimation()
putOnClothes($Trainer.favorite_clothes, true) if $Trainer.favorite_clothes putOnClothes($player.favorite_clothes, true) if $player.favorite_clothes
putOnHat($Trainer.favorite_hat, true, false) if $Trainer.favorite_hat putOnHat($player.favorite_hat, true, false) if $player.favorite_hat
putOnHat($Trainer.favorite_hat2, true, true) if $Trainer.favorite_hat2 putOnHat($player.favorite_hat2, true, true) if $player.favorite_hat2
else else
return 0 return 0
end end
@@ -432,12 +432,12 @@ def useRocketUniform()
return 0 if !$game_switches[SWITCH_JOINED_TEAM_ROCKET] return 0 if !$game_switches[SWITCH_JOINED_TEAM_ROCKET]
if isWearingTeamRocketOutfit() if isWearingTeamRocketOutfit()
if (Kernel.pbConfirmMessage("Remove the Team Rocket uniform?")) if (Kernel.pbConfirmMessage("Remove the Team Rocket uniform?"))
if ($Trainer.last_worn_outfit == CLOTHES_TEAM_ROCKET_MALE || $Trainer.last_worn_outfit == CLOTHES_TEAM_ROCKET_FEMALE) && $Trainer.last_worn_hat == HAT_TEAM_ROCKET if ($player.last_worn_outfit == CLOTHES_TEAM_ROCKET_MALE || $player.last_worn_outfit == CLOTHES_TEAM_ROCKET_FEMALE) && $player.last_worn_hat == HAT_TEAM_ROCKET
$Trainer.last_worn_outfit = getDefaultClothes() $player.last_worn_outfit = getDefaultClothes()
end end
playOutfitChangeAnimation() playOutfitChangeAnimation()
putOnClothes($Trainer.last_worn_outfit, true) putOnClothes($player.last_worn_outfit, true)
putOnHat($Trainer.last_worn_hat, true) putOnHat($player.last_worn_hat, true)
else else
return 0 return 0
end end
@@ -600,10 +600,10 @@ end
def useSplicerFromField(item) def useSplicerFromField(item)
scene = PokemonParty_Scene.new scene = PokemonParty_Scene.new
scene.pbStartScene($Trainer.party, "Select a Pokémon") scene.pbStartScene($player.party, "Select a Pokémon")
screen = PokemonPartyScreen.new(scene, $Trainer.party) screen = PokemonPartyScreen.new(scene, $player.party)
chosen = screen.pbChoosePokemon("Select a Pokémon") chosen = screen.pbChoosePokemon("Select a Pokémon")
pokemon = $Trainer.party[chosen] pokemon = $player.party[chosen]
fusion_success = pbDNASplicing(pokemon, scene, item) fusion_success = pbDNASplicing(pokemon, scene, item)
screen.pbEndScene screen.pbEndScene
scene.dispose scene.dispose
@@ -686,11 +686,11 @@ ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
# def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false) # def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
# if (pokemon.species <= NB_POKEMON) # if (pokemon.species <= NB_POKEMON)
# if pokemon.fused != nil # if pokemon.fused != nil
# if $Trainer.party.length >= 6 # if $player.party.length >= 6
# scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name)) # scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
# return false # return false
# else # else
# $Trainer.party[$Trainer.party.length] = pokemon.fused # $player.party[$player.party.length] = pokemon.fused
# pokemon.fused = nil # pokemon.fused = nil
# pokemon.form = 0 # pokemon.form = 0
# scene.pbHardRefresh # scene.pbHardRefresh
@@ -700,7 +700,7 @@ ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
# else # else
# chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?")) # chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
# if chosen >= 0 # if chosen >= 0
# poke2 = $Trainer.party[chosen] # poke2 = $player.party[chosen]
# if (poke2.species <= NB_POKEMON) && poke2 != pokemon # if (poke2.species <= NB_POKEMON) && poke2 != pokemon
# #check if fainted # #check if fainted
# if pokemon.hp == 0 || poke2.hp == 0 # if pokemon.hp == 0 || poke2.hp == 0
@@ -735,7 +735,7 @@ ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
# #pcPosition [x,x] : unfusing from pc # #pcPosition [x,x] : unfusing from pc
# # # #
# #
# if (pokemon.obtain_method == 2 || pokemon.ot != $Trainer.name) # && !canunfuse # if (pokemon.obtain_method == 2 || pokemon.ot != $player.name) # && !canunfuse
# scene.pbDisplay(_INTL("You can't unfuse a Pokémon obtained in a trade!")) # scene.pbDisplay(_INTL("You can't unfuse a Pokémon obtained in a trade!"))
# return false # return false
# else # else
@@ -743,7 +743,7 @@ ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
# if pokemon.species > (NB_POKEMON * NB_POKEMON) + NB_POKEMON #triple fusion # if pokemon.species > (NB_POKEMON * NB_POKEMON) + NB_POKEMON #triple fusion
# scene.pbDisplay(_INTL("{1} cannot be unfused.", pokemon.name)) # scene.pbDisplay(_INTL("{1} cannot be unfused.", pokemon.name))
# return false # return false
# elsif $Trainer.party.length >= 6 && !pcPosition # elsif $player.party.length >= 6 && !pcPosition
# scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name)) # scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
# return false # return false
# else # else
@@ -771,8 +771,8 @@ ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
# poke2.exp = exp_head # poke2.exp = exp_head
# end # end
# #
# #poke1 = PokeBattle_Pokemon.new(bodyPoke, lev, $Trainer) # #poke1 = PokeBattle_Pokemon.new(bodyPoke, lev, $player)
# #poke2 = PokeBattle_Pokemon.new(headPoke, lev, $Trainer) # #poke2 = PokeBattle_Pokemon.new(headPoke, lev, $player)
# #
# if pcPosition == nil # if pcPosition == nil
# box = pcPosition[0] # box = pcPosition[0]
@@ -782,10 +782,10 @@ ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
# Kernel.pbAddPokemonSilent(poke2, poke2.level) # Kernel.pbAddPokemonSilent(poke2, poke2.level)
# end # end
# #On ajoute l'autre dans le pokedex aussi # #On ajoute l'autre dans le pokedex aussi
# $Trainer.seen[poke1.species] = true # $player.seen[poke1.species] = true
# $Trainer.owned[poke1.species] = true # $player.owned[poke1.species] = true
# $Trainer.seen[poke2.species] = true # $player.seen[poke2.species] = true
# $Trainer.owned[poke2.species] = true # $player.owned[poke2.species] = true
# #
# pokemon.species = poke1.species # pokemon.species = poke1.species
# pokemon.level = poke1.level # pokemon.level = poke1.level

View File

@@ -62,32 +62,32 @@ def get_current_outfit_position(currentOutfit_id, available_outfits)
end end
def setHairColor(hue_shift) def setHairColor(hue_shift)
$Trainer.hair_color = hue_shift $player.hair_color = hue_shift
refreshPlayerOutfit() refreshPlayerOutfit()
end end
def shiftHatColor(incr,secondary_hat=false) def shiftHatColor(incr,secondary_hat=false)
if secondary_hat if secondary_hat
$Trainer.hat2_color = 0 if !$Trainer.hat2_color $player.hat2_color = 0 if !$player.hat2_color
$Trainer.hat2_color += incr $player.hat2_color += incr
else else
$Trainer.hat_color = 0 if !$Trainer.hat_color $player.hat_color = 0 if !$player.hat_color
$Trainer.hat_color += incr $player.hat_color += incr
end end
refreshPlayerOutfit() refreshPlayerOutfit()
end end
def shiftClothesColor(incr) def shiftClothesColor(incr)
$Trainer.clothes_color = 0 if !$Trainer.clothes_color $player.clothes_color = 0 if !$player.clothes_color
$Trainer.clothes_color += incr $player.clothes_color += incr
refreshPlayerOutfit() refreshPlayerOutfit()
end end
def shiftHairColor(incr) def shiftHairColor(incr)
$Trainer.hair_color = 0 if !$Trainer.hair_color $player.hair_color = 0 if !$player.hair_color
$Trainer.hair_color += incr $player.hair_color += incr
echoln "Hair color: #{$Trainer.hair_color}" echoln "Hair color: #{$player.hair_color}"
refreshPlayerOutfit() refreshPlayerOutfit()
end end
@@ -101,11 +101,11 @@ def pbLoadOutfitBitmap(outfitFileName)
end end
def setOutfit(outfit_id) def setOutfit(outfit_id)
$Trainer.clothes = outfit_id $player.clothes = outfit_id
end end
def setHat(hat_id) def setHat(hat_id)
$Trainer.hat = hat_id $player.hat = hat_id
end end
def getEasterEggHeldItem() def getEasterEggHeldItem()
@@ -134,7 +134,7 @@ end
def getCurrentPokeball(allowEasterEgg=true) def getCurrentPokeball(allowEasterEgg=true)
otherItem = getEasterEggHeldItem() if allowEasterEgg otherItem = getEasterEggHeldItem() if allowEasterEgg
return otherItem if otherItem return otherItem if otherItem
firstPokemon = $Trainer.party[0] firstPokemon = $player.party[0]
return firstPokemon.poke_ball if firstPokemon return firstPokemon.poke_ball if firstPokemon
return nil return nil
end end
@@ -152,19 +152,19 @@ def generate_front_trainer_sprite_bitmap(allowEasterEgg=true, pokeball = nil,
skin_tone_id = nil, hair_color = nil, hat_color = nil, clothes_color = nil, skin_tone_id = nil, hair_color = nil, hat_color = nil, clothes_color = nil,
hat2_color = nil) hat2_color = nil)
clothes_id = $Trainer.clothes if !clothes_id clothes_id = $player.clothes if !clothes_id
hat_id = $Trainer.hat if !hat_id hat_id = $player.hat if !hat_id
hat2_id = $Trainer.hat2 if !hat2_id hat2_id = $player.hat2 if !hat2_id
hair_id = $Trainer.hair if !hair_id hair_id = $player.hair if !hair_id
skin_tone_id = $Trainer.skin_tone if !skin_tone_id skin_tone_id = $player.skin_tone if !skin_tone_id
hair_color = $Trainer.hair_color if !hair_color hair_color = $player.hair_color if !hair_color
hat_color = $Trainer.hat_color if !hat_color hat_color = $player.hat_color if !hat_color
hat2_color = $Trainer.hat2_color if !hat2_color hat2_color = $player.hat2_color if !hat2_color
clothes_color = $Trainer.clothes_color if !clothes_color clothes_color = $player.clothes_color if !clothes_color
hairFilename = getTrainerSpriteHairFilename(hair_id) #_INTL(Settings::PLAYER_GRAPHICS_FOLDER + Settings::PLAYER_HAIR_FOLDER + "/hair_trainer_{1}", $Trainer.hair) hairFilename = getTrainerSpriteHairFilename(hair_id) #_INTL(Settings::PLAYER_GRAPHICS_FOLDER + Settings::PLAYER_HAIR_FOLDER + "/hair_trainer_{1}", $player.hair)
outfitFilename = getTrainerSpriteOutfitFilename(clothes_id) #_INTL(Settings::PLAYER_GRAPHICS_FOLDER + Settings::PLAYER_CLOTHES_FOLDER + "/clothes_trainer_{1}", $Trainer.clothes) outfitFilename = getTrainerSpriteOutfitFilename(clothes_id) #_INTL(Settings::PLAYER_GRAPHICS_FOLDER + Settings::PLAYER_CLOTHES_FOLDER + "/clothes_trainer_{1}", $player.clothes)
hatFilename = getTrainerSpriteHatFilename(hat_id) hatFilename = getTrainerSpriteHatFilename(hat_id)
hat2Filename = getTrainerSpriteHatFilename(hat2_id) hat2Filename = getTrainerSpriteHatFilename(hat2_id)

View File

@@ -134,39 +134,39 @@ class OutfitSelector
end end
def changeToNextClothes(incr,all_unlocked=false) def changeToNextClothes(incr,all_unlocked=false)
$Trainer.unlocked_clothes = [] if !$Trainer.unlocked_clothes $player.unlocked_clothes = [] if !$player.unlocked_clothes
currentOutfit = $Trainer.clothes currentOutfit = $player.clothes
currentOutfit = 0 if !currentOutfit currentOutfit = 0 if !currentOutfit
nextOutfit = selectNextOutfit(currentOutfit, incr, @clothes_list, [], false,nil,$Trainer.unlocked_clothes,all_unlocked) nextOutfit = selectNextOutfit(currentOutfit, incr, @clothes_list, [], false,nil,$player.unlocked_clothes,all_unlocked)
$Trainer.clothes = nextOutfit $player.clothes = nextOutfit
$Trainer.clothes_color = 0 $player.clothes_color = 0
echoln $Trainer.clothes echoln $player.clothes
end end
def changeToNextHat(incr,all_unlocked=false) def changeToNextHat(incr,all_unlocked=false)
$Trainer.unlocked_hats = [] if !$Trainer.unlocked_hats $player.unlocked_hats = [] if !$player.unlocked_hats
currentHat = $Trainer.hat currentHat = $player.hat
currentHat = 0 if !currentHat currentHat = 0 if !currentHat
nextOutfit = selectNextOutfit(currentHat, incr, @hats_list, [], true, "hat",$Trainer.unlocked_hats,all_unlocked) nextOutfit = selectNextOutfit(currentHat, incr, @hats_list, [], true, "hat",$player.unlocked_hats,all_unlocked)
$Trainer.hat = nextOutfit $player.hat = nextOutfit
$Trainer.hat_color = 0 $player.hat_color = 0
echoln $Trainer.hat echoln $player.hat
end end
def changeToNextHairstyle(incr,all_unlocked=false) def changeToNextHairstyle(incr,all_unlocked=false)
$Trainer.unlocked_hairstyles = [] if !$Trainer.unlocked_hairstyles $player.unlocked_hairstyles = [] if !$player.unlocked_hairstyles
currentHair = $Trainer.hair currentHair = $player.hair
currentHair = 0 if !currentHair currentHair = 0 if !currentHair
nextOutfit = selectNextOutfit(currentHair, incr, @hairstyles_list, ["a", "b", "c", "d"], true,nil,$Trainer.unlocked_hairstyles,all_unlocked) nextOutfit = selectNextOutfit(currentHair, incr, @hairstyles_list, ["a", "b", "c", "d"], true,nil,$player.unlocked_hairstyles,all_unlocked)
$Trainer.hair_color = 0 $player.hair_color = 0
$Trainer.hair = nextOutfit $player.hair = nextOutfit
echoln $Trainer.hair echoln $player.hair
end end

View File

@@ -6,7 +6,7 @@ def search_clothes(matching_tags = [], only_unlocked = false)
full_data_list = $PokemonGlobal.clothes_data full_data_list = $PokemonGlobal.clothes_data
existing_files_list = selector.parse_clothes_folder() existing_files_list = selector.parse_clothes_folder()
unlocked_list = $Trainer.unlocked_clothes unlocked_list = $player.unlocked_clothes
return search_outfits_by_tag(full_data_list, matching_tags, existing_files_list, unlocked_list, only_unlocked) return search_outfits_by_tag(full_data_list, matching_tags, existing_files_list, unlocked_list, only_unlocked)
end end
@@ -16,14 +16,14 @@ def filter_clothes(filter_tags = [], only_unlocked = false)
full_data_list = $PokemonGlobal.hats_data full_data_list = $PokemonGlobal.hats_data
existing_files_list = selector.parse_hats_folder() existing_files_list = selector.parse_hats_folder()
unlocked_list = $Trainer.unlocked_hats unlocked_list = $player.unlocked_hats
return filter_outfits_by_tag(full_data_list, filter_tags, existing_files_list, unlocked_list, only_unlocked) return filter_outfits_by_tag(full_data_list, filter_tags, existing_files_list, unlocked_list, only_unlocked)
end end
def filter_clothes_only_not_owned(clothes_ids_list) def filter_clothes_only_not_owned(clothes_ids_list)
filtered_list = [] filtered_list = []
clothes_ids_list.each do|clothe_id| clothes_ids_list.each do|clothe_id|
filtered_list << clothe_id if !$Trainer.unlocked_clothes.include?(clothe_id) filtered_list << clothe_id if !$player.unlocked_clothes.include?(clothe_id)
end end
return filtered_list return filtered_list
end end
@@ -31,7 +31,7 @@ end
def filter_clothes_only_owned(clothes_ids_list) def filter_clothes_only_owned(clothes_ids_list)
filtered_list = [] filtered_list = []
clothes_ids_list.each do|clothe_id| clothes_ids_list.each do|clothe_id|
filtered_list << clothe_id if $Trainer.unlocked_clothes.include?(clothe_id) filtered_list << clothe_id if $player.unlocked_clothes.include?(clothe_id)
end end
return filtered_list return filtered_list
end end
@@ -45,7 +45,7 @@ def search_hats(matching_tags = [],excluding_tags=[], only_unlocked = false)
full_data_list = $PokemonGlobal.hats_data full_data_list = $PokemonGlobal.hats_data
existing_files_list = selector.parse_hats_folder() existing_files_list = selector.parse_hats_folder()
unlocked_list = $Trainer.unlocked_hats unlocked_list = $player.unlocked_hats
return search_outfits_by_tag(full_data_list, matching_tags, existing_files_list, unlocked_list, only_unlocked,excluding_tags) return search_outfits_by_tag(full_data_list, matching_tags, existing_files_list, unlocked_list, only_unlocked,excluding_tags)
end end
@@ -55,14 +55,14 @@ def filter_hats(filter_tags = [], only_unlocked = false)
full_data_list = $PokemonGlobal.hats_data full_data_list = $PokemonGlobal.hats_data
existing_files_list = selector.parse_hats_folder() existing_files_list = selector.parse_hats_folder()
unlocked_list = $Trainer.unlocked_hats unlocked_list = $player.unlocked_hats
return filter_outfits_by_tag(full_data_list, filter_tags, existing_files_list, unlocked_list, only_unlocked) return filter_outfits_by_tag(full_data_list, filter_tags, existing_files_list, unlocked_list, only_unlocked)
end end
def filter_hats_only_not_owned(hats_ids_list) def filter_hats_only_not_owned(hats_ids_list)
filtered_list = [] filtered_list = []
hats_ids_list.each do|hat_id| hats_ids_list.each do|hat_id|
filtered_list << hat_id if !$Trainer.unlocked_hats.include?(hat_id) filtered_list << hat_id if !$player.unlocked_hats.include?(hat_id)
end end
return filtered_list return filtered_list
end end
@@ -70,7 +70,7 @@ end
def filter_hats_only_owned(hats_ids_list) def filter_hats_only_owned(hats_ids_list)
filtered_list = [] filtered_list = []
hats_ids_list.each do|hat_id| hats_ids_list.each do|hat_id|
filtered_list << hat_id if $Trainer.unlocked_hats.include?(hat_id) filtered_list << hat_id if $player.unlocked_hats.include?(hat_id)
end end
return filtered_list return filtered_list
end end

View File

@@ -114,8 +114,8 @@ class CharacterSelectMenuPresenter
applyGender(@gender) applyGender(@gender)
echoln @age echoln @age
pbSet(VAR_TRAINER_AGE, @age) pbSet(VAR_TRAINER_AGE, @age)
$Trainer.skin_tone = @skinTone $player.skin_tone = @skinTone
$Trainer.name = @name $player.name = @name
end end
def getOptionIndex(option_name) def getOptionIndex(option_name)
@@ -201,7 +201,7 @@ class CharacterSelectMenuPresenter
@skinTone += incr @skinTone += incr
@skinTone = MIN_SKIN_COLOR if @skinTone > MAX_SKIN_COLOR @skinTone = MIN_SKIN_COLOR if @skinTone > MAX_SKIN_COLOR
@skinTone = MAX_SKIN_COLOR if @skinTone < MIN_SKIN_COLOR @skinTone = MAX_SKIN_COLOR if @skinTone < MIN_SKIN_COLOR
$Trainer.skin_tone = @skinTone $player.skin_tone = @skinTone
label = SKIN_COLOR_IDS[@skinTone - 1] label = SKIN_COLOR_IDS[@skinTone - 1]
@view.displayText(SKIN_TEXT_ID, label, current_index) @view.displayText(SKIN_TEXT_ID, label, current_index)
end end
@@ -219,7 +219,7 @@ class CharacterSelectMenuPresenter
applyHairEasterEggs() applyHairEasterEggs()
hairColorId = HAIR_COLOR_IDS[@hairColor] hairColorId = HAIR_COLOR_IDS[@hairColor]
hairId = hairColorId.to_s + "_" + @hairstyle.to_s hairId = hairColorId.to_s + "_" + @hairstyle.to_s
$Trainer.hair = hairId $player.hair = hairId
end end
def applyHairEasterEggs() def applyHairEasterEggs()
@@ -236,9 +236,9 @@ class CharacterSelectMenuPresenter
outfitId = get_outfit_id_from_index(gender_index) outfitId = get_outfit_id_from_index(gender_index)
@hairstyle = outfitId @hairstyle = outfitId
applyHair() applyHair()
#$Trainer.hair = outfitId #$player.hair = outfitId
$Trainer.clothes = outfitId $player.clothes = outfitId
$Trainer.hat = outfitId $player.hat = outfitId
end end
def get_outfit_id_from_index(gender_index) def get_outfit_id_from_index(gender_index)

View File

@@ -11,7 +11,7 @@ end
def selectHairstyle(all_unlocked = false) def selectHairstyle(all_unlocked = false)
selector = OutfitSelector.new selector = OutfitSelector.new
display_outfit_preview() display_outfit_preview()
hat = $Trainer.hat hat = $player.hat
commands = ["Next style", "Previous style", "Toggle hat", "Back"] commands = ["Next style", "Previous style", "Toggle hat", "Back"]
previous_input = 0 previous_input = 0
# To enable turning the common event that lets you turn around while in the dialog box # To enable turning the common event that lets you turn around while in the dialog box
@@ -29,10 +29,10 @@ def selectHairstyle(all_unlocked = false)
display_outfit_preview() display_outfit_preview()
when 2 #Toggle hat when 2 #Toggle hat
pbSEPlay("GUI storage put down", 80, 100) pbSEPlay("GUI storage put down", 80, 100)
if hat == $Trainer.hat if hat == $player.hat
$Trainer.hat = nil $player.hat = nil
else else
$Trainer.hat = hat $player.hat = hat
end end
display_outfit_preview() display_outfit_preview()
else else
@@ -40,11 +40,11 @@ def selectHairstyle(all_unlocked = false)
end end
end end
hide_outfit_preview() hide_outfit_preview()
$Trainer.hat = hat $player.hat = hat
end end
def swapToNextHairVersion() def swapToNextHairVersion()
split_hair = getSplitHairFilenameAndVersionFromID($Trainer.hair) split_hair = getSplitHairFilenameAndVersionFromID($player.hair)
hair_version = split_hair[0] hair_version = split_hair[0]
hair_style = split_hair[1] hair_style = split_hair[1]
current_version = hair_version current_version = hair_version
@@ -53,16 +53,16 @@ def swapToNextHairVersion()
lastVersion = findLastHairVersion(hair_style) lastVersion = findLastHairVersion(hair_style)
newVersion = lastVersion if newVersion <= 0 newVersion = lastVersion if newVersion <= 0
newVersion = 1 if newVersion > lastVersion newVersion = 1 if newVersion > lastVersion
$Trainer.hair = getFullHairId(hair_style,newVersion) $player.hair = getFullHairId(hair_style,newVersion)
end end
def selectHairColor def selectHairColor
original_color = $Trainer.hair_color original_color = $player.hair_color
original_hair = $Trainer.hair original_hair = $player.hair
$game_switches[SWITCH_SELECTING_CLOTHES]=true $game_switches[SWITCH_SELECTING_CLOTHES]=true
$game_map.update $game_map.update
display_outfit_preview() display_outfit_preview()
hat = $Trainer.hat hat = $player.hat
commands = ["Swap base color", "Shift up", "Shift down", "Toggle hat", "Remove dye", "Confirm", "Never Mind"] commands = ["Swap base color", "Shift up", "Shift down", "Toggle hat", "Remove dye", "Confirm", "Never Mind"]
previous_input = 0 previous_input = 0
@@ -87,28 +87,28 @@ def selectHairColor
ret = true ret = true
when 3 #Toggle hat when 3 #Toggle hat
pbSEPlay("GUI storage put down", 80, 100) pbSEPlay("GUI storage put down", 80, 100)
if hat == $Trainer.hat if hat == $player.hat
$Trainer.hat = nil $player.hat = nil
else else
$Trainer.hat = hat $player.hat = hat
end end
display_outfit_preview() display_outfit_preview()
when 4 #Reset when 4 #Reset
pbSEPlay("GUI storage put down", 80, 100) pbSEPlay("GUI storage put down", 80, 100)
$Trainer.hair_color = 0 $player.hair_color = 0
display_outfit_preview() display_outfit_preview()
ret = false ret = false
when 5 #Confirm when 5 #Confirm
break break
else else
$Trainer.hair_color = original_color $player.hair_color = original_color
$Trainer.hair = original_hair $player.hair = original_hair
ret = false ret = false
break break
end end
end end
hide_outfit_preview() hide_outfit_preview()
$Trainer.hat = hat $player.hat = hat
$game_switches[SWITCH_SELECTING_CLOTHES]=false $game_switches[SWITCH_SELECTING_CLOTHES]=false
$game_map.update $game_map.update
return ret return ret
@@ -116,7 +116,7 @@ def selectHairColor
end end
def selectHatColor(secondary_hat=false) def selectHatColor(secondary_hat=false)
original_color = secondary_hat ? $Trainer.hat2_color : $Trainer.hat_color original_color = secondary_hat ? $player.hat2_color : $player.hat_color
display_outfit_preview() display_outfit_preview()
commands = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"] commands = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"]
previous_input = 0 previous_input = 0
@@ -136,16 +136,16 @@ def selectHatColor(secondary_hat=false)
ret = true ret = true
when 2 #Reset when 2 #Reset
pbSEPlay("GUI storage put down", 80, 100) pbSEPlay("GUI storage put down", 80, 100)
$Trainer.hat_color = 0 if !secondary_hat $player.hat_color = 0 if !secondary_hat
$Trainer.hat2_color = 0 if secondary_hat $player.hat2_color = 0 if secondary_hat
display_outfit_preview display_outfit_preview
refreshPlayerOutfit refreshPlayerOutfit
ret = false ret = false
when 3 #Confirm when 3 #Confirm
break break
else else
$Trainer.hat_color = original_color if !secondary_hat $player.hat_color = original_color if !secondary_hat
$Trainer.hat2_color = original_color if secondary_hat $player.hat2_color = original_color if secondary_hat
ret = false ret = false
break break
end end
@@ -156,7 +156,7 @@ def selectHatColor(secondary_hat=false)
end end
def selectClothesColor def selectClothesColor
original_color = $Trainer.clothes_color original_color = $player.clothes_color
display_outfit_preview() display_outfit_preview()
commands = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"] commands = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"]
previous_input = 0 previous_input = 0
@@ -177,14 +177,14 @@ def selectClothesColor
ret = true ret = true
when 2 #Reset when 2 #Reset
pbSEPlay("GUI storage pick up", 80, 100) pbSEPlay("GUI storage pick up", 80, 100)
$Trainer.clothes_color = 0 $player.clothes_color = 0
display_outfit_preview() display_outfit_preview()
refreshPlayerOutfit() refreshPlayerOutfit()
ret = false ret = false
when 3 #Confirm when 3 #Confirm
break break
else else
$Trainer.clothes_color = original_color $player.clothes_color = original_color
ret = false ret = false
break break
end end
@@ -213,7 +213,7 @@ def selectHat(all_unlocked = false)
display_outfit_preview() display_outfit_preview()
when 2 #REMOVE HAT when 2 #REMOVE HAT
playOutfitRemovedAnimation() playOutfitRemovedAnimation()
$Trainer.hat = nil $player.hat = nil
selector.display_outfit_preview() selector.display_outfit_preview()
else else
break break
@@ -250,7 +250,7 @@ def selectClothes(all_unlocked = false)
when 2 #REMOVE CLOTHES when 2 #REMOVE CLOTHES
break if !$DEBUG break if !$DEBUG
playOutfitRemovedAnimation() playOutfitRemovedAnimation()
$Trainer.clothes = nil $player.clothes = nil
display_outfit_preview() display_outfit_preview()
else else
break break

View File

@@ -47,8 +47,8 @@ class PokemonHatPresenter
loop do loop do
Graphics.update Graphics.update
Input.update Input.update
@hat_id = selector.selectNextOutfit(@hat_id, 1, selector.hats_list, [], false, "hat",$Trainer.unlocked_hats,false) if Input.trigger?(Input::RIGHT) @hat_id = selector.selectNextOutfit(@hat_id, 1, selector.hats_list, [], false, "hat",$player.unlocked_hats,false) if Input.trigger?(Input::RIGHT)
@hat_id = selector.selectNextOutfit(@hat_id, -1, selector.hats_list, [], false, "hat",$Trainer.unlocked_hats,false) if Input.trigger?(Input::LEFT) @hat_id = selector.selectNextOutfit(@hat_id, -1, selector.hats_list, [], false, "hat",$player.unlocked_hats,false) if Input.trigger?(Input::LEFT)
break if Input.trigger?(Input::USE) break if Input.trigger?(Input::USE)
return false if Input.trigger?(Input::BACK) return false if Input.trigger?(Input::BACK)
@view.update() @view.update()

View File

@@ -29,15 +29,15 @@ class TrainerClothesPreview
end end
def resetOutfits() def resetOutfits()
@clothes = $Trainer.clothes @clothes = $player.clothes
@hat = $Trainer.hat @hat = $player.hat
@hat2 = $Trainer.hat2 @hat2 = $player.hat2
@hair = $Trainer.hair @hair = $player.hair
@skin_tone = $Trainer.skin_tone @skin_tone = $player.skin_tone
@hair_color = $Trainer.hair_color @hair_color = $player.hair_color
@hat_color = $Trainer.hat_color @hat_color = $player.hat_color
@hat2_color = $Trainer.hat2_color @hat2_color = $player.hat2_color
@clothes_color = $Trainer.clothes_color @clothes_color = $player.clothes_color
end end
def show() def show()

View File

@@ -19,8 +19,8 @@ class OutfitsMartAdapter < PokemonMartAdapter
@worn_clothes = get_current_clothes() @worn_clothes = get_current_clothes()
@isShop = isShop @isShop = isShop
@version = nil @version = nil
$Trainer.dyed_hats = {} if !$Trainer.dyed_hats $player.dyed_hats = {} if !$player.dyed_hats
$Trainer.dyed_clothes = {} if !$Trainer.dyed_clothes $player.dyed_clothes = {} if !$player.dyed_clothes
#todo: refactor to get the list from the first search when #todo: refactor to get the list from the first search when
# setting the stock instead of searching twice # setting the stock instead of searching twice

View File

@@ -3,9 +3,9 @@ class ClothesMartAdapter < OutfitsMartAdapter
DEFAULT_NAME = "[unknown]" DEFAULT_NAME = "[unknown]"
DEFAULT_DESCRIPTION = "A piece of clothing that trainers can wear." DEFAULT_DESCRIPTION = "A piece of clothing that trainers can wear."
def toggleEvent(item) def toggleEvent(item)
if !isShop? && $Trainer.clothes_color != 0 if !isShop? && $player.clothes_color != 0
if pbConfirmMessage(_INTL("Would you like to remove the dye?")) if pbConfirmMessage(_INTL("Would you like to remove the dye?"))
$Trainer.clothes_color = 0 $player.clothes_color = 0
end end
end end
end end
@@ -41,7 +41,7 @@ class ClothesMartAdapter < OutfitsMartAdapter
def updateTrainerPreview(item, previewWindow) def updateTrainerPreview(item, previewWindow)
return if !item return if !item
previewWindow.clothes = item.id previewWindow.clothes = item.id
$Trainer.clothes = item.id $player.clothes = item.id
set_dye_color(item,previewWindow) set_dye_color(item,previewWindow)
pbRefreshSceneMap pbRefreshSceneMap
@@ -50,26 +50,26 @@ class ClothesMartAdapter < OutfitsMartAdapter
def get_dye_color(item_id) def get_dye_color(item_id)
return 0 if isShop? return 0 if isShop?
$Trainer.dyed_clothes= {} if ! $Trainer.dyed_clothes $player.dyed_clothes= {} if ! $player.dyed_clothes
if $Trainer.dyed_clothes.include?(item_id) if $player.dyed_clothes.include?(item_id)
return $Trainer.dyed_clothes[item_id] return $player.dyed_clothes[item_id]
end end
return 0 return 0
end end
def set_dye_color(item,previewWindow) def set_dye_color(item,previewWindow)
if !isShop? if !isShop?
$Trainer.dyed_clothes= {} if ! $Trainer.dyed_clothes $player.dyed_clothes= {} if ! $player.dyed_clothes
if $Trainer.dyed_clothes.include?(item.id) if $player.dyed_clothes.include?(item.id)
dye_color = $Trainer.dyed_clothes[item.id] dye_color = $player.dyed_clothes[item.id]
$Trainer.clothes_color = dye_color $player.clothes_color = dye_color
previewWindow.clothes_color = dye_color previewWindow.clothes_color = dye_color
else else
$Trainer.clothes_color=0 $player.clothes_color=0
previewWindow.clothes_color=0 previewWindow.clothes_color=0
end end
else else
$Trainer.clothes_color=0 $player.clothes_color=0
previewWindow.clothes_color=0 previewWindow.clothes_color=0
end end
end end
@@ -82,16 +82,16 @@ class ClothesMartAdapter < OutfitsMartAdapter
end end
def get_current_clothes() def get_current_clothes()
return $Trainer.clothes return $player.clothes
end end
def player_changed_clothes?() def player_changed_clothes?()
$Trainer.clothes != @worn_clothes $player.clothes != @worn_clothes
end end
def putOnSelectedOutfit() def putOnSelectedOutfit()
putOnClothes($Trainer.clothes) putOnClothes($player.clothes)
@worn_clothes = $Trainer.clothes @worn_clothes = $player.clothes
end end
def putOnOutfit(item) def putOnOutfit(item)
@@ -100,12 +100,12 @@ class ClothesMartAdapter < OutfitsMartAdapter
end end
def reset_player_clothes() def reset_player_clothes()
$Trainer.clothes = @worn_clothes $player.clothes = @worn_clothes
$Trainer.clothes_color = $Trainer.dyed_clothes[@worn_clothes] if $Trainer.dyed_clothes && $Trainer.dyed_clothes[@worn_clothes] $player.clothes_color = $player.dyed_clothes[@worn_clothes] if $player.dyed_clothes && $player.dyed_clothes[@worn_clothes]
end end
def get_unlocked_items_list() def get_unlocked_items_list()
return $Trainer.unlocked_clothes return $player.unlocked_clothes
end end
def isWornItem?(item) def isWornItem?(item)

View File

@@ -61,10 +61,10 @@ def hatShop(outfits_list = [], free=false, customMessage=nil)
end end
def hairShop(outfits_list = [],free=false, customMessage=nil) def hairShop(outfits_list = [],free=false, customMessage=nil)
currentHair = getSimplifiedHairIdFromFullID($Trainer.hair) currentHair = getSimplifiedHairIdFromFullID($player.hair)
stock = [:SWAP_COLOR] stock = [:SWAP_COLOR]
#always add current hairstyle as first option (in case the player just wants to swap the color) #always add current hairstyle as first option (in case the player just wants to swap the color)
stock << get_hair_by_id(currentHair) if $Trainer.hair stock << get_hair_by_id(currentHair) if $player.hair
outfits_list.each { |outfit_id| outfits_list.each { |outfit_id|
next if outfit_id == currentHair next if outfit_id == currentHair
outfit = get_hair_by_id(outfit_id) outfit = get_hair_by_id(outfit_id)
@@ -74,15 +74,15 @@ def hairShop(outfits_list = [],free=false, customMessage=nil)
end end
def switchHatsPosition() def switchHatsPosition()
hat1 = $Trainer.hat hat1 = $player.hat
hat2 = $Trainer.hat2 hat2 = $player.hat2
hat1_color = $Trainer.hat_color hat1_color = $player.hat_color
hat2_color = $Trainer.hat2_color hat2_color = $player.hat2_color
$Trainer.hat = hat2 $player.hat = hat2
$Trainer.hat2 = hat1 $player.hat2 = hat1
$Trainer.hat_color = hat1_color $player.hat_color = hat1_color
$Trainer.hat_color = hat2_color $player.hat_color = hat2_color
pbSEPlay("GUI naming tab swap start") pbSEPlay("GUI naming tab swap start")
end end
@@ -108,7 +108,7 @@ end
def changeClothesMenu() def changeClothesMenu()
stock = [] stock = []
$Trainer.unlocked_clothes.each { |outfit_id| $player.unlocked_clothes.each { |outfit_id|
outfit = get_clothes_by_id(outfit_id) outfit = get_clothes_by_id(outfit_id)
stock << outfit if outfit stock << outfit if outfit
} }
@@ -117,7 +117,7 @@ end
def changeHatMenu(is_secondary_hat = false) def changeHatMenu(is_secondary_hat = false)
stock = [] stock = []
$Trainer.unlocked_hats.each { |outfit_id| $player.unlocked_hats.each { |outfit_id|
outfit = get_hat_by_id(outfit_id) outfit = get_hat_by_id(outfit_id)
stock << outfit if outfit stock << outfit if outfit
} }

View File

@@ -15,7 +15,7 @@ class ClothesShopPresenter < PokemonMartScreen
def dyeClothes() def dyeClothes()
original_color = $Trainer.clothes_color original_color = $player.clothes_color
options = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"] options = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"]
previous_input = 0 previous_input = 0
ret = false ret = false
@@ -33,12 +33,12 @@ class ClothesShopPresenter < PokemonMartScreen
ret = true ret = true
when 2 #Reset when 2 #Reset
pbSEPlay("GUI storage pick up", 80, 100) pbSEPlay("GUI storage pick up", 80, 100)
$Trainer.clothes_color = 0 $player.clothes_color = 0
ret = false ret = false
when 3 #Confirm when 3 #Confirm
break break
else else
$Trainer.clothes_color = original_color $player.clothes_color = original_color
ret = false ret = false
break break
end end
@@ -60,7 +60,7 @@ class ClothesShopPresenter < PokemonMartScreen
if options[choice] == cmd_wear if options[choice] == cmd_wear
putOnClothes(item,false) putOnClothes(item,false)
$Trainer.clothes_color = @adapter.get_dye_color(item.id) $player.clothes_color = @adapter.get_dye_color(item.id)
return true return true
elsif options[choice] == cmd_dye elsif options[choice] == cmd_dye
dyeClothes() dyeClothes()

View File

@@ -9,31 +9,31 @@ class ClothesShopPresenter < PokemonMartScreen
def wearAsHat1(item) def wearAsHat1(item)
@adapter.set_secondary_hat(false) @adapter.set_secondary_hat(false)
putOnClothes(item) putOnClothes(item)
$Trainer.set_hat_color(@adapter.get_dye_color(item.id),false) $player.set_hat_color(@adapter.get_dye_color(item.id),false)
end end
def wearAsHat2(item) def wearAsHat2(item)
@adapter.set_secondary_hat(true) @adapter.set_secondary_hat(true)
putOnClothes(item) putOnClothes(item)
$Trainer.set_hat_color(@adapter.get_dye_color(item.id),true) $player.set_hat_color(@adapter.get_dye_color(item.id),true)
end end
def removeDye(item) def removeDye(item)
if pbConfirm(_INTL("Are you sure you want to remove the dye from the {1}?", item.name)) if pbConfirm(_INTL("Are you sure you want to remove the dye from the {1}?", item.name))
$Trainer.set_hat_color(0,@adapter.is_secondary_hat) $player.set_hat_color(0,@adapter.is_secondary_hat)
end end
end end
def swapHats() def swapHats()
echoln "hat 1: #{$Trainer.hat}" echoln "hat 1: #{$player.hat}"
echoln "hat 2: #{$Trainer.hat2}" echoln "hat 2: #{$player.hat2}"
$Trainer.hat, $Trainer.hat2 = $Trainer.hat2, $Trainer.hat $player.hat, $player.hat2 = $player.hat2, $player.hat
pbSEPlay("GUI naming tab swap start") pbSEPlay("GUI naming tab swap start")
new_selected_hat = @adapter.is_secondary_hat ? $Trainer.hat2 : $Trainer.hat new_selected_hat = @adapter.is_secondary_hat ? $player.hat2 : $player.hat
echoln "hat 1: #{$Trainer.hat}" echoln "hat 1: #{$player.hat}"
echoln "hat 2: #{$Trainer.hat2}" echoln "hat 2: #{$player.hat2}"
echoln "new selected hat: #{new_selected_hat}" echoln "new selected hat: #{new_selected_hat}"
@scene.select_specific_item(new_selected_hat,true) @scene.select_specific_item(new_selected_hat,true)
@@ -69,18 +69,18 @@ class ClothesShopPresenter < PokemonMartScreen
def putOnHats() def putOnHats()
@adapter.worn_clothes = $Trainer.hat @adapter.worn_clothes = $player.hat
@adapter.worn_clothes2 = $Trainer.hat2 @adapter.worn_clothes2 = $player.hat2
putOnHat($Trainer.hat,true,false) putOnHat($player.hat,true,false)
putOnHat($Trainer.hat2,true,true) putOnHat($player.hat2,true,true)
playOutfitChangeAnimation() playOutfitChangeAnimation()
pbMessage(_INTL("You put on the hat(s)!\\wtnp[30]")) pbMessage(_INTL("You put on the hat(s)!\\wtnp[30]"))
end end
def dyeOptions(secondary_hat=false,item) def dyeOptions(secondary_hat=false,item)
original_color = secondary_hat ? $Trainer.hat2_color : $Trainer.hat_color original_color = secondary_hat ? $player.hat2_color : $player.hat_color
options = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"] options = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"]
previous_input = 0 previous_input = 0
while (true) while (true)
@@ -97,14 +97,14 @@ class ClothesShopPresenter < PokemonMartScreen
ret = true ret = true
when 2 #Reset when 2 #Reset
pbSEPlay("GUI storage put down", 80, 100) pbSEPlay("GUI storage put down", 80, 100)
$Trainer.hat_color = 0 if !secondary_hat $player.hat_color = 0 if !secondary_hat
$Trainer.hat2_color = 0 if secondary_hat $player.hat2_color = 0 if secondary_hat
ret = false ret = false
when 3 #Confirm when 3 #Confirm
break break
else else
$Trainer.hat_color = original_color if !secondary_hat $player.hat_color = original_color if !secondary_hat
$Trainer.hat2_color = original_color if secondary_hat $player.hat2_color = original_color if secondary_hat
ret = false ret = false
break break
end end
@@ -117,8 +117,8 @@ class ClothesShopPresenter < PokemonMartScreen
def confirmPutClothes(item) def confirmPutClothes(item)
if @adapter.is_a?(HatsMartAdapter) if @adapter.is_a?(HatsMartAdapter)
putOnHats() putOnHats()
$Trainer.hat_color = @adapter.get_dye_color($Trainer.hat) $player.hat_color = @adapter.get_dye_color($player.hat)
$Trainer.hat2_color = @adapter.get_dye_color($Trainer.hat2) $player.hat2_color = @adapter.get_dye_color($player.hat2)
else else
putOnClothes(item,false) putOnClothes(item,false)
end end

View File

@@ -8,9 +8,9 @@ class HairMartAdapter < OutfitsMartAdapter
super super
@version = getCurrentHairVersion().to_i @version = getCurrentHairVersion().to_i
@worn_hair = $Trainer.hair @worn_hair = $player.hair
@worn_hat = $Trainer.hat @worn_hat = $player.hat
@worn_hat2 = $Trainer.hat2 @worn_hat2 = $player.hat2
@hat_visible = false @hat_visible = false
@removable = true @removable = true
@@ -34,7 +34,7 @@ class HairMartAdapter < OutfitsMartAdapter
end end
def player_changed_clothes?() def player_changed_clothes?()
$Trainer.hairstyle != @worn_hair $player.hairstyle != @worn_hair
end end
#player can't "own" hairstyles #player can't "own" hairstyles
@@ -85,7 +85,7 @@ class HairMartAdapter < OutfitsMartAdapter
def getCurrentHairVersion() def getCurrentHairVersion()
begin begin
return getSplitHairFilenameAndVersionFromID($Trainer.hair)[0] return getSplitHairFilenameAndVersionFromID($player.hair)[0]
rescue rescue
return 1 return 1
end end
@@ -96,7 +96,7 @@ class HairMartAdapter < OutfitsMartAdapter
end end
def getName(item) def getName(item)
echoln $Trainer.hair echoln $player.hair
return item.id return item.id
end end
@@ -121,12 +121,12 @@ class HairMartAdapter < OutfitsMartAdapter
previewWindow.hat = displayed_hat previewWindow.hat = displayed_hat
previewWindow.hat2 = displayed_hat2 previewWindow.hat2 = displayed_hat2
$Trainer.hat = displayed_hat $player.hat = displayed_hat
$Trainer.hat2 = displayed_hat2 $player.hat2 = displayed_hat2
itemId = getCurrentHairId(item.id) itemId = getCurrentHairId(item.id)
previewWindow.hair = itemId previewWindow.hair = itemId
$Trainer.hair = itemId $player.hair = itemId
pbRefreshSceneMap pbRefreshSceneMap
previewWindow.updatePreview() previewWindow.updatePreview()
end end
@@ -139,7 +139,7 @@ class HairMartAdapter < OutfitsMartAdapter
end end
def get_current_clothes() def get_current_clothes()
return $Trainer.hair return $player.hair
end end
def putOnOutfit(item) def putOnOutfit(item)
@@ -152,19 +152,19 @@ class HairMartAdapter < OutfitsMartAdapter
# can change hair color for free if not changing the style # can change hair color for free if not changing the style
if getVersionFromFullID(@worn_hair) != @version if getVersionFromFullID(@worn_hair) != @version
worn_id = getSimplifiedHairIdFromFullID(@worn_hair) worn_id = getSimplifiedHairIdFromFullID(@worn_hair)
if getSimplifiedHairIdFromFullID($Trainer.hair) == worn_id if getSimplifiedHairIdFromFullID($player.hair) == worn_id
@worn_hair = getFullHairId(worn_id,@version) @worn_hair = getFullHairId(worn_id,@version)
end end
end end
$Trainer.hair = @worn_hair $player.hair = @worn_hair
$Trainer.hat = @worn_hat $player.hat = @worn_hat
$Trainer.hat2 = @worn_hat2 $player.hat2 = @worn_hat2
end end
def get_unlocked_items_list() def get_unlocked_items_list()
return $Trainer.unlocked_hairstyles return $player.unlocked_hairstyles
end end

View File

@@ -27,7 +27,7 @@ class HatShopView < ClothesShopView
def switchItemVersion(itemwindow) def switchItemVersion(itemwindow)
@adapter.switchVersion(itemwindow.item, 1) @adapter.switchVersion(itemwindow.item, 1)
new_selected_hat = @adapter.is_secondary_hat ? $Trainer.hat2 : $Trainer.hat new_selected_hat = @adapter.is_secondary_hat ? $player.hat2 : $player.hat
select_specific_item(new_selected_hat,true) select_specific_item(new_selected_hat,true)
updateTrainerPreview() updateTrainerPreview()
end end
@@ -39,7 +39,7 @@ class HatShopView < ClothesShopView
end end
def handleHatlessLayerIcons(selected_item) def handleHatlessLayerIcons(selected_item)
other_hat = @adapter.is_secondary_hat ? $Trainer.hat : $Trainer.hat2 other_hat = @adapter.is_secondary_hat ? $player.hat : $player.hat2
if !selected_item.is_a?(Hat) if !selected_item.is_a?(Hat)
if @adapter.is_secondary_hat if @adapter.is_secondary_hat
@sprites["wornHat_layer2"].bitmap=nil @sprites["wornHat_layer2"].bitmap=nil
@@ -59,12 +59,12 @@ class HatShopView < ClothesShopView
def displayLayerIcons(selected_item=nil) def displayLayerIcons(selected_item=nil)
handleHatlessLayerIcons(selected_item) handleHatlessLayerIcons(selected_item)
hat1Filename = getOverworldHatFilename($Trainer.hat) hat1Filename = getOverworldHatFilename($player.hat)
hat2Filename = getOverworldHatFilename($Trainer.hat2) hat2Filename = getOverworldHatFilename($player.hat2)
hat_color_shift = $Trainer.dyed_hats[$Trainer.hat] hat_color_shift = $player.dyed_hats[$player.hat]
hat2_color_shift = $Trainer.dyed_hats[$Trainer.hat2] hat2_color_shift = $player.dyed_hats[$player.hat2]
hatBitmapWrapper = AnimatedBitmap.new(hat1Filename, hat_color_shift) if pbResolveBitmap(hat1Filename) hatBitmapWrapper = AnimatedBitmap.new(hat1Filename, hat_color_shift) if pbResolveBitmap(hat1Filename)
hat2BitmapWrapper = AnimatedBitmap.new(hat2Filename, hat2_color_shift) if pbResolveBitmap(hat2Filename) hat2BitmapWrapper = AnimatedBitmap.new(hat2Filename, hat2_color_shift) if pbResolveBitmap(hat2Filename)

View File

@@ -7,22 +7,22 @@ class HatsMartAdapter < OutfitsMartAdapter
def initialize(stock = nil, isShop = nil, isSecondaryHat = false) def initialize(stock = nil, isShop = nil, isSecondaryHat = false)
super(stock,isShop,isSecondaryHat) super(stock,isShop,isSecondaryHat)
@worn_clothes = $Trainer.hat @worn_clothes = $player.hat
@worn_clothes2 = $Trainer.hat2 @worn_clothes2 = $player.hat2
@second_hat_visible = true @second_hat_visible = true
end end
#Used in shops only #Used in shops only
def toggleSecondHat() def toggleSecondHat()
@second_hat_visible = !@second_hat_visible @second_hat_visible = !@second_hat_visible
$Trainer.hat2 = @second_hat_visible ? @worn_clothes2 : nil $player.hat2 = @second_hat_visible ? @worn_clothes2 : nil
end end
def toggleEvent(item) def toggleEvent(item)
if isShop? if isShop?
toggleSecondHat toggleSecondHat
else else
$Trainer.set_hat(nil,@is_secondary_hat) $player.set_hat(nil,@is_secondary_hat)
@worn_clothes = nil @worn_clothes = nil
end end
end end
@@ -72,8 +72,8 @@ class HatsMartAdapter < OutfitsMartAdapter
def updateTrainerPreview(item, previewWindow) def updateTrainerPreview(item, previewWindow)
if item.is_a?(Outfit) if item.is_a?(Outfit)
hat1 = @is_secondary_hat ? get_hat_by_id($Trainer.hat) : item hat1 = @is_secondary_hat ? get_hat_by_id($player.hat) : item
hat2 = @is_secondary_hat ? item : get_hat_by_id($Trainer.hat2) hat2 = @is_secondary_hat ? item : get_hat_by_id($player.hat2)
previewWindow.set_hat(hat1.id,false) if hat1 previewWindow.set_hat(hat1.id,false) if hat1
previewWindow.set_hat(hat2.id,true) if hat2 previewWindow.set_hat(hat2.id,true) if hat2
@@ -81,18 +81,18 @@ class HatsMartAdapter < OutfitsMartAdapter
hat1_color=0 hat1_color=0
hat2_color=0 hat2_color=0
hat1_color = $Trainer.dyed_hats[hat1.id] if hat1 && $Trainer.dyed_hats.include?(hat1.id) hat1_color = $player.dyed_hats[hat1.id] if hat1 && $player.dyed_hats.include?(hat1.id)
hat2_color = $Trainer.dyed_hats[hat2.id] if hat2 && $Trainer.dyed_hats.include?(hat2.id) hat2_color = $player.dyed_hats[hat2.id] if hat2 && $player.dyed_hats.include?(hat2.id)
previewWindow.hat_color = hat1_color previewWindow.hat_color = hat1_color
previewWindow.hat2_color = hat2_color previewWindow.hat2_color = hat2_color
$Trainer.hat = hat1&.id $player.hat = hat1&.id
$Trainer.hat2 = hat2&.id $player.hat2 = hat2&.id
$Trainer.hat_color = hat1_color $player.hat_color = hat1_color
$Trainer.hat2_color = hat2_color $player.hat2_color = hat2_color
else else
$Trainer.set_hat(nil,@is_secondary_hat) $player.set_hat(nil,@is_secondary_hat)
previewWindow.set_hat(nil,@is_secondary_hat) previewWindow.set_hat(nil,@is_secondary_hat)
end end
@@ -104,9 +104,9 @@ class HatsMartAdapter < OutfitsMartAdapter
def get_dye_color(item_id) def get_dye_color(item_id)
return if !item_id return if !item_id
return 0 if isShop? return 0 if isShop?
$Trainer.dyed_hats= {} if ! $Trainer.dyed_hats $player.dyed_hats= {} if ! $player.dyed_hats
if $Trainer.dyed_hats.include?(item_id) if $player.dyed_hats.include?(item_id)
return $Trainer.dyed_hats[item_id] return $player.dyed_hats[item_id]
end end
return 0 return 0
end end
@@ -117,7 +117,7 @@ class HatsMartAdapter < OutfitsMartAdapter
if !isShop? if !isShop?
else else
$Trainer.set_hat_color(0,is_secondary_hat) $player.set_hat_color(0,is_secondary_hat)
previewWindow.hat_color=0 previewWindow.hat_color=0
end end
end end
@@ -125,23 +125,23 @@ class HatsMartAdapter < OutfitsMartAdapter
# def set_dye_color(item,previewWindow,is_secondary_hat=false) # def set_dye_color(item,previewWindow,is_secondary_hat=false)
# return if !item # return if !item
# if !isShop? # if !isShop?
# $Trainer.dyed_hats= {} if !$Trainer.dyed_hats # $player.dyed_hats= {} if !$player.dyed_hats
# #
# echoln item.id # echoln item.id
# echoln $Trainer.dyed_hats.include?(item.id) # echoln $player.dyed_hats.include?(item.id)
# echoln $Trainer.dyed_hats[item.id] # echoln $player.dyed_hats[item.id]
# #
# if $Trainer.dyed_hats.include?(item.id) # if $player.dyed_hats.include?(item.id)
# dye_color = $Trainer.dyed_hats[item.id] # dye_color = $player.dyed_hats[item.id]
# $Trainer.set_hat_color(dye_color,is_secondary_hat) # $player.set_hat_color(dye_color,is_secondary_hat)
# previewWindow.hat_color = dye_color # previewWindow.hat_color = dye_color
# else # else
# $Trainer.set_hat_color(0,is_secondary_hat) # $player.set_hat_color(0,is_secondary_hat)
# previewWindow.hat_color=0 # previewWindow.hat_color=0
# end # end
# #echoln $Trainer.dyed_hats # #echoln $player.dyed_hats
# else # else
# $Trainer.set_hat_color(0,is_secondary_hat) # $player.set_hat_color(0,is_secondary_hat)
# previewWindow.hat_color=0 # previewWindow.hat_color=0
# end # end
# end # end
@@ -156,22 +156,22 @@ class HatsMartAdapter < OutfitsMartAdapter
end end
def get_current_clothes() def get_current_clothes()
return $Trainer.hat(@is_secondary_hat) return $player.hat(@is_secondary_hat)
end end
def player_changed_clothes?() def player_changed_clothes?()
echoln("Trainer hat: #{$Trainer.hat}, Worn hat: #{@worn_clothes}") echoln("Trainer hat: #{$player.hat}, Worn hat: #{@worn_clothes}")
echoln("Trainer hat2: #{$Trainer.hat2}, Worn hat2: #{@worn_clothes2}") echoln("Trainer hat2: #{$player.hat2}, Worn hat2: #{@worn_clothes2}")
$Trainer.hat != @worn_clothes || $Trainer.hat2 != @worn_clothes2 $player.hat != @worn_clothes || $player.hat2 != @worn_clothes2
end end
def putOnSelectedOutfit() def putOnSelectedOutfit()
putOnHat($Trainer.hat,true,false) if $Trainer.hat putOnHat($player.hat,true,false) if $player.hat
putOnHat($Trainer.hat2,true,true) if $Trainer.hat2 putOnHat($player.hat2,true,true) if $player.hat2
@worn_clothes = $Trainer.hat @worn_clothes = $player.hat
@worn_clothes2 = $Trainer.hat2 @worn_clothes2 = $player.hat2
playOutfitChangeAnimation() playOutfitChangeAnimation()
pbMessage(_INTL("You put on the hat(s)!\\wtnp[30]")) pbMessage(_INTL("You put on the hat(s)!\\wtnp[30]"))
@@ -184,15 +184,15 @@ class HatsMartAdapter < OutfitsMartAdapter
end end
def reset_player_clothes() def reset_player_clothes()
$Trainer.set_hat(@worn_clothes,false) $player.set_hat(@worn_clothes,false)
$Trainer.set_hat(@worn_clothes2,true) $player.set_hat(@worn_clothes2,true)
$Trainer.set_hat_color($Trainer.dyed_hats[@worn_clothes],false) if $Trainer.dyed_hats && $Trainer.dyed_hats[@worn_clothes] $player.set_hat_color($player.dyed_hats[@worn_clothes],false) if $player.dyed_hats && $player.dyed_hats[@worn_clothes]
$Trainer.set_hat_color($Trainer.dyed_hats[@worn_clothes2],true) if $Trainer.dyed_hats && $Trainer.dyed_hats[@worn_clothes2] $player.set_hat_color($player.dyed_hats[@worn_clothes2],true) if $player.dyed_hats && $player.dyed_hats[@worn_clothes2]
end end
def get_unlocked_items_list() def get_unlocked_items_list()
return $Trainer.unlocked_hats return $player.unlocked_hats
end end
def getSpecialItemCaption(specialType) def getSpecialItemCaption(specialType)
@@ -220,7 +220,7 @@ class HatsMartAdapter < OutfitsMartAdapter
end end
def getSpecialItemDescription(specialType) def getSpecialItemDescription(specialType)
hair_situation = !$Trainer.hair || getSimplifiedHairIdFromFullID($Trainer.hair) == HAIR_BALD ? "bald head" : "fabulous hair" hair_situation = !$player.hair || getSimplifiedHairIdFromFullID($player.hair) == HAIR_BALD ? "bald head" : "fabulous hair"
return "Go without a hat and show off your #{hair_situation}!" return "Go without a hat and show off your #{hair_situation}!"
end end

View File

@@ -16,14 +16,14 @@ class HairstyleSelectionMenuPresenter
def initialize(view) def initialize(view)
@view = view @view = view
@hairstyle_full_id = $Trainer.hair @hairstyle_full_id = $player.hair
hairstyle_split = getSplitHairFilenameAndVersionFromID(@hairstyle_full_id) hairstyle_split = getSplitHairFilenameAndVersionFromID(@hairstyle_full_id)
@hairstyle = hairstyle_split[0] if hairstyle_split[0] @hairstyle = hairstyle_split[0] if hairstyle_split[0]
@hair_version = hairstyle_split[1] if hairstyle_split[1] @hair_version = hairstyle_split[1] if hairstyle_split[1]
@hairColor = $Trainer.hair_color @hairColor = $player.hair_color
@available_styles= $Trainer.unlocked_hairstyles @available_styles= $player.unlocked_hairstyles
@selected_hairstyle_index = 0 @selected_hairstyle_index = 0
echoln @available_styles echoln @available_styles
@@ -74,8 +74,8 @@ class HairstyleSelectionMenuPresenter
def applyAllSelectedValues def applyAllSelectedValues
$Trainer.hair = getFullHairId(@hairstyle,@hair_version) $player.hair = getFullHairId(@hairstyle,@hair_version)
$Trainer.hair_color = @hairColor $player.hair_color = @hairColor
end end
def getOptionIndex(option_name) def getOptionIndex(option_name)
@@ -182,6 +182,6 @@ class HairstyleSelectionMenuPresenter
hairstyle = @hairstyle hairstyle = @hairstyle
hair_version =@hair_version hair_version =@hair_version
hairId = getFullHairId(hairstyle,hair_version) hairId = getFullHairId(hairstyle,hair_version)
$Trainer.hair = hairId $player.hair = hairId
end end
end end

View File

@@ -13,7 +13,7 @@ def obtainHat(outfit_id,secondary=false)
pbMessage(_INTL("The hat #{outfit_id} is invalid.")) pbMessage(_INTL("The hat #{outfit_id} is invalid."))
return return
end end
$Trainer.unlocked_hats << outfit_id if !$Trainer.unlocked_hats.include?(outfit_id) $player.unlocked_hats << outfit_id if !$player.unlocked_hats.include?(outfit_id)
obtainOutfitMessage(outfit) obtainOutfitMessage(outfit)
if pbConfirmMessage("Would you like to put it on right now?") if pbConfirmMessage("Would you like to put it on right now?")
putOnHat(outfit_id, false, false) if !secondary putOnHat(outfit_id, false, false) if !secondary
@@ -31,7 +31,7 @@ def obtainClothes(outfit_id)
return return
end end
return if !outfit return if !outfit
$Trainer.unlocked_clothes << outfit_id if !$Trainer.unlocked_clothes.include?(outfit_id) $player.unlocked_clothes << outfit_id if !$player.unlocked_clothes.include?(outfit_id)
obtainOutfitMessage(outfit) obtainOutfitMessage(outfit)
if pbConfirmMessage("Would you like to put it on right now?") if pbConfirmMessage("Would you like to put it on right now?")
putOnClothes(outfit_id) putOnClothes(outfit_id)
@@ -50,16 +50,16 @@ def obtainNewHairstyle(full_outfit_id)
end end
def putOnClothes(outfit_id, silent = false) def putOnClothes(outfit_id, silent = false)
$Trainer.dyed_clothes= {} if ! $Trainer.dyed_clothes $player.dyed_clothes= {} if ! $player.dyed_clothes
$Trainer.last_worn_outfit = $Trainer.clothes $player.last_worn_outfit = $player.clothes
outfit = get_clothes_by_id(outfit_id) outfit = get_clothes_by_id(outfit_id)
$Trainer.clothes = outfit_id $player.clothes = outfit_id
dye_color = $Trainer.dyed_clothes[outfit_id] dye_color = $player.dyed_clothes[outfit_id]
if dye_color if dye_color
$Trainer.clothes_color = dye_color $player.clothes_color = dye_color
else else
$Trainer.clothes_color = nil $player.clothes_color = nil
end end
$game_map.update $game_map.update
@@ -68,19 +68,19 @@ def putOnClothes(outfit_id, silent = false)
end end
def putOnHat(outfit_id, silent = false, is_secondary=false) def putOnHat(outfit_id, silent = false, is_secondary=false)
$Trainer.dyed_hats= {} if ! $Trainer.dyed_hats $player.dyed_hats= {} if ! $player.dyed_hats
$Trainer.set_last_worn_hat($Trainer.hat,is_secondary) $player.set_last_worn_hat($player.hat,is_secondary)
outfit = get_hat_by_id(outfit_id) outfit = get_hat_by_id(outfit_id)
$Trainer.set_hat(outfit_id,is_secondary) $player.set_hat(outfit_id,is_secondary)
dye_color = $Trainer.dyed_hats[outfit_id] dye_color = $player.dyed_hats[outfit_id]
if dye_color if dye_color
$Trainer.hat_color = dye_color if !is_secondary $player.hat_color = dye_color if !is_secondary
$Trainer.hat2_color = dye_color if is_secondary $player.hat2_color = dye_color if is_secondary
else else
$Trainer.hat_color = nil if !is_secondary $player.hat_color = nil if !is_secondary
$Trainer.hat2_color = nil if is_secondary $player.hat2_color = nil if is_secondary
end end
$game_map.refreshPlayerOutfit() $game_map.refreshPlayerOutfit()
@@ -91,7 +91,7 @@ end
def putOnHairFullId(full_outfit_id) def putOnHairFullId(full_outfit_id)
outfit_id = getSplitHairFilenameAndVersionFromID(full_outfit_id)[1] outfit_id = getSplitHairFilenameAndVersionFromID(full_outfit_id)[1]
outfit = get_hair_by_id(outfit_id) outfit = get_hair_by_id(outfit_id)
$Trainer.hair = full_outfit_id $player.hair = full_outfit_id
$game_map.update $game_map.update
refreshPlayerOutfit() refreshPlayerOutfit()
putOnOutfitMessage(outfit) putOnOutfitMessage(outfit)
@@ -101,7 +101,7 @@ def putOnHair(outfit_id, version)
full_id = getFullHairId(outfit_id, version) full_id = getFullHairId(outfit_id, version)
putOnHairFullId(full_id) putOnHairFullId(full_id)
#outfit = get_hair_by_id(outfit_id) #outfit = get_hair_by_id(outfit_id)
#$Trainer.hair = #$player.hair =
#putOnOutfitMessage(outfit) #putOnOutfitMessage(outfit)
end end
@@ -173,15 +173,15 @@ def findLastHairVersion(hairId)
end end
def isWearingClothes(outfitId) def isWearingClothes(outfitId)
return $Trainer.clothes == outfitId return $player.clothes == outfitId
end end
def isWearingHat(outfitId) def isWearingHat(outfitId)
return $Trainer.hat == outfitId || $Trainer.hat2 == outfitId return $player.hat == outfitId || $player.hat2 == outfitId
end end
def isWearingHairstyle(outfitId, version = nil) def isWearingHairstyle(outfitId, version = nil)
current_hair_split_id = getSplitHairFilenameAndVersionFromID($Trainer.hair) current_hair_split_id = getSplitHairFilenameAndVersionFromID($player.hair)
current_id = current_hair_split_id.length >= 1 ? current_hair_split_id[1] : nil current_id = current_hair_split_id.length >= 1 ? current_hair_split_id[1] : nil
current_version = current_hair_split_id[0] current_version = current_hair_split_id[0]
if version if version
@@ -209,11 +209,11 @@ def getDefaultClothes()
end end
def hasClothes?(outfit_id) def hasClothes?(outfit_id)
return $Trainer.unlocked_clothes.include?(outfit_id) return $player.unlocked_clothes.include?(outfit_id)
end end
def hasHat?(outfit_id) def hasHat?(outfit_id)
return $Trainer.unlocked_hats.include?(outfit_id) return $player.unlocked_hats.include?(outfit_id)
end end
def getOutfitForPokemon(pokemonSpecies) def getOutfitForPokemon(pokemonSpecies)
@@ -249,16 +249,16 @@ def getOutfitForPokemon(pokemonSpecies)
end end
def hatUnlocked?(hatId) def hatUnlocked?(hatId)
return $Trainer.unlocked_hats.include?(hatId) return $player.unlocked_hats.include?(hatId)
end end
def export_current_outfit() def export_current_outfit()
skinTone = $Trainer.skin_tone ? $Trainer.skin_tone : 0 skinTone = $player.skin_tone ? $player.skin_tone : 0
hat = $Trainer.hat ? $Trainer.hat : "nil" hat = $player.hat ? $player.hat : "nil"
hair_color = $Trainer.hair_color || 0 hair_color = $player.hair_color || 0
clothes_color = $Trainer.clothes_color || 0 clothes_color = $player.clothes_color || 0
hat_color = $Trainer.hat_color || 0 hat_color = $player.hat_color || 0
exportedString = "TrainerAppearance.new(#{skinTone},\"#{hat}\",\"#{$Trainer.clothes}\",\"#{$Trainer.hair}\",#{hair_color},#{clothes_color},#{hat_color})" exportedString = "TrainerAppearance.new(#{skinTone},\"#{hat}\",\"#{$player.clothes}\",\"#{$player.hair}\",#{hair_color},#{clothes_color},#{hat_color})"
Input.clipboard = exportedString Input.clipboard = exportedString
end end
@@ -287,30 +287,30 @@ def setEventAppearance(event_id, trainerAppearance)
end end
def getPlayerAppearance() def getPlayerAppearance()
return TrainerAppearance.new($Trainer.skin_tone,$Trainer.hat,$Trainer.clothes, $Trainer.hair, return TrainerAppearance.new($player.skin_tone,$player.hat,$player.clothes, $player.hair,
$Trainer.hair_color, $Trainer.clothes_color, $Trainer.hat_color) $player.hair_color, $player.clothes_color, $player.hat_color)
end end
def randomizePlayerOutfitUnlocked() def randomizePlayerOutfitUnlocked()
$Trainer.hat = $Trainer.unlocked_hats.sample $player.hat = $player.unlocked_hats.sample
$Trainer.hat2 = $Trainer.unlocked_hats.sample $player.hat2 = $player.unlocked_hats.sample
$Trainer.clothes = $Trainer.unlocked_clothes.sample $player.clothes = $player.unlocked_clothes.sample
dye_hat = rand(2)==0 dye_hat = rand(2)==0
dye_hat2 = rand(2)==0 dye_hat2 = rand(2)==0
dye_clothes = rand(2)==0 dye_clothes = rand(2)==0
dye_hair = rand(2)==0 dye_hair = rand(2)==0
$Trainer.hat2 = nil if rand(3)==0 $player.hat2 = nil if rand(3)==0
$Trainer.hat_color = dye_hat ? rand(255) : 0 $player.hat_color = dye_hat ? rand(255) : 0
$Trainer.hat2_color = dye_hat2 ? rand(255) : 0 $player.hat2_color = dye_hat2 ? rand(255) : 0
$Trainer.clothes_color = dye_clothes ? rand(255) : 0 $player.clothes_color = dye_clothes ? rand(255) : 0
$Trainer.hair_color = dye_hair ? rand(255) : 0 $player.hair_color = dye_hair ? rand(255) : 0
hair_id = $PokemonGlobal.hairstyles_data.keys.sample hair_id = $PokemonGlobal.hairstyles_data.keys.sample
hair_color = [1,2,3,4].sample hair_color = [1,2,3,4].sample
$Trainer.hair = getFullHairId(hair_id,hair_color) $player.hair = getFullHairId(hair_id,hair_color)
end end
@@ -389,21 +389,21 @@ def get_random_appearance()
end end
def randomizePlayerOutfit() def randomizePlayerOutfit()
$Trainer.hat = $PokemonGlobal.hats_data.keys.sample $player.hat = $PokemonGlobal.hats_data.keys.sample
$Trainer.hat2 = $PokemonGlobal.hats_data.keys.sample $player.hat2 = $PokemonGlobal.hats_data.keys.sample
$Trainer.hat2 = nil if(rand(3)==0) $player.hat2 = nil if(rand(3)==0)
$Trainer.clothes = $PokemonGlobal.clothes_data.keys.sample $player.clothes = $PokemonGlobal.clothes_data.keys.sample
$Trainer.hat_color = rand(2)==0 ? rand(255) : 0 $player.hat_color = rand(2)==0 ? rand(255) : 0
$Trainer.hat2_color = rand(2)==0 ? rand(255) : 0 $player.hat2_color = rand(2)==0 ? rand(255) : 0
$Trainer.clothes_color = rand(2)==0 ? rand(255) : 0 $player.clothes_color = rand(2)==0 ? rand(255) : 0
$Trainer.hair_color = rand(2)==0 ? rand(255) : 0 $player.hair_color = rand(2)==0 ? rand(255) : 0
hair_id = $PokemonGlobal.hairstyles_data.keys.sample hair_id = $PokemonGlobal.hairstyles_data.keys.sample
hair_color = [1,2,3,4].sample hair_color = [1,2,3,4].sample
$Trainer.skin_tone = [1,2,3,4,5,6].sample $player.skin_tone = [1,2,3,4,5,6].sample
$Trainer.hair = getFullHairId(hair_id,hair_color) $player.hair = getFullHairId(hair_id,hair_color)
end end

View File

@@ -137,8 +137,8 @@ class Player < Trainer
def clothes_color=(value) def clothes_color=(value)
@clothes_color = value @clothes_color = value
$Trainer.dyed_clothes = {} if !$Trainer.dyed_clothes $player.dyed_clothes = {} if !$player.dyed_clothes
$Trainer.dyed_clothes[@clothes] = value if value $player.dyed_clothes[@clothes] = value if value
refreshPlayerOutfit() refreshPlayerOutfit()
end end
@@ -148,25 +148,25 @@ class Player < Trainer
else else
@hat_color = value @hat_color = value
end end
$Trainer.dyed_hats = {} if !$Trainer.dyed_hats $player.dyed_hats = {} if !$player.dyed_hats
worn_hat = is_secondary ? @hat2 : @hat worn_hat = is_secondary ? @hat2 : @hat
$Trainer.dyed_hats[worn_hat] = value if value $player.dyed_hats[worn_hat] = value if value
refreshPlayerOutfit() refreshPlayerOutfit()
end end
def hat_color=(value) def hat_color=(value)
@hat_color = value @hat_color = value
$Trainer.dyed_hats = {} if !$Trainer.dyed_hats $player.dyed_hats = {} if !$player.dyed_hats
worn_hat = @hat worn_hat = @hat
$Trainer.dyed_hats[worn_hat] = value if value $player.dyed_hats[worn_hat] = value if value
refreshPlayerOutfit() refreshPlayerOutfit()
end end
def hat2_color=(value) def hat2_color=(value)
@hat2_color = value @hat2_color = value
$Trainer.dyed_hats = {} if !$Trainer.dyed_hats $player.dyed_hats = {} if !$player.dyed_hats
worn_hat = @hat2 worn_hat = @hat2
$Trainer.dyed_hats[worn_hat] = value if value $player.dyed_hats[worn_hat] = value if value
refreshPlayerOutfit() refreshPlayerOutfit()
end end
@@ -218,7 +218,7 @@ class Player < Trainer
outfit_preview = PictureWindow.new(filepath) outfit_preview = PictureWindow.new(filepath)
outfit_preview.x = Graphics.width / 4 outfit_preview.x = Graphics.width / 4
musicEffect = "Key item get" musicEffect = "Key item get"
pbMessage(_INTL("{1} obtained \\C[{2}]{3}\\C[0]!\\me[{4}]", $Trainer.name, color, name, musicEffect)) pbMessage(_INTL("{1} obtained \\C[{2}]{3}\\C[0]!\\me[{4}]", $player.name, color, name, musicEffect))
outfit_preview.dispose outfit_preview.dispose
end end

View File

@@ -80,7 +80,7 @@ end
def exportTeamForShowdown() def exportTeamForShowdown()
message = "" message = ""
for pokemon in $Trainer.party for pokemon in $player.party
message << exportFusedPokemonForShowdown(pokemon) message << exportFusedPokemonForShowdown(pokemon)
message << "\n" message << "\n"
end end