mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Created and implemented GameData::Species
This commit is contained in:
@@ -178,7 +178,7 @@ def pbChangeLevel(pkmn,newlevel,scene)
|
||||
end
|
||||
# Check for evolution
|
||||
newspecies = pbCheckEvolution(pkmn)
|
||||
if newspecies>0
|
||||
if newspecies
|
||||
pbFadeOutInWithMusic {
|
||||
evo = PokemonEvolutionScene.new
|
||||
evo.pbStartScreen(pkmn,newspecies)
|
||||
@@ -458,13 +458,6 @@ def pbForgetMove(pkmn,moveToLearn)
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbSpeciesCompatible?(species,move)
|
||||
return false if species<=0
|
||||
data = pbLoadSpeciesTMData
|
||||
return false if !data[move]
|
||||
return data[move].any? { |item| item==species }
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Use an item from the Bag and/or on a Pokémon
|
||||
#===============================================================================
|
||||
@@ -498,7 +491,7 @@ def pbUseItem(bag,item,bagscene=nil)
|
||||
if itm.is_evolution_stone?
|
||||
annot = []
|
||||
for pkmn in $Trainer.party
|
||||
elig = pbCheckEvolution(pkmn,item)>0
|
||||
elig = pbCheckEvolution(pkmn,item)
|
||||
annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE"))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -349,22 +349,21 @@ ItemHandlers::UseOnPokemon.addIf(proc { |item| GameData::Item.get(item).is_evolu
|
||||
next false
|
||||
end
|
||||
newspecies = pbCheckEvolution(pkmn,item)
|
||||
if newspecies<=0
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
else
|
||||
if newspecies
|
||||
pbFadeOutInWithMusic {
|
||||
evo = PokemonEvolutionScene.new
|
||||
evo.pbStartScreen(pkmn,newspecies)
|
||||
evo.pbEvolution(false)
|
||||
evo.pbEndScreen
|
||||
if scene.is_a?(PokemonPartyScreen)
|
||||
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p,item)>0 })
|
||||
scene.pbRefreshAnnotations(proc { |p| !pbCheckEvolution(p,item).nil? })
|
||||
scene.pbRefresh
|
||||
end
|
||||
}
|
||||
next true
|
||||
end
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ def pbEncounterSpecies(phonenum)
|
||||
species = pbRandomEncounterSpecies(enctypes[EncounterTypes::LandNight]) if species==0
|
||||
species = pbRandomEncounterSpecies(enctypes[EncounterTypes::Water]) if species==0
|
||||
return "" if species==0
|
||||
return PBSpecies.getName(species)
|
||||
return GameData::Species.get(species).name
|
||||
end
|
||||
|
||||
def pbTrainerSpecies(phonenum)
|
||||
@@ -269,7 +269,7 @@ def pbTrainerSpecies(phonenum)
|
||||
trainer = pbGetTrainerData(phonenum[1],phonenum[2],partyid)
|
||||
return "" if !trainer || trainer[3].length==0
|
||||
rndpoke = trainer[3][rand(trainer[3].length)]
|
||||
return PBSpecies.getName(rndpoke[0])
|
||||
return GameData::Species.get(rndpoke[0]).name
|
||||
end
|
||||
|
||||
def pbTrainerMapName(phonenum)
|
||||
|
||||
@@ -128,7 +128,7 @@ def pbPokeRadarGetEncounter(rarity=0)
|
||||
map = $game_map.map_id rescue 0
|
||||
array = []
|
||||
for enc in POKE_RADAR_ENCOUNTERS
|
||||
array.push(enc) if enc.length>=4 && enc[0]==map && getID(PBSpecies,enc[2])>0
|
||||
array.push(enc) if enc.length>=4 && enc[0]==map && GameData::Species.exists?(enc[2])
|
||||
end
|
||||
# If there are any exclusives, first have a chance of encountering those
|
||||
if array.length>0
|
||||
@@ -137,9 +137,8 @@ def pbPokeRadarGetEncounter(rarity=0)
|
||||
for enc in array
|
||||
chance += enc[1]
|
||||
if rnd<chance
|
||||
upper = (enc[4]!=nil) ? enc[4] : enc[3]
|
||||
level = enc[3]+rand(1+upper-enc[3])
|
||||
return [getID(PBSpecies,enc[2]),level]
|
||||
level = (enc[4] && enc[4] > enc[3]) ? rand(enc[3], enc[4]) : enc[3]
|
||||
return [enc[2], level]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,19 +42,22 @@ def pbDisplayMail(mail,_bearer=nil)
|
||||
if GameData::Item.get(mail.item).is_icon_mail?
|
||||
if mail.poke1
|
||||
sprites["bearer"] = IconSprite.new(64,288,viewport)
|
||||
bitmapFileName = pbCheckPokemonIconFiles(mail.poke1,mail.poke1[5])
|
||||
bitmapFileName = GameData::Species.icon_filename(mail.poke1[0],
|
||||
mail.poke1[3], mail.poke1[1], mail.poke1[2], mail.poke1[4], mail.poke1[5])
|
||||
sprites["bearer"].setBitmap(bitmapFileName)
|
||||
sprites["bearer"].src_rect.set(0,0,64,64)
|
||||
end
|
||||
if mail.poke2
|
||||
sprites["bearer2"] = IconSprite.new(144,288,viewport)
|
||||
bitmapFileName = pbCheckPokemonIconFiles(mail.poke2,mail.poke2[5])
|
||||
bitmapFileName = GameData::Species.icon_filename(mail.poke2[0],
|
||||
mail.poke2[3], mail.poke2[1], mail.poke2[2], mail.poke2[4], mail.poke2[5])
|
||||
sprites["bearer2"].setBitmap(bitmapFileName)
|
||||
sprites["bearer2"].src_rect.set(0,0,64,64)
|
||||
end
|
||||
if mail.poke3
|
||||
sprites["bearer3"] = IconSprite.new(224,288,viewport)
|
||||
bitmapFileName = pbCheckPokemonIconFiles(mail.poke3,mail.poke3[5])
|
||||
bitmapFileName = GameData::Species.icon_filename(mail.poke3[0],
|
||||
mail.poke3[3], mail.poke3[1], mail.poke3[2], mail.poke3[4], mail.poke3[5])
|
||||
sprites["bearer3"].setBitmap(bitmapFileName)
|
||||
sprites["bearer3"].src_rect.set(0,0,64,64)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user