• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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:
    1
    Posts
    3
    Years
    • Seen Oct 20, 2021
    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?
     
    1
    Posts
    2
    Years
    • Seen Apr 10, 2022
    Is this compatible with v19? Or is there going to be an updated one that will be? Thanks!
     
    Back
    Top