Update 6.8

This commit is contained in:
chardub
2026-07-10 15:42:06 -04:00
parent 5b85e72cb2
commit 6a6f126a18
7871 changed files with 493194 additions and 224826 deletions
@@ -1,4 +1,9 @@
def Kernel.pbDisplayText(message,xposition,yposition,z=nil, baseColor=nil, shadowColor=nil)
#alignment
# 1: right
# 2 : centered
# 3 : left
def Kernel.pbDisplayText(message,xposition,yposition,z=nil, baseColor=nil, shadowColor=nil,alignment=2)
if @hud==nil
@hud = []
end
@@ -8,12 +13,14 @@ def Kernel.pbDisplayText(message,xposition,yposition,z=nil, baseColor=nil, shado
sprite = BitmapSprite.new(Graphics.width,Graphics.height,@viewport1)
if z != nil
sprite.z=z
else
sprite.z = 999999
end
@hud.push(sprite)
text1=_INTL(message)
textPosition=[
[text1,xposition,yposition,2,baseColor,shadowColor],
[text1,xposition,yposition,alignment,baseColor,shadowColor],
]
pbSetSystemFont(@hud[-1].bitmap)
pbDrawTextPositions(@hud[0].bitmap,textPosition)
@@ -0,0 +1,91 @@
class ChallengeOptionsScene < PokemonOption_Scene
def initialize
@changedColor = false
end
def pbStartScene(inloadscreen = false)
super
@sprites["option"].nameBaseColor = Color.new(35, 130, 200)
@sprites["option"].nameShadowColor = Color.new(20, 75, 115)
@changedColor = true
for i in 0...@PokemonOptions.length
@sprites["option"][i] = (@PokemonOptions[i].get || 0)
end
@sprites["title"]=Window_UnformattedTextPokemon.newWithSize(
_INTL("Optional Challenge Options"),0,0,Graphics.width,64,@viewport)
@sprites["textbox"].text=_INTL("Optional challenge options")
pbFadeInAndShow(@sprites) { pbUpdate }
end
def pbFadeInAndShow(sprites, visiblesprites = nil)
return if !@changedColor
super
end
def pbGetOptions(inloadscreen = false)
options = []
options << EnumOption.new(_INTL("Level caps"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.level_caps },
proc { |value| $PokemonSystem.level_caps = value },
_INTL("Prevents leveling above the next gym leader's highest leveled Pokemon."))
options << EnumOption.new(_INTL("Battle Style"), [_INTL("Switch"), _INTL("Set")],
proc { $PokemonSystem.battlestyle },
proc { |value| $PokemonSystem.battlestyle = value },
[_INTL("Prompts to switch Pokémon before the opponent sends out the next one."),
_INTL("No prompt to switch Pokémon before the opponent sends the next one.")]
)
options << EnumOption.new(_INTL("No reviving"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.no_reviving ? 1 : 0},
proc { |value| $PokemonSystem.no_reviving = value == 1 },
_INTL("Fainted Pokémon cannot be revived."))
#TODO
# options << EnumOption.new(_INTL("Limited Catch"), [_INTL("Off"), _INTL("On")],
# proc { $PokemonSystem.level_caps },
# proc { |value| $PokemonSystem.level_caps = value },
# _INTL("You're only allowed to catch the first X Pokémon on every route."))
options << EnumOption.new(_INTL("No heals (battles)"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.no_healing_items_battles ? 1 : 0},
proc { |value| $PokemonSystem.no_healing_items_battles = value == 1 },
_INTL("Healing items cannot be used during battles (excluding held berries)."))
options << EnumOption.new(_INTL("No heals (overworld)"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.no_healing_items_ow ? 1 : 0},
proc { |value| $PokemonSystem.no_healing_items_ow = value == 1 },
_INTL("Healing items cannot be used in the overworld."))
if Settings::HOENN
options << EnumOption.new(_INTL("No Pokécenters"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.no_pokemon_center ? 1 : 0},
proc { |value| $PokemonSystem.no_pokemon_center = value == 1 },
_INTL("Pokémon centers will not heal your Pokémon."))
end
return options
end
def selectAutosaveSteps()
if pbGet(AUTOSAVE_STEPS_VAR) == 0
pbSet(AUTOSAVE_STEPS_VAR,DEFAULT_AUTOSAVE_STEPS)
end
params=ChooseNumberParams.new
params.setRange(20,999999)
params.setInitialValue(pbGet(AUTOSAVE_STEPS_VAR))
params.setCancelValue(0)
val = Kernel.pbMessageChooseNumber(_INTL("Autosave every how many steps?"),params)
if val < 200
Kernel.pbMessage(_INTL("Warning: Choosing a low number of steps may decrease performance."))
end
if val == 0
val = 1
end
pbSet(AUTOSAVE_STEPS_VAR,val)
end
end
@@ -0,0 +1,134 @@
class PokemonGameOption_Scene < PokemonOption_Scene
ICON_AUDIO = "optionIcons/AUDIO"
ICON_GAMEPLAY = "optionIcons/GAMEPLAY"
ICON_VISUALS = "optionIcons/VISUALS"
ICON_CHALLENGE = "optionIcons/CHALLENGE"
ICON_RANDOMIZER = "optionIcons/RANDOMIZER"
def pbGetOptions(inloadscreen = false)
@current_game_mode = getTrainersDataMode
options = []
options << ButtonOption.new(
_INTL("System & Audio"),
proc {
@system_menu = true
openSystemMenu()
},
"<icon=#{ICON_AUDIO}> " + _INTL("Volume, UI, Autosave, etc.")
)
if $game_switches
options << ButtonOption.new(
_INTL("Gameplay"),
proc {
@gameplay_menu = true
openGameplayMenu()
},
"<icon=#{ICON_GAMEPLAY}> " + _INTL("Difficulty, movement, etc.")
)
options << ButtonOption.new(
_INTL("Visuals & Content"),
proc {
@sprites_menu = true
openSpritesMenu()
},
"<icon=#{ICON_VISUALS}> " + _INTL("Sprites, Pokédex entries, etc.")
)
options << ButtonOption.new(
_INTL("Challenge Options"),
proc {
@challenge_menu = true
openChallengeMenu()
},
"<icon=#{ICON_CHALLENGE}> " + _INTL("Set optional self-imposed challenges.")
)
# if $game_switches[SWITCH_RANDOMIZED_AT_LEAST_ONCE]
# options << ButtonOption.new(
# _INTL("Randomizer Options"),
# proc {
# @randomizer_menu = true
# openRandomizerMenu()
# },
# "<icon=#{ICON_RANDOMIZER}> " + _INTL("Set how to randomize the game.")
# )
# end
end
return options
end
def openChallengeMenu()
return unless @challenge_menu
pbFadeOutIn {
scene = ChallengeOptionsScene.new
screen = PokemonOptionScreen.new(scene)
screen.pbStartScreen
}
@challenge_menu = false
end
def openRandomizerMenu()
return unless @randomizer_menu
pbFadeOutIn {
scene = RandomizerOptionsScene.new
screen = PokemonOptionScreen.new(scene)
screen.pbStartScreen
}
@randomizer_menu = false
end
def openSystemMenu()
return unless @system_menu
pbFadeOutIn {
scene = SystemOptionsScene.new
screen = PokemonOptionScreen.new(scene)
screen.pbStartScreen
}
@system_menu = false
end
def openSpritesMenu()
return unless @sprites_menu
pbFadeOutIn {
scene = SpriteOptionsScene.new
screen = PokemonOptionScreen.new(scene)
screen.pbStartScreen
}
@sprites_menu = false
end
def openGameplayMenu()
return unless @gameplay_menu
pbFadeOutIn {
scene = GameplayOptionsScene.new
screen = PokemonOptionScreen.new(scene)
screen.pbStartScreen
}
@gameplay_menu = false
end
def pbEndScene
echoln "Selected Difficulty: #{$Trainer.selected_difficulty}, lowest difficutly: #{$Trainer.lowest_difficulty}" if $Trainer
if $Trainer && $Trainer.selected_difficulty < $Trainer.lowest_difficulty
$Trainer.lowest_difficulty = $Trainer.selected_difficulty
echoln "lowered difficulty (#{$Trainer.selected_difficulty})"
if @manually_changed_difficulty
pbMessage(_INTL("The savefile's lowest selected difficulty was changed to {1}.",getDisplayDifficulty()))
@manually_changed_difficulty = false
end
end
if getTrainersDataMode != @current_game_mode
pbMessage(_INTL("The game was mode changed - Reshuffling trainers."))
Kernel.pbShuffleTrainers
@manually_changed_gamemode = false
end
super
end
end
@@ -0,0 +1,132 @@
class GameplayOptionsScene < PokemonOption_Scene
def initialize
@changedColor = false
end
def pbStartScene(inloadscreen = false)
super
@sprites["option"].nameBaseColor = Color.new(35, 130, 200)
@sprites["option"].nameShadowColor = Color.new(20, 75, 115)
@changedColor = true
for i in 0...@PokemonOptions.length
@sprites["option"][i] = (@PokemonOptions[i].get || 0)
end
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Gameplay Options"), 0, 0, Graphics.width, 64, @viewport)
@sprites["textbox"].text = _INTL("Gameplay options")
pbFadeInAndShow(@sprites) { pbUpdate }
end
def pbFadeInAndShow(sprites, visiblesprites = nil)
return if !@changedColor
super
end
def pbGetOptions(inloadscreen = false)
@current_game_mode = getTrainersDataMode
options = []
options << EnumOption.new(_INTL("Default Movement"), [_INTL("Walking"), _INTL("Running")],
proc { $PokemonSystem.runstyle },
proc { |value| $PokemonSystem.runstyle = value },
[_INTL("Default to walking when not holding the Run key"),
_INTL("Default to running when not holding the Run key")]
)
difficulty_description = []
if Settings::KANTO
difficulty_description = [_INTL("All Pokémon in the team gain experience. Otherwise the same as Normal difficulty."),
_INTL("The default experience. Levels are similar to the official games."),
_INTL("Higher levels and smarter AI. All trainers have access to healing items.")]
else
difficulty_description = [_INTL("Trainer Pokémon levels are 10% lower"),
_INTL("The default experience. Levels are similar to the official games."),
_INTL("Trainer Pokémon levels are 10% higher"),]
end
options << EnumOption.new(_INTL("Difficulty"), [_INTL("Easy"), _INTL("Normal"), _INTL("Hard")],
proc { $Trainer.selected_difficulty },
proc { |value|
setDifficulty(value)
@manually_changed_difficulty = true
}, difficulty_description
)
if Settings::HOENN
options << EnumOption.new(_INTL("Overworld Encounters"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.overworld_encounters ? 0 : 1 },
proc { |value| $PokemonSystem.overworld_encounters = value == 0 },
[_INTL("Pokémon are encountered in the overworld."),
_INTL("Pokémon are only encountered in tall grass, etc.")]
)
end
if $game_switches && (Settings::KANTO && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE])) || Settings::HOENN # beat the league
options <<
EnumOption.new(_INTL("Battle type"), [_INTL("1v1"), _INTL("2v2"), _INTL("3v3")],
proc { $PokemonSystem.battle_type },
proc { |value|
if value == 0
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1]
elsif value == 1
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [2, 2]
elsif value == 2
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [3, 3]
else
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1]
end
$PokemonSystem.battle_type = value
}, _INTL("Sets the number of Pokémon sent out in battles (when possible)")
)
end
options << EnumOption.new(_INTL("Speed-up type"), [_INTL("Hold"), _INTL("Toggle")],
proc { $PokemonSystem.speedup },
proc { |value|
$PokemonSystem.speedup = value
}, _INTL("Pick how you want speed-up to be enabled")
)
options << SliderOption.new(_INTL("Speed-up (Overworld)"), 1, 10, 1,
proc { $PokemonSystem.speedup_speed },
proc { |value|
$PokemonSystem.speedup_speed = value
}, _INTL("Sets by how much to speed up the game when holding the speed up button when walking in the overworld."))
options << SliderOption.new(_INTL("Speed-up (Battles)"), 1, 10, 1,
proc { $PokemonSystem.speedup_speed_battles },
proc { |value|
$PokemonSystem.speedup_speed_battles = value
}, _INTL("Sets by how much to speed up the game when holding the speed up button in battles."))
options << EnumOption.new(_INTL("Prompt Nicknames"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.prompt_nicknames ? 0 : 1 },
proc { |value| $PokemonSystem.prompt_nicknames = value == 0 },
[_INTL("Ask to set a nickname when catching a new Pokémon."),
_INTL("Don't ask to set a nickname when catching a new Pokémon.")]
)
options << EnumOption.new(_INTL("Quick HMs"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.quickHM },
proc { |value| $PokemonSystem.quickHM = value },
[
_INTL("Prompt to use HMs when interacting with an obstacle"),
_INTL("Use HMs automatically when interacting with an obstacle")]
)
if $game_switches && $game_switches[SWITCH_LEGENDARY_MODE]
selected_game_mode = $game_switches[SWITCH_MODERN_MODE] ? 1 : 0
options << EnumOption.new(_INTL("Trainers"), [_INTL("Classic"), _INTL("Remix")],
proc { selected_game_mode },
proc { |value|
$game_switches[SWITCH_MODERN_MODE] = value == 1
@manually_changed_gamemode = true
},
[_INTL("Use trainers from Classic Mode for Legendary Mode"),
_INTL("Use trainers from Remix Mode for Legendary Mode")]
)
end
return options
end
end
@@ -0,0 +1,110 @@
class SpriteOptionsScene < PokemonOption_Scene
def initialize
@changedColor = false
end
def pbStartScene(inloadscreen = false)
super
@sprites["option"].nameBaseColor = Color.new(35, 130, 200)
@sprites["option"].nameShadowColor = Color.new(20, 75, 115)
@changedColor = true
for i in 0...@PokemonOptions.length
@sprites["option"][i] = (@PokemonOptions[i].get || 0)
end
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Visuals & Content Options"), 0, 0, Graphics.width, 64, @viewport)
@sprites["textbox"].text = _INTL("Visuals & Content Options")
pbFadeInAndShow(@sprites) { pbUpdate }
end
def pbFadeInAndShow(sprites, visiblesprites = nil)
return if !@changedColor
super
end
def pbGetOptions(inloadscreen = false)
options = []
generated_entries_option_selected = $PokemonSystem.use_generated_dex_entries ? 1 : 0
options << EnumOption.new(_INTL("Autogen dex entries"), [_INTL("Off"), _INTL("On")],
proc { generated_entries_option_selected },
proc { |value|
$PokemonSystem.use_generated_dex_entries = value == 1
},
[
_INTL("Fusions without a custom Pokédex entry display nothing."),
_INTL("Fusions without a custom Pokédex entry display an auto-generated placeholder.")
]
)
use_random_sprites = $PokemonSystem.random_sprites ? 1 : 0
options << EnumOption.new(_INTL("Random Sprites"), [_INTL("Off"), _INTL("On")],
proc { use_random_sprites },
proc { |value|
$PokemonSystem.random_sprites = value == 1
},
[
_INTL("The game uses the same sprite each time you encounter the same species."),
_INTL("A random sprite is selected each time you encounter a Pokémon."),
]
) ? 1 : 0
allow_joke_sprites = $PokemonSystem.include_alt_sprites_in_random ? 1 : 0
options << EnumOption.new(_INTL("Joke Sprites"), [_INTL("Off"), _INTL("On")],
proc { allow_joke_sprites },
proc { |value|
$PokemonSystem.include_alt_sprites_in_random = value == 1
},
[
_INTL("Auto-selected sprites follow standard Pokémon sprites rules."),
_INTL("Auto-selected sprites can be anything, including references, memes, jokes, etc.")
]
) ? 1 : 0
custom_eggs_option_selected = $PokemonSystem.hide_custom_eggs ? 1 : 0
options << EnumOption.new(_INTL("Custom Eggs"), [_INTL("On"), _INTL("Off")],
proc { custom_eggs_option_selected },
proc { |value|
$PokemonSystem.hide_custom_eggs = value == 1
},
[_INTL("Eggs have different sprites for each Pokémon."),
_INTL("Eggs all use the same sprite.")]
)
options << EnumOption.new(_INTL("Fusion Icons"), [_INTL("Combined"), _INTL("DNA")],
proc { $game_variables[VAR_FUSION_ICON_STYLE] },
proc { |value| $game_variables[VAR_FUSION_ICON_STYLE] = value },
[_INTL("Combines both Pokémon's party icons"),
_INTL("Uses the same party icon for all fusions")]
)
battle_type_icon_option_selected = $PokemonSystem.type_icons ? 1 : 0
options << EnumOption.new(_INTL("Battle Type Icons"), [_INTL("Off"), _INTL("On")],
proc { battle_type_icon_option_selected },
proc { |value| $PokemonSystem.type_icons = value == 1 },
_INTL("Display the enemy Pokémon type in battles.")
)
options << EnumOption.new(_INTL("Battle Animations"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.battlescene },
proc { |value| $PokemonSystem.battlescene = value },
_INTL("Display move animations in battles")
)
options << EnumOption.new(_INTL("Battle Movement"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.nobattlemovement ? 1 : 0 },
proc { |value| $PokemonSystem.nobattlemovement = value == 1 },
[_INTL("Sprites move up and down slightly during battles."),
_INTL("Sprites are completely static during battles.")
]
)
return options
end
end
@@ -0,0 +1,129 @@
class SystemOptionsScene < PokemonOption_Scene
def initialize
@changedColor = false
end
def pbStartScene(inloadscreen = false)
super
@sprites["option"].nameBaseColor = Color.new(35, 130, 200)
@sprites["option"].nameShadowColor = Color.new(20, 75, 115)
@changedColor = true
for i in 0...@PokemonOptions.length
@sprites["option"][i] = (@PokemonOptions[i].get || 0)
end
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("System & Audio Options"), 0, 0, Graphics.width, 64, @viewport)
@sprites["textbox"].text = _INTL("System & Audio options")
pbFadeInAndShow(@sprites) { pbUpdate }
end
def pbFadeInAndShow(sprites, visiblesprites = nil)
return if !@changedColor
super
end
def pbGetOptions(inloadscreen = false)
options = []
options << EnumOption.new(_INTL("Text Entry"), [_INTL("Cursor"), _INTL("Keyboard")],
proc { $PokemonSystem.textinput },
proc { |value| $PokemonSystem.textinput = value },
[_INTL("Enter text by selecting letters on the screen"),
_INTL("Enter text by typing on the keyboard")]
)
options << SliderOption.new(_INTL("Music Volume"), 0, 100, 1,
proc { $PokemonSystem.bgmvolume },
proc { |value|
if $PokemonSystem.bgmvolume != value
$PokemonSystem.bgmvolume = value
if $game_system.playing_bgm != nil# && !inloadscreen
playingBGM = $game_system.getPlayingBGM
$game_system.bgm_pause
$game_system.bgm_resume(playingBGM)
end
end
}, _INTL("Sets the volume for background music")
)
options << SliderOption.new(_INTL("SE Volume"), 0, 100, 1,
proc { $PokemonSystem.sevolume },
proc { |value|
if $PokemonSystem.sevolume != value
$PokemonSystem.sevolume = value
if $game_system.playing_bgs != nil
$game_system.playing_bgs.volume = value
playingBGS = $game_system.getPlayingBGS
$game_system.bgs_pause
$game_system.bgs_resume(playingBGS)
end
pbPlayCursorSE
end
}, _INTL("Sets the volume for sound effects")
)
options << EnumOption.new(_INTL("Text Speed"), [_INTL("Normal"), _INTL("Fast")],
proc { $PokemonSystem.textspeed },
proc { |value|
$PokemonSystem.textspeed = value
MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
}, _INTL("Sets the speed at which the text is displayed")
)
options << NumberOption.new(_INTL("Speech Frame"), 1, Settings::SPEECH_WINDOWSKINS.length,
proc { $PokemonSystem.textskin },
proc { |value|
$PokemonSystem.textskin = value
MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[value])
}
)
options << EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")],
proc { [$PokemonSystem.screensize, 4].min },
proc { |value|
if $PokemonSystem.screensize != value
$PokemonSystem.screensize = value
pbSetResizeFactor($PokemonSystem.screensize)
echoln $PokemonSystem.screensize
end
}, _INTL("Sets the size of the screen")
)
if $game_switches
options <<
EnumOption.new(_INTL("Autosave"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[AUTOSAVE_ENABLED_SWITCH] ? 0 : 1 },
proc { |value|
if !$game_switches[AUTOSAVE_ENABLED_SWITCH] && value == 0
@autosave_menu = true
openAutosaveMenu()
end
$game_switches[AUTOSAVE_ENABLED_SWITCH] = value == 0
},
_INTL("Automatically saves when healing at Pokémon centers")
)
end
options <<
EnumOption.new(_INTL("Download data"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.download_sprites },
proc { |value|
$PokemonSystem.download_sprites = value
},
_INTL("Automatically download missing custom sprites and Pokédex entries from the internet")
)
device_option_selected = $PokemonSystem.on_mobile ? 1 : 0
options << EnumOption.new(_INTL("Device"), [_INTL("PC"), _INTL("Mobile")],
proc { device_option_selected },
proc { |value| $PokemonSystem.on_mobile = value == 1 },
[_INTL("The intended device on which to play the game."),
_INTL("Disables some options that aren't supported when playing on mobile.")]
)
return options
end
end
@@ -122,7 +122,7 @@ def getNewLegendaryFusionForGymType(original_species, nb_retries = 0)
echoln "gymType: #{gym_type} - body_species: #{body_species.species} head_species: #{head_species.species}, kept: #{pokemon_to_be_kept.species}"
legendary_species = LEGENDARIES_LIST.sample
return getNewLegendaryFusion(original_species, nb_retries) unless pokemon_to_be_replaced
if pokemon_to_be_replaced.species == head_species.species
head_species_id = legendary_species
else
@@ -1,282 +0,0 @@
class PokemonGameOption_Scene < PokemonOption_Scene
def pbGetOptions(inloadscreen = false)
@current_game_mode = getTrainersDataMode
options = []
options << SliderOption.new(_INTL("Music Volume"), 0, 100, 5,
proc { $PokemonSystem.bgmvolume },
proc { |value|
if $PokemonSystem.bgmvolume != value
$PokemonSystem.bgmvolume = value
if $game_system.playing_bgm != nil && !inloadscreen
playingBGM = $game_system.getPlayingBGM
$game_system.bgm_pause
$game_system.bgm_resume(playingBGM)
end
end
}, _INTL("Sets the volume for background music")
)
options << SliderOption.new(_INTL("SE Volume"), 0, 100, 5,
proc { $PokemonSystem.sevolume },
proc { |value|
if $PokemonSystem.sevolume != value
$PokemonSystem.sevolume = value
if $game_system.playing_bgs != nil
$game_system.playing_bgs.volume = value
playingBGS = $game_system.getPlayingBGS
$game_system.bgs_pause
$game_system.bgs_resume(playingBGS)
end
pbPlayCursorSE
end
}, _INTL("Sets the volume for sound effects")
)
options << EnumOption.new(_INTL("Default Movement"), [_INTL("Walking"), _INTL("Running")],
proc { $PokemonSystem.runstyle },
proc { |value| $PokemonSystem.runstyle = value },
[_INTL("Default to walking when not holding the Run key"),
_INTL("Default to running when not holding the Run key")]
)
options << EnumOption.new(_INTL("Text Speed"), [_INTL("Normal"), _INTL("Fast")],
proc { $PokemonSystem.textspeed },
proc { |value|
$PokemonSystem.textspeed = value
MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
}, _INTL("Sets the speed at which the text is displayed")
)
if $game_switches
options << EnumOption.new(_INTL("Difficulty"), [_INTL("Easy"), _INTL("Normal"), _INTL("Hard")],
proc { $Trainer.selected_difficulty },
proc { |value|
setDifficulty(value)
@manually_changed_difficulty = true
}, [_INTL("All Pokémon in the team gain experience. Otherwise the same as Normal difficulty."),
_INTL("The default experience. Levels are similar to the official games."),
_INTL("Higher levels and smarter AI. All trainers have access to healing items.")]
)
end
if $game_switches
options <<
EnumOption.new(_INTL("Autosave"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[AUTOSAVE_ENABLED_SWITCH] ? 0 : 1 },
proc { |value|
if !$game_switches[AUTOSAVE_ENABLED_SWITCH] && value == 0
@autosave_menu = true
openAutosaveMenu()
end
$game_switches[AUTOSAVE_ENABLED_SWITCH] = value == 0
},
_INTL("Automatically saves when healing at Pokémon centers")
)
end
options << EnumOption.new(_INTL("Speed-up type"), [_INTL("Hold"), _INTL("Toggle")],
proc { $PokemonSystem.speedup },
proc { |value|
$PokemonSystem.speedup = value
}, _INTL("Pick how you want speed-up to be enabled")
)
options << SliderOption.new(_INTL("Speed-up speed"), 1, 10, 1,
proc { $PokemonSystem.speedup_speed },
proc { |value|
$PokemonSystem.speedup_speed = value
}, _INTL("Sets by how much to speed up the game when holding the speed up button (Default: 3x)")
)
# if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) #beat the league
# options << EnumOption.new("Text Speed", ["Normal", "Fast", "Instant"],
# proc { $PokemonSystem.textspeed },
# proc { |value|
# $PokemonSystem.textspeed = value
# MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
# }, "Sets the speed at which the text is displayed"
# )
# else
# options << EnumOption.new("Text Speed", ["Normal", "Fast"],
# proc { $PokemonSystem.textspeed },
# proc { |value|
# $PokemonSystem.textspeed = value
# MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
# }, "Sets the speed at which the text is displayed"
# )
# end
options <<
EnumOption.new(_INTL("Download data"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.download_sprites },
proc { |value|
$PokemonSystem.download_sprites = value
},
_INTL("Automatically download missing custom sprites and Pokédex entries from the internet")
)
#
generated_entries_option_selected = $PokemonSystem.use_generated_dex_entries ? 1 : 0
options << EnumOption.new(_INTL("Autogen dex entries"), [_INTL("Off"), _INTL("On")],
proc { generated_entries_option_selected },
proc { |value|
$PokemonSystem.use_generated_dex_entries = value == 1
},
[
_INTL("Fusions without a custom Pokédex entry display nothing."),
_INTL("Fusions without a custom Pokédex entry display an auto-generated placeholder.")
]
)
generated_entries_option_selected = $PokemonSystem.include_alt_sprites_in_random ? 1 : 0
options << EnumOption.new(_INTL("Sprite categories"), [_INTL("Normal"), _INTL("Anything")],
proc { generated_entries_option_selected },
proc { |value|
$PokemonSystem.include_alt_sprites_in_random = value == 1
},
[
_INTL("Auto-selected sprites follow standard Pokémon sprites rules."),
_INTL("Auto-selected sprites can be anything, including references, memes, jokes, etc.")
]
) ? 1 : 0
custom_eggs_option_selected = $PokemonSystem.hide_custom_eggs ? 1 : 0
options << EnumOption.new(_INTL("Custom Eggs"), [_INTL("On"), _INTL("Off")],
proc { custom_eggs_option_selected },
proc { |value|
$PokemonSystem.hide_custom_eggs = value == 1
},
[_INTL("Eggs have different sprites for each Pokémon."),
_INTL("Eggs all use the same sprite.")]
)
if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) # beat the league
options <<
EnumOption.new(_INTL("Battle type"), [_INTL("1v1"), _INTL("2v2"), _INTL("3v3")],
proc { $PokemonSystem.battle_type },
proc { |value|
if value == 0
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1]
elsif value == 1
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [2, 2]
elsif value == 2
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [3, 3]
else
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1]
end
$PokemonSystem.battle_type = value
}, _INTL("Sets the number of Pokémon sent out in battles (when possible)")
)
end
options << EnumOption.new(_INTL("Battle Effects"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.battlescene },
proc { |value| $PokemonSystem.battlescene = value },
_INTL("Display move animations in battles")
)
options << EnumOption.new(_INTL("Battle Style"), [_INTL("Switch"), _INTL("Set")],
proc { $PokemonSystem.battlestyle },
proc { |value| $PokemonSystem.battlestyle = value },
[_INTL("Prompts to switch Pokémon before the opponent sends out the next one"),
_INTL("No prompt to switch Pokémon before the opponent sends the next one")]
)
options << NumberOption.new(_INTL("Speech Frame"), 1, Settings::SPEECH_WINDOWSKINS.length,
proc { $PokemonSystem.textskin },
proc { |value|
$PokemonSystem.textskin = value
MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[value])
}
)
# NumberOption.new("Menu Frame",1,Settings::MENU_WINDOWSKINS.length,
# proc { $PokemonSystem.frame },
# proc { |value|
# $PokemonSystem.frame = value
# MessageConfig.pbSetSystemFrame("Graphics/Windowskins/" + Settings::MENU_WINDOWSKINS[value])
# }
# ),
options << EnumOption.new(_INTL("Text Entry"), [_INTL("Cursor"), _INTL("Keyboard")],
proc { $PokemonSystem.textinput },
proc { |value| $PokemonSystem.textinput = value },
[_INTL("Enter text by selecting letters on the screen"),
_INTL("Enter text by typing on the keyboard")]
)
if $game_variables
options << EnumOption.new(_INTL("Fusion Icons"), [_INTL("Combined"), _INTL("DNA")],
proc { $game_variables[VAR_FUSION_ICON_STYLE] },
proc { |value| $game_variables[VAR_FUSION_ICON_STYLE] = value },
[_INTL("Combines both Pokémon's party icons"),
_INTL("Uses the same party icon for all fusions")]
)
battle_type_icon_option_selected = $PokemonSystem.type_icons ? 1 : 0
options << EnumOption.new(_INTL("Battle Type Icons"), [_INTL("Off"), _INTL("On")],
proc { battle_type_icon_option_selected },
proc { |value| $PokemonSystem.type_icons = value == 1 },
_INTL("Display the enemy Pokémon type in battles.")
)
end
options << EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")],
proc { [$PokemonSystem.screensize, 4].min },
proc { |value|
if $PokemonSystem.screensize != value
$PokemonSystem.screensize = value
pbSetResizeFactor($PokemonSystem.screensize)
echoln $PokemonSystem.screensize
end
}, _INTL("Sets the size of the screen")
)
options << EnumOption.new(_INTL("Quick Surf"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.quicksurf },
proc { |value| $PokemonSystem.quicksurf = value },
_INTL("Start surfing automatically when interacting with water")
)
options << EnumOption.new(_INTL("Level caps"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.level_caps },
proc { |value| $PokemonSystem.level_caps = value },
_INTL("Prevents leveling above the next gym leader's highest leveled Pokemon")
)
device_option_selected = $PokemonSystem.on_mobile ? 1 : 0
options << EnumOption.new(_INTL("Device"), [_INTL("PC"), _INTL("Mobile")],
proc { device_option_selected },
proc { |value| $PokemonSystem.on_mobile = value == 1 },
["The intended device on which to play the game.",
_INTL("Disables some options that aren't supported when playing on mobile.")]
)
if $game_switches && $game_switches[SWITCH_LEGENDARY_MODE]
selected_game_mode = $game_switches[SWITCH_MODERN_MODE] ? 1 : 0
options << EnumOption.new(_INTL("Trainers"), [_INTL("Classic"), _INTL("Remix")],
proc { selected_game_mode },
proc { |value|
$game_switches[SWITCH_MODERN_MODE] = value == 1
@manually_changed_gamemode = true
},
[_INTL("Use trainers from Classic Mode for Legendary Mode"),
_INTL("Use trainers from Remix Mode for Legendary Mode")]
)
end
return options
end
def pbEndScene
echoln "Selected Difficulty: #{$Trainer.selected_difficulty}, lowest difficutly: #{$Trainer.lowest_difficulty}" if $Trainer
if $Trainer && $Trainer.selected_difficulty < $Trainer.lowest_difficulty
$Trainer.lowest_difficulty = $Trainer.selected_difficulty
echoln "lowered difficulty (#{$Trainer.selected_difficulty})"
if @manually_changed_difficulty
pbMessage(_INTL("The savefile's lowest selected difficulty was changed to #{getDisplayDifficulty()}."))
@manually_changed_difficulty = false
end
end
if getTrainersDataMode != @current_game_mode
pbMessage(_INTL("The game was mode changed - Reshuffling trainers."))
Kernel.pbShuffleTrainers
@manually_changed_gamemode = false
end
super
end
end
@@ -39,10 +39,10 @@ def download_file(url, saveLocation)
File.open(saveLocation, "wb") do |file|
file.write(response[:body])
end
echoln _INTL("\nDownloaded file {1} to {2}", url, saveLocation)
echoln "\nDownloaded file #{url} to #{saveLocation}"
return saveLocation
else
echoln _INTL("Failed to download file {1}", url)
echoln "Failed to download file #{url}"
end
return nil
rescue MKXPError, Errno::ENOENT => error
@@ -44,10 +44,30 @@
# end
# }
class PokemonSystem
attr_accessor :current_game_version
end
def onLoadExistingGame()
migrateOldSavesToCharacterCustomization()
clear_all_images()
loadDateSpecificChanges()
checkGameVersionUpdate()
$PokemonSystem.overworld_encounters = false if Settings::KANTO
end
def checkGameVersionUpdate
if $PokemonSystem.current_game_version != Settings::GAME_VERSION_NUMBER
echoln "invalidating cache!"
invalidate_sprite_cache
$PokemonSystem.current_game_version = Settings::GAME_VERSION_NUMBER
end
end
def invalidate_sprite_cache
spritesLoader = BattleSpriteLoader.new
spritesLoader.clear_sprites_cache(:CUSTOM)
spritesLoader.clear_sprites_cache(:BASE)
end
def loadDateSpecificChanges()
@@ -57,7 +77,21 @@ def loadDateSpecificChanges()
end
end
def onStartingNewGame() end
def onStartingNewGame()
set_starting_options
end
def set_starting_options
if Settings::HOENN
$PokemonSystem.overworld_encounters= true
$PokemonSystem.use_generated_dex_entries=true
$PokemonGlobal.runningShoes=true
end
if $PokemonSystem.obtained_transfer_box
addPokemonStorageTransferBox
end
end
def migrateOldSavesToCharacterCustomization()
if !$Trainer.unlocked_clothes
@@ -234,11 +268,26 @@ end
#
#===============================================================================
class PokemonLoad_Scene
def pbChoose(commands, continue_idx)
@sprites["cmdwindow"].commands = commands
@language_option_selected = false unless defined?(@language_option_selected)
loop do
Graphics.update
Input.update
if @language_option_selected
result = pbUpdateLanguageOption(continue_idx, commands)
return result if result
next
end
if @sprites["cmdwindow"].index == continue_idx && Input.trigger?(Input::UP) && @show_language_option
pbPlayCursorSE
pbEnterLanguageOption(continue_idx)
next
end
pbUpdate
if Input.trigger?(Input::USE)
return @sprites["cmdwindow"].index
@@ -257,7 +306,55 @@ class PokemonLoad_Scene
end
end
# Called when the player presses UP while on Continue, to enter language-icon mode.
def pbEnterLanguageOption(continue_idx)
@language_option_selected = true
@sprites["cmdwindow"].active = false
@sprites["leftarrow"].visible = false
@sprites["rightarrow"].visible = false
@sprites["panel#{continue_idx}"].selected = false if @sprites["panel#{continue_idx}"]
@sprites["panel#{continue_idx}"].pbRefresh if @sprites["panel#{continue_idx}"]
pbUpdate
end
# Handles input while language-icon mode is active.
# Returns -4 if the player confirmed (caller should return this from pbChoose).
# Returns nil otherwise (caller should just `next` the loop).
def pbUpdateLanguageOption(continue_idx, commands)
@sprites["langicon"].bitmap = Bitmap.new(ICON_LANGUAGE_SELECTED) rescue nil
if Input.trigger?(Input::DOWN)
pbPlayCursorSE
@language_option_selected = false
@sprites["langicon"].bitmap = Bitmap.new(ICON_LANGUAGE) rescue nil
@sprites["cmdwindow"].active = true
@sprites["panel#{continue_idx}"].selected = true if @sprites["panel#{continue_idx}"]
@sprites["panel#{continue_idx}"].pbRefresh if @sprites["panel#{continue_idx}"]
return nil
elsif Input.trigger?(Input::UP)
pbPlayCursorSE
@language_option_selected = false
@sprites["langicon"].bitmap = Bitmap.new(ICON_LANGUAGE) rescue nil
last_index = commands.length - 1
oldi = @sprites["cmdwindow"].index
@sprites["cmdwindow"].index = last_index
@sprites["cmdwindow"].active = true
pbSelectPanel(oldi, last_index)
return nil
elsif Input.trigger?(Input::USE)
@language_option_selected = false
return -4
end
pbUpdate
return nil
end
ICON_LANGUAGE = "Graphics/Icons/mainMenu/LANGUAGE"
ICON_LANGUAGE_SELECTED = "Graphics/Icons/mainMenu/LANGUAGE_sel"
def pbStartScene(commands, show_continue, trainer, frame_count, map_id)
@commands = commands
@sprites = {}
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@@ -289,6 +386,16 @@ class PokemonLoad_Scene
@sprites["cmdwindow"] = Window_CommandPokemon.new([])
@sprites["cmdwindow"].viewport = @viewport
@sprites["cmdwindow"].visible = false
@show_language_option = Settings::LANGUAGES[Settings::GAME_ID].length >= 2
@language_option_selected= false
if @show_language_option
@sprites["langicon"] = Sprite.new(@viewport)
@sprites["langicon"].bitmap = Bitmap.new(ICON_LANGUAGE)
@sprites["langicon"].x=12
@sprites["langicon"].y = 4
end
end
end
@@ -430,9 +537,13 @@ class PokemonLoadScreen
pbMessage(_INTL("Version {1} is now available! Please use the game's installer to download the newest version. Check the Discord for more information.", newer_version))
end
if Settings::STARTUP_MESSAGES != ""
pbMessage(_INTL(Settings::STARTUP_MESSAGES))
if Settings::STARTUP_MESSAGES_KANTO != "" && Settings::KANTO
pbMessage(_INTL(Settings::STARTUP_MESSAGES_KANTO))
end
if Settings::STARTUP_MESSAGES_HOENN != "" && Settings::HOENN
pbMessage(_INTL(Settings::STARTUP_MESSAGES_HOENN))
end
if ($game_temp.unimportedSprites && $game_temp.unimportedSprites.size > 0)
handleReplaceExistingSprites()
end
@@ -459,27 +570,43 @@ class PokemonLoadScreen
cmd_language = -1
cmd_mystery_gift = -1
cmd_debug = -1
cmd_savefile = -1
cmd_quit = -1
cmd_lang_icon = -4
show_continue = !@save_data.empty?
new_game_plus = show_continue && (@save_data[:player].new_game_plus_unlocked || $DEBUG)
if show_continue
commands[cmd_continue = commands.length] = "#{@selected_file}"
if @save_data[:player].mystery_gift_unlocked
commands[cmd_mystery_gift = commands.length] = _INTL('Mystery Gift') # Honestly I have no idea how to make Mystery Gift work well with this.
end
#if @save_data[:player].mystery_gift_unlocked
commands[cmd_mystery_gift = commands.length] = _INTL("Mystery Gift")
#end
end
commands[cmd_new_game = commands.length] = _INTL('New Game')
commands[cmd_new_game = commands.length] = _INTL("New Game")
if new_game_plus
commands[cmd_new_game_plus = commands.length] = _INTL('New Game +')
commands[cmd_new_game_plus = commands.length] = _INTL("New Game +")
end
commands[cmd_options = commands.length] = _INTL('Options')
commands[cmd_language = commands.length] = _INTL('Language') if Settings::LANGUAGES.length >= 2
commands[cmd_discord = commands.length] = _INTL('Discord')
commands[cmd_wiki = commands.length] = _INTL('Wiki')
commands[cmd_debug = commands.length] = _INTL('Debug') if $DEBUG
commands[cmd_quit = commands.length] = _INTL('Quit Game')
commands[cmd_options = commands.length] = _INTL("Options")
#commands[cmd_language = commands.length] = _INTL("Language") if Settings::LANGUAGES[Settings::GAME_ID].length >= 2
cmd_links = {}
# if Settings::HOENN && new_game_plus && !Settings::FEEDBACK_FORM_URL.empty?
# cmd_links[commands.length] = Settings::FEEDBACK_FORM_URL
# commands[commands.length] = _INTL("Game Feedback Form")
# end
Settings::MAIN_MENU_LINKS.each do |key, value|
cmd_links[commands.length] = value
commands[commands.length] = _INTL(key)
end
# commands[cmd_discord = commands.length] = _INTL("Discord")
# commands[cmd_wiki = commands.length] = _INTL("Wiki")
commands[cmd_savefile = commands.length] = _INTL("Savefile management") if show_continue
commands[cmd_debug = commands.length] = _INTL("Debug") if $DEBUG
commands[cmd_quit = commands.length] = _INTL("Quit Game")
cmd_left = -3
cmd_right = -2
@@ -489,11 +616,11 @@ class PokemonLoadScreen
@scene.pbSetParty(@save_data[:player]) if show_continue
if first_time
@scene.pbStartScene2
pbBGMPlay("pokemon_go_map") if Settings::HOENN
first_time = false
else
@scene.pbUpdate
end
loop do
# Inner loop is used for going to other menus and back and stuff (vanilla)
command = @scene.pbChoose(commands, cmd_continue)
@@ -523,10 +650,6 @@ class PokemonLoadScreen
initialize_alt_sprite_substitutions()
@save_data[:player].new_game_plus_unlocked = true
return
when cmd_discord
openUrlInBrowser(Settings::DISCORD_URL)
when cmd_wiki
openUrlInBrowser(Settings::WIKI_URL)
when cmd_mystery_gift
pbFadeOutIn { pbDownloadMysteryGift(@save_data[:player]) }
when cmd_options
@@ -535,16 +658,24 @@ class PokemonLoadScreen
screen = PokemonOptionScreen.new(scene)
screen.pbStartScreen(true)
end
when cmd_language
when cmd_lang_icon
@scene.pbEndScene
$PokemonSystem.language = pbChooseLanguage
pbLoadMessages('Data/' + Settings::LANGUAGES[$PokemonSystem.language][1])
MessageConfig.pbResetSystemFontName
pbLoadMessages('Data/' + Settings::LANGUAGES[Settings::GAME_ID][$PokemonSystem.language][1])
if show_continue
@save_data[:pokemon_system] = $PokemonSystem
File.open(SaveData.get_full_path(@selected_file), 'wb') { |file| Marshal.dump(@save_data, file) }
end
$scene = pbCallTitle
return
when cmd_savefile
save_data_to_load = savefileOptions(SaveData.get_full_path(@selected_file))
if save_data_to_load
@scene.pbEndScene
Game.load(save_data_to_load)
return
end
when cmd_debug
pbFadeOutIn { pbDebugMenu(false) }
when cmd_quit
@@ -561,11 +692,101 @@ class PokemonLoadScreen
@selected_file = SaveData.get_next_slot(save_file_list, @selected_file)
break # to outer loop
else
pbPlayBuzzerSE
if cmd_links.key?(command)
openUrlInBrowser(cmd_links[command])
else
pbPlayBuzzerSE
end
end
end
end
end
def savefileOptions(selected_file)
cmd_cancel = _INTL("Cancel")
cmd_loadBackup = _INTL("Load an older backup")
cmd_delete = _INTL("Delete this savefile")
commands = [cmd_cancel, cmd_loadBackup, cmd_delete]
choice = optionsMenu(commands,0)
case commands[choice]
when cmd_loadBackup
echoln selected_file
return load_specific_backup(selected_file)
when cmd_delete
delete_savefile_menu(selected_file)
return nil
end
end
def delete_savefile_menu(selected_file)
file_name= File.basename(selected_file)
pbMessage(_INTL("\\C[2]WARNING: You are trying to delete {1}.",file_name))
if pbConfirmMessageSerious(_INTL("\\C[2]This operation cannot be undone. Do you still wish to continue?"))
confirm_text = pbEnterText(_INTL("Type DELETE to continue."),0,10)
if confirm_text == "DELETE"
self.delete_save_data(selected_file)
pbMessage(_INTL("The game will now close automatically."))
exit
else
pbMessage(_INTL("The savefile was NOT deleted."))
end
end
end
def load_specific_backup(file_path)
file_name = File.basename(file_path, ".rxdata")
save_folder = File.dirname(file_path)
backup_dir = File.join(save_folder, "backups", file_name)
unless Dir.exist?(backup_dir)
pbMessage(_INTL("No backup folder found for this save file."))
return nil
end
backups = Dir.children(backup_dir).select { |f|
f.start_with?(file_name + "_") && f.end_with?(".rxdata")
}
if backups.empty?
pbMessage(_INTL("No backups found for this save file."))
return nil
end
# Sort by timestamp, newest first
backups.sort_by! do |fname|
timestamp = fname.sub(/^#{Regexp.escape(file_name)}_/, "").sub(/\.rxdata$/, "")
timestamp.to_i
end.reverse!
# Build menu options
backup_options = backups.map do |fname|
timestamp_str = fname.sub(/^#{Regexp.escape(file_name)}_/, "").sub(/\.rxdata$/, "")
timestamp_str.length >= 12 ? formatSaveDate(timestamp_str) : timestamp_str
end
backup_options << _INTL("Cancel")
choice = optionsMenu(backup_options, backup_options.length - 1)
# Cancelled or out of range
return nil if choice < 0 || choice >= backups.length
chosen_file = backups[choice]
chosen_date = backup_options[choice]
return nil unless pbConfirmMessage(_INTL("Load the backup from {1}?", chosen_date))
backup_path = File.join(backup_dir, chosen_file)
save_data = SaveData.read_from_file(backup_path) rescue nil
unless SaveData.valid?(save_data)
pbMessage(_INTL("This backup appears to be corrupt and could not be loaded."))
return nil
end
return save_data
end
end
#===============================================================================
@@ -610,7 +831,7 @@ class PokemonSaveScreen
_INTL("Save to another slot"),
_INTL("Don't save")
]
opt = pbMessage(_INTL('Would you like to save the game?'), choices, 3)
opt = pbMessage(_INTL("Would you like to save the game?"), choices, 3)
if opt == 0
pbSEPlay('GUI save choice')
ret = doSave($Trainer.save_slot)
@@ -759,6 +980,11 @@ module Game
if ngp_trainer
$Trainer.unlocked_hats = ngp_trainer.unlocked_hats
$Trainer.unlocked_clothes = ngp_trainer.unlocked_clothes
if Settings::HOENN
$Trainer.pokenav = Pokenav.new
$Trainer.pokenav&.installed_apps = ngp_trainer.pokenav&.installed_apps
end
end
$Trainer.new_game_plus_unlocked = ngp_unlocked
end
@@ -781,9 +1007,12 @@ module Game
# Set resize factor
pbSetResizeFactor([$PokemonSystem.screensize, 4].min)
# Set language (and choose language if there is no save file)
if Settings::LANGUAGES.length >= 2
if Settings::LANGUAGES[Settings::GAME_ID].length >= 2
$PokemonSystem.language = pbChooseLanguage if save_data.empty?
pbLoadMessages('Data/' + Settings::LANGUAGES[$PokemonSystem.language][1])
available_languages = Settings::LANGUAGES[Settings::GAME_ID]
$PokemonSystem.language = 0 if $PokemonSystem.language > available_languages.length-1
pbLoadMessages('Data/' + available_languages[$PokemonSystem.language][1])
end
end
@@ -28,6 +28,9 @@ class PokemonTemp
attr_accessor :speechbubble_talking
attr_accessor :speechbubble_alwaysDown
attr_accessor :speechbubble_alwaysUp
attr_accessor :windowSkin
end
module MessageConfig
@@ -91,13 +94,13 @@ def pbRepositionMessageWindow(msgwindow, linecount=2)
msgwindow.setSkin("Graphics/windowskins/frlgtextskin")
msgwindow.height = 102
msgwindow.width = Graphics.width
if ($game_player.direction==8 && !$PokemonTemp.speechbubble_alwaysDown) || $PokemonTemp.speechbubble_alwaysUp
if ($game_player.direction==DIRECTION_UP && !$PokemonTemp.speechbubble_alwaysDown) || $PokemonTemp.speechbubble_alwaysUp
$PokemonTemp.speechbubble_vp = Viewport.new(0, 0, Graphics.width, 280)
msgwindow.y = 6
else
$PokemonTemp.speechbubble_vp = Viewport.new(0, 6 + msgwindow.height, Graphics.width, 280)
msgwindow.y = (Graphics.height - msgwindow.height) - 6
if $PokemonTemp.speechbubble_outofrange==true
if $PokemonTemp.speechbubble_outofrange==true && !$PokemonTemp.speechbubble_alwaysDown
msgwindow.y = 6
end
end
@@ -168,6 +171,7 @@ def pbCreateMessageWindow(viewport=nil,skin=nil)
arrow.zoom_y = 2
end
end
arrow.bitmap=nil if $PokemonTemp.speechbubble_outofrange && arrow
$PokemonTemp.speechbubble_arrow = arrow
msgwindow=Window_AdvancedTextPokemon.new("")
if !viewport
@@ -204,14 +208,34 @@ def pbCallBubDown(status=0,value=0)
end
#always_down, always_up is not ideal but used everywhere in game so too late to change
def pbCallBub(status=0,value=0,always_down=false, always_up=false)
def pbCallBub(status=0, event_id=0, always_down=false, always_up=false)
begin
$PokemonTemp.speechbubble_talking=get_character(value).id if status<3
$PokemonTemp.speechbubble_bubble=status
$PokemonTemp.speechbubble_alwaysDown=always_down
$PokemonTemp.speechbubble_alwaysUp=always_up
if status < 3
if event_id.is_a?(Integer)
char = $game_map.events[event_id]
$PokemonTemp.speechbubble_talking = char ? char.id : event_id
else
$PokemonTemp.speechbubble_talking = get_character(event_id).id
end
end
$PokemonTemp.speechbubble_bubble = status
$PokemonTemp.speechbubble_alwaysDown = always_down
$PokemonTemp.speechbubble_alwaysUp = always_up
rescue
return #Let's not crash the game if error
return
end
end
def setSign(type=:NORMAL)
case type
when :NORMAL
setWindowSkin("sign_normal")
when :WOOD
setWindowSkin("sign_wood")
when :WALL
setWindowSkin("sign_wall")
end
end
def setWindowSkin(skin)
$PokemonTemp.windowSkin=skin
end
@@ -1,4 +1,3 @@
#==============================================================================#
# Better Fast-forward Mode #
# v1.0 #
@@ -28,8 +27,7 @@ PluginManager.register({
})
# When the user clicks F, it'll pick the next number in this array.
SPEEDUP_STAGES = [1,2,3]
SPEEDUP_STAGES = [1, 2, 3]
def pbAllowSpeedup
$CanToggle = true
@@ -50,7 +48,11 @@ module Graphics
end
def self.update
if $CanToggle && Input.trigger?(Input::AUX1)
# if $DEBUG && Input.trigger?(Input::AUX1)
# spawn_random_overworld_pokemon_group
# end
if $CanToggle && Input.trigger?(Input::X)
$GameSpeed += 1
$GameSpeed = 0 if $GameSpeed >= SPEEDUP_STAGES.size
end
@@ -59,13 +61,44 @@ module Graphics
speedStage = SPEEDUP_STAGES[$GameSpeed]
else
speedStage = 1
if Input.press?(Input::AUX1) && $CanToggle
$PokemonSystem.speedup_speed = Settings::DEFAULT_SPEED_UP_SPEED if !$PokemonSystem.speedup_speed || $PokemonSystem.speedup_speed==0
speedStage=$PokemonSystem.speedup_speed+1
if Input.press?(Input::X) && $CanToggle
speedStage = self.get_speedup_speed + 1
end
end
return unless $frame % speedStage == 0
fast_forward_update
$frame = 0
end
#TODO: For compatibility with set controls screen
# def self.update
# if $CanToggle && Input.trigger?(Input::AUX3)
# $GameSpeed += 1
# $GameSpeed = 0 if $GameSpeed >= SPEEDUP_STAGES.size
# end
# $frame += 1
# if $PokemonSystem && $PokemonSystem.speedup == 1
# speedStage = SPEEDUP_STAGES[$GameSpeed]
# else
# speedStage = 1
# if Input.press?(Input::AUX3) && $CanToggle
# speedStage = self.get_speedup_speed + 1
# end
# end
# return unless $frame % speedStage == 0
# fast_forward_update
# $frame = 0
# end
def self.get_speedup_speed
$PokemonSystem.speedup_speed = Settings::DEFAULT_SPEED_UP_SPEED if !$PokemonSystem.speedup_speed || $PokemonSystem.speedup_speed == 0
$PokemonSystem.speedup_speed_battles = Settings::DEFAULT_SPEED_UP_SPEED if !$PokemonSystem.speedup_speed_battles || $PokemonSystem.speedup_speed_battles == 0
if $game_temp.in_battle
return $PokemonSystem.speedup_speed_battles
else
return $PokemonSystem.speedup_speed
end
end
end
@@ -24,17 +24,20 @@ class PokemonTemp
@silhouetteDirection = nil
end
def createTempEvent(eventTemplateID, map_id, position = [0, 0],direction=nil)
def createTempEvent(eventTemplateID, map_id, position = [0, 0],direction=nil, event_class = Game_Event)
return unless $scene.is_a?(Scene_Map)
template_event = $MapFactory.getMap(MAP_TEMPLATE_EVENTS,false).events[eventTemplateID]
key_id = ($game_map.events.keys.max || -1) + 1
rpgEvent= template_event.event.dup
rpgEvent.id = key_id
gameEvent = Game_Event.new($game_map.map_id, rpgEvent, $game_map)
gameEvent = event_class.new($game_map.map_id, rpgEvent, $game_map)
gameEvent.moveto(position[0], position[1])
gameEvent.direction = direction if direction
yield gameEvent if block_given?
registerTempEvent(map_id, gameEvent)
$game_map.events[key_id] = gameEvent
@@ -54,7 +54,11 @@
# :credits => "FL"
# })
# end
#
class Game_Temp
attr_accessor :faster_time
end
module UnrealTime
# Set false to disable this system (returns Time.now)
ENABLED = true
@@ -63,7 +67,6 @@ module UnrealTime
# So if it is 100, one second in real time will be 100 seconds in game.
# If it is 60, one second in real time will be one minute in game.
PROPORTION = 60
# Starting on Essentials v17, the map tone only try to refresh tone each 30
# real time seconds.
# If this variable number isn't -1, the game use this number instead of 30.
@@ -87,7 +90,7 @@ module UnrealTime
# Choose switch number that when true the time won't pass (or -1 to cancel).
# Only works if TIME_STOPS=true.
SWITCH_STOPS = -1
SWITCH_STOPS = SWITCH_TIME_PAUSED
# Choose variable(s) number(s) that can hold time passage (or -1 to cancel).
# Look at description for more details.
@@ -132,10 +135,18 @@ module UnrealTime
# Does the same thing as EXTRA_SECONDS variable.
def self.add_seconds(seconds)
raise "Method doesn't work when TIME_STOPS is false!" if !TIME_STOPS
$PokemonGlobal.newFrameCount += (seconds * Graphics.frame_rate) / PROPORTION.to_f
$PokemonGlobal.newFrameCount += (seconds * Graphics.frame_rate) / UnrealTime.proportion.to_f
PBDayNight.sheduleToneRefresh
end
def self.proportion
if $game_temp.faster_time
return UnrealTime::PROPORTION*$game_temp.faster_time
else
return UnrealTime::PROPORTION
end
end
def self.add_days(days)
add_seconds(60 * 60 * 24 * days)
end
@@ -178,6 +189,16 @@ def getDayOfTheWeek()
return UnrealTime::WEEK_DAYS[day_of_week]
end
def getDayOfTheWeekName(day = getDayOfTheWeek())
return _INTL("Monday") if day == :MONDAY
return _INTL("Tuesday") if day == :TUESDAY
return _INTL("Wednesday") if day == :WEDNESDAY
return _INTL("Thursday") if day == :THURSDAY
return _INTL("Friday") if day == :FRIDAY
return _INTL("Saturday") if day == :SATURDAY
return _INTL("Sunday")
end
def isDayOfTheWeek(day)
return day == getDayOfTheWeek()
end
@@ -243,12 +264,19 @@ if UnrealTime::ENABLED
attr_accessor :newFrameCount # Became float when using extra values
attr_accessor :extraYears
# def addNewFrameCount
# return if (UnrealTime::SWITCH_STOPS > 0 &&
# $game_switches[UnrealTime::SWITCH_STOPS])
# self.newFrameCount += 1
# end
def addNewFrameCount
return if (UnrealTime::SWITCH_STOPS > 0 &&
$game_switches[UnrealTime::SWITCH_STOPS])
self.newFrameCount += 1
return if (UnrealTime::SWITCH_STOPS > 0 && $game_switches[UnrealTime::SWITCH_STOPS])
mult = $game_temp&.faster_time
mult = 1 if !mult || mult <= 0
self.newFrameCount += mult
end
def newFrameCount
@newFrameCount = 0 if !@newFrameCount
return @newFrameCount
@@ -290,4 +318,4 @@ if UnrealTime::ENABLED
end
end
end
end
end