• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our 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