Misc tidying

This commit is contained in:
Maruno17
2021-01-31 19:13:51 +00:00
parent f68cc1c98b
commit 168a1e5df7
19 changed files with 520 additions and 585 deletions

View File

@@ -26,10 +26,9 @@ module PBNatures
QUIRKY = 24
def self.maxValue; 24; end
def self.getCount; 25; end
def self.getName(id)
id = getID(PBNatures,id)
id = getID(PBNatures, id)
names = [
_INTL("Hardy"),
_INTL("Lonely"),
@@ -61,15 +60,17 @@ module PBNatures
end
def self.getStatRaised(id)
m = (id%25)/5 # 25 here is (number of stats)**2, not PBNatures.getCount
return [PBStats::ATTACK,PBStats::DEFENSE,PBStats::SPEED,
PBStats::SPATK,PBStats::SPDEF][m]
stats = [PBStats::ATTACK, PBStats::DEFENSE, PBStats::SPEED,
PBStats::SPATK, PBStats::SPDEF]
m = (id % (stats.length ** 2)) / stats.length
return stats[m]
end
def self.getStatLowered(id)
m = id%5 # Don't need to %25 here because 25 is a multiple of 5
return [PBStats::ATTACK,PBStats::DEFENSE,PBStats::SPEED,
PBStats::SPATK,PBStats::SPDEF][m]
stats = [PBStats::ATTACK, PBStats::DEFENSE, PBStats::SPEED,
PBStats::SPATK, PBStats::SPDEF]
m = id % stats.length
return stats[m]
end
def self.getStatChanges(id)

View File

@@ -8,6 +8,8 @@ module PBGenderRates
FemaleSevenEighths = 6
AlwaysFemale = 7
def self.maxValue; return 7; end
def self.genderByte(gender)
case gender
when AlwaysMale then return 0

View File

@@ -16,27 +16,4 @@ module PBEggGroups
Dragon = 14
def self.maxValue; 14; end
def self.getCount; 15; end
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")
]
return names[id]
end
end

View File

@@ -11,8 +11,7 @@ module PBColors
White = 8
Pink = 9
def self.maxValue; 9; end
def self.getCount; 10; end
def self.maxValue; 9; end
def self.getName(id)
id = getID(PBColors,id)

View File

@@ -10,8 +10,7 @@ module PBHabitats
Urban = 8
Rare = 9
def self.maxValue; 9; end
def self.getCount; 10; end
def self.maxValue; 9; end
def self.getName(id)
id = getID(PBHabitats,id)

View File

@@ -81,7 +81,6 @@ module PBRibbons
WORLDCHAMPION = 80
def self.maxValue; 80; end
def self.getCount; 80; end
def self.getName(id)
id = getID(PBRibbons,id)