Resolved many Rubocop warnings

This commit is contained in:
Maruno17
2020-09-06 17:31:12 +01:00
parent 6c4670eaa3
commit 681a8331ab
137 changed files with 921 additions and 1200 deletions

View File

@@ -147,7 +147,7 @@ class PokeBattle_AI
#=============================================================================
def pbDefaultChooseNewEnemy(idxBattler,party)
enemies = []
party.each_with_index do |p,i|
party.each_with_index do |_p,i|
enemies.push(i) if @battle.pbCanSwitchLax?(idxBattler,i)
end
return -1 if enemies.length==0

View File

@@ -14,7 +14,7 @@ class PokeBattle_AI
# NOTE: A move is only added to the choices array if it has a non-zero
# score.
choices = []
user.eachMoveWithIndex do |m,i|
user.eachMoveWithIndex do |_m,i|
next if !@battle.pbCanChooseMove?(idxBattler,i,false)
if wildBattler
pbRegisterMoveWild(user,i,choices)
@@ -106,7 +106,7 @@ class PokeBattle_AI
# Get scores for the given move against each possible target
#=============================================================================
# Wild Pokémon choose their moves randomly.
def pbRegisterMoveWild(user,idxMove,choices)
def pbRegisterMoveWild(_user,idxMove,choices)
choices.push([idxMove,100,-1]) # Move index, score, target
end
@@ -195,7 +195,6 @@ class PokeBattle_AI
end
# If user is asleep, prefer moves that are usable while asleep
if user.status==PBStatuses::SLEEP && !move.usableWhenAsleep?
hasSleepMove = false
user.eachMove do |m|
next unless m.usableWhenAsleep?
score -= 60

View File

@@ -12,13 +12,13 @@ class PokeBattle_AI
@battle.eachBattler { |b| numTargets += 1 if b.near?(user) }
return numTargets>1
when PBTargets::UserAndAllies
@battle.eachSameSideBattler(user) { |b| numTargets += 1 }
@battle.eachSameSideBattler(user) { |_b| numTargets += 1 }
return numTargets>1
when PBTargets::AllFoes
@battle.eachOtherSideBattler(user) { |b| numTargets += 1 }
@battle.eachOtherSideBattler(user) { |_b| numTargets += 1 }
return numTargets>1
when PBTargets::AllBattlers
@battle.eachBattler { |b| numTargets += 1 }
@battle.eachBattler { |_b| numTargets += 1 }
return numTargets>1
end
return false
@@ -75,7 +75,7 @@ class PokeBattle_AI
# For switching. Determines the effectiveness of a potential switch-in against
# an opposing battler.
def pbCalcTypeModPokemon(battlerThis,battlerOther)
def pbCalcTypeModPokemon(battlerThis,_battlerOther)
mod1 = PBTypes.getCombinedEffectiveness(battlerThis.type1,target.type1,target.type2)
mod2 = PBTypeEffectiveness::NORMAL_EFFECTIVE
if battlerThis.type1!=battlerThis.type2
@@ -214,7 +214,7 @@ class PokeBattle_AI
end
when "0C1" # Beat Up
mult = 0
@battle.eachInTeamFromBattlerIndex(user.index) do |pkmn,i|
@battle.eachInTeamFromBattlerIndex(user.index) do |pkmn,_i|
mult += 1 if pkmn && pkmn.able? && pkmn.status==PBStatuses::NONE
end
baseDmg *= mult