• 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!
  • Dawn, Gloria, Juliana, or Summer - 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] How do I change non-critical hit moves' crit ratio to 0?

  • 79
    Posts
    9
    Years
    • Seen Jan 12, 2024
    So, in Pokebattle_Move, under def pbIsCritical?
    Code:
        ratios=(USENEWBATTLEMECHANICS) ? [16,8,2,1,1] : [16,8,4,3,2]
    I'm assuming the 16,8,2,1 means the crit stages are 1/16, 1/8, 1/2 and 100%, however, I want the first stage to be a 0% chance (This means that non crit moves like tackle will never crit unless things like Focus Energy or Scope lens are used). How would I go about doing this? I don't want to break the universe by dividing by 0

    Thanks!
     
    Well, for starters, there's no division involved, it'd just end up calling rand(0), which picks a random floating point between 0 (inclusive) and 1 (exclusive). though you could instead put a line above the return that returns false if ratios[c] is 0. that'd be simplest.
    return false if ratios[c]==0
     
    Well, for starters, there's no division involved, it'd just end up calling rand(0), which picks a random floating point between 0 (inclusive) and 1 (exclusive). though you could instead put a line above the return that returns false if ratios[c] is 0. that'd be simplest.
    return false if ratios[c]==0

    When you say above the return, do you mean above return @battle.pbRandom(ratios[c])==0? So like:

    Spoiler:
     
    Back
    Top