- 1
- Posts
- 3
- Years
- Seen Dec 25, 2021
Hi, so I am currently trying to get moves with a certain id of 850 or higher to be deleted upon evolution (since they are supposed to be moves unique to each species). The game crashes in debug whenever I try to get there, though. My code is as follows (edited from UI_Evolution (v.19.1), new additions highlighted).
Code:
def pbEvolutionSuccess
# Play cry of evolved species
frames = GameData::Species.cry_length(@newspecies, @pokemon.form)
pbBGMStop
Pokemon.play_cry(@newspecies, @pokemon.form)
frames.times do
Graphics.update
pbUpdate
end
# Success jingle/message
pbMEPlay("Evolution success")
newspeciesname = GameData::Species.get(@newspecies).name
pbMessageDisplay(@sprites["msgwindow"],
_INTL("\\se[]Congratulations! Your {1} evolved into {2}!\\wt[80]",
@pokemon.name,newspeciesname)) { pbUpdate }
@sprites["msgwindow"].text = ""
# Check for consumed item and check if Pokémon should be duplicated
pbEvolutionMethodAfterEvolution
# Modify Pokémon to make it evolved
@pokemon.species = @newspecies
@pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM)
@pokemon.calc_stats
# See and own evolved species
$Trainer.pokedex.register(@pokemon)
$Trainer.pokedex.set_owned(@newspecies)
# Learn moves upon evolution for evolved species
[B]movesknownevo = @pokemon.moves
for i in movesknownevo
next if i.id>=850
pbDeleteMove(i[1]) { pbUpdate }
end[/B]
movelist = @pokemon.getMoveList
for i in movelist
next if i[0]!=0 && i[0][email protected] # 0 is "learn upon evolution"
pbLearnMove(@pokemon,i[1],true) { pbUpdate }
end
end