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
@@ -61,7 +61,37 @@ module PokemonSelection
return ret
end
def self.choose(min=1, max=6, canCancel=false, acceptFainted=false, ableproc=nil)
def self.force(party_indexes = [])
if $PokemonGlobal.pokemonSelectionOriginalParty
PokemonSelection.restore
echoln "Can't choose a new party until the old one is restored"
return false
end
party_indexes = party_indexes.compact.uniq
if party_indexes.empty?
echoln "No party indexes provided."
return false
end
new_party = []
party_indexes.each do |i|
if i < 0 || i >= $Trainer.party.length
echoln "Invalid party index: #{i}"
return false
end
new_party << $Trainer.party[i]
end
if new_party.size != $Trainer.party.size
$PokemonGlobal.pokemonSelectionOriginalParty = $Trainer.party
end
$Trainer.party = new_party
pbBattleChallenge.pbCancel
return true
end
#indexedVar Optionally store the indexes of the chosen pokemon in that variable
def self.choose(min=1, max=6, canCancel=false, acceptFainted=false, ableproc=nil, indexesVar=nil)
if $PokemonGlobal.pokemonSelectionOriginalParty
PokemonSelection.restore
echoln "Can't choose a new party until restore the old one"
@@ -69,7 +99,7 @@ module PokemonSelection
validPartyChosen=false
pbBattleChallenge.set("pokemonSelectionRules",7,self.rules(min,max))
loop do
pbEntryScreen(ableproc)
pbEntryScreen(ableproc,indexesVar)
validPartyChosen=(pbBattleChallenge.getParty!=nil)
break if(canCancel || validPartyChosen)
Kernel.pbMessage(_INTL("Choose a Pokémon."))