mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-07-22 07:37:00 +00:00
Update 6.8
This commit is contained in:
@@ -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."))
|
||||
|
||||
Reference in New Issue
Block a user