Class GlobalStatusController
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.GlobalStatusController
Controls global statuses like weather in battle.
-
Field Summary
Modifier and TypeFieldDescriptionThe battle that this controller is a part of. -
Constructor Summary
ConstructorDescriptionInitializes a global status controller. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addGlobalStatus
(PixelmonWrapper cause, GlobalStatusBase g) Adds the specified status.boolean
canWeatherChange
(Weather newWeather) void
On battle end, remove all statuses.getGlobalStatus
(int index) Gets the status at the specified index.getGlobalStatus
(StatusType type) Gets the specified status if it is active.Returns a list of global statuses.int
Returns the number of global statuses.Returns the active terrain.Returns the active weather.Returns the active weather, ignoring Cloud Nine and Air Lock's weather canceling effects.boolean
hasStatus
(StatusType type) Returns whether the given status is currently active.void
Removes the specified status.boolean
removeGlobalStatus
(StatusType status) Removes the status with the specified type.boolean
removeGlobalStatuses
(StatusType... statuses) Removes statuses with the specified types.void
triggerTerrainChange
(Terrain terrain) Triggers effects when the terrain changes.void
triggerWeatherChange
(Weather weather) Triggers effects when the weather changes.
-
Field Details
-
bc
The battle that this controller is a part of.
-
-
Constructor Details
-
GlobalStatusController
Initializes a global status controller.- Parameters:
bc
- The battle controller to associate with the global status controller.
-
-
Method Details
-
getGlobalStatuses
Returns a list of global statuses. Ignores weather if certain Abilities are in effect.- Returns:
- A list of global statuses.
-
getWeather
Returns the active weather.- Returns:
- The active weather, or null if there is no 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
Returns the active terrain.- Returns:
- The active terrain, or null if there is no terrain.
-
removeGlobalStatus
Removes the status with the specified type.- Parameters:
status
- The type of status to remove.
-
removeGlobalStatuses
Removes statuses with the specified types.- Parameters:
statuses
- The types of statuses to remove.
-
removeGlobalStatus
Removes the specified status.- Parameters:
g
- The status to remove.
-
addGlobalStatus
Adds the specified status. If the status is a weather, replaces the currently active weather with it.- Parameters:
g
- The status to add.
-
getGlobalStatus
Gets the status at the specified index.- Parameters:
index
- The index of the status to get.- Returns:
- The status at the index.
-
getGlobalStatus
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
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
Triggers effects when the weather changes.- Parameters:
weather
- The new weather.
-
triggerTerrainChange
Triggers effects when the terrain changes.- Parameters:
terrain
- The new terrain.
-
canWeatherChange
-