Moved methods that return item/trainer graphics, refactored evolution helper methods, rearranged some methods

This commit is contained in:
Maruno17
2020-12-13 19:40:17 +00:00
parent d4b5aa0ce7
commit 1ffeddc41c
35 changed files with 582 additions and 548 deletions

View File

@@ -692,7 +692,7 @@ end
def pbBattleChallengeGraphic(event)
nextTrainer=pbBattleChallenge.nextTrainer
bttrainers=pbGetBTTrainers(pbBattleChallenge.currentChallenge)
filename=pbTrainerCharNameFile((bttrainers[nextTrainer][0] rescue 0))
filename=GameData::TrainerType.charset_filename_brief((bttrainers[nextTrainer][0] rescue 0))
begin
bitmap=AnimatedBitmap.new("Graphics/Characters/"+filename)
bitmap.dispose

View File

@@ -574,7 +574,7 @@ $canEvolve = {}
class BabyRestriction
def isValid?(pokemon)
baby=$babySpeciesData[pokemon.species] ? $babySpeciesData[pokemon.species] :
($babySpeciesData[pokemon.species]=pbGetBabySpecies(pokemon.species))
($babySpeciesData[pokemon.species]=EvolutionHelper.baby_species(pokemon.species))
return baby==pokemon.species
end
end
@@ -584,10 +584,10 @@ end
class UnevolvedFormRestriction
def isValid?(pokemon)
baby=$babySpeciesData[pokemon.species] ? $babySpeciesData[pokemon.species] :
($babySpeciesData[pokemon.species]=pbGetBabySpecies(pokemon.species))
($babySpeciesData[pokemon.species]=EvolutionHelper.baby_species(pokemon.species))
return false if baby!=pokemon.species
canEvolve=($canEvolve[pokemon.species]!=nil) ? $canEvolve[pokemon.species] :
($canEvolve[pokemon.species]=(pbGetEvolvedFormData(pokemon.species,true).length!=0))
($canEvolve[pokemon.species]=(EvolutionHelper.evolutions(pokemon.species, true).length!=0))
return false if !canEvolve
return true
end

View File

@@ -110,21 +110,21 @@ end
def babySpecies(move)
if !$babySpecies[move]
$babySpecies[move]=pbGetBabySpecies(move)
$babySpecies[move]=EvolutionHelper.baby_species(move)
end
return $babySpecies[move]
end
def minimumLevel(move)
if !$minimumLevel[move]
$minimumLevel[move]=pbGetMinimumLevel(move)
$minimumLevel[move]=EvolutionHelper.minimum_level(move)
end
return $minimumLevel[move]
end
def evolutions(move)
if !$evolutions[move]
$evolutions[move]=pbGetEvolvedFormData(move,true)
$evolutions[move]=EvolutionHelper.evolutions(move, true)
end
return $evolutions[move]
end