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
# met via a fateful encounter.
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
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

View File

@@ -444,18 +444,27 @@ end
# Pokémon party visuals
#===============================================================================
class PokemonParty_Scene
def pbStartScene(party,starthelptext,annotations=nil,multiselect=false)
def pbStartScene(party, starthelptext, annotations = nil, multiselect = false, can_access_storage = false)
@sprites = {}
@party = party
@viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z = 99999
@multiselect = multiselect
@can_access_storage = can_access_storage
addBackgroundPlane(@sprites,"partybg","Party/bg",@viewport)
@sprites["messagebox"] = Window_AdvancedTextPokemon.new("")
@sprites["messagebox"].viewport = @viewport
@sprites["messagebox"].visible = false
@sprites["messagebox"].letterbyletter = true
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"].viewport = @viewport
@sprites["helpwindow"].visible = true
@@ -719,7 +728,15 @@ class PokemonParty_Scene
end
end
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
return [1,@activecmd]
elsif Input.trigger?(Input::ACTION) && canswitch==2
@@ -1131,8 +1148,16 @@ class PokemonPartyScreen
end
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,
(@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
@scene.pbSetHelpText((@party.length>1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
pkmnid = @scene.pbChoosePokemon(false,-1,1)

View File

@@ -6517,6 +6517,14 @@ Price = 0
Flags = KeyItem
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]
Name = Aurora Ticket
NamePlural = Aurora Tickets

View File

@@ -6517,6 +6517,14 @@ Price = 0
Flags = KeyItem
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]
Name = Aurora Ticket
NamePlural = Aurora Tickets

View File

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