Class ProtectVariation

Direct Known Subclasses:
Protect, ProtectVariationTeam

public abstract class ProtectVariation extends StatusBase
Uses a shared counter that reduces the chance of move success upon consecutive use.
  • Constructor Details

    • ProtectVariation

      public ProtectVariation(StatusType type)
      Initializes the Protect variation.
      Parameters:
      type - The status's type.
  • Method Details

    • applyEffect

      public void applyEffect(PixelmonWrapper user, PixelmonWrapper target)
      Description copied from class: EffectBase
      Causes various effects during the move.
      Overrides:
      applyEffect in class StatusBase
      Parameters:
      user - The move's user.
      target - The move's target.
    • stopsIncomingAttack

      public boolean stopsIncomingAttack(PixelmonWrapper pokemon, PixelmonWrapper user)
      Description copied from class: StatusBase
      Determines whether the status stops an attack about to hit the statused Pokémon.
      Overrides:
      stopsIncomingAttack in class StatusBase
      Parameters:
      pokemon - The statused Pokémon.
      user - The attack's user.
      Returns:
      Whether the attack is stopped.
    • protectVariationBlocksAttack

      public boolean protectVariationBlocksAttack(PixelmonWrapper pokemon, PixelmonWrapper user, Attack a)
    • applyProtectionEffect

      public void applyProtectionEffect(PixelmonWrapper target, PixelmonWrapper user, Attack a)
    • canBeRemoved

      public boolean canBeRemoved()
    • modifyDamageIncludeFixed

      public int modifyDamageIncludeFixed(int damage, PixelmonWrapper user, PixelmonWrapper target, Attack a, DamageTypeEnum damageType)
      Description copied from class: StatusBase
      Triggers when the Pokémon takes direct damage, including fixed damage moves.
      Overrides:
      modifyDamageIncludeFixed in class StatusBase
      Parameters:
      damage - The amount of damage dealt.
      user - The attack's user.
      target - The attack's target.
      a - The attack.
      Returns:
      The modified damage.
    • addStatus

      protected abstract boolean addStatus(PixelmonWrapper user)
      Adds the status to the user.
      Parameters:
      user - The user of the move.
      Returns:
      Whether the status addition succeeded.
    • displayMessage

      protected abstract void displayMessage(PixelmonWrapper user)
      Displays a battle message upon successfully using the move.
      Parameters:
      user - The user of the move.
    • canFail

      protected boolean canFail()
      Checks if the move can fail when used in succession.
      Returns:
      Whether the move can fail when used in succession.