mechanics.statuses.field
Class WeatherEffect

java.lang.Object
  extended by mechanics.statuses.StatusEffect
      extended by mechanics.statuses.field.FieldEffect
          extended by mechanics.statuses.field.WeatherEffect
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
HailEffect, RainEffect, SandstormEffect, SunEffect

public abstract class WeatherEffect
extends FieldEffect


Field Summary
protected  boolean[] m_applied
           
 
Fields inherited from class mechanics.statuses.StatusEffect
m_lock, SPECIAL_EFFECT_LOCK, STATE_ACTIVE, STATE_DEACTIVATED, STATE_REMOVABLE, WEATHER_EFFECT_LOCK
 
Constructor Summary
WeatherEffect(int turns)
          Initialise the number of turns that this effect will remain active for before it fades.
 
Method Summary
 int getTier()
          Weather effects are currently all in the third tier (zero is the first tier, so returning two is indeed the third tier).
protected  boolean hasEffects(BattleField field)
          Whether the weather should have effects.
 boolean isMoveTransformer(boolean enemy)
          Weather effects are move transformers.
protected  void setTypes(Pokemon p, PokemonType[] types, boolean apply)
          Changes the types of a Pokemon (for Forecast).
protected  boolean tickField(BattleField field)
          Handle the number of turns that this effect will last for.
protected abstract  void tickWeather(BattleField field)
          Tick the weather on this field.
 
Methods inherited from class mechanics.statuses.field.FieldEffect
applyToField, beginTick, clone, getFieldCopy, switchOut, tick, tickPokemon, unapplyToField
 
Methods inherited from class mechanics.statuses.StatusEffect
activate, apply, apply, canSwitch, canSwitch, deactivate, deactivates, disable, equals, executeTurn, getDescription, getEffectiveness, getEnemyTransformedEffectiveness, getEnemyTransformedMove, getInducer, getLock, getMove, getName, getTierCount, getTransformedEffectiveness, getTransformedMove, hitsThroughSubstitute, immobilises, informDamaged, informDuplicateEffect, isActive, isEffectivenessTransformer, isExclusiveWith, isListener, isPassable, isRemovable, isSingleton, setInducer, switchIn, unapply, vetoesMove
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_applied

protected boolean[] m_applied
Constructor Detail

WeatherEffect

public WeatherEffect(int turns)
Initialise the number of turns that this effect will remain active for before it fades.

Method Detail

tickField

protected final boolean tickField(BattleField field)
Handle the number of turns that this effect will last for. This method actually deactivatves the effect if it is time for it to fade. Subclasses should return super.tickField()!

Specified by:
tickField in class FieldEffect
Returns:
whether the weather effect faded

tickWeather

protected abstract void tickWeather(BattleField field)
Tick the weather on this field.


getTier

public int getTier()
Weather effects are currently all in the third tier (zero is the first tier, so returning two is indeed the third tier).

Overrides:
getTier in class StatusEffect

isMoveTransformer

public boolean isMoveTransformer(boolean enemy)
Weather effects are move transformers.

Overrides:
isMoveTransformer in class StatusEffect
Parameters:
enemy - whether this is an enemy move

hasEffects

protected boolean hasEffects(BattleField field)
Whether the weather should have effects.


setTypes

protected void setTypes(Pokemon p,
                        PokemonType[] types,
                        boolean apply)
Changes the types of a Pokemon (for Forecast).

Parameters:
apply - Whether the types are being applied or unapplied.