Class PermanentStats

java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.stats.PermanentStats

public class PermanentStats extends Object
A Pokémon's stats.
  • Field Details

    • pokemon

      public transient Pokemon pokemon
  • Constructor Details

    • PermanentStats

      public PermanentStats()
  • Method Details

    • getPokemon

      public Pokemon 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

      public IVStore getIVs()
      Gets the IV store for IVs stats
      Returns:
      The IV store
    • setIVs

      public void setIVs(IVStore ivs)
      Sets the IV store
      Parameters:
      ivs - Sets the new IV store
    • getEVs

      public EVStore getEVs()
      Gets the EV store for ev stats
      Returns:
      The ev store
    • setEVs

      public void setEVs(EVStore evs)
      Sets the ev store
      Parameters:
      evs - The new ev store
    • setLevelStats

      public PermanentStats setLevelStats(Nature nature, Stats stats, int level)
      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

      public PermanentStats withPokemon(Pokemon pokemon)
      Updates the pokemon related to these stats
      Parameters:
      pokemon - The new pokemon
      Returns:
      This object
    • calculateStat

      public int calculateStat(BattleStatsType stat, Nature nature, Stats stats, int level)
      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

      protected int calculateHP(Stats stats, int level)
      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

      public int get(BattleStatsType stat)
      Gets the value associated with the given stat
      Parameters:
      stat - The battle stat type
      Returns:
      The value in the permanent stats
    • set

      public void set(BattleStatsType stat, int value)
      Sets the value associated with the given stat
      Parameters:
      stat - The battle stat type
      value - The value to set the stat to
    • toArray

      public int[] toArray()