• 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!
  • 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] Does this code look right?

  • 40
    Posts
    4
    Years
    • Seen Jan 13, 2022
    I am trying to implement a new Apricorn ball, and this is the code I got.
    Does it look right, or did I do something wrong?
    Tell me if I got it right or not.

    Code:
    BallHandlers::ModifyCatchRate.add(:GLIMMERBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
      catchRate *= 3.5 if battler.isShiny?
      next catchRate
    })
     
    I am trying to implement a new Apricorn ball, and this is the code I got.
    Does it look right, or did I do something wrong?
    Tell me if I got it right or not.

    Code:
    BallHandlers::ModifyCatchRate.add(:GLIMMERBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
      catchRate *= 3.5 if battler.isShiny?
      next catchRate
    })

    Looks good.
    But now you have to try it and see if it does what you want ^^
     
    It works like a charm.
    This was one of my first self-coding experiences so I had to be sure.
     
    This was one of my first self-coding experiences so I had to be sure.
    Nice!
    Good luck in learning how to code!
    Also, don't give up, it may takes some time if you have big projects.
    :)
     
    Back
    Top