Moved some global metadata values to class Player, added battle points property

This commit is contained in:
Maruno17
2021-04-12 20:31:15 +01:00
parent e49ddde198
commit 9f70b29795
24 changed files with 283 additions and 94 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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