Direct Known Subclasses:
Hail, MysteriousAirCurrent, Rainy, Sandstorm, Snow, Sunny

public abstract class Weather extends GlobalStatusBase
A type of weather condition in battle.
  • Field Details

    • turnsToGo

      protected transient int turnsToGo
      The amount of turns of the weather remaining.
    • weatherRock

      protected EnumHeldItems weatherRock
      The held item that increases the duration of the weather.
    • langStart

      protected transient String langStart
      The lang string to display when the weather starts.
    • langContinue

      protected transient String langContinue
      The lang string to display each turn the weather is in effect.
    • langEnd

      protected transient String langEnd
      The lang string to display when the weather ends.
    • extreme

      public transient boolean extreme
    • isOverworldWeather

      protected transient boolean isOverworldWeather
      Whether this weather was created due to the current weather in the overworld.
  • Constructor Details

    • Weather

      public Weather(StatusType type, int turnsToGo, EnumHeldItems weatherRock, String langStart, String langContinue, String langEnd, boolean extreme, boolean isOverworldWeather)
      Initializes a weather condition.
      Parameters:
      type - The weather's type.
      weatherRock - The held item that increases the duration of the weather.
      langStart - The lang string to display when the weather starts.
      langContinue - The lang string to display each turn the weather is in effect.
      langEnd - The lang string to display when the weather ends.
  • 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.
    • setStartTurns

      public void setStartTurns(PixelmonWrapper user)
      Sets the number of turns that the weather will last for according to the user.
      Parameters:
      user - The Pokémon initiating the weather.
    • getRemainingTurns

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

      public boolean getIsOverworldWeather()
    • getNewInstance

      protected abstract Weather getNewInstance(int turns)
      Gets a new instance of the subclass.
      Parameters:
      turns - The number of turns that the weather will last for.
      Returns:
      A new instance of the subclass.
    • 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.
    • 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.
    • countBenefits

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

      public String toString()
      Overrides:
      toString in class Object
    • getLangContinue

      public String getLangContinue()