Added class GameData::Evolution, moved evolution-related methods to more appropriate places

This commit is contained in:
Maruno17
2021-03-12 23:20:02 +00:00
parent ba1d225b83
commit d8bf4b7fda
37 changed files with 975 additions and 969 deletions

View File

@@ -553,7 +553,7 @@ $canEvolve = {}
class BabyRestriction
def isValid?(pokemon)
baby=$babySpeciesData[pokemon.species] ? $babySpeciesData[pokemon.species] :
($babySpeciesData[pokemon.species]=EvolutionHelper.baby_species(pokemon.species))
($babySpeciesData[pokemon.species] = pokemon.species_data.get_baby_species)
return baby==pokemon.species
end
end
@@ -563,10 +563,10 @@ end
class UnevolvedFormRestriction
def isValid?(pokemon)
baby=$babySpeciesData[pokemon.species] ? $babySpeciesData[pokemon.species] :
($babySpeciesData[pokemon.species]=EvolutionHelper.baby_species(pokemon.species))
return false if baby!=pokemon.species
($babySpeciesData[pokemon.species] = pokemon.species_data.get_baby_species)
return false if pokemon.species != baby
canEvolve=($canEvolve[pokemon.species]!=nil) ? $canEvolve[pokemon.species] :
($canEvolve[pokemon.species]=(EvolutionHelper.evolutions(pokemon.species, true).length!=0))
($canEvolve[pokemon.species] = pokemon.species_data.get_evolutions(true).length > 0))
return false if !canEvolve
return true
end

View File

@@ -103,17 +103,17 @@ def baseStatTotal(species)
end
def babySpecies(species)
$babySpecies[species] = EvolutionHelper.baby_species(species) if !$babySpecies[species]
$babySpecies[species] = GameData::Species.get(species).get_baby_species if !$babySpecies[species]
return $babySpecies[species]
end
def minimumLevel(move)
$minimumLevel[species] = EvolutionHelper.minimum_level(species) if !$minimumLevel[species]
$minimumLevel[species] = GameData::Species.get(species).minimum_level if !$minimumLevel[species]
return $minimumLevel[species]
end
def evolutions(species)
$evolutions[species] = EvolutionHelper.evolutions(species, true) if !$evolutions[species]
$evolutions[species] = GameData::Species.get(species).get_evolutions(true) if !$evolutions[species]
return $evolutions[species]
end