• 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.

[Scripting Question] Infinite Use of Vitamins

HeyHeyHenry

HeyHeyHenryΔ
  • 11
    Posts
    5
    Years
    I want to know if it's possible to allow the player to use how much vitamins they want to, I mean, you have a limit to use Carbos, Calcium...
    But there is a way to remove this limit and allow the player to increase their pokémon status as much they want?
     
    I removed the 100 EVs limit recently in my game. You need to search for this line
    Code:
    def pbRaiseEffortValues
    then change every 100 to either 252 or 255 as you wish like this:
    Code:
    def pbRaiseEffortValues(pokemon,ev,evgain=10,evlimit=true)
      return 0 if evlimit && pokemon.ev[ev]>=252
      totalev=0
      for i in 0...6
        totalev+=pokemon.ev[i]
      end
      if totalev+evgain>PokeBattle_Pokemon::EVLIMIT
        evgain=PokeBattle_Pokemon::EVLIMIT-totalev
      end
      if pokemon.ev[ev]+evgain>PokeBattle_Pokemon::EVSTATLIMIT
        evgain=PokeBattle_Pokemon::EVSTATLIMIT-pokemon.ev[ev]
      end
      if evlimit && pokemon.ev[ev]+evgain>252
        evgain=252-pokemon.ev[ev]
      end
      if evgain>0
        pokemon.ev[ev]+=evgain
        pokemon.calcStats
      end
      return evgain
    end
    That's all I did if I remember correctly.
     
    Back
    Top