mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Moved some global metadata values to class Player, added battle points property
This commit is contained in:
@@ -52,6 +52,10 @@ module Settings
|
||||
MAX_MONEY = 999_999
|
||||
# The maximum number of Game Corner coins the player can have.
|
||||
MAX_COINS = 99_999
|
||||
# The maximum number of Battle Points the player can have.
|
||||
MAX_BATTLE_POINTS = 9_999
|
||||
# The maximum amount of soot the player can have.
|
||||
MAX_SOOT = 9_999
|
||||
# The maximum length, in characters, that the player's name can be.
|
||||
MAX_PLAYER_NAME_SIZE = 10
|
||||
# The maximum number of Pokémon that can be in the party.
|
||||
|
||||
@@ -46,7 +46,7 @@ end
|
||||
|
||||
SaveData.register_conversion(:v19_move_global_data_to_player) do
|
||||
essentials_version 19
|
||||
display_title 'Moving some Global Metadata data to Player class'
|
||||
display_title 'Moving some global metadata data to player'
|
||||
to_all do |save_data|
|
||||
global = save_data[:global_metadata]
|
||||
player = save_data[:player]
|
||||
@@ -57,6 +57,18 @@ SaveData.register_conversion(:v19_move_global_data_to_player) do
|
||||
player.pokedex.lock(i)
|
||||
end
|
||||
end
|
||||
trainer.coins = global.coins
|
||||
global.coins = nil
|
||||
trainer.soot = global.sootsack
|
||||
global.sootsack = nil
|
||||
trainer.has_running_shoes = global.runningShoes
|
||||
global.runningShoes = nil
|
||||
trainer.seen_storage_creator = global.seenStorageCreator
|
||||
global.seenStorageCreator = nil
|
||||
trainer.has_snag_machine = global.snagMachine
|
||||
global.snagMachine = nil
|
||||
trainer.seen_purify_chamber = global.seenPurifyChamber
|
||||
global.seenPurifyChamber = nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class Game_Player < Game_Character
|
||||
@move_route_forcing || $game_temp.message_window_showing ||
|
||||
pbMapInterpreterRunning?
|
||||
input = ($PokemonSystem.runstyle == 1) ^ Input.press?(Input::ACTION)
|
||||
return input && $PokemonGlobal.runningShoes && !jumping? &&
|
||||
return input && $Trainer.has_running_shoes && !jumping? &&
|
||||
!$PokemonGlobal.diving && !$PokemonGlobal.surfing &&
|
||||
!$PokemonGlobal.bicycle && !$game_player.pbTerrainTag.must_walk
|
||||
end
|
||||
|
||||
@@ -436,7 +436,7 @@ def pbDisplayGoldWindow(msgwindow)
|
||||
end
|
||||
|
||||
def pbDisplayCoinsWindow(msgwindow,goldwindow)
|
||||
coinString=($PokemonGlobal) ? $PokemonGlobal.coins.to_s_formatted : "0"
|
||||
coinString=($Trainer) ? $Trainer.coins.to_s_formatted : "0"
|
||||
coinwindow=Window_AdvancedTextPokemon.new(_INTL("Coins:\n<ar>{1}</ar>",coinString))
|
||||
coinwindow.setSkin("Graphics/Windowskins/goldskin")
|
||||
coinwindow.resizeToFit(coinwindow.text,Graphics.width)
|
||||
|
||||
@@ -89,7 +89,7 @@ module GameData
|
||||
def is_mail?; return @type == 1 || @type == 2; end
|
||||
def is_icon_mail?; return @type == 2; end
|
||||
def is_poke_ball?; return @type == 3 || @type == 4; end
|
||||
def is_snag_ball?; return @type == 3 || (@type == 4 && $PokemonGlobal.snagMachine); end
|
||||
def is_snag_ball?; return @type == 3 || (@type == 4 && $Trainer.has_snag_machine); end
|
||||
def is_berry?; return @type == 5; end
|
||||
def is_key_item?; return @type == 6; end
|
||||
def is_evolution_stone?; return @type == 7; end
|
||||
|
||||
@@ -40,7 +40,7 @@ class PokeBattle_RealBattlePeer
|
||||
end
|
||||
|
||||
def pbGetStorageCreatorName
|
||||
return pbGetStorageCreator if $PokemonGlobal.seenStorageCreator
|
||||
return pbGetStorageCreator if $Trainer.seen_storage_creator
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
@@ -135,9 +135,8 @@ Events.onStepTakenFieldMovement += proc { |_sender,e|
|
||||
tile_id = map.data[thistile[1],thistile[2],i]
|
||||
next if tile_id == nil
|
||||
next if GameData::TerrainTag.try_get(map.terrain_tags[tile_id]).id != :SootGrass
|
||||
if event == $game_player && GameData::Item.exists?(:SOOTSACK) && $PokemonBag.pbHasItem?(:SOOTSACK)
|
||||
$PokemonGlobal.sootsack = 0 if !$PokemonGlobal.sootsack
|
||||
$PokemonGlobal.sootsack += 1
|
||||
if event == $game_player && GameData::Item.exists?(:SOOTSACK)
|
||||
$Trainer.soot += 1 if $PokemonBag.pbHasItem?(:SOOTSACK)
|
||||
end
|
||||
# map.data[thistile[1], thistile[2], i] = 0
|
||||
# $scene.createSingleSpriteset(map.map_id)
|
||||
|
||||
@@ -9,20 +9,15 @@ class PokemonGlobalMetadata
|
||||
attr_accessor :diving
|
||||
attr_accessor :sliding
|
||||
attr_accessor :fishing
|
||||
attr_accessor :runningShoes
|
||||
# Player data
|
||||
attr_accessor :startTime
|
||||
attr_accessor :stepcount
|
||||
attr_accessor :playerID
|
||||
attr_accessor :coins
|
||||
attr_accessor :sootsack
|
||||
attr_accessor :seenStorageCreator
|
||||
attr_accessor :pcItemStorage
|
||||
attr_accessor :mailbox
|
||||
attr_accessor :phoneNumbers
|
||||
attr_accessor :phoneTime
|
||||
attr_accessor :partner
|
||||
attr_accessor :snagMachine
|
||||
attr_accessor :creditsPlayed
|
||||
# Pokédex
|
||||
attr_accessor :pokedexUnlocked # Deprecated, replaced with Player::Pokedex#unlocked_dexes
|
||||
@@ -68,20 +63,15 @@ class PokemonGlobalMetadata
|
||||
@diving = false
|
||||
@sliding = false
|
||||
@fishing = false
|
||||
@runningShoes = false
|
||||
# Player data
|
||||
@startTime = Time.now
|
||||
@stepcount = 0
|
||||
@playerID = -1
|
||||
@coins = 0
|
||||
@sootsack = 0
|
||||
@seenStorageCreator = false
|
||||
@pcItemStorage = nil
|
||||
@mailbox = nil
|
||||
@phoneNumbers = []
|
||||
@phoneTime = 0
|
||||
@partner = nil
|
||||
@snagMachine = false
|
||||
@creditsPlayed = false
|
||||
# Pokédex
|
||||
numRegions = pbLoadRegionalDexes.length
|
||||
@@ -123,6 +113,70 @@ class PokemonGlobalMetadata
|
||||
# Save file
|
||||
@safesave = false
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#coins} instead. This alias is slated to be removed in v20.
|
||||
def coins
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#coins', 'v20', '$Trainer.coins')
|
||||
return @coins || $Trainer.coins
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#coins=} instead. This alias is slated to be removed in v20.
|
||||
def coins=(value)
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#coins=', 'v20', '$Trainer.coins=')
|
||||
if value.nil?
|
||||
@coins = value # For setting to nil by a save data conversion
|
||||
else
|
||||
$Trainer.coins = value
|
||||
end
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#soot} instead. This alias is slated to be removed in v20.
|
||||
def sootsack
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#sootsack', 'v20', '$Trainer.soot')
|
||||
return @sootsack || $Trainer.soot
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#soot=} instead. This alias is slated to be removed in v20.
|
||||
def sootsack=(value)
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#sootsack=', 'v20', '$Trainer.soot=')
|
||||
if value.nil?
|
||||
@sootsack = value # For setting to nil by a save data conversion
|
||||
else
|
||||
$Trainer.soot = value
|
||||
end
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#has_running_shoes} instead. This alias is slated to be removed in v20.
|
||||
def runningShoes
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#runningShoes', 'v20', '$Trainer.has_running_shoes')
|
||||
return (!@runningShoes.nil?) ? @runningShoes : $Trainer.has_running_shoes
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#has_running_shoes=} instead. This alias is slated to be removed in v20.
|
||||
def runningShoes=(value)
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#runningShoes=', 'v20', '$Trainer.has_running_shoes=')
|
||||
if value.nil?
|
||||
@runningShoes = value # For setting to nil by a save data conversion
|
||||
else
|
||||
$Trainer.has_running_shoes = value
|
||||
end
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#seen_storage_creator} instead. This alias is slated to be removed in v20.
|
||||
def seenStorageCreator
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#seenStorageCreator', 'v20', '$Trainer.seen_storage_creator')
|
||||
return (!@seenStorageCreator.nil?) ? @seenStorageCreator : $Trainer.seen_storage_creator
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#seen_storage_creator=} instead. This alias is slated to be removed in v20.
|
||||
def seenStorageCreator=(value)
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#seenStorageCreator=', 'v20', '$Trainer.seen_storage_creator=')
|
||||
if value.nil?
|
||||
@seenStorageCreator = value # For setting to nil by a save data conversion
|
||||
else
|
||||
$Trainer.seen_storage_creator = value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -2,15 +2,32 @@
|
||||
# Trainer class for the player
|
||||
#===============================================================================
|
||||
class Player < Trainer
|
||||
# @param value [Integer] new character ID
|
||||
attr_writer :character_ID
|
||||
# @return [Integer] the player's outfit
|
||||
attr_accessor :outfit
|
||||
# @return [Array<Boolean>] the player's Gym Badges (true if owned)
|
||||
attr_accessor :badges
|
||||
# @return [Integer] the player's money
|
||||
attr_reader :money
|
||||
# @return [Integer] the player's Game Corner coins
|
||||
attr_reader :coins
|
||||
# @return [Integer] the player's battle points
|
||||
attr_reader :battle_points
|
||||
# @return [Integer] the player's soot
|
||||
attr_reader :soot
|
||||
# @return [Pokedex] the player's Pokédex
|
||||
attr_reader :pokedex
|
||||
# @return [Boolean] whether the Pokédex has been obtained
|
||||
attr_accessor :has_pokedex
|
||||
attr_accessor :pokegear # Whether the Pokégear was obtained
|
||||
attr_accessor :mystery_gift_unlocked # Whether MG can be used from load screen
|
||||
attr_accessor :mystery_gifts # Variable that stores downloaded MG data
|
||||
# @return [Boolean] whether the Pokégear has been obtained
|
||||
attr_accessor :has_pokegear
|
||||
# @return [Boolean] whether the creator of the Pokémon Storage System has been seen
|
||||
attr_accessor :seen_storage_creator
|
||||
# @return [Boolean] whether Mystery Gift can be used from the load screen
|
||||
attr_accessor :mystery_gift_unlocked
|
||||
# @return [Array<Array>] downloaded Mystery Gift data
|
||||
attr_accessor :mystery_gifts
|
||||
|
||||
def inspect
|
||||
str = self.to_s.chop
|
||||
@@ -19,32 +36,59 @@ class Player < Trainer
|
||||
return str
|
||||
end
|
||||
|
||||
# @return [Integer] the character ID of the player
|
||||
def character_ID
|
||||
@character_ID = $PokemonGlobal.playerID || 0 if !@character_ID
|
||||
return @character_ID
|
||||
end
|
||||
|
||||
# Sets the player's money. It can not exceed {Settings::MAX_MONEY}.
|
||||
# @param value [Integer] new money value
|
||||
def money=(value)
|
||||
validate value => Integer
|
||||
@money = value.clamp(0, Settings::MAX_MONEY)
|
||||
end
|
||||
|
||||
# Sets the player's coins amount. It can not exceed {Settings::MAX_COINS}.
|
||||
# @param value [Integer] new coins value
|
||||
def coins=(value)
|
||||
validate value => Integer
|
||||
@coins = value.clamp(0, Settings::MAX_COINS)
|
||||
end
|
||||
|
||||
# Sets the player's Battle Points amount. It can not exceed
|
||||
# {Settings::MAX_BATTLE_POINTS}.
|
||||
# @param value [Integer] new Battle Points value
|
||||
def battle_points=(value)
|
||||
validate value => Integer
|
||||
@battle_points = value.clamp(0, Settings::MAX_BATTLE_POINTS)
|
||||
end
|
||||
|
||||
# Sets the player's soot amount. It can not exceed {Settings::MAX_SOOT}.
|
||||
# @param value [Integer] new soot value
|
||||
def soot=(value)
|
||||
validate value => Integer
|
||||
@soot = value.clamp(0, Settings::MAX_SOOT)
|
||||
end
|
||||
|
||||
# @return [Integer] the number of Gym Badges owned by the player
|
||||
def badge_count
|
||||
ret = 0
|
||||
@badges.each { |b| ret += 1 if b }
|
||||
return ret
|
||||
return @badges.count { |badge| badge == true }
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
|
||||
# (see Pokedex#seen?)
|
||||
# Shorthand for +self.pokedex.seen?+.
|
||||
def seen?(species)
|
||||
return @pokedex.seen?(species)
|
||||
end
|
||||
alias hasSeen? seen?
|
||||
|
||||
# (see Pokedex#owned?)
|
||||
# Shorthand for +self.pokedex.owned?+.
|
||||
def owned?(species)
|
||||
return @pokedex.owned?(species)
|
||||
end
|
||||
alias hasOwned? owned?
|
||||
|
||||
#=============================================================================
|
||||
|
||||
@@ -54,9 +98,14 @@ class Player < Trainer
|
||||
@outfit = 0
|
||||
@badges = [false] * 8
|
||||
@money = Settings::INITIAL_MONEY
|
||||
@coins = 0
|
||||
@battle_points = 0
|
||||
@soot = 0
|
||||
@pokedex = Pokedex.new
|
||||
@pokegear = false
|
||||
@has_pokedex = false
|
||||
@has_pokegear = false
|
||||
@has_running_shoes = false
|
||||
@seen_storage_creator = false
|
||||
@mystery_gift_unlocked = false
|
||||
@mystery_gifts = []
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class Player
|
||||
class Player < Trainer
|
||||
# Represents the player's Pokédex.
|
||||
class Pokedex
|
||||
# @return [Array<Integer>] an array of accessible Dexes
|
||||
@@ -105,6 +105,9 @@ class Player
|
||||
return @last_seen_forms[species][0] || 0, @last_seen_forms[species][1] || 0
|
||||
end
|
||||
|
||||
# @param species [Symbol, GameData::Species] Pokémon species
|
||||
# @param gender [Integer] gender (0=male, 1=female, 2=genderless)
|
||||
# @param form [Integer] form number
|
||||
def set_last_form_seen(species, gender = 0, form = 0)
|
||||
@last_seen_forms[species] = [gender, form]
|
||||
end
|
||||
@@ -125,7 +128,7 @@ class Player
|
||||
def set_shadow_pokemon_owned(species)
|
||||
species_id = GameData::Species.try_get(species)&.species
|
||||
return if species_id.nil?
|
||||
@owned[species_id] = true
|
||||
@owned_shadow[species_id] = true
|
||||
self.refresh_accessible_dexes
|
||||
end
|
||||
|
||||
@@ -137,6 +140,14 @@ class Player
|
||||
return @owned[species_id] == true
|
||||
end
|
||||
|
||||
# @param species [Symbol, GameData::Species] species to check
|
||||
# @return [Boolean] whether a Shadow Pokémon of the species is owned
|
||||
def owned_shadow_pokemon?(species)
|
||||
species_id = GameData::Species.try_get(species)&.species
|
||||
return false if species_id.nil?
|
||||
return @owned_shadow[species_id] == true
|
||||
end
|
||||
|
||||
# Returns the amount of owned Pokémon.
|
||||
# If a region ID is given, returns the amount of owned Pokémon
|
||||
# in that region.
|
||||
@@ -217,12 +228,6 @@ class Player
|
||||
return @unlocked_dexes.length
|
||||
end
|
||||
|
||||
# Shorthand for +self.accessible_dexes.length+.
|
||||
# @return [Integer] amount of accessible Dexes
|
||||
def accessible_dexes_count
|
||||
return @accessible_dexes.length
|
||||
end
|
||||
|
||||
# Decides which Dex lists are able to be viewed (i.e. they are unlocked and
|
||||
# have at least 1 seen species in them), and saves all accessible Dex region
|
||||
# numbers into {#accessible_dexes}. National Dex comes after all regional
|
||||
|
||||
@@ -26,6 +26,7 @@ end
|
||||
|
||||
class Player < Trainer
|
||||
class Pokedex
|
||||
# @deprecated Use {seen?} or {set_seen} instead. This alias is slated to be removed in v20.
|
||||
attr_reader :seen_forms
|
||||
end
|
||||
|
||||
@@ -33,6 +34,9 @@ class Player < Trainer
|
||||
deprecated_method_alias :metaID, :character_ID, removal_in: 'v20'
|
||||
deprecated_method_alias :mysterygiftaccess, :mystery_gift_unlocked, removal_in: 'v20'
|
||||
deprecated_method_alias :mysterygift, :mystery_gifts, removal_in: 'v20'
|
||||
deprecated_method_alias :hasSeen?, :seen?, removal_in: 'v20'
|
||||
deprecated_method_alias :hasOwned?, :owned?, removal_in: 'v20'
|
||||
deprecated_method_alias :pokegear, :has_pokegear, removal_in: 'v20'
|
||||
|
||||
# @deprecated Use {Player::Pokedex#set_seen} instead. This alias is slated to be removed in v20.
|
||||
def setSeen(species)
|
||||
@@ -91,10 +95,14 @@ class PokeBattle_Trainer
|
||||
trainer.seen.each_with_index { |value, i| ret.pokedex.set_seen(i) if value }
|
||||
trainer.owned.each_with_index { |value, i| ret.pokedex.set_owned(i) if value }
|
||||
trainer.formseen.each_with_index do |value, i|
|
||||
ret.pokedex.seen_forms[GameData::Species.get(i).species] = [value[0].clone, value[1].clone] if value
|
||||
species_id = GameData::Species.try_get(i)&.species
|
||||
next if species_id.nil? || value.nil?
|
||||
ret.pokedex.seen_forms[species_id] = [value[0].clone, value[1].clone] if value
|
||||
end
|
||||
trainer.formlastseen.each_with_index do |value, i|
|
||||
ret.pokedex.set_last_form_seen(GameData::Species.get(i).species, value[0], value[1]) if value
|
||||
species_id = GameData::Species.try_get(i)&.species
|
||||
next if species_id.nil? || value.nil?
|
||||
ret.pokedex.set_last_form_seen(species_id, value[0], value[1]) if value
|
||||
end
|
||||
if trainer.shadowcaught
|
||||
trainer.shadowcaught.each_with_index do |value, i|
|
||||
@@ -102,7 +110,7 @@ class PokeBattle_Trainer
|
||||
end
|
||||
end
|
||||
ret.has_pokedex = trainer.pokedex
|
||||
ret.pokegear = trainer.pokegear
|
||||
ret.has_pokegear = trainer.pokegear
|
||||
ret.mystery_gift_unlocked = trainer.mysterygiftaccess if trainer.mysterygiftaccess
|
||||
ret.mystery_gifts = trainer.mysterygift.clone if trainer.mysterygift
|
||||
return ret
|
||||
|
||||
@@ -311,7 +311,7 @@ ItemHandlers::UseInField.add(:TOWNMAP,proc { |item|
|
||||
})
|
||||
|
||||
ItemHandlers::UseInField.add(:COINCASE,proc { |item|
|
||||
pbMessage(_INTL("Coins: {1}",$PokemonGlobal.coins.to_s_formatted))
|
||||
pbMessage(_INTL("Coins: {1}", $Trainer.coins.to_s_formatted))
|
||||
next 1
|
||||
})
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ def pbPhoneDeleteContact(index)
|
||||
end
|
||||
|
||||
def pbPhoneRegisterBattle(message,event,trainertype,trainername,maxbattles)
|
||||
return if !$Trainer.pokegear # Can't register without a Pokégear
|
||||
return if !$Trainer.has_pokegear # Can't register without a Pokégear
|
||||
return false if !GameData::TrainerType.exists?(trainertype)
|
||||
trainertype = GameData::TrainerType.get(trainertype)
|
||||
contact = pbFindPhoneTrainer(trainertype,trainername)
|
||||
@@ -133,7 +133,7 @@ end
|
||||
# Phone-related counters
|
||||
#===============================================================================
|
||||
Events.onMapUpdate += proc { |_sender,_e|
|
||||
next if !$Trainer || !$Trainer.pokegear
|
||||
next if !$Trainer || !$Trainer.has_pokegear
|
||||
# Reset time to next phone call if necessary
|
||||
if !$PokemonGlobal.phoneTime || $PokemonGlobal.phoneTime<=0
|
||||
$PokemonGlobal.phoneTime = 20*60*Graphics.frame_rate
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class IntroEventScene < EventScene
|
||||
# Splash screen images that appear for a few seconds and then disappear.
|
||||
SPLASH_IMAGES = ['intro1']
|
||||
SPLASH_IMAGES = ['splash1']
|
||||
# The main title screen background image.
|
||||
TITLE_BG_IMAGE = 'splash'
|
||||
TITLE_BG_IMAGE = 'title'
|
||||
TITLE_START_IMAGE = 'start'
|
||||
TITLE_START_IMAGE_X = 0
|
||||
TITLE_START_IMAGE_Y = 322
|
||||
|
||||
@@ -10,27 +10,27 @@ class ButtonEventScene < EventScene
|
||||
super
|
||||
Graphics.freeze
|
||||
@current_screen = 1
|
||||
addImage(0, 0, "Graphics/Pictures/help_bg")
|
||||
addImage(0, 0, "Graphics/Pictures/Controls help/help_bg")
|
||||
@labels = []
|
||||
@label_screens = []
|
||||
@keys = []
|
||||
@key_screens = []
|
||||
|
||||
addImageForScreen(1, 44, 122, "Graphics/Pictures/help_f1")
|
||||
addImageForScreen(1, 44, 252, "Graphics/Pictures/help_f8")
|
||||
addImageForScreen(1, 44, 122, "Graphics/Pictures/Controls help/help_f1")
|
||||
addImageForScreen(1, 44, 252, "Graphics/Pictures/Controls help/help_f8")
|
||||
addLabelForScreen(1, 134, 84, 352, _INTL("Opens the Key Bindings window, where you can choose which keyboard keys to use for each control."))
|
||||
addLabelForScreen(1, 134, 244, 352, _INTL("Take a screenshot. It is put in the same folder as the save file."))
|
||||
|
||||
addImageForScreen(2, 16, 158, "Graphics/Pictures/help_arrows")
|
||||
addImageForScreen(2, 16, 158, "Graphics/Pictures/Controls help/help_arrows")
|
||||
addLabelForScreen(2, 134, 100, 352, _INTL("Use the Arrow keys to move the main character.\r\n\r\nYou can also use the Arrow keys to select entries and navigate menus."))
|
||||
|
||||
addImageForScreen(3, 16, 106, "Graphics/Pictures/help_usekey")
|
||||
addImageForScreen(3, 16, 236, "Graphics/Pictures/help_backkey")
|
||||
addImageForScreen(3, 16, 106, "Graphics/Pictures/Controls help/help_usekey")
|
||||
addImageForScreen(3, 16, 236, "Graphics/Pictures/Controls help/help_backkey")
|
||||
addLabelForScreen(3, 134, 84, 352, _INTL("Used to confirm a choice, interact with people and things, and move through text. (Default: C)"))
|
||||
addLabelForScreen(3, 134, 212, 352, _INTL("Used to exit, cancel a choice, and cancel a mode. Also used to open the Pause Menu. (Default: X)"))
|
||||
|
||||
addImageForScreen(4, 16, 90, "Graphics/Pictures/help_actionkey")
|
||||
addImageForScreen(4, 16, 252, "Graphics/Pictures/help_specialkey")
|
||||
addImageForScreen(4, 16, 90, "Graphics/Pictures/Controls help/help_actionkey")
|
||||
addImageForScreen(4, 16, 252, "Graphics/Pictures/Controls help/help_specialkey")
|
||||
addLabelForScreen(4, 134, 52, 352, _INTL("Has various functions depending on context. While moving around, hold to move at a different speed. (Default: Z)"))
|
||||
addLabelForScreen(4, 134, 212, 352, _INTL("Press to open the Ready Menu, where registered items and available field moves can be used. (Default: D)"))
|
||||
|
||||
|
||||
@@ -113,11 +113,13 @@ class PokemonPauseMenu
|
||||
cmdDebug = -1
|
||||
cmdQuit = -1
|
||||
cmdEndGame = -1
|
||||
commands[cmdPokedex = commands.length] = _INTL("Pokédex") if $Trainer.has_pokedex && $Trainer.pokedex.accessible_dexes_count > 0
|
||||
commands[cmdPokemon = commands.length] = _INTL("Pokémon") if $Trainer.party.length>0
|
||||
commands[cmdBag = commands.length] = _INTL("Bag") if !pbInBugContest?
|
||||
commands[cmdPokegear = commands.length] = _INTL("Pokégear") if $Trainer.pokegear
|
||||
commands[cmdTrainer = commands.length] = $Trainer.name
|
||||
if $Trainer.has_pokedex && $Trainer.pokedex.accessible_dexes.length > 0
|
||||
commands[cmdPokedex = commands.length] = _INTL("Pokédex")
|
||||
end
|
||||
commands[cmdPokemon = commands.length] = _INTL("Pokémon") if $Trainer.party_count > 0
|
||||
commands[cmdBag = commands.length] = _INTL("Bag") if !pbInBugContest?
|
||||
commands[cmdPokegear = commands.length] = _INTL("Pokégear") if $Trainer.has_pokegear
|
||||
commands[cmdTrainer = commands.length] = $Trainer.name
|
||||
if pbInSafari?
|
||||
if Settings::SAFARI_STEPS <= 0
|
||||
@scene.pbShowInfo(_INTL("Balls: {1}",pbSafariState.ballcount))
|
||||
@@ -125,7 +127,7 @@ class PokemonPauseMenu
|
||||
@scene.pbShowInfo(_INTL("Steps: {1}/{2}\nBalls: {3}",
|
||||
pbSafariState.steps, Settings::SAFARI_STEPS, pbSafariState.ballcount))
|
||||
end
|
||||
commands[cmdQuit = commands.length] = _INTL("Quit")
|
||||
commands[cmdQuit = commands.length] = _INTL("Quit")
|
||||
elsif pbInBugContest?
|
||||
if pbBugContestState.lastPokemon
|
||||
@scene.pbShowInfo(_INTL("Caught: {1}\nLevel: {2}\nBalls: {3}",
|
||||
@@ -135,13 +137,13 @@ class PokemonPauseMenu
|
||||
else
|
||||
@scene.pbShowInfo(_INTL("Caught: None\nBalls: {1}",pbBugContestState.ballcount))
|
||||
end
|
||||
commands[cmdQuit = commands.length] = _INTL("Quit Contest")
|
||||
commands[cmdQuit = commands.length] = _INTL("Quit Contest")
|
||||
else
|
||||
commands[cmdSave = commands.length] = _INTL("Save") if $game_system && !$game_system.save_disabled
|
||||
commands[cmdSave = commands.length] = _INTL("Save") if $game_system && !$game_system.save_disabled
|
||||
end
|
||||
commands[cmdOption = commands.length] = _INTL("Options")
|
||||
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
|
||||
commands[cmdEndGame = commands.length] = _INTL("Quit Game")
|
||||
commands[cmdOption = commands.length] = _INTL("Options")
|
||||
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
|
||||
commands[cmdEndGame = commands.length] = _INTL("Quit Game")
|
||||
loop do
|
||||
command = @scene.pbShowCommands(commands)
|
||||
if cmdPokedex>=0 && command==cmdPokedex
|
||||
@@ -154,7 +156,7 @@ class PokemonPauseMenu
|
||||
@scene.pbRefresh
|
||||
}
|
||||
else
|
||||
if $Trainer.pokedex.accessible_dexes_count == 1
|
||||
if $Trainer.pokedex.accessible_dexes.length == 1
|
||||
$PokemonGlobal.pokedexDex = $Trainer.pokedex.accessible_dexes[0]
|
||||
pbFadeOutIn {
|
||||
scene = PokemonPokedex_Scene.new
|
||||
|
||||
@@ -296,9 +296,9 @@ class PokemonPokedex_Scene
|
||||
# National Dex at the end.
|
||||
def pbGetSavePositionIndex
|
||||
index = pbGetPokedexRegion
|
||||
if index==-1 # National Dex
|
||||
index = $Trainer.pokedex.dexes_count - 1 # National Dex index comes
|
||||
end # after regional Dex indices
|
||||
if index==-1 # National Dex (comes after regional Dex indices)
|
||||
index = $Trainer.pokedex.dexes_count - 1
|
||||
end
|
||||
return index
|
||||
end
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class StorageSystemPC
|
||||
end
|
||||
|
||||
def name
|
||||
if $PokemonGlobal.seenStorageCreator
|
||||
if $Trainer.seen_storage_creator
|
||||
return _INTL("{1}'s PC",pbGetStorageCreator)
|
||||
else
|
||||
return _INTL("Someone's PC")
|
||||
|
||||
@@ -1,14 +1,57 @@
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class Player < Trainer
|
||||
attr_accessor :has_snag_machine
|
||||
attr_accessor :seen_purify_chamber
|
||||
|
||||
alias __shadowPkmn__initialize initialize
|
||||
def initialize(name, trainer_type)
|
||||
__shadowPkmn__initialize(name, trainer_type)
|
||||
@has_snag_machine = false
|
||||
@seen_purify_chamber = false
|
||||
end
|
||||
end
|
||||
|
||||
class PokemonGlobalMetadata
|
||||
attr_writer :purifyChamber
|
||||
attr_accessor :seenPurifyChamber
|
||||
attr_writer :purifyChamber
|
||||
|
||||
def purifyChamber
|
||||
@purifyChamber = PurifyChamber.new() if !@purifyChamber
|
||||
return @purifyChamber
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#seen_purify_chamber} instead. This alias is slated to be removed in v20.
|
||||
def seenPurifyChamber
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#seenPurifyChamber', 'v20', '$Trainer.seen_purify_chamber')
|
||||
return (!@seenPurifyChamber.nil?) ? @seenPurifyChamber : $Trainer.seen_purify_chamber
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#seen_purify_chamber=} instead. This alias is slated to be removed in v20.
|
||||
def seenPurifyChamber=(value)
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#seenPurifyChamber=', 'v20', '$Trainer.seen_purify_chamber=')
|
||||
if value.nil?
|
||||
@seenPurifyChamber = value # For setting to nil by a save data conversion
|
||||
else
|
||||
$Trainer.seen_purify_chamber = value
|
||||
end
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#has_snag_machine} instead. This alias is slated to be removed in v20.
|
||||
def snagMachine
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#snagMachine', 'v20', '$Trainer.has_snag_machine')
|
||||
return (!@snagMachine.nil?) ? @snagMachine : $Trainer.has_snag_machine
|
||||
end
|
||||
|
||||
# @deprecated Use {Player#has_snag_machine=} instead. This alias is slated to be removed in v20.
|
||||
def snagMachine=(value)
|
||||
Deprecation.warn_method('PokemonGlobalMetadata#snagMachine=', 'v20', '$Trainer.has_snag_machine=')
|
||||
if value.nil?
|
||||
@snagMachine = value # For setting to nil by a save data conversion
|
||||
else
|
||||
$Trainer.has_snag_machine = value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
@@ -1285,7 +1328,7 @@ end
|
||||
#
|
||||
#===============================================================================
|
||||
def pbPurifyChamber
|
||||
$PokemonGlobal.seenPurifyChamber = true
|
||||
$Trainer.seen_purify_chamber = true
|
||||
pbFadeOutIn {
|
||||
scene = PurifyChamberScene.new
|
||||
screen = PurifyChamberScreen.new(scene)
|
||||
@@ -1298,7 +1341,7 @@ end
|
||||
#===============================================================================
|
||||
class PurifyChamberPC
|
||||
def shouldShow?
|
||||
return $PokemonGlobal.seenPurifyChamber
|
||||
return $Trainer.seen_purify_chamber
|
||||
end
|
||||
|
||||
def name
|
||||
|
||||
@@ -269,7 +269,7 @@ class SlotMachineScene
|
||||
@sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/insert"))
|
||||
@sprites["window1"].src_rect.set(0,0,152,208)
|
||||
@sprites["window2"]=IconSprite.new(358,96,@viewport)
|
||||
@sprites["credit"]=SlotMachineScore.new(360,66,$PokemonGlobal.coins)
|
||||
@sprites["credit"]=SlotMachineScore.new(360,66,$Trainer.coins)
|
||||
@sprites["payout"]=SlotMachineScore.new(438,66,0)
|
||||
@wager=0
|
||||
update
|
||||
@@ -289,7 +289,7 @@ class SlotMachineScene
|
||||
if @sprites["credit"].score == Settings::MAX_COINS
|
||||
pbMessage(_INTL("You've got {1} Coins.", Settings::MAX_COINS.to_s_formatted))
|
||||
break
|
||||
elsif $PokemonGlobal.coins==0
|
||||
elsif $Trainer.coins==0
|
||||
pbMessage(_INTL("You've run out of Coins.\nGame over!"))
|
||||
break
|
||||
elsif @gameRunning # Reels are spinning
|
||||
@@ -361,7 +361,7 @@ class SlotMachineScene
|
||||
end
|
||||
frame = (frame+1)%(Graphics.frame_rate*4)
|
||||
end
|
||||
$PokemonGlobal.coins = @sprites["credit"].score
|
||||
$Trainer.coins = @sprites["credit"].score
|
||||
end
|
||||
|
||||
def pbEndScene
|
||||
@@ -390,9 +390,9 @@ end
|
||||
def pbSlotMachine(difficulty=1)
|
||||
if GameData::Item.exists?(:COINCASE) && !$PokemonBag.pbHasItem?(:COINCASE)
|
||||
pbMessage(_INTL("It's a Slot Machine."))
|
||||
elsif $PokemonGlobal.coins==0
|
||||
elsif $Trainer.coins == 0
|
||||
pbMessage(_INTL("You don't have any Coins to play!"))
|
||||
elsif $PokemonGlobal.coins == Settings::MAX_COINS
|
||||
elsif $Trainer.coins == Settings::MAX_COINS
|
||||
pbMessage(_INTL("Your Coin Case is full!"))
|
||||
else
|
||||
pbFadeOutIn {
|
||||
|
||||
@@ -108,11 +108,11 @@ class VoltorbFlip
|
||||
@sprites["curtainL"].visible=false
|
||||
@sprites["curtainR"].visible=false
|
||||
@sprites["curtain"].opacity=100
|
||||
if $PokemonGlobal.coins >= Settings::MAX_COINS
|
||||
if $Trainer.coins >= Settings::MAX_COINS
|
||||
pbMessage(_INTL("You've gathered {1} Coins. You cannot gather any more.", Settings::MAX_COINS.to_s_formatted))
|
||||
$PokemonGlobal.coins = Settings::MAX_COINS # As a precaution
|
||||
$Trainer.coins = Settings::MAX_COINS # As a precaution
|
||||
@quit=true
|
||||
# elsif !pbConfirmMessage(_INTL("Play Voltorb Flip Lv. {1}?",@level)) && $PokemonGlobal.coins<99999
|
||||
# elsif !pbConfirmMessage(_INTL("Play Voltorb Flip Lv. {1}?",@level)) && $Trainer.coins<Settings::MAX_COINS
|
||||
# @quit=true
|
||||
else
|
||||
@sprites["curtain"].opacity=0
|
||||
@@ -370,7 +370,7 @@ class VoltorbFlip
|
||||
# Update level text
|
||||
@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)
|
||||
$PokemonGlobal.coins+=@points
|
||||
$Trainer.coins+=@points
|
||||
@points=0
|
||||
pbUpdateCoins
|
||||
@sprites["curtain"].opacity=0
|
||||
@@ -414,7 +414,7 @@ class VoltorbFlip
|
||||
end
|
||||
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))
|
||||
$PokemonGlobal.coins+=@points
|
||||
$Trainer.coins+=@points
|
||||
@points=0
|
||||
pbUpdateCoins
|
||||
@sprites["curtain"].opacity=0
|
||||
@@ -479,7 +479,7 @@ class VoltorbFlip
|
||||
def pbUpdateCoins
|
||||
# Update coins display
|
||||
@sprites["totalCoins"].bitmap.clear
|
||||
pbCreateCoins($PokemonGlobal.coins,44)
|
||||
pbCreateCoins($Trainer.coins,44)
|
||||
pbDrawImagePositions(@sprites["totalCoins"].bitmap,@coins)
|
||||
# Update points display
|
||||
@sprites["currentCoins"].bitmap.clear
|
||||
@@ -616,7 +616,7 @@ end
|
||||
def pbVoltorbFlip
|
||||
if GameData::Item.exists?(:COINCASE) && !$PokemonBag.pbHasItem?(:COINCASE)
|
||||
pbMessage(_INTL("You can't play unless you have a Coin Case."))
|
||||
elsif $PokemonGlobal.coins == Settings::MAX_COINS
|
||||
elsif $Trainer.coins == Settings::MAX_COINS
|
||||
pbMessage(_INTL("Your Coin Case is full!"))
|
||||
else
|
||||
scene=VoltorbFlip.new
|
||||
|
||||
@@ -26,7 +26,7 @@ def pbStorePokemon(pkmn)
|
||||
curboxname = $PokemonStorage[oldcurbox].name
|
||||
boxname = $PokemonStorage[storedbox].name
|
||||
creator = nil
|
||||
creator = pbGetStorageCreator if $PokemonGlobal.seenStorageCreator
|
||||
creator = pbGetStorageCreator if $Trainer.seen_storage_creator
|
||||
if storedbox != oldcurbox
|
||||
if creator
|
||||
pbMessage(_INTL("Box \"{1}\" on {2}'s PC was full.\1", curboxname, creator))
|
||||
|
||||
@@ -719,9 +719,22 @@ DebugMenuCommands.register("setcoins", {
|
||||
"effect" => proc {
|
||||
params = ChooseNumberParams.new
|
||||
params.setRange(0, Settings::MAX_COINS)
|
||||
params.setDefaultValue($PokemonGlobal.coins)
|
||||
$PokemonGlobal.coins = pbMessageChooseNumber(_INTL("Set the player's Coin amount."), params)
|
||||
pbMessage(_INTL("You now have {1} Coins.", $PokemonGlobal.coins.to_s_formatted))
|
||||
params.setDefaultValue($Trainer.coins)
|
||||
$Trainer.coins = pbMessageChooseNumber(_INTL("Set the player's Coin amount."), params)
|
||||
pbMessage(_INTL("You now have {1} Coins.", $Trainer.coins.to_s_formatted))
|
||||
}
|
||||
})
|
||||
|
||||
DebugMenuCommands.register("setbp", {
|
||||
"parent" => "playermenu",
|
||||
"name" => _INTL("Set Battle Points"),
|
||||
"description" => _INTL("Edit how many Battle Points you have."),
|
||||
"effect" => proc {
|
||||
params = ChooseNumberParams.new
|
||||
params.setRange(0, Settings::MAX_BATTLE_POINTS)
|
||||
params.setDefaultValue($Trainer.battle_points)
|
||||
$Trainer.battle_points = pbMessageChooseNumber(_INTL("Set the player's BP amount."), params)
|
||||
pbMessage(_INTL("You now have {1} BP.", $Trainer.battle_points.to_s_formatted))
|
||||
}
|
||||
})
|
||||
|
||||
@@ -730,9 +743,9 @@ DebugMenuCommands.register("toggleshoes", {
|
||||
"name" => _INTL("Toggle Running Shoes"),
|
||||
"description" => _INTL("Toggle possession of running shoes."),
|
||||
"effect" => proc {
|
||||
$PokemonGlobal.runningShoes = !$PokemonGlobal.runningShoes
|
||||
pbMessage(_INTL("Gave Running Shoes.")) if $PokemonGlobal.runningShoes
|
||||
pbMessage(_INTL("Lost Running Shoes.")) if !$PokemonGlobal.runningShoes
|
||||
$Trainer.has_running_shoes = !$Trainer.has_running_shoes
|
||||
pbMessage(_INTL("Gave Running Shoes.")) if $Trainer.has_running_shoes
|
||||
pbMessage(_INTL("Lost Running Shoes.")) if !$Trainer.has_running_shoes
|
||||
}
|
||||
})
|
||||
|
||||
@@ -741,9 +754,9 @@ DebugMenuCommands.register("togglepokegear", {
|
||||
"name" => _INTL("Toggle Pokégear"),
|
||||
"description" => _INTL("Toggle possession of the Pokégear."),
|
||||
"effect" => proc {
|
||||
$Trainer.pokegear = !$Trainer.pokegear
|
||||
pbMessage(_INTL("Gave Pokégear.")) if $Trainer.pokegear
|
||||
pbMessage(_INTL("Lost Pokégear.")) if !$Trainer.pokegear
|
||||
$Trainer.has_pokegear = !$Trainer.has_pokegear
|
||||
pbMessage(_INTL("Gave Pokégear.")) if $Trainer.has_pokegear
|
||||
pbMessage(_INTL("Lost Pokégear.")) if !$Trainer.has_pokegear
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -734,9 +734,9 @@ module Compiler
|
||||
echoln ""
|
||||
echoln _INTL("*** Finished full compile ***")
|
||||
echoln ""
|
||||
System.reload_cache
|
||||
end
|
||||
pbSetWindowText(nil)
|
||||
System.reload_cache
|
||||
end
|
||||
|
||||
def main
|
||||
|
||||
Reference in New Issue
Block a user