• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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
    7
    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