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

Immune Ball (Custom Pokéball)

14
Posts
4
Years
    • Seen Jun 22, 2022
    I made a custom Pokéball and wanted to share it!
    The Immune Ball has an increased catch rate on Pokémon that have a type that is immune to one of your Pokémon's types. For example, if you have a Pikachu and you're battling a Diglett, then you will have an increased chance to catch because Diglett's Ground type is immune to Pikachu's Electric type.

    Here's how to put an Immune Ball in your game.
    In items.txt in your PBS folder, add this (replace XXX with an unused number)
    XXX,IMMUNEBALL,Immune Ball,Immune Balls,3,1000,"A rare ball that works well on Pokémon that are immune to one of your Pokémon's types.",0,2,4,

    Then go to PItem_PokeBalls and at the bottom of the list under "$BallTypes={" add this (replace XX with the next unused number)
    Code:
       XX=>:IMMUNEBALL

    Finally, still in PItem_PokeBalls, go to the very bottom of the script and add this
    Code:
    BallHandlers::ModifyCatchRate.add(:IMMUNEBALL,proc{|ball,catchRate,battle,battler|
       pbattler=battle.battlers[0]
       pbattler2=battle.battlers[2] if battle.battlers[2]
       catchRate*=7/2 if (battler.pbHasType?(:FLYING) && pbattler.pbHasType?(:GROUND)) ||
       (battler.pbHasType?(:FAIRY) && pbattler.pbHasType?(:DRAGON)) ||
       (battler.pbHasType?(:DARK) && pbattler.pbHasType?(:PSYCHIC)) ||
       (battler.pbHasType?(:FLYING) && pbattler.pbHasType?(:GROUND)) ||
       (battler.pbHasType?(:STEEL) && pbattler.pbHasType?(:POISON)) ||
       (battler.pbHasType?(:GHOST) && pbattler.pbHasType?(:NORMAL)) ||
       (battler.pbHasType?(:GHOST) && pbattler.pbHasType?(:FIGHTING)) ||
       (battler.pbHasType?(:NORMAL) && pbattler.pbHasType?(:GHOST)) ||
       (battler.pbHasType?(:GROUND) && pbattler.pbHasType?(:ELECTRIC))
       next catchRate   
    })

    And that's it as far as scripting goes. You'll need to add your own icon and ball animation.
     
    Last edited:
    658
    Posts
    7
    Years
  • if (battler.pbHasType?(:FLYING) && pbattler.pbHasType?(:GROUND)) ||
    (battler.pbHasType?(:FAIRY) && pbattler.pbHasType?(:DRAGON)) ||
    (battler.pbHasType?(:DARK) && pbattler.pbHasType?(:PSYCHIC)) ||
    (battler.pbHasType?(:FLYING) && pbattler.pbHasType?(:GROUND)) ||
    (battler.pbHasType?(:STEEL) && pbattler.pbHasType?(:POISON)) ||
    (battler.pbHasType?(:GHOST) && pbattler.pbHasType?(:NORMAL)) ||
    (battler.pbHasType?(:GHOST) && pbattler.pbHasType?(:FIGHTING)) ||
    (battler.pbHasType?(:NORMAL) && pbattler.pbHasType?(:GHOST)) ||
    (battler.pbHasType?(:GROUND) && pbattler.pbHasType?(:ELECTRIC))
    next catchRate
    })[/CODE]

    This is pretty cool but you should work on a more efficient way to implement this than actually listing down the type immunities in your game.
     
    Back
    Top