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

[Scripting Question] Custom ability that has chance of suppressing targeting moves

  • 217
    Posts
    15
    Years
    • Seen Nov 29, 2021
    Code:
    #ARACHNOPHOBIA
          if target.hasWorkingAbility(:ARACHNOPHOBIA) && !thismove.pbIsStatus?(thismove.type)
            if @battle.pbRandom(10)==0
              PBDebug.log("ARACHNOPHOBIA triggered #{pbThis} was unable to move")
              return false
            end
          end
    #END ARACHNOPHOBIA

    As you can see, it's supposed to result in damaging moves targeting the ability-wielder to have a 1 in 10 chance of failing. I tried putting it in def pbTryUseMove, but target isn't defined then (or something).
     
    Last edited by a moderator:
    I'd say paste it somewhere inside the method def Pbsuccesscheck.
     
    Back
    Top