mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 14:44:58 +00:00
Many more Rubocop-inspired code improvements
This commit is contained in:
@@ -197,12 +197,8 @@ class BattleChallengeData
|
||||
end
|
||||
|
||||
def setParty(value)
|
||||
if @inProgress
|
||||
$player.party = value
|
||||
@party = value
|
||||
else
|
||||
@party = value
|
||||
end
|
||||
$player.party = value if @inProgress
|
||||
@party = value
|
||||
end
|
||||
|
||||
def pbStart(t, numRounds)
|
||||
|
||||
@@ -87,7 +87,7 @@ def pbOrganizedBattleEx(opponent, challengedata, endspeech, endspeechwin)
|
||||
end
|
||||
# Save the record of the battle
|
||||
$game_temp.last_battle_record = nil
|
||||
if decision == 1 || decision == 2 || decision == 5 # if win, loss or draw
|
||||
if [1, 2, 5].include?(decision) # if win, loss or draw
|
||||
$game_temp.last_battle_record = battle.pbDumpRecord
|
||||
end
|
||||
case decision
|
||||
|
||||
@@ -104,9 +104,10 @@ class BattleSwapScene
|
||||
def pbUpdateChoices(choices)
|
||||
commands = pbGetCommands(@rentals, choices)
|
||||
@choices = choices
|
||||
if choices.length == 0
|
||||
case choices.length
|
||||
when 0
|
||||
@sprites["help"].text = _INTL("Choose the first Pokémon.")
|
||||
elsif choices.length == 1
|
||||
when 1
|
||||
@sprites["help"].text = _INTL("Choose the second Pokémon.")
|
||||
else
|
||||
@sprites["help"].text = _INTL("Choose the third Pokémon.")
|
||||
@@ -162,9 +163,10 @@ class BattleSwapScreen
|
||||
end
|
||||
commands.push(_INTL("OTHERS"))
|
||||
command = @scene.pbShowCommands(commands)
|
||||
if command == 0
|
||||
case command
|
||||
when 0
|
||||
@scene.pbSummary(rentals, index)
|
||||
elsif command == 1
|
||||
when 1
|
||||
if chosen.include?(index)
|
||||
chosen.delete(index)
|
||||
@scene.pbUpdateChoices(chosen.clone)
|
||||
@@ -194,9 +196,10 @@ class BattleSwapScreen
|
||||
if pkmn >= 0
|
||||
commands = [_INTL("SUMMARY"), _INTL("SWAP"), _INTL("RECHOOSE")]
|
||||
command = @scene.pbShowCommands(commands)
|
||||
if command == 0
|
||||
case command
|
||||
when 0
|
||||
@scene.pbSummary(currentPokemon, pkmn)
|
||||
elsif command == 1
|
||||
when 1
|
||||
@scene.pbSwapChosen(pkmn)
|
||||
yourPkmn = pkmn
|
||||
loop do
|
||||
|
||||
Reference in New Issue
Block a user