Class Substitute


public class Substitute extends StatusBase
A barrier that takes damage for its summoner and blocks most status moves.
  • Field Details

    • health

      public transient int health
      The substitute's hp.
  • Constructor Details

    • Substitute

      public Substitute()
      Initializes the status.
    • Substitute

      public Substitute(int health)
      Initializes a substitute.
      Parameters:
      health - The subsitute's initial hp.
  • Method Details

    • applyEffect

      public void applyEffect(PixelmonWrapper user, PixelmonWrapper target)
      Description copied from class: EffectBase
      Causes various effects during the move.
      Overrides:
      applyEffect in class StatusBase
      Parameters:
      user - The move's user.
      target - The move's target.
    • stopsStatusChange

      public boolean stopsStatusChange(StatusType t, PixelmonWrapper target, PixelmonWrapper user)
      Description copied from class: StatusBase
      Determines whether the status prevents the Pokémon from obtaining other statuses.
      Overrides:
      stopsStatusChange in class StatusBase
      Parameters:
      t - The status to be afflicted
      target - The Pokémon to be afflicted.
      user - The Pokémon afflicting the status.
      Returns:
      Whether the status stops the other status from being afflicted.
    • stopsIncomingAttack

      public boolean stopsIncomingAttack(PixelmonWrapper pokemon, PixelmonWrapper user)
      Description copied from class: StatusBase
      Determines whether the status stops an attack about to hit the statused Pokémon.
      Overrides:
      stopsIncomingAttack in class StatusBase
      Parameters:
      pokemon - The statused Pokémon.
      user - The attack's user.
      Returns:
      Whether the attack is stopped.
    • allowsStatChange

      public boolean allowsStatChange(PixelmonWrapper pokemon, PixelmonWrapper user, StatsEffect e)
      Description copied from class: StatusBase
      Determines whether the status allows stats to be modified
      Overrides:
      allowsStatChange in class StatusBase
      Parameters:
      pokemon - The statused Pokémon.
      user - The attack's user.
      e - The stat modifier.
      Returns:
      Whether the stat can be modified.
    • applyRepeatedEffect

      public void applyRepeatedEffect(PixelmonWrapper pw)
      Description copied from class: StatusBase
      Triggered at the end of every turn.
      Overrides:
      applyRepeatedEffect in class StatusBase
      Parameters:
      pw - The statused Pokémon.
    • onEndOfAttackersTurn

      public void onEndOfAttackersTurn(PixelmonWrapper statusedPokemon, PixelmonWrapper attacker)
      If possible, remove the substitute immediately after the end of the attacking Pokémon's turn.
      Overrides:
      onEndOfAttackersTurn in class StatusBase
      Parameters:
      statusedPokemon - The defending Pokémon that has the status condition.
      attacker - The attacking Pokémon.
    • attackSubstitute

      public float attackSubstitute(float damage, PixelmonWrapper source, PixelmonWrapper pw)
      Deals damage to the substitute.
      Parameters:
      damage - The damage to deal.
      pw - The Pokémon with the substitute.
      Returns:
      The amount of damage actually dealt.
    • ignoreSubstitute

      public boolean ignoreSubstitute(PixelmonWrapper attacker)
      Checks if an incoming move should ignore the substitute and directly damage the Pokémon.
      Parameters:
      attacker - The attacking Pokémon.
      Returns:
      Whether the incoming move should ignore the substitute.
    • weightEffect

      public void weightEffect(PixelmonWrapper pw, MoveChoice userChoice, List<MoveChoice> userChoices, List<MoveChoice> bestUserChoices, List<MoveChoice> opponentChoices, List<MoveChoice> bestOpponentChoices)
      Description copied from class: EffectBase
      Determines a weight for the move that has this effect. Used for battle AI.
      Overrides:
      weightEffect in class EffectBase
      Parameters:
      pw - The Pokémon using the move.
      userChoice - The move with this effect.
      userChoices - All choices the Pokémon has for the turn.
      bestUserChoices - The best offensive choices the Pokémon has for the turn.
      opponentChoices - All choices the opponent has for the turn.
      bestOpponentChoices - The best choices the opponent has for the turn.