Class EntryHazard

Direct Known Subclasses:
Spikes, StealthRock, Steelsurge, StickyWeb, ToxicSpikes

public abstract class EntryHazard extends StatusBase
Negatively affects Pokémon who switch in on the side that the status is laid on.
  • Field Details

    • ENTRY_HAZARDS

      public static List<Supplier<ImmutableAttack>> ENTRY_HAZARDS
    • numLayers

      protected transient int numLayers
      The current number of layers of the entry hazard present.
  • Constructor Details

    • EntryHazard

      public EntryHazard(StatusType type, int maxLayers)
      Initializes the entry hazard.
      Parameters:
      type - The type of entry hazard.
      maxLayers - The maximum number of layers of the entry hazard that can be laid.
  • 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.
    • applyHazards

      public void applyHazards(PixelmonWrapper user, PixelmonWrapper target)
    • getNumLayers

      public int getNumLayers()
      Gets the current number of layers of the entry hazard present.
      Returns:
      The current number of layers of the entry hazard present.
    • getNewInstance

      public abstract EntryHazard getNewInstance()
      Gets a new instance of the entry hazard.
      Returns:
      A new instance of the entry hazard.
    • getFirstLayerMessage

      protected abstract String getFirstLayerMessage()
      Gets the lang key for the message displayed when a hazard is first laid.
      Returns:
      The lang key for the message displayed when a hazard is first laid.
    • getMultiLayerMessage

      protected String getMultiLayerMessage()
      Gets the lang key for the message displayed when a hazard layer is added to an existing one.
      Returns:
      The lang key for the message displayed when a hazard layer is added to an existing one.
    • getAffectedMessage

      protected abstract String getAffectedMessage()
      Gets the lang key for the message displayed when a hazard is triggered.
      Returns:
      The lang key for the message displayed when a hazard is triggered.
    • isTeamStatus

      public boolean isTeamStatus()
      Description copied from class: StatusBase
      Determines whether the status applies to the Pokémon's position in the battle.
      Overrides:
      isTeamStatus in class StatusBase
      Returns:
      Whether the status applies to the Pokémon's position in the battle.
    • applyEffectOnSwitch

      public void applyEffectOnSwitch(PixelmonWrapper pw)
      Description copied from class: StatusBase
      Triggers when the statused Pokémon switches in.
      Overrides:
      applyEffectOnSwitch in class StatusBase
      Parameters:
      pw - The statused Pokémon.
    • doEffect

      protected void doEffect(PixelmonWrapper pw)
      Affects a Pokémon when it switches in.
      Parameters:
      pw - The Pokémon to affect.
    • getDamage

      public int getDamage(PixelmonWrapper pw)
      Returns the amount of damage dealt by the entry hazard.
      Parameters:
      pw - The Pokémon being damaged by the entry hazard.
      Returns:
      The amount of damage dealt by the entry hazard.
    • copy

      public StatusBase copy()
      Description copied from class: StatusBase
      If necessary, makes a deep copy of the status.
      Overrides:
      copy in class StatusBase
      Returns:
      A deep copy of the status.
    • isAirborne

      protected boolean isAirborne(PixelmonWrapper pw)
      Checks if the Pokémon is flying over the entry hazard. Differs from PixelmonWrapper.isAirborne() because of Mold Breaker.
      Parameters:
      pw - The Pokémon to check.
      Returns:
      Whether the Pokémon is flying over the entry hazard.
    • weightEffect

      public void weightEffect(PixelmonWrapper pw, MoveChoice userChoice, List<MoveChoice> userChoices, List<MoveChoice> bestUserChoices, List<MoveChoice> opponentChoices, List<MoveChoice> bestOpponentChoices)
      Description copied from class: EffectBase
      Determines a weight for the move that has this effect. Used for battle AI.
      Overrides:
      weightEffect in class EffectBase
      Parameters:
      pw - The Pokémon using the move.
      userChoice - The move with this effect.
      userChoices - All choices the Pokémon has for the turn.
      bestUserChoices - The best offensive choices the Pokémon has for the turn.
      opponentChoices - All choices the opponent has for the turn.
      bestOpponentChoices - The best choices the opponent has for the turn.
    • getAIWeight

      public abstract int getAIWeight()
      Gets the weight per Pokémon that an AI will assign to the move.
      Returns:
      The weight per Pokémon that an AI will assign to the move.
    • isUnharmed

      protected boolean isUnharmed(PixelmonWrapper pw)
      Checks if the Pokémon is unharmed by the entry hazard.
      Parameters:
      pw - The Pokémon to check.
      Returns:
      Whether the Pokémon is unharmed by the entry hazard.