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

@@ -525,7 +525,7 @@ end
#===============================================================================
# Load various wild battle music
#===============================================================================
def pbGetWildBattleBGM(wildParty) # wildParty is an array of Pokémon objects
def pbGetWildBattleBGM(_wildParty) # wildParty is an array of Pokémon objects
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end

View File

@@ -428,7 +428,7 @@ def pbBalancedLevel(party)
weights.push(weight)
end
weightSum = 0
weights.each { |weight| weightSum += weight }
weights.each { |w| weightSum += w }
# Calculate the weighted mean, assigning each weight to each level's
# contribution to the sum
for i in 0...party.length

View File

@@ -248,7 +248,7 @@ class LinearCongRandom
def self.dsSeed
t = Time.now
seed = (((t.mon*t.mday+t.min+t.sec)&0xFF)<<24) | (t.hour<<16) | (t.year-2000)
seed = (((t.mon*t.mday+t.min+t.sec)&0xFF)<<24) | (t.hour << 16) | (t.year-2000)
seed = (seed+0xFFFFFFFF)+1 if seed<0
return seed
end
@@ -416,9 +416,8 @@ class MiniXmlReader
raise ArgumentError.new("Illegal character") if codepoint<9 ||
codepoint==11 || codepoint==12 || (codepoint>=14 && codepoint<32) ||
codepoint==0xFFFE || codepoint==0xFFFF || (codepoint>=0xD800 && codepoint<0xE000)
if codepoint<=0x7F
return codepoint.chr
elsif codepoint<=0x7FF
return codepoint.chr if codepoint<=0x7F
if codepoint<=0x7FF
str = (0xC0|((codepoint>>6)&0x1F)).chr
str += (0x80|(codepoint &0x3F)).chr
return str
@@ -436,7 +435,6 @@ class MiniXmlReader
else
raise ArgumentError.new("Illegal character")
end
return str
end
def unescape(attr) #:nodoc: