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

Gen I style Critical Hit probability

IceGod64

In the Lost & Found bin!
  • 578
    Posts
    16
    Years
    In PokeBattle_Pokemon, append the following line to the attr_accessor section:
    Code:
      attr_reader(:baseStats)     # Base Stats
    And now, in PokBattle_Move, replace the entire def pbIsCritical? with:
    Code:
      def pbIsCritical?(attacker,opponent)
        if !attacker.hasMoldBreaker
          if opponent.hasWorkingAbility(:BATTLEARMOR) ||
             opponent.hasWorkingAbility(:SHELLARMOR)
            return false
          end
        end
        return false if opponent.pbOwnSide.effects[PBEffects::LuckyChant]>0
        return true if pbCritialOverride(attacker,opponent)
        #A Jolteon is used. It's base speed stat is 130.
        b=attacker.pokemon.baseStats #Get the stat array.
          t = b[3]*100/512.round  #Jolteon's default threshold is about 25%
          t = b[3]*100/128.round if attacker.effects[PBEffects::FocusEnergy]>0
          t = b[3]*100/64.round  if hasHighCriticalRate?
        #For Jolteon, Focus Energy or a high crit move both add up to more than 100%
        if (attacker.inHyperMode? rescue false) && isConst?(self.type,PBTypes,:SHADOW)
          t*4
        end #Increased odds during hyper mode.
        if attacker.hasWorkingItem(:STICK) &&
           isConst?(attacker.species,PBSpecies,:FARFETCHD)
          t*2
        end
        if attacker.hasWorkingItem(:LUCKYPUNCH) &&
           isConst?(attacker.species,PBSpecies,:CHANSEY)
          t*2
        end
        t*2 if attacker.hasWorkingAbility(:SUPERLUCK)
        t*1.5 if attacker.hasWorkingItem(:RAZORCLAW)
        t*1.5 if attacker.hasWorkingItem(:SCOPELENS)
        return true if t>=rand(100)
        return false
      end
    So, what's the point?
    For the most part, Gen I's battle mechanics are indeed quite broken, and are undesirable to be used in a game - However, the critical hit probability, is quite an interesting exception. In Generation 1, Critical Hit Ratio is based on a Pokémon's base speed, rather than being a flat rate. Personally, I like this. The actual values, however, you may want to adjust. By default, Jolteon has a 25% chance of landing a critical hit, which is fine to me, but after using focue energy, his chance become over 100%. Moves with high critical hit ratios work similar, so you may want to alter the mechanics.

    Part of the Gen 1 mechanic that I DIDN'T bring over however, is the bug where using Focus Energy Accidentally DIVIDES your chances of getting a crit by 4, not multiplies. Because I'd consider that a bug. If you really want to do that for some reason, you can change the Focus Energy line to this:

    Code:
     t = b[3]*100/2048.round if attacker.effects[PBEffects::FocusEnergy]>0
     
    Last edited:
    Back
    Top