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

@@ -351,7 +351,6 @@ class PokeBattle_Battler
:COMATOSE,
:RKSSYSTEM
]
failed = false
abilityBlacklist.each do |abil|
return true if isConst?(@ability,PBAbilities,abil)
end

View File

@@ -31,7 +31,6 @@ class PokeBattle_Battler
def pbRecoverHPFromDrain(amt,target,msg=nil)
if target.hasActiveAbility?(:LIQUIDOOZE)
oldHP = @hp
@battle.pbShowAbilitySplash(target)
pbReduceHP(amt)
@battle.pbDisplay(_INTL("{1} sucked up the liquid ooze!",pbThis))

View File

@@ -566,7 +566,7 @@ class PokeBattle_Battler
#=============================================================================
# Flinching
#=============================================================================
def pbFlinch(user=nil)
def pbFlinch(_user=nil)
return if hasActiveAbility?(:INNERFOCUS) && !@battle.moldBreaker
@effects[PBEffects::Flinch] = true
end

View File

@@ -149,7 +149,7 @@ class PokeBattle_Battler
#=============================================================================
# Held item consuming/removing
#=============================================================================
def pbCanConsumeBerry?(item,alwaysCheckGluttony=true)
def pbCanConsumeBerry?(_item,alwaysCheckGluttony=true)
return false if @battle.pbCheckOpposingAbility(:UNNERVE,@index)
return true if @hp<=@totalhp/4
if alwaysCheckGluttony || NEWEST_BATTLE_MECHANICS

View File

@@ -67,7 +67,7 @@ class PokeBattle_Battler
#=============================================================================
#
#=============================================================================
def pbBeginTurn(choice)
def pbBeginTurn(_choice)
# Cancel some lingering effects which only apply until the user next moves
@effects[PBEffects::BeakBlast] = false
@effects[PBEffects::DestinyBondPrevious] = @effects[PBEffects::DestinyBond]
@@ -105,7 +105,7 @@ class PokeBattle_Battler
@effects[PBEffects::FuryCutter] = 0
end
def pbEndTurn(choice)
def pbEndTurn(_choice)
@lastRoundMoved = @battle.turnCount # Done something this round
if @effects[PBEffects::ChoiceBand]<0 &&
hasActiveItem?([:CHOICEBAND,:CHOICESPECS,:CHOICESCARF])
@@ -438,7 +438,6 @@ class PokeBattle_Battler
# NOTE: If a multi-hit move becomes disabled partway through doing those
# hits (e.g. by Cursed Body), the rest of the hits continue as
# normal.
notFainted = false
break if !targets.any? { |t| !t.fainted? } # All targets are fainted
end
# Battle Arena only - attack is successful
@@ -479,7 +478,7 @@ class PokeBattle_Battler
newTargets = pbChangeTargets(move,b,newTargets)
success = pbProcessMoveHit(move,b,newTargets,0,false)
b.lastMoveFailed = true if !success
targets.each { |b| b.pbFaint if b && b.fainted? }
targets.each { |otherB| otherB.pbFaint if otherB && otherB.fainted? }
user.pbFaint if user.fainted?
end
# Magic Coat's bouncing back (move has no targets)

View File

@@ -2,7 +2,7 @@ class PokeBattle_Battler
#=============================================================================
# Get move's user
#=============================================================================
def pbFindUser(choice,move)
def pbFindUser(_choice,_move)
return self
end
@@ -169,7 +169,7 @@ class PokeBattle_Battler
return true
end
def pbAddTargetRandomAlly(targets,user,move,nearOnly=true)
def pbAddTargetRandomAlly(targets,user,_move,nearOnly=true)
choices = []
user.eachAlly do |b|
next if nearOnly && !user.near?(b)
@@ -180,7 +180,7 @@ class PokeBattle_Battler
end
end
def pbAddTargetRandomFoe(targets,user,move,nearOnly=true)
def pbAddTargetRandomFoe(targets,user,_move,nearOnly=true)
choices = []
user.eachOpposing do |b|
next if nearOnly && !user.near?(b)

View File

@@ -136,7 +136,7 @@ class PokeBattle_Battler
@battle.pbDisplay(_INTL("{1} ignored orders!",pbThis))
return false if !@battle.pbCanShowFightMenu?(@index)
otherMoves = []
eachMoveWithIndex do |m,i|
eachMoveWithIndex do |_m,i|
next if i==choice[1]
otherMoves[otherMoves.length] = i if @battle.pbCanChooseMove?(@index,i,false)
end