|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmechanics.statuses.StatusEffect
public abstract class StatusEffect
This class represents a change in status of a pokemon.
Field Summary | |
---|---|
protected int |
m_lock
|
static int |
SPECIAL_EFFECT_LOCK
A pokemon can have only one of freeze, burn, sleep, paralysis, and poison, so we protect against this by giving this class of effects a designated lock called SPECIAL_EFFECT_LOCK. |
static int |
STATE_ACTIVE
States of a StatusEffect. |
static int |
STATE_DEACTIVATED
|
static int |
STATE_REMOVABLE
|
static int |
WEATHER_EFFECT_LOCK
There can be only be only weather effect in play. |
Constructor Summary | |
---|---|
StatusEffect()
|
Method Summary | |
---|---|
void |
activate()
Activate this status effect, unless it is removable. |
boolean |
apply(Pokemon p)
Applies the initial effects of the status to a pokemon but does not add the status to the list of statuses the pokemon has. |
boolean |
apply(Pokemon source,
Pokemon p)
The point of this method is to catch errors. |
void |
beginTick()
Begin ticking this effect. |
boolean |
canSwitch()
This method catches errors. |
boolean |
canSwitch(Pokemon p)
Return whether this status effect allows switching. |
java.lang.Object |
clone()
Clone this status effect. |
void |
deactivate()
Deactivate this status effect, unless it is removable. |
boolean |
deactivates(Pokemon p)
Determine whether this effect deactivates a pokemon. |
void |
disable()
Disable this status effect (i.e. |
boolean |
equals(java.lang.Object eff)
Determine whether two status effects are equal semantically. |
void |
executeTurn(Pokemon p,
BattleTurn turn)
This method is called when the pokemon to whom the status effect is applied is just about to execute his turn. |
java.lang.String |
getDescription()
Get a description of this status effect. |
double |
getEffectiveness(PokemonType move,
PokemonType pokemon,
boolean enemy)
Get transformed effectiveness based on this status effect. |
protected double |
getEnemyTransformedEffectiveness(PokemonType move,
PokemonType pokemon)
|
protected MoveListEntry |
getEnemyTransformedMove(Pokemon p,
MoveListEntry move)
|
Pokemon |
getInducer()
Get the pokemon who induced this effect. |
int |
getLock()
Get the lock of this effect. |
MoveListEntry |
getMove(Pokemon p,
MoveListEntry move,
boolean enemy)
Transform a move based on this status effect. |
java.lang.String |
getName()
Get the name of this status effect. |
int |
getTier()
Remove the tier of the after-turn effect. |
static int |
getTierCount()
Return the total number of tiers. |
protected double |
getTransformedEffectiveness(PokemonType move,
PokemonType pokemon)
|
protected MoveListEntry |
getTransformedMove(Pokemon p,
MoveListEntry move)
|
boolean |
hitsThroughSubstitute()
Return whether this status effect can apply statuses through a substitute. |
boolean |
immobilises(Pokemon poke)
Return whether this effect immobilises the pokemon. |
void |
informDamaged(Pokemon source,
Pokemon target,
MoveListEntry move,
int damage)
React to damage. |
void |
informDuplicateEffect(Pokemon p)
Inform that this effect was applied, unsuccessfully, a second time. |
boolean |
isActive()
Is this status effect active? |
boolean |
isEffectivenessTransformer(boolean enemy)
Does this status effect transform effectivenesses? |
boolean |
isExclusiveWith(StatusEffect eff)
Return whether this effect can coexist with another effect. |
boolean |
isListener()
Return whether this effect listens for damage. |
boolean |
isMoveTransformer(boolean enemy)
Returns true if this status effect is capable of transforming moves. |
boolean |
isPassable()
Can this status effect by baton passed? (Almost all can.) |
boolean |
isRemovable()
Is this status effect waiting to be removed? |
boolean |
isSingleton()
Determine whether this effect is a singleton -- i.e., whether only a single copy of it can be present on a pokemon. |
void |
setInducer(Pokemon p)
Set the pokemon who induced this effect. |
void |
switchIn(Pokemon p)
Called when a pokemon with this status effect switches in. |
boolean |
switchOut(Pokemon p)
Called when a pokemon with this status effect switches out. |
boolean |
tick(Pokemon p)
Called each turn that this status effect is applied to a pokemon. |
void |
unapply(Pokemon p)
Unapply this status effect. |
boolean |
vetoesMove(Pokemon p,
MoveListEntry entry)
Returns whether this status effect vetoes the choice of a particular move. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SPECIAL_EFFECT_LOCK
public static final int WEATHER_EFFECT_LOCK
public static final int STATE_ACTIVE
public static final int STATE_DEACTIVATED
public static final int STATE_REMOVABLE
protected int m_lock
Constructor Detail |
---|
public StatusEffect()
Method Detail |
---|
public void setInducer(Pokemon p)
public Pokemon getInducer()
public int getLock()
public java.lang.String getName()
public static final int getTierCount()
public boolean isPassable()
public boolean isExclusiveWith(StatusEffect eff)
eff
- the effect to test exclusiveness withpublic final void disable()
public final void deactivate()
public final void activate()
public final boolean isActive()
public final boolean isRemovable()
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean immobilises(Pokemon poke)
public java.lang.String getDescription()
public boolean tick(Pokemon p)
public int getTier()
public void switchIn(Pokemon p)
public boolean switchOut(Pokemon p)
public void unapply(Pokemon p)
public final boolean apply(Pokemon source, Pokemon p)
public boolean apply(Pokemon p)
public boolean hitsThroughSubstitute()
public boolean isEffectivenessTransformer(boolean enemy)
public void executeTurn(Pokemon p, BattleTurn turn)
public final double getEffectiveness(PokemonType move, PokemonType pokemon, boolean enemy)
move
- type of the movepokemon
- type of the pokemonenemy
- whether the Pokemon using the move is an enemyprotected double getTransformedEffectiveness(PokemonType move, PokemonType pokemon)
protected double getEnemyTransformedEffectiveness(PokemonType move, PokemonType pokemon)
public final MoveListEntry getMove(Pokemon p, MoveListEntry move, boolean enemy)
move
- the move to transform; the method is free to modify it
although it may also return a new MoveListEntryenemy
- whether the Pokemon p is an enemy
protected MoveListEntry getEnemyTransformedMove(Pokemon p, MoveListEntry move)
protected MoveListEntry getTransformedMove(Pokemon p, MoveListEntry move)
public boolean isMoveTransformer(boolean enemy)
enemy
- whether this is an enemy movepublic boolean isListener()
public void informDamaged(Pokemon source, Pokemon target, MoveListEntry move, int damage)
public boolean deactivates(Pokemon p)
public boolean equals(java.lang.Object eff)
equals
in class java.lang.Object
public boolean isSingleton()
public void informDuplicateEffect(Pokemon p)
public boolean canSwitch(Pokemon p)
public boolean canSwitch()
public boolean vetoesMove(Pokemon p, MoveListEntry entry)
public void beginTick()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |