java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.ability.AbstractAbility
com.pixelmonmod.pixelmon.api.pokemon.ability.abilities.Redirect
All Implemented Interfaces:
Ability, RarityTweak, ITranslatable
Direct Known Subclasses:
LightningRod, StormDrain

public abstract class Redirect extends AbstractAbility
Grants an immunity to a type and redirects any single-target moves of that type to the Pokémon.
  • Constructor Details

    • Redirect

      public Redirect(Element type, String langImmune, String langRedirect)
      Initializes the Ability.
      Parameters:
      type - The type that the Ability grants an immunity to and redirects.
      langImmune - The message displayed when the Ability nullifies a move.
      langRedirect - The message displayed when the Ability redirects a move.
  • Method Details

    • applySwitchInEffect

      public void applySwitchInEffect(PixelmonWrapper newPokemon)
      Description copied from interface: Ability
      Triggers after the Pokémon switches in and when the Pokémon gains an Ability.
      Parameters:
      newPokemon - The Pokémon switching in.
    • allowsIncomingAttack

      public boolean allowsIncomingAttack(PixelmonWrapper pokemon, PixelmonWrapper user, Attack a)
      Description copied from interface: Ability
      Determines whether an incoming attack can hit the Pokémon
      Parameters:
      pokemon - The Pokémon with the Ability.
      user - The attack's user.
      a - The attack.
      Returns:
      Whether the attack can hit the Pokémon.
    • redirectAttack

      public boolean redirectAttack(PixelmonWrapper attacker, PixelmonWrapper abilityUser, Attack attack)
      Description copied from interface: Ability
      Determines whether the Pokémon's Ability causes an incoming attack to be redirected.
      Parameters:
      attacker - The Pokémon using the attack.
      abilityUser - The Pokémon with the Ability.
      attack - The attack.
      Returns:
      Whether the attack is redirected to the Pokémon with the Ability.
    • inRedirectRange

      protected boolean inRedirectRange(PixelmonWrapper attacker, PixelmonWrapper abilityUser, Attack attack)