Direct Known Subclasses:
ElectricTerrain, GrassyTerrain, MistyTerrain, NoTerrain, PsychicTerrain

public abstract class Terrain extends GlobalStatusBase
Global status that affects grounded opponents.
  • Field Details

    • turnsToGo

      protected transient int turnsToGo
      The amount of turns of the terrain remaining.
    • langStart

      public String langStart
      The lang string to display when the terrain starts.
    • langEnd

      public String langEnd
      The lang string to display when the terrain ends.
  • Constructor Details

    • Terrain

      public Terrain(StatusType type, String langStart, String langEnd, boolean extended)
      Initializes a terrain effect.
      Parameters:
      type - The terrain's type.
      langStart - The lang string to display when the terrain starts.
      langEnd - The lang string to display when the terrain ends.
    • Terrain

      protected Terrain(StatusType type, int turnsToGo, String langStart, String langEnd)
  • Method Details

    • setTurns

      public void setTurns(int turns)
    • 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.
    • getNewInstance

      public abstract Terrain getNewInstance()
      Gets a new instance of the subclass.
      Returns:
      A new instance of the subclass.
    • getTerrainType

      @Nonnull public abstract Terrain getTerrainType()
    • getTypingForTerrain

      public abstract Element getTypingForTerrain()
    • applyRepeatedEffect

      public void applyRepeatedEffect(GlobalStatusController global)
      Description copied from class: GlobalStatusBase
      Triggers at the end of every turn.
      Overrides:
      applyRepeatedEffect in class GlobalStatusBase
      Parameters:
      global - The battle's global status controller.
    • getRemainingTurns

      public int getRemainingTurns()
      Returns:
      The number of turns remaining for this status.
    • applyRepeatedEffect

      protected void applyRepeatedEffect(BattleController bc)
      Triggers at the end of every turn.
      Parameters:
      bc - The battle that the weather is in.
    • 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.
    • affectsPokemon

      public boolean affectsPokemon(PixelmonWrapper pw)
      Checks if the terrain can affect a Pokémon.
      Parameters:
      pw - The Pokémon to check for being affected.
      Returns:
      Whether the terrain can affect a Pokémon.
    • countBenefits

      protected abstract int countBenefits(PixelmonWrapper user, PixelmonWrapper target)
      Counts the number of ways that the target Pokémon benefits from the terrain.
      Parameters:
      user - The Pokémon using the terrain move.
      target - The Pokémon to count benefits for.
      Returns:
      The number of ways that the target Pokémon benefits from the terrain.
    • toString

      public String toString()
      Overrides:
      toString in class Object