Class PermanentStats
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.stats.PermanentStats
A Pokémon's stats.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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 statint
Gets the attack statint
Gets the defense statgetEVs()
Gets the EV store for ev statsint
getHP()
Gets the HP valuegetIVs()
Gets the IV store for IVs statsGets the pokemonint
Gets the special attack statint
Gets the special defense statint
getSpeed()
Gets the speed statvoid
readFromNBT
(net.minecraft.nbt.CompoundTag nbt) Reads the Pokémon's stats from NBT.void
Recalculates the pokemon's stats and then updates their health percentagevoid
set
(BattleStatsType stat, int value) Sets the value associated with the given statvoid
setAttack
(int attack) Sets the attack statvoid
setDefense
(int defense) Sets the defense statvoid
Sets the ev storevoid
setHP
(int hp) Gets the HPvoid
Sets the IV storesetLevelStats
(Nature nature, Stats stats, int level) Calculates the Pokémon's stats.void
setSpecialAttack
(int specialAttack) Sets the special attack statvoid
setSpecialDefense
(int specialDefense) Sets the special defense statvoid
setSpeed
(int speed) Sets the speed statint[]
toArray()
withPokemon
(Pokemon pokemon) Updates the pokemon related to these statsvoid
writeToNBT
(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()
-