public abstract class EffectBase
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.ArrayList<ModifierBase> |
modifiers
Chance modifiers for the effect.
|
Constructor and Description |
---|
EffectBase()
Initializes an effect.
|
EffectBase(boolean persists)
Initializes an effect.
|
Modifier and Type | Method and Description |
---|---|
void |
applyEarlyEffect(PixelmonWrapper user)
Triggers before the move is used.
|
abstract void |
applyEffect(PixelmonWrapper user,
PixelmonWrapper target)
Causes various effects during the move.
|
void |
applyEffectAfterAllTargets(PixelmonWrapper user)
Triggers after a Pokemon attacks all of its targets.
|
void |
applyEffectAfterStatus(PixelmonWrapper user)
Triggers at the end of every turn after residual status damage has been applied.
|
void |
applyEffectHitOrMiss(PixelmonWrapper user,
PixelmonWrapper target)
Triggers after a Pokemon attacks, no matter if it hits or misses.
|
AttackResult |
applyEffectStart(PixelmonWrapper user,
PixelmonWrapper target)
Causes effects before the move's power is calculated.
|
void |
applyMissEffect(PixelmonWrapper user,
PixelmonWrapper target)
Triggers when the move misses.
|
abstract boolean |
cantMiss(PixelmonWrapper user)
Determines whether a move cannot miss.
|
void |
changeChance(float multiplier)
Modifies the chance of a modifier's secondary effect occurring.
|
boolean |
checkChance()
Randomly determines whether a secondary effect will occur based on the multiplier.
|
void |
dealtDamage(PixelmonWrapper attacker,
PixelmonWrapper defender,
Attack attack,
DamageTypeEnum damageType)
Triggers when an attacker deals damage.
|
boolean |
doesPersist(PixelmonWrapper user)
Returns whether the move lasts multiple turns.
|
float |
getChance()
Gets the chance that the effect will occur.
|
protected float |
getWeightWithChance(float weight)
Chooses a weight for the effect based on the chance of it occurring.
|
boolean |
isChance()
Determines whether the move has a secondary effect.
|
int |
modifyDamage(int damage,
PixelmonWrapper user,
PixelmonWrapper target,
Attack a)
Triggers when the Pokémon deals direct damage.
|
int |
modifyPriority(int priority,
ImmutableAttack attack,
PixelmonWrapper pw)
Modifies the priority of a move.
|
double |
modifyTypeEffectiveness(java.util.List<Element> effectiveTypes,
Element moveType,
double baseEffectiveness)
Modifies the type effectiveness of a move.
|
double |
modifyTypeEffectiveness(java.util.List<Element> effectiveTypes,
Element moveType,
double baseEffectiveness,
BattleController bc)
Modifies the type effectiveness of a move.
|
void |
weightEffect(PixelmonWrapper pw,
MoveChoice userChoice,
java.util.List<MoveChoice> userChoices,
java.util.List<MoveChoice> bestUserChoices,
java.util.List<MoveChoice> opponentChoices,
java.util.List<MoveChoice> bestOpponentChoices)
Determines a weight for the move that has this effect.
|
public java.util.ArrayList<ModifierBase> modifiers
public EffectBase()
public EffectBase(boolean persists)
persists
- Whether the effect is a multi-turn move.public AttackResult applyEffectStart(PixelmonWrapper user, PixelmonWrapper target)
user
- The move's user.target
- The move's target.public abstract void applyEffect(PixelmonWrapper user, PixelmonWrapper target)
user
- The move's user.target
- The move's target.public boolean checkChance()
public boolean isChance()
public float getChance()
public void changeChance(float multiplier)
multiplier
- The multiplier to apply to the chance.public abstract boolean cantMiss(PixelmonWrapper user)
user
- The move's user.public boolean doesPersist(PixelmonWrapper user)
user
- The move's user.public void applyMissEffect(PixelmonWrapper user, PixelmonWrapper target)
user
- The move's user.target
- The move's target.public void applyEarlyEffect(PixelmonWrapper user)
user
- The move's user.public void applyEffectAfterAllTargets(PixelmonWrapper user)
user
- The move's user.public void applyEffectHitOrMiss(PixelmonWrapper user, PixelmonWrapper target)
user
- The move's user.public void applyEffectAfterStatus(PixelmonWrapper user)
user
- The Pokémon that attacked.public void dealtDamage(PixelmonWrapper attacker, PixelmonWrapper defender, Attack attack, DamageTypeEnum damageType)
attacker
- The source of the damage.defender
- The target of the damage.attack
- The attack used by the attacker.damageType
- The type of damage that was dealt.public void weightEffect(PixelmonWrapper pw, MoveChoice userChoice, java.util.List<MoveChoice> userChoices, java.util.List<MoveChoice> bestUserChoices, java.util.List<MoveChoice> opponentChoices, java.util.List<MoveChoice> bestOpponentChoices)
pw
- The Pokémon using the move.userChoice
- The move with this effect.userChoices
- All choices the Pokémon has for the turn.bestUserChoices
- The best offensive choices the Pokémon has for the turn.opponentChoices
- All choices the opponent has for the turn.bestOpponentChoices
- The best choices the opponent has for the turn.protected float getWeightWithChance(float weight)
weight
- The weight to assign to the effect if it has more than a 50% chance of occurring.public double modifyTypeEffectiveness(java.util.List<Element> effectiveTypes, Element moveType, double baseEffectiveness)
effectiveTypes
- The types of the Pokémon targeted by the move.moveType
- The type of the move being used in the calculation.baseEffectiveness
- The type effectiveness before modification.public double modifyTypeEffectiveness(java.util.List<Element> effectiveTypes, Element moveType, double baseEffectiveness, BattleController bc)
effectiveTypes
- The types of the Pokémon targeted by the move.moveType
- The type of the move being used in the calculation.baseEffectiveness
- The type effectiveness before modification.bc
- The active in use battle controller, this method calls the method without BC if unused specifically by the effectpublic int modifyPriority(int priority, ImmutableAttack attack, PixelmonWrapper pw)
priority
- The current calculated priority.attack
- The attack being used.pw
- The Pokémon using the move.public int modifyDamage(int damage, PixelmonWrapper user, PixelmonWrapper target, Attack a)
damage
- The amount of damage dealt.user
- The attack's user.target
- The attack's target.a
- The attack.