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

How to make a move with a chance to 1 hit KO?

  • 24
    Posts
    11
    Years
    • Seen Jul 5, 2018
    What would the effect for a move with a chance to 1 hit ko be?
    For example, a Ghost type move with 50 power and a 10 percent chance to 1 Hit KO.
     
    Would that OHKO probability be altered by abilities/effects such as Serene Grace, Sheer Force, Shield Dust and the Water/Fire Pledge combo?

    Also as a side note, the OHKO effect would be blocked by a target with the Sturdy ability.
     
    Code:
    class PokeBattle_Move_nnn < PokeBattle_Move [COLOR="Green"]# change to a new function code[/COLOR]
      def pbAdditionalEffect(attacker,opponent)
        return if opponent.damagestate.substitute
        return if opponent.level>attacker.level
        if !attacker.hasMoldBreaker && opponent.hasWorkingAbility(:STURDY)
          @battle.pbDisplay(_INTL("{1} was protected by {2}!",opponent.pbThis,PBAbilities.getName(opponent.ability)))  
          return
        end
        if !opponent.fainted?
          opponent.pbReduceHP(opponent.hp)
          opponent.pbFaint if opponent.fainted?
          @battle.pbDisplay(_INTL("It's a one-hit KO!"))
        end
      end
    end
    The effect will not trigger if the opponent is of a higher level as is the case for OHKO moves. The rest of the data can be defined in the PBS file.
     
    Back
    Top