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

@@ -54,8 +54,8 @@ class PBMoveData
attr_reader :function,:basedamage,:type,:accuracy,:category
attr_reader :totalpp,:addlEffect,:target,:priority,:flags
def initialize(moveid)
moveData = pbGetMoveData(moveID)
def initialize(move_id)
moveData = pbGetMoveData(move_id)
@function = moveData[MOVE_FUNCTION_CODE]
@basedamage = moveData[MOVE_BASE_DAMAGE]
@type = moveData[MOVE_TYPE]

View File

@@ -11,15 +11,16 @@ begin
def self.getName(id)
id = getID(PBStatuses,id)
names = [
_INTL("healthy"),
_INTL("asleep"),
_INTL("poisoned"),
_INTL("burned"),
_INTL("paralyzed"),
_INTL("frozen")
_INTL("healthy"),
_INTL("asleep"),
_INTL("poisoned"),
_INTL("burned"),
_INTL("paralyzed"),
_INTL("frozen")
]
return names[id]
end end
end
end
rescue Exception
if $!.is_a?(SystemExit) || "#{$!.class}"=="Reset"

View File

@@ -185,12 +185,10 @@ module PBExperience
mLevel = maxLevel
maxexp = pbGetExpInternal(mLevel,growth)
exp = maxexp if exp>maxexp
i = 0
for j in 0..mLevel
currentExp = pbGetExpInternal(i,growth)
return i if exp==currentExp
return i-1 if exp<currentExp
i += 1
for lvl in 0..mLevel
currentExp = pbGetExpInternal(lvl,growth)
return lvl if exp==currentExp
return lvl-1 if exp<currentExp
end
return mLevel
end

View File

@@ -21,21 +21,21 @@ module PBEggGroups
def self.getName(id)
id = getID(PBEggGroups,id)
names = [
_INTL("Undiscovered"),
_INTL("Monster"),
_INTL("Water 1"),
_INTL("Bug"),
_INTL("Flying"),
_INTL("Field"),
_INTL("Fairy"),
_INTL("Grass"),
_INTL("Human-like"),
_INTL("Water 3"),
_INTL("Mineral"),
_INTL("Amorphous"),
_INTL("Water 2"),
_INTL("Ditto"),
_INTL("Dragon")
_INTL("Undiscovered"),
_INTL("Monster"),
_INTL("Water 1"),
_INTL("Bug"),
_INTL("Flying"),
_INTL("Field"),
_INTL("Fairy"),
_INTL("Grass"),
_INTL("Human-like"),
_INTL("Water 3"),
_INTL("Mineral"),
_INTL("Amorphous"),
_INTL("Water 2"),
_INTL("Ditto"),
_INTL("Dragon")
]
return names[id]
end

View File

@@ -17,16 +17,16 @@ module PBColors
def self.getName(id)
id = getID(PBColors,id)
names = [
_INTL("Red"),
_INTL("Blue"),
_INTL("Yellow"),
_INTL("Green"),
_INTL("Black"),
_INTL("Brown"),
_INTL("Purple"),
_INTL("Gray"),
_INTL("White"),
_INTL("Pink")
_INTL("Red"),
_INTL("Blue"),
_INTL("Yellow"),
_INTL("Green"),
_INTL("Black"),
_INTL("Brown"),
_INTL("Purple"),
_INTL("Gray"),
_INTL("White"),
_INTL("Pink")
]
return names[id]
end

View File

@@ -16,16 +16,16 @@ module PBHabitats
def self.getName(id)
id = getID(PBHabitats,id)
names = [
_INTL("None"),
_INTL("Grassland"),
_INTL("Forest"),
_INTL("Water's Edge"),
_INTL("Sea"),
_INTL("Cave"),
_INTL("Mountain"),
_INTL("Rough Terrain"),
_INTL("Urban"),
_INTL("Rare")
_INTL("None"),
_INTL("Grassland"),
_INTL("Forest"),
_INTL("Water's Edge"),
_INTL("Sea"),
_INTL("Cave"),
_INTL("Mountain"),
_INTL("Rough Terrain"),
_INTL("Urban"),
_INTL("Rare")
]
return names[id]
end