Moved species data constants into module SpeciesData

This commit is contained in:
Maruno17
2020-10-17 00:17:40 +01:00
parent e82b5409fb
commit d3ec5c2c53
25 changed files with 348 additions and 347 deletions

View File

@@ -253,8 +253,8 @@ class PokemonEncounters
newChances = []
speciesData = pbLoadSpeciesData
for i in 0...encList.length
t1 = speciesData[encList[i][0]][SpeciesType1]
t2 = speciesData[encList[i][0]][SpeciesType2]
t1 = speciesData[encList[i][0]][SpeciesData::TYPE1]
t2 = speciesData[encList[i][0]][SpeciesData::TYPE2]
next if t1!=favoredType && (!t2 || t2!=favoredType)
newEncList.push(encList[i])
newChances.push(chances[i])

View File

@@ -105,7 +105,7 @@ end
# Check compatibility of Pokémon in the Day Care.
#===============================================================================
def pbIsDitto?(pkmn)
compat = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesCompatibility)
compat = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesData::COMPATIBILITY)
if compat.is_a?(Array)
return compat.include?(getConst(PBEggGroups,:Ditto))
end
@@ -129,14 +129,14 @@ def pbDayCareGetCompat
return 0 if pkmn1.shadowPokemon?
return 0 if pkmn2.shadowPokemon?
# Insert code here if certain forms of certain species cannot breed
compat1 = pbGetSpeciesData(pkmn1.species,pkmn1.form,SpeciesCompatibility)
compat1 = pbGetSpeciesData(pkmn1.species,pkmn1.form,SpeciesData::COMPATIBILITY)
if compat1.is_a?(Array)
compat10 = compat1[0] || 0
compat11 = compat1[1] || compat10
else
compat10 = compat11 = compat || 0
end
compat2 = pbGetSpeciesData(pkmn2.species,pkmn2.form,SpeciesCompatibility)
compat2 = pbGetSpeciesData(pkmn2.species,pkmn2.form,SpeciesData::COMPATIBILITY)
if compat2.is_a?(Array)
compat20 = compat2[0] || 0
compat21 = compat2[1] || compat20
@@ -396,7 +396,7 @@ def pbDayCareGenerateEgg
egg.calcStats
egg.obtainText = _INTL("Day-Care Couple")
egg.name = _INTL("Egg")
eggSteps = pbGetSpeciesData(babyspecies,egg.form,SpeciesStepsToHatch)
eggSteps = pbGetSpeciesData(babyspecies,egg.form,SpeciesData::STEPS_TO_HATCH)
egg.eggsteps = eggSteps
egg.givePokerus if rand(65536)<POKERUS_CHANCE
# Add egg to party