• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Evolution during battle (PE v.18.1)

  • 295
    Posts
    6
    Years
    • Seen Aug 15, 2022
    This script is compatible with PE v.18.1. Just small fix.
    Main post

    Code
    Code:
    class PokeBattle_Battle
      alias evolution_during_battle pbGainExpOne
      def pbGainExpOne(idxParty,defeatedBattler,numPartic,expShare,expAll,showMessages=true)
        pkmn = pbParty(0)[idxParty]
        oldlevel = pkmn.level
        evolution_during_battle(idxParty,defeatedBattler,numPartic,expShare,expAll,showMessages)
        # New
        return if pkmn.level==oldlevel
        battler = pbFindBattler(idxParty)
        newSpecies = pbCheckEvolution(pkmn)
        return if newSpecies<=0
        previousBGM = $game_system.getPlayingBGM
        # Evolution
        pbFadeOutInWithMusic { evo = PokemonEvolutionScene.new
        evo.pbStartScreen(pkmn,newSpecies)
        evo.pbEvolution
        evo.pbEndScreen }
        if battler
          @scene.pbChangePokemon(@battlers[battler.index],@battlers[battler.index].pokemon)
          battler.pbInitPokemon(pkmn,battler.pokemonIndex)
          battler.name = battler.name
          battler.pbUpdate(false)
          @scene.pbRefreshOne(battler.index)
        end
        $PokemonTemp.evolutionLevels = []
        (0...$Trainer.party.length).each { |i| $PokemonTemp.evolutionLevels[i] = $Trainer.party[i].level}
        pbBGMPlay(previousBGM)
      end
    end

    Credit:
    Vendily
     
    Last edited:
    This script is compatible with PE v.18.1. Just small fix.
    Main post

    Code
    Code:
    class PokeBattle_Battle
      alias evolution_during_battle pbGainExpOne
      def pbGainExpOne(idxParty,defeatedBattler,numPartic,expShare,expAll,showMessages=true)
        pkmn = pbParty(0)[idxParty]
        oldlevel = pkmn.level
        evolution_during_battle(idxParty,defeatedBattler,numPartic,expShare,expAll,showMessages)
        # New
        return if pkmn.level==oldlevel
        battler = pbFindBattler(idxParty)
        newSpecies = pbCheckEvolution(pkmn)
        return if newSpecies<=0
        previousBGM = $game_system.getPlayingBGM
        # Evolution
        evo = PokemonEvolutionScene.new
        evo.pbStartScreen(pkmn,newSpecies)
        evo.pbEvolution
        evo.pbEndScreen
        if battler
          @scene.pbChangePokemon(@battlers[battler.index],@battlers[battler.index].pokemon)
          battler.pbInitPokemon(pkmn,battler.pokemonIndex)
          battler.name = battler.name
          battler.pbUpdate(false)
          @scene.pbRefreshOne(battler.index)
        end
        $PokemonTemp.evolutionLevels = []
        (0...$Trainer.party.length).each { |i| $PokemonTemp.evolutionLevels[i] = $Trainer.party[i].level}
        pbBGMPlay(previousBGM)
      end
    end

    Credit:
    Vendily

    Where to paste this?
     
    Is this compatible with v19? Or is there going to be an updated one that will be? Thanks!
     
    Back
    Top