public class BattleStats
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
accuracy
The Pokémon's accuracy modifier.
|
int |
attackModifier
The Pokémon's attack modifier.
|
int |
attackStat
The Pokémon's attack stat.
|
int |
defenseModifier
The Pokémon's defense modifier.
|
int |
defenseStat
The Pokémon's Defense stat.
|
int |
evasion
The Pokémon's evasion modifier.
|
int |
specialAttackModifier
The Pokémon's Special attack modifier.
|
int |
specialAttackStat
The Pokémon's Special attack stat.
|
int |
specialDefenseModifier
The Pokémon's Special Defense modifier.
|
int |
specialDefenseStat
The Pokémon's Special Defense stat.
|
int |
speedModifier
The Pokémon's speed modifier.
|
int |
speedStat
The Pokémon's speed stat.
|
Constructor and Description |
---|
BattleStats(BattleStats original)
Saves a copy of another set of battle stats.
|
BattleStats(PixelmonWrapper pixelmon)
Creates and resets BattleStats.
|
Modifier and Type | Method and Description |
---|---|
void |
changeStat(BattleStatsType stat,
int value)
Changes a stat to its value.
|
void |
clearBattleStats()
Resets battle-specific stats.
|
void |
clearBattleStats(boolean init)
Resets battle-specific stats.
|
void |
clearBattleStatsNoCrit()
Resets battle stats besides critical hit ratio.
|
BattleStats |
copy() |
void |
copyStats(BattleStats battleStats)
Copies all modifiers and stages.
|
boolean |
decreaseCritStage(int value)
Attempts to increase critical hit ratio.
|
boolean |
decreaseStat(int amount,
BattleStatsType stat,
PixelmonWrapper user,
boolean isAttack) |
boolean |
decreaseStat(int amount,
BattleStatsType stat,
PixelmonWrapper user,
boolean isAttack,
boolean messages)
Decreases the given stat the amount of stages.
|
int |
GetAccOrEva(double stage)
Gets the new value of the stat.
|
int |
getAccuracy()
Returns accuracy modifier.
|
int |
getAccuracyStage()
Returns accuracy stage.
|
double |
getAttackModifier()
Returns attack modifier.
|
int[] |
getBaseBattleStats()
Returns all base stats (not counting multipliers).
|
int[] |
getBattleStats()
Returns all stats.
|
int |
getCritStage()
Returns critical hit ratio.
|
int |
getDefenseModifier()
Returns defense modifier.
|
int |
getEvasion()
Returns evasion modifier.
|
int |
getEvasionStage()
Returns evasion stage.
|
java.util.ArrayList<java.lang.Integer> |
getPossibleStatIncreases() |
double |
getSpecialAttackModifier()
Returns Special attack modifier.
|
int |
getSpecialDefenseModifier()
Returns Special defense modifier.
|
double |
getSpeedModifier()
Returns speed modifier.
|
int |
getStage(BattleStatsType stat)
Returns the stage of a specified stat.
|
BattleStatsType |
getStageEnum(int index)
Returns the stat enum from the stage array index.
|
int[] |
getStages()
Returns all stat stages.
|
void |
getStatFailureMessage(BattleStatsType stat,
boolean increase)
Sends a battle message saying the stat cannot be increased/decreased any further.
|
int |
getStatFromEnum(BattleStatsType stat)
Returns the stat modifier from the stat enum.
|
int |
getStatModFromEnum(BattleStatsType stat)
Returns the stat modifier from the stat enum.
|
java.lang.String |
getStatStringLang(BattleStatsType stat)
Returns a string corresponding with lang entries for the stats.
|
int |
getStatWithMod(BattleStatsType stat)
Calculates the specified stat with its modifier.
|
int |
getSumIncreases()
Computes the total number of increased stages.
|
int |
getSumStages()
Computes the net number of stage modifiers.
|
boolean |
increaseCritStage(int value,
boolean isFocusEnergy)
Attempts to increase critical hit ratio.
|
boolean |
increaseStat(int amount,
BattleStatsType stat,
PixelmonWrapper user,
boolean isAttack)
Increases the given stat the amount of stages.
|
boolean |
increaseStat(int amount,
BattleStatsType stat,
PixelmonWrapper user,
boolean isAttack,
boolean sendMessage)
Increases the given stat the amount of stages.
|
boolean |
isLoweredThisTurn() |
boolean |
isRaisedThisTurn()
True if any stats were raised this turn.
|
boolean |
isStatModified()
Checks if any stats have been modified.
|
boolean |
modifyStat(int[] amounts,
BattleStatsType[] stats)
Modifies several stats by different amounts.
|
boolean |
modifyStat(int[] amounts,
BattleStatsType[] stats,
PixelmonWrapper user,
boolean isAttack) |
boolean |
modifyStat(int[] amounts,
BattleStatsType[] stats,
PixelmonWrapper user,
boolean isAttack,
boolean messages)
Modifies several stats by different amounts.
|
boolean |
modifyStat(int amount,
BattleStatsType... stats)
Modifies several stats by the same amount.
|
boolean |
modifyStat(int amount,
BattleStatsType stat)
Modifies a specified stat.
|
boolean |
modifyStat(int amount,
BattleStatsType[] stats,
PixelmonWrapper user)
Modifies several stats by the same amount.
|
boolean |
modifyStat(int amount,
BattleStatsType stat,
PixelmonWrapper user,
boolean isAttack)
Modifies a specified stat.
|
boolean |
modifyStat(int amount,
BattleStatsType stat,
PixelmonWrapper user,
boolean isAttack,
boolean messages) |
void |
notifyActivePokemonOfStatChange() |
boolean |
raiseRandomStat(int amount)
Raises a random stat.
|
void |
resetLoweredBattleStats() |
void |
resetStat(BattleStatsType stat)
Resets a specific stat.
|
void |
resetStat(int index)
Resets a specific stat.
|
void |
reverseStats()
Reverses all stat boosts.
|
void |
setBattleStatsForCurrentForm()
Update the battle stats of a new Pokémon with their current form.
|
void |
setLoweredThisTurn(boolean loweredThisTurn) |
void |
setRaisedThisTurn(boolean raisedThisTurn) |
void |
setStage(BattleStatsType stat,
int value)
Sets the stage of a stat.
|
void |
setStatsForTurn(int[] stats)
Sets stats during a battle turn.
|
boolean |
statCanBeLowered()
Determines whether a stat can be lowered.
|
boolean |
statCanBeLowered(BattleStatsType stat)
Determines whether the specified stat can be lowered.
|
boolean |
statCanBeRaised()
Determines whether a stat can be raised.
|
boolean |
statCanBeRaised(BattleStatsType stat)
Determines whether the specified stat can be raised.
|
void |
swapStats(BattleStats otherPokemon,
BattleStatsType... stats)
Swaps the stats of the Pokémon and another Pokémon.
|
java.lang.String |
toString() |
public int accuracy
public int evasion
public int attackModifier
public int defenseModifier
public int specialAttackModifier
public int specialDefenseModifier
public int speedModifier
public int attackStat
public int defenseStat
public int specialAttackStat
public int specialDefenseStat
public int speedStat
public BattleStats(PixelmonWrapper pixelmon)
pixelmon
- The Pokémon who the battle stats are attributed to.public BattleStats(BattleStats original)
original
- The battle stats to save.public int getAccuracy()
public int getEvasion()
public double getAttackModifier()
public int getDefenseModifier()
public double getSpecialAttackModifier()
public int getSpecialDefenseModifier()
public double getSpeedModifier()
public int getAccuracyStage()
public int getEvasionStage()
public int[] getStages()
public boolean modifyStat(int amount, BattleStatsType stat)
amount
- How much to raise or lower stat by.stat
- The stat to modify.public boolean modifyStat(int amount, BattleStatsType... stats)
amount
- How much to raise or lower the specified stats by.stats
- The stats to modify.public boolean modifyStat(int[] amounts, BattleStatsType[] stats)
amounts
- The amounts to modify each corresponding stat by.stats
- The stats to modify.public boolean modifyStat(int amount, BattleStatsType[] stats, PixelmonWrapper user)
amount
- How much to raise or lower the specified stats by.stats
- The stats to modify.user
- The Pokémon that caused the stat modification.public boolean modifyStat(int amount, BattleStatsType stat, PixelmonWrapper user, boolean isAttack, boolean messages)
public boolean modifyStat(int amount, BattleStatsType stat, PixelmonWrapper user, boolean isAttack)
amount
- How much to raise or lower stat by.stat
- The stat to modify.user
- The Pokémon that caused the stat modification.isAttack
- Whether the modification was from an attack.public boolean modifyStat(int[] amounts, BattleStatsType[] stats, PixelmonWrapper user, boolean isAttack)
public boolean modifyStat(int[] amounts, BattleStatsType[] stats, PixelmonWrapper user, boolean isAttack, boolean messages)
amounts
- The amounts to modify each corresponding stat by.stats
- The stats to modify.user
- The Pokémon that caused the stat modifications.isAttack
- Whether the modifications were from an attack.public void notifyActivePokemonOfStatChange()
public boolean increaseCritStage(int value, boolean isFocusEnergy)
value
- How much to increase critical hit ratio by.isFocusEnergy
- Whether this is Focus Energy.public boolean decreaseCritStage(int value)
value
- How much to increase critical hit ratio by.public int getCritStage()
public int GetAccOrEva(double stage)
stage
- The current stage of the stat (bounds of -6 to 6).public boolean increaseStat(int amount, BattleStatsType stat, PixelmonWrapper user, boolean isAttack)
amount
- How much to increase the stat by.stat
- The stat to increase.user
- The Pokémon that caused the stat increase.isAttack
- Whether the stat increase was caused by an attack.public boolean increaseStat(int amount, BattleStatsType stat, PixelmonWrapper user, boolean isAttack, boolean sendMessage)
amount
- How much to increase the stat by.stat
- The stat to increase.user
- The Pokémon that caused the stat increase.isAttack
- Whether the stat increase was caused by an attack.sendMessage
- Whether to send the message to the battle.public boolean decreaseStat(int amount, BattleStatsType stat, PixelmonWrapper user, boolean isAttack)
public boolean decreaseStat(int amount, BattleStatsType stat, PixelmonWrapper user, boolean isAttack, boolean messages)
amount
- How much to decrease the stat by.stat
- The stat to decrease.user
- The Pokémon that caused the stat decrease.isAttack
- Whether the stat decrease was caused by an attack.public void changeStat(BattleStatsType stat, int value)
stat
- The stat to change.value
- The new value to change the stat to.public int getStatFromEnum(BattleStatsType stat)
stat
- The stat modifier to retrieve.public int getStatModFromEnum(BattleStatsType stat)
stat
- The stat modifier to retrieve.public BattleStatsType getStageEnum(int index)
index
- The stage array index.public int getStage(BattleStatsType stat)
stat
- The stat to get the stage for.public void setStage(BattleStatsType stat, int value)
stat
- The stat to change the stage of.value
- The value to change the stage to.public void swapStats(BattleStats otherPokemon, BattleStatsType... stats)
otherPokemon
- The other Pokémon.stats
- The stats to swap.public void reverseStats()
public void resetStat(int index)
index
- The index of the stat to reset.public void resetStat(BattleStatsType stat)
stat
- The stat to reset.public void clearBattleStats()
public void clearBattleStats(boolean init)
init
- Whether to ignore the check for simulate mode.public void clearBattleStatsNoCrit()
public void resetLoweredBattleStats()
public void copyStats(BattleStats battleStats)
battleStats
- The source stats to copy from.public boolean isStatModified()
public int getSumIncreases()
public int getSumStages()
public boolean statCanBeRaised()
public boolean statCanBeLowered()
public boolean statCanBeRaised(BattleStatsType stat)
stat
- The stat to be raised.public boolean statCanBeLowered(BattleStatsType stat)
stat
- The stat to be lowered.public java.util.ArrayList<java.lang.Integer> getPossibleStatIncreases()
public boolean raiseRandomStat(int amount)
amount
- The amount to raise the random stat by.public int[] getBattleStats()
public int[] getBaseBattleStats()
public void setStatsForTurn(int[] stats)
stats
- What to set the stats to.public java.lang.String getStatStringLang(BattleStatsType stat)
stat
- The stat to get the lang entry for.public void getStatFailureMessage(BattleStatsType stat, boolean increase)
stat
- The stat that cannot be modified.increase
- Whether the stat was supposed to be increased.public int getStatWithMod(BattleStatsType stat)
stat
- The stat to calculate.public void setLoweredThisTurn(boolean loweredThisTurn)
public boolean isLoweredThisTurn()
public boolean isRaisedThisTurn()
public void setRaisedThisTurn(boolean raisedThisTurn)
public void setBattleStatsForCurrentForm()
public BattleStats copy()
public java.lang.String toString()
toString
in class java.lang.Object