Added effect of Pokémon Box Link

This commit is contained in:
Maruno17
2021-09-12 21:08:46 +01:00
parent f9c6e142e5
commit f00f030825
6 changed files with 57 additions and 8 deletions

View File

@@ -320,6 +320,10 @@ module Settings
# The Game Switch which, while ON, makes all Pokémon created considered to be # The Game Switch which, while ON, makes all Pokémon created considered to be
# met via a fateful encounter. # met via a fateful encounter.
FATEFUL_ENCOUNTER_SWITCH = 32 FATEFUL_ENCOUNTER_SWITCH = 32
# The Game Switch which, while ON, disables the effect of the Pokémon Box Link
# and prevents the player from accessing Pokémon storage via the party screen
# with it.
DISABLE_BOX_LINK_SWITCH = 35
#============================================================================= #=============================================================================

View File

@@ -388,9 +388,4 @@ When holder's stat(s) is lowered, consume item and holder switches out. Not
triggered by Parting Shot, or if a faster mon's Eject Button/Eject Pack triggered by Parting Shot, or if a faster mon's Eject Button/Eject Pack
triggers. triggers.
Pokémon Box Link
Key item, unusable. Enables pressing a button while in the party screen to open
the "Organise Boxes" mode of Pokémon storage. This is disabled at certain times,
perhaps when a Game Switch is on.
=end =end

View File

@@ -444,18 +444,27 @@ end
# Pokémon party visuals # Pokémon party visuals
#=============================================================================== #===============================================================================
class PokemonParty_Scene class PokemonParty_Scene
def pbStartScene(party,starthelptext,annotations=nil,multiselect=false) def pbStartScene(party, starthelptext, annotations = nil, multiselect = false, can_access_storage = false)
@sprites = {} @sprites = {}
@party = party @party = party
@viewport = Viewport.new(0,0,Graphics.width,Graphics.height) @viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
@multiselect = multiselect @multiselect = multiselect
@can_access_storage = can_access_storage
addBackgroundPlane(@sprites,"partybg","Party/bg",@viewport) addBackgroundPlane(@sprites,"partybg","Party/bg",@viewport)
@sprites["messagebox"] = Window_AdvancedTextPokemon.new("") @sprites["messagebox"] = Window_AdvancedTextPokemon.new("")
@sprites["messagebox"].viewport = @viewport @sprites["messagebox"].viewport = @viewport
@sprites["messagebox"].visible = false @sprites["messagebox"].visible = false
@sprites["messagebox"].letterbyletter = true @sprites["messagebox"].letterbyletter = true
pbBottomLeftLines(@sprites["messagebox"],2) pbBottomLeftLines(@sprites["messagebox"],2)
@sprites["storagetext"] = Window_UnformattedTextPokemon.new(
@can_access_storage ? _INTL("[Special]: To Boxes") : "")
@sprites["storagetext"].x = 32
@sprites["storagetext"].y = Graphics.height - @sprites["messagebox"].height - 16
@sprites["storagetext"].viewport = @viewport
@sprites["storagetext"].baseColor = Color.new(248, 248, 248)
@sprites["storagetext"].shadowColor = Color.new(0, 0, 0)
@sprites["storagetext"].windowskin = nil
@sprites["helpwindow"] = Window_UnformattedTextPokemon.new(starthelptext) @sprites["helpwindow"] = Window_UnformattedTextPokemon.new(starthelptext)
@sprites["helpwindow"].viewport = @viewport @sprites["helpwindow"].viewport = @viewport
@sprites["helpwindow"].visible = true @sprites["helpwindow"].visible = true
@@ -719,7 +728,15 @@ class PokemonParty_Scene
end end
end end
cancelsprite = Settings::MAX_PARTY_SIZE + ((@multiselect) ? 1 : 0) cancelsprite = Settings::MAX_PARTY_SIZE + ((@multiselect) ? 1 : 0)
if Input.trigger?(Input::ACTION) && canswitch==1 && @activecmd!=cancelsprite if Input.trigger?(Input::SPECIAL) && @can_access_storage && canswitch != 2
pbPlayDecisionSE
pbFadeOutIn {
scene = PokemonStorageScene.new
screen = PokemonStorageScreen.new(scene, $PokemonStorage)
screen.pbStartScreen(0)
pbHardRefresh
}
elsif Input.trigger?(Input::ACTION) && canswitch==1 && @activecmd!=cancelsprite
pbPlayDecisionSE pbPlayDecisionSE
return [1,@activecmd] return [1,@activecmd]
elsif Input.trigger?(Input::ACTION) && canswitch==2 elsif Input.trigger?(Input::ACTION) && canswitch==2
@@ -1131,8 +1148,16 @@ class PokemonPartyScreen
end end
def pbPokemonScreen def pbPokemonScreen
can_access_storage = false
if GameData::Item.exists?(:POKEMONBOXLINK) && $PokemonBag.pbHasItem?(:POKEMONBOXLINK)
if !$game_switches[Settings::DISABLE_BOX_LINK_SWITCH] &&
!$game_map.metadata&.has_flag?("DisableBoxLink")
can_access_storage = true
end
end
@scene.pbStartScene(@party, @scene.pbStartScene(@party,
(@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."),nil) (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."),
nil, false, can_access_storage)
loop do loop do
@scene.pbSetHelpText((@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")) @scene.pbSetHelpText((@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
pkmnid = @scene.pbChoosePokemon(false,-1,1) pkmnid = @scene.pbChoosePokemon(false,-1,1)

View File

@@ -6517,6 +6517,14 @@ Price = 0
Flags = KeyItem Flags = KeyItem
Description = This ring contains an untold power that somehow enables Pokémon carrying Mega Stones to Mega Evolve. Description = This ring contains an untold power that somehow enables Pokémon carrying Mega Stones to Mega Evolve.
#------------------------------- #-------------------------------
[POKEMONBOXLINK]
Name = Pokémon Box Link
NamePlural = Pokémon Box Links
Pocket = 8
Price = 0
Flags = KeyItem
Description = A device that allows you to access the Pokémon storage system. There are some places where it won't work.
#-------------------------------
[AURORATICKET] [AURORATICKET]
Name = Aurora Ticket Name = Aurora Ticket
NamePlural = Aurora Tickets NamePlural = Aurora Tickets

View File

@@ -6517,6 +6517,14 @@ Price = 0
Flags = KeyItem Flags = KeyItem
Description = This ring contains an untold power that somehow enables Pokémon carrying Mega Stones to Mega Evolve. Description = This ring contains an untold power that somehow enables Pokémon carrying Mega Stones to Mega Evolve.
#------------------------------- #-------------------------------
[POKEMONBOXLINK]
Name = Pokémon Box Link
NamePlural = Pokémon Box Links
Pocket = 8
Price = 0
Flags = KeyItem
Description = A device that allows you to access the Pokémon storage system. There are some places where it won't work.
#-------------------------------
[AURORATICKET] [AURORATICKET]
Name = Aurora Ticket Name = Aurora Ticket
NamePlural = Aurora Tickets NamePlural = Aurora Tickets

View File

@@ -63,6 +63,7 @@ MapPosition = 0,14,10
MapPosition = 0,13,10 MapPosition = 0,13,10
BattleBack = indoor3 BattleBack = indoor3
Environment = Rock Environment = Rock
Flags = DisableBoxLink
#------------------------------- #-------------------------------
[011] [011]
# Pokémon Institute # Pokémon Institute
@@ -184,10 +185,12 @@ MapPosition = 0,13,6
# Pokémon League # Pokémon League
MapPosition = 0,13,6 MapPosition = 0,13,6
BattleBack = elite1 BattleBack = elite1
Flags = DisableBoxLink
#------------------------------- #-------------------------------
[038] [038]
# Hall of Fame # Hall of Fame
MapPosition = 0,13,6 MapPosition = 0,13,6
Flags = DisableBoxLink
#------------------------------- #-------------------------------
[039] [039]
# Route 4 # Route 4
@@ -292,6 +295,7 @@ MapPosition = 0,17,10
# Battle Tower arena # Battle Tower arena
MapPosition = 0,17,10 MapPosition = 0,17,10
BattleBack = indoor1 BattleBack = indoor1
Flags = DisableBoxLink
#------------------------------- #-------------------------------
[057] [057]
# Stadium Cup lobby # Stadium Cup lobby
@@ -305,6 +309,7 @@ MapPosition = 0,17,10
# Battle Palace arena # Battle Palace arena
MapPosition = 0,17,10 MapPosition = 0,17,10
BattleBack = indoor1 BattleBack = indoor1
Flags = DisableBoxLink
#------------------------------- #-------------------------------
[060] [060]
# Battle Arena # Battle Arena
@@ -314,6 +319,7 @@ MapPosition = 0,17,10
# Battle Arena arena # Battle Arena arena
MapPosition = 0,17,10 MapPosition = 0,17,10
BattleBack = indoor1 BattleBack = indoor1
Flags = DisableBoxLink
#------------------------------- #-------------------------------
[062] [062]
# Battle Factory # Battle Factory
@@ -322,15 +328,18 @@ MapPosition = 0,17,10
[063] [063]
# Battle Factory intro corridor # Battle Factory intro corridor
MapPosition = 0,17,10 MapPosition = 0,17,10
Flags = DisableBoxLink
#------------------------------- #-------------------------------
[064] [064]
# Battle Factory arena # Battle Factory arena
MapPosition = 0,17,10 MapPosition = 0,17,10
BattleBack = indoor1 BattleBack = indoor1
Flags = DisableBoxLink
#------------------------------- #-------------------------------
[065] [065]
# Battle Factory corridor # Battle Factory corridor
MapPosition = 0,17,10 MapPosition = 0,17,10
Flags = DisableBoxLink
#------------------------------- #-------------------------------
[066] [066]
# Safari Zone # Safari Zone