• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
10
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.
     
    188
    Posts
    9
    Years
    • Seen Jan 21, 2024
    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.
     
    188
    Posts
    9
    Years
    • Seen Jan 21, 2024
    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