Class PermanentStats
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.stats.PermanentStats
A Pokémon's stats.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcalculateHP(Stats stats, int level) Calculates the Pokémon's hp.intcalculateStat(BattleStatsType stat, Nature nature, Stats stats, int level) Calculates a stat.intget(BattleStatsType stat) Gets the value associated with the given statintGets the attack statintGets the defense statgetEVs()Gets the EV store for ev statsintgetHP()Gets the HP valuegetIVs()Gets the IV store for IVs statsGets the pokemonintGets the special attack statintGets the special defense statintgetSpeed()Gets the speed statvoidreadFromNBT(net.minecraft.nbt.CompoundTag nbt) Reads the Pokémon's stats from NBT.voidRecalculates the pokemon's stats and then updates their health percentagevoidset(BattleStatsType stat, int value) Sets the value associated with the given statvoidsetAttack(int attack) Sets the attack statvoidsetDefense(int defense) Sets the defense statvoidSets the ev storevoidsetHP(int hp) Gets the HPvoidSets the IV storesetLevelStats(Nature nature, Stats stats, int level) Calculates the Pokémon's stats.voidsetSpecialAttack(int specialAttack) Sets the special attack statvoidsetSpecialDefense(int specialDefense) Sets the special defense statvoidsetSpeed(int speed) Sets the speed statint[]toArray()withPokemon(Pokemon pokemon) Updates the pokemon related to these statsvoidwriteToNBT(net.minecraft.nbt.CompoundTag nbt) Writes the Pokémon's stats to NBT.
-
Field Details
-
pokemon
-
-
Constructor Details
-
PermanentStats
public PermanentStats()
-
-
Method Details
-
getPokemon
Gets the pokemon- Returns:
- The pokemon related to these Permanent stats
-
getHP
public int getHP()Gets the HP value- Returns:
- The HP
-
setHP
public void setHP(int hp) Gets the HP- Parameters:
hp- The HP stat
-
getAttack
public int getAttack()Gets the attack stat- Returns:
- The attack stat
-
setAttack
public void setAttack(int attack) Sets the attack stat- Parameters:
attack- The new attack stat
-
getDefense
public int getDefense()Gets the defense stat- Returns:
- The defense stat
-
setDefense
public void setDefense(int defense) Sets the defense stat- Parameters:
defense- The new defense stat
-
getSpecialAttack
public int getSpecialAttack()Gets the special attack stat- Returns:
- The special attack stat
-
setSpecialAttack
public void setSpecialAttack(int specialAttack) Sets the special attack stat- Parameters:
specialAttack- The new special attack stat
-
getSpecialDefense
public int getSpecialDefense()Gets the special defense stat- Returns:
- The special defense stat
-
setSpecialDefense
public void setSpecialDefense(int specialDefense) Sets the special defense stat- Parameters:
specialDefense- The new special defense stat
-
getSpeed
public int getSpeed()Gets the speed stat- Returns:
- The speed stat
-
setSpeed
public void setSpeed(int speed) Sets the speed stat- Parameters:
speed- The new speed stat
-
getIVs
Gets the IV store for IVs stats- Returns:
- The IV store
-
setIVs
Sets the IV store- Parameters:
ivs- Sets the new IV store
-
getEVs
Gets the EV store for ev stats- Returns:
- The ev store
-
setEVs
Sets the ev store- Parameters:
evs- The new ev store
-
setLevelStats
Calculates the Pokémon's stats.- Parameters:
nature- The Pokémon's Nature.stats- The Pokémon's base stats.level- The Pokémon's pokemonLevel.- Returns:
- The stats instance.
-
recalculateStats
public void recalculateStats()Recalculates the pokemon's stats and then updates their health percentage -
withPokemon
Updates the pokemon related to these stats- Parameters:
pokemon- The new pokemon- Returns:
- This object
-
calculateStat
Calculates a stat.- Parameters:
stat- The stat to calculate.nature- The Pokémon's Nature.stats- The Pokémon's base stats.level- The Pokémon's pokemonLevel.- Returns:
- The calculated stat.
-
calculateHP
Calculates the Pokémon's hp.- Parameters:
stats- The Pokémon's base stats.level- The Pokémon's pokemonLevel.- Returns:
- The Pokémon's hp.
-
writeToNBT
public void writeToNBT(net.minecraft.nbt.CompoundTag nbt) Writes the Pokémon's stats to NBT.- Parameters:
nbt- The NBT tag to write to.
-
readFromNBT
public void readFromNBT(net.minecraft.nbt.CompoundTag nbt) Reads the Pokémon's stats from NBT.- Parameters:
nbt- The NBT tag to read from.
-
get
Gets the value associated with the given stat- Parameters:
stat- The battle stat type- Returns:
- The value in the permanent stats
-
set
Sets the value associated with the given stat- Parameters:
stat- The battle stat typevalue- The value to set the stat to
-
toArray
public int[] toArray()
-