Added decent spacing to all scripts thanks to Rubocop

This commit is contained in:
Maruno17
2021-12-18 15:25:40 +00:00
parent f7b76ae62e
commit d17fc40a47
207 changed files with 18577 additions and 18587 deletions

View File

@@ -15,7 +15,7 @@ class Battle
def pbAttackPhaseCall
pbPriority.each do |b|
next unless @choices[b.index][0]==:Call && !b.fainted?
next unless @choices[b.index][0] == :Call && !b.fainted?
b.lastMoveFailed = false # Counts as a successful move for Stomping Tantrum
pbCall(b.index)
end
@@ -25,31 +25,31 @@ class Battle
@switching = true
pbPriority.each do |b|
next if b.fainted? || !b.opposes?(idxSwitcher) # Shouldn't hit an ally
next if b.movedThisRound? || !pbChoseMoveFunctionCode?(b.index,"PursueSwitchingFoe")
next if b.movedThisRound? || !pbChoseMoveFunctionCode?(b.index, "PursueSwitchingFoe")
# Check whether Pursuit can be used
next unless pbMoveCanTarget?(b.index,idxSwitcher,@choices[b.index][2].pbTarget(b))
next unless pbCanChooseMove?(b.index,@choices[b.index][1],false)
next unless pbMoveCanTarget?(b.index, idxSwitcher, @choices[b.index][2].pbTarget(b))
next unless pbCanChooseMove?(b.index, @choices[b.index][1], false)
next if b.status == :SLEEP || b.status == :FROZEN
next if b.effects[PBEffects::SkyDrop]>=0
next if b.effects[PBEffects::SkyDrop] >= 0
next if b.hasActiveAbility?(:TRUANT) && b.effects[PBEffects::Truant]
# Mega Evolve
if !b.wild?
owner = pbGetOwnerIndexFromBattlerIndex(b.index)
pbMegaEvolve(b.index) if @megaEvolution[b.idxOwnSide][owner]==b.index
pbMegaEvolve(b.index) if @megaEvolution[b.idxOwnSide][owner] == b.index
end
# Use Pursuit
@choices[b.index][3] = idxSwitcher # Change Pursuit's target
if b.pbProcessTurn(@choices[b.index],false)
if b.pbProcessTurn(@choices[b.index], false)
b.effects[PBEffects::Pursuit] = true
end
break if @decision>0 || @battlers[idxSwitcher].fainted?
break if @decision > 0 || @battlers[idxSwitcher].fainted?
end
@switching = false
end
def pbAttackPhaseSwitch
pbPriority.each do |b|
next unless @choices[b.index][0]==:SwitchOut && !b.fainted?
next unless @choices[b.index][0] == :SwitchOut && !b.fainted?
idxNewPkmn = @choices[b.index][1] # Party index of Pokémon to switch to
b.lastMoveFailed = false # Counts as a successful move for Stomping Tantrum
@lastMoveUser = b.index
@@ -57,13 +57,13 @@ class Battle
pbMessageOnRecall(b)
# Pursuit interrupts switching
pbPursuit(b.index)
return if @decision>0
return if @decision > 0
# Switch Pokémon
allBattlers.each do |b|
b.droppedBelowHalfHP = false
b.statsDropped = false
end
pbRecallAndReplace(b.index,idxNewPkmn)
pbRecallAndReplace(b.index, idxNewPkmn)
pbOnBattlerEnteringBattle(b.index, true)
end
end
@@ -94,9 +94,9 @@ class Battle
def pbAttackPhaseMegaEvolution
pbPriority.each do |b|
next if b.wild?
next unless @choices[b.index][0]==:UseMove && !b.fainted?
next unless @choices[b.index][0] == :UseMove && !b.fainted?
owner = pbGetOwnerIndexFromBattlerIndex(b.index)
next if @megaEvolution[b.idxOwnSide][owner]!=b.index
next if @megaEvolution[b.idxOwnSide][owner] != b.index
pbMegaEvolve(b.index)
end
end
@@ -104,7 +104,7 @@ class Battle
def pbAttackPhaseMoves
# Show charging messages (Focus Punch)
pbPriority.each do |b|
next unless @choices[b.index][0]==:UseMove && !b.fainted?
next unless @choices[b.index][0] == :UseMove && !b.fainted?
next if b.movedThisRound?
@choices[b.index][2].pbDisplayChargeMessage(b)
end
@@ -115,28 +115,28 @@ class Battle
advance = false
priority.each do |b|
next unless b.effects[PBEffects::MoveNext] && !b.fainted?
next unless @choices[b.index][0]==:UseMove || @choices[b.index][0]==:Shift
next unless @choices[b.index][0] == :UseMove || @choices[b.index][0] == :Shift
next if b.movedThisRound?
advance = b.pbProcessTurn(@choices[b.index])
break if advance
end
return if @decision>0
return if @decision > 0
next if advance
# Regular priority order
priority.each do |b|
next if b.effects[PBEffects::Quash]>0 || b.fainted?
next unless @choices[b.index][0]==:UseMove || @choices[b.index][0]==:Shift
next if b.effects[PBEffects::Quash] > 0 || b.fainted?
next unless @choices[b.index][0] == :UseMove || @choices[b.index][0] == :Shift
next if b.movedThisRound?
advance = b.pbProcessTurn(@choices[b.index])
break if advance
end
return if @decision>0
return if @decision > 0
next if advance
# Quashed
if Settings::MECHANICS_GENERATION >= 8
priority.each do |b|
next unless b.effects[PBEffects::Quash] > 0 && !b.fainted?
next unless @choices[b.index][0]==:UseMove || @choices[b.index][0]==:Shift
next unless @choices[b.index][0] == :UseMove || @choices[b.index][0] == :Shift
next if b.movedThisRound?
advance = b.pbProcessTurn(@choices[b.index])
break if advance
@@ -147,9 +147,9 @@ class Battle
quashLevel += 1
moreQuash = false
priority.each do |b|
moreQuash = true if b.effects[PBEffects::Quash]>quashLevel
next unless b.effects[PBEffects::Quash]==quashLevel && !b.fainted?
next unless @choices[b.index][0]==:UseMove || @choices[b.index][0]==:Shift
moreQuash = true if b.effects[PBEffects::Quash] > quashLevel
next unless b.effects[PBEffects::Quash] == quashLevel && !b.fainted?
next unless @choices[b.index][0] == :UseMove || @choices[b.index][0] == :Shift
next if b.movedThisRound?
advance = b.pbProcessTurn(@choices[b.index])
break
@@ -157,12 +157,12 @@ class Battle
break if advance || !moreQuash
end
end
return if @decision>0
return if @decision > 0
next if advance
# Check for all done
priority.each do |b|
if !b.fainted? && !b.movedThisRound?
advance = true if @choices[b.index][0]==:UseMove || @choices[b.index][0]==:Shift
advance = true if @choices[b.index][0] == :UseMove || @choices[b.index][0] == :Shift
end
break if advance
end
@@ -178,15 +178,15 @@ class Battle
def pbAttackPhase
@scene.pbBeginAttackPhase
# Reset certain effects
@battlers.each_with_index do |b,i|
@battlers.each_with_index do |b, i|
next if !b
b.turnCount += 1 if !b.fainted?
@successStates[i].clear
if @choices[i][0]!=:UseMove && @choices[i][0]!=:Shift && @choices[i][0]!=:SwitchOut
if @choices[i][0] != :UseMove && @choices[i][0] != :Shift && @choices[i][0] != :SwitchOut
b.effects[PBEffects::DestinyBond] = false
b.effects[PBEffects::Grudge] = false
end
b.effects[PBEffects::Rage] = false if !pbChoseMoveFunctionCode?(i,"StartRaiseUserAtk1WhenDamaged")
b.effects[PBEffects::Rage] = false if !pbChoseMoveFunctionCode?(i, "StartRaiseUserAtk1WhenDamaged")
end
PBDebug.log("")
# Calculate move order for this round
@@ -195,9 +195,9 @@ class Battle
pbAttackPhasePriorityChangeMessages
pbAttackPhaseCall
pbAttackPhaseSwitch
return if @decision>0
return if @decision > 0
pbAttackPhaseItems
return if @decision>0
return if @decision > 0
pbAttackPhaseMegaEvolution
pbAttackPhaseMoves
end