mechanics.statuses.field
Class FieldEffect

java.lang.Object
  extended by mechanics.statuses.StatusEffect
      extended by mechanics.statuses.field.FieldEffect
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
MoveList.PartyEffect, MoveList.SpeedSwapEffect, MoveList.SpikesEffect, WeatherEffect

public abstract class FieldEffect
extends StatusEffect

This class represents a StatusEffect that is applied to a whole battle field, rather than a single pokemon.


Field Summary
 
Fields inherited from class mechanics.statuses.StatusEffect
m_lock, SPECIAL_EFFECT_LOCK, STATE_ACTIVE, STATE_DEACTIVATED, STATE_REMOVABLE, WEATHER_EFFECT_LOCK
 
Constructor Summary
FieldEffect()
           
 
Method Summary
abstract  boolean applyToField(BattleField field)
          Apply this effect to a field.
 void beginTick()
          Prepare this effect for ticking.
 java.lang.Object clone()
          Returns this object, rather than making a clone.
 FieldEffect getFieldCopy()
          Allow for functional cloning when applying this effect to a field.
 boolean switchOut(Pokemon poke)
          Generally a FieldEffect is said to be healed when a pokemon is switched out because it will be reapplied when the pokemon returns.
 boolean tick(Pokemon poke)
          Tick the effect on its associated field.
protected abstract  boolean tickField(BattleField field)
          Tick the effect on the whole field.
protected  boolean tickPokemon(Pokemon poke)
          Tick the effect on a pokemon.
 void unapplyToField(BattleField field)
          Remove this effect from a field.
 
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, getTier, getTierCount, getTransformedEffectiveness, getTransformedMove, hitsThroughSubstitute, immobilises, informDamaged, informDuplicateEffect, isActive, isEffectivenessTransformer, isExclusiveWith, isListener, isMoveTransformer, isPassable, isRemovable, isSingleton, setInducer, switchIn, unapply, vetoesMove
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldEffect

public FieldEffect()
Method Detail

switchOut

public boolean switchOut(Pokemon poke)
Generally a FieldEffect is said to be healed when a pokemon is switched out because it will be reapplied when the pokemon returns. This is the case with all current pokemon field effects (i.e. weather) in the sense that a pokemon who switches out during a weather effect and returns when the weather has cleared up is not still affected by that weather. If this function returned false, a pokemon switching in in clear times who had left when weather was present would still be affected by the weather.

Overrides:
switchOut in class StatusEffect

clone

public final java.lang.Object clone()
Returns this object, rather than making a clone. This is important so that all pokemon getting a clone of a FieldEffect are actually getting the same effect.

Overrides:
clone in class StatusEffect

getFieldCopy

public FieldEffect getFieldCopy()
Allow for functional cloning when applying this effect to a field.


tick

public final boolean tick(Pokemon poke)
Tick the effect on its associated field. Subclasses should override tickPokemon() or tickField() rather than this method.

Overrides:
tick in class StatusEffect

tickPokemon

protected boolean tickPokemon(Pokemon poke)
Tick the effect on a pokemon.


tickField

protected abstract boolean tickField(BattleField field)
Tick the effect on the whole field.

Returns:
whether the effect was removed

applyToField

public abstract boolean applyToField(BattleField field)
Apply this effect to a field.


unapplyToField

public void unapplyToField(BattleField field)
Remove this effect from a field.


beginTick

public void beginTick()
Prepare this effect for ticking.

Overrides:
beginTick in class StatusEffect