public class PermanentStats
extends java.lang.Object
Constructor and Description |
---|
PermanentStats() |
Modifier and Type | Method and Description |
---|---|
protected int |
calculateHP(Stats stats,
int level)
Calculates the Pokémon's hp.
|
int |
calculateStat(BattleStatsType stat,
Nature nature,
Stats stats,
int level)
Calculates a stat.
|
int |
get(BattleStatsType stat)
Gets the value associated with the given stat
|
int |
getAttack()
Gets the attack stat
|
int |
getDefense()
Gets the defense stat
|
EVStore |
getEVs()
Gets the EV store for ev stats
|
int |
getHP()
Gets the HP value
|
IVStore |
getIVs()
Gets the IV store for IVs stats
|
Pokemon |
getPokemon()
Gets the pokemon
|
int |
getSpecialAttack()
Gets the special attack stat
|
int |
getSpecialDefense()
Gets the special defense stat
|
int |
getSpeed()
Gets the speed stat
|
void |
readFromNBT(net.minecraft.nbt.CompoundNBT nbt)
Reads the Pokémon's stats from NBT.
|
void |
recalculateStats()
Recalculates the pokemon's stats and then updates their health percentage
|
void |
set(BattleStatsType stat,
int value)
Sets the value associated with the given stat
|
void |
setAttack(int attack)
Sets the attack stat
|
void |
setDefense(int defense)
Sets the defense stat
|
void |
setEVs(EVStore evs)
Sets the ev store
|
void |
setHP(int hp)
Gets the HP
|
void |
setIVs(IVStore ivs)
Sets the IV store
|
PermanentStats |
setLevelStats(Nature nature,
Stats stats,
int level)
Calculates the Pokémon's stats.
|
void |
setSpecialAttack(int specialAttack)
Sets the special attack stat
|
void |
setSpecialDefense(int specialDefense)
Sets the special defense stat
|
void |
setSpeed(int speed)
Sets the speed stat
|
int[] |
toArray() |
PermanentStats |
withPokemon(Pokemon pokemon)
Updates the pokemon related to these stats
|
void |
writeToNBT(net.minecraft.nbt.CompoundNBT nbt)
Writes the Pokémon's stats to NBT.
|
public transient Pokemon pokemon
public Pokemon getPokemon()
public int getHP()
public void setHP(int hp)
hp
- The HP statpublic int getAttack()
public void setAttack(int attack)
attack
- The new attack statpublic int getDefense()
public void setDefense(int defense)
defense
- The new defense statpublic int getSpecialAttack()
public void setSpecialAttack(int specialAttack)
specialAttack
- The new special attack statpublic int getSpecialDefense()
public void setSpecialDefense(int specialDefense)
specialDefense
- The new special defense statpublic int getSpeed()
public void setSpeed(int speed)
speed
- The new speed statpublic IVStore getIVs()
public void setIVs(IVStore ivs)
ivs
- Sets the new IV storepublic EVStore getEVs()
public void setEVs(EVStore evs)
evs
- The new ev storepublic PermanentStats setLevelStats(Nature nature, Stats stats, int level)
nature
- The Pokémon's Nature.stats
- The Pokémon's base stats.level
- The Pokémon's pokemonLevel.public void recalculateStats()
public PermanentStats withPokemon(Pokemon pokemon)
pokemon
- The new pokemonpublic int calculateStat(BattleStatsType stat, Nature nature, Stats stats, int level)
stat
- The stat to calculate.nature
- The Pokémon's Nature.stats
- The Pokémon's base stats.level
- The Pokémon's pokemonLevel.protected int calculateHP(Stats stats, int level)
stats
- The Pokémon's base stats.level
- The Pokémon's pokemonLevel.public void writeToNBT(net.minecraft.nbt.CompoundNBT nbt)
nbt
- The NBT tag to write to.public void readFromNBT(net.minecraft.nbt.CompoundNBT nbt)
nbt
- The NBT tag to read from.public int get(BattleStatsType stat)
stat
- The battle stat typepublic void set(BattleStatsType stat, int value)
stat
- The battle stat typevalue
- The value to set the stat topublic int[] toArray()