Class GlobalStatusController

java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.GlobalStatusController

public class GlobalStatusController extends Object
Controls global statuses like weather in battle.
  • Field Details

  • Constructor Details

    • GlobalStatusController

      public GlobalStatusController(BattleController bc)
      Initializes a global status controller.
      Parameters:
      bc - The battle controller to associate with the global status controller.
  • Method Details

    • getGlobalStatuses

      public List<GlobalStatusBase> getGlobalStatuses()
      Returns a list of global statuses. Ignores weather if certain Abilities are in effect.
      Returns:
      A list of global statuses.
    • getWeather

      public Weather getWeather()
      Returns the active weather.
      Returns:
      The active weather, or null if there is no weather.
    • getWeatherIgnoreAbility

      public Weather getWeatherIgnoreAbility()
      Returns the active weather, ignoring Cloud Nine and Air Lock's weather canceling effects.
      Returns:
      The active weather, or null if there is no weather.
    • getTerrain

      public Terrain getTerrain()
      Returns the active terrain.
      Returns:
      The active terrain, or null if there is no terrain.
    • removeGlobalStatus

      public boolean removeGlobalStatus(StatusType status)
      Removes the status with the specified type.
      Parameters:
      status - The type of status to remove.
    • removeGlobalStatuses

      public boolean removeGlobalStatuses(StatusType... statuses)
      Removes statuses with the specified types.
      Parameters:
      statuses - The types of statuses to remove.
    • removeGlobalStatus

      public void removeGlobalStatus(GlobalStatusBase g)
      Removes the specified status.
      Parameters:
      g - The status to remove.
    • addGlobalStatus

      public void addGlobalStatus(PixelmonWrapper cause, GlobalStatusBase g)
      Adds the specified status. If the status is a weather, replaces the currently active weather with it.
      Parameters:
      g - The status to add.
    • getGlobalStatus

      public GlobalStatusBase getGlobalStatus(int index)
      Gets the status at the specified index.
      Parameters:
      index - The index of the status to get.
      Returns:
      The status at the index.
    • getGlobalStatus

      public GlobalStatusBase getGlobalStatus(StatusType type)
      Gets the specified status if it is active.
      Parameters:
      type - The status to get.
      Returns:
      The status with the specified type, or null if it is not active.
    • getGlobalStatusSize

      public int getGlobalStatusSize()
      Returns the number of global statuses.
      Returns:
      The number of global statuses.
    • hasStatus

      public boolean hasStatus(StatusType type)
      Returns whether the given status is currently active.
      Parameters:
      type - The status to check for.
      Returns:
      Whether the status is active.
    • endBattle

      public void endBattle()
      On battle end, remove all statuses.
    • triggerWeatherChange

      public void triggerWeatherChange(Weather weather)
      Triggers effects when the weather changes.
      Parameters:
      weather - The new weather.
    • triggerTerrainChange

      public void triggerTerrainChange(Terrain terrain)
      Triggers effects when the terrain changes.
      Parameters:
      terrain - The new terrain.
    • canWeatherChange

      public boolean canWeatherChange(Weather newWeather)