java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
com.pixelmonmod.pixelmon.battles.controller.participants.TestParticipant
All Implemented Interfaces:
BattleViewer

public class TestParticipant extends BattleParticipant
A battle participant representing a player, optimized for testing.
  • Field Details

    • hasAmuletCoin

      public boolean hasAmuletCoin
      Whether an Amulet Coin will double prize money.
    • amuletCoinMultiplier

      public int amuletCoinMultiplier
      The multiplier value used by the Amulet Coin to calculate the prize money.
    • hasHappyHour

      public boolean hasHappyHour
      Whether Happy Hour will double prize money.
    • happyHourMultiplier

      public int happyHourMultiplier
      The multiplier value used by Happy Hour to calculate the prize money.
    • payDay

      public int payDay
      The amount of money earned from Pay Day after the battle ends.
    • unlocked

      public EnumMegaItemsUnlocked unlocked
      Which battle gimmicks are unlocked
    • moveChoices

      public HashMap<UUID,MoveChoice> moveChoices
      The actions for each pokemon as obtained in the PickAction stage of a battle turn
    • battleMessages

      public List<net.minecraft.network.chat.Component> battleMessages
      A record of all the battle messages that would have appeared onscreen for a player
    • enforceStruggle

      public boolean enforceStruggle
      Whether to enforce Struggle mechanics on chosen moves
    • skipMax

      public boolean skipMax
      Whether to disable Max move conversion when attacking while dynamaxed
  • Constructor Details

    • TestParticipant

      public TestParticipant(Pokemon... team)
      Initializes the test participant.
      Parameters:
      team - The participant's party.
    • TestParticipant

      public TestParticipant(int numControlled, Pokemon... team)
      Initializes the test participant.
      Parameters:
      numControlled - How many pokemon are controlled at once
      team - The participant's party.
  • Method Details

    • asWrapper

      public PixelmonWrapper asWrapper()
      Access the default pokemon as a PixelmonWrapper
    • asWrapper

      public PixelmonWrapper asWrapper(Pokemon pokemon)
      Access any pokemon in the participant's party, can be used to access fainted pokemon
    • preBattleChecks

      public void preBattleChecks()
      Description copied from class: BattleParticipant
      Adds the participant to a battle.
      Overrides:
      preBattleChecks in class BattleParticipant
    • logBattleMessage

      public void logBattleMessage(net.minecraft.network.chat.Component message)
    • lastMessageKey

      public String lastMessageKey()
    • hasMessageContaining

      public boolean hasMessageContaining(String keyFragment)
    • numberOfMessageOccurrences

      public int numberOfMessageOccurrences(String keyFragment)
      Finds how many times a given message has been sent.
      Parameters:
      keyFragment - String representing a portion of a translatable battle message key
      Returns:
      how many times a message with the specified fragment has been sent to the participant.
    • getTeamPokemonList

      public List<PixelmonWrapper> getTeamPokemonList()
      Finds all Pokémon in the battle allied with the player.
      Returns:
      An array of Pokémon allied with the player.
    • endBattle

      public void endBattle(BattleEndCause cause)
      Description copied from class: BattleParticipant
      Ends the battle the participant is in.
      Specified by:
      endBattle in class BattleParticipant
    • getNextSwitch

      public UUID getNextSwitch(PixelmonWrapper user)
    • getPrizeMoneyMultiplier

      public int getPrizeMoneyMultiplier()
      Gets the multiplier for end-of-battle prize money awarded.
      Returns:
      The multiplier for end-of-battle prize money awarded.
    • getName

      public net.minecraft.network.chat.Component getName()
      Description copied from class: BattleParticipant
      Gets the name of the participant.
      Overrides:
      getName in class BattleParticipant
      Returns:
      The name of the participant.
    • getMove

      public MoveChoice getMove(PixelmonWrapper pixelmonWrapper)
      Description copied from class: BattleParticipant
      Gets the move to be used by the specified Pokémon.
      Overrides:
      getMove in class BattleParticipant
      Parameters:
      pixelmonWrapper - The Pokémon to get a move for.
      Returns:
      The move to be used by the specified Pokémon.
    • selectAction

      public void selectAction()
      Description copied from class: BattleParticipant
      Chooses an action for the participant's Pokémon.
      Overrides:
      selectAction in class BattleParticipant
    • evolve

      public void evolve()
    • evolve

      public void evolve(Pokemon pokemon)
    • useZMove

      public void useZMove()
      Causes the pokemon to use a Z-Move if possible
    • useZMove

      public void useZMove(Pokemon user)
    • switchPokemon

      public void switchPokemon(Pokemon switchingOut, Pokemon switchingIn)
      Causes a switch action to be performed during the turn. Note: Can be used after using an attackX call for the pokemon to select the target when switching out after a switch move, forced switch, or fainted pokemon
    • switchPokemon

      public void switchPokemon(int switchingOut, int switchingIn)
      Convenience method for switching between many pokemon in a test
    • attackSelf

      public void attackSelf(int move)
      Sets the first Pokémon's attack to the attack in the move set at the given position and targets itself
    • attackSelf

      public void attackSelf(Pokemon pw, int move)
      Sets the Pokémon's attack to the attack in the moveset at the given position and targets itself
      Parameters:
      pw - The pokemon using the attack
      move - The position of the attack to use
    • attackAuto

      public void attackAuto()
      Sets the first pokemon to target the opponent with the first move in its moveset
    • attackAutoTarget

      public void attackAutoTarget()
      Sets the Pokémon's attack to the attack in the move set at the first position and targets based on the move's targeting info

      Endure targets self, StealthRocks targets whole enemy team, HyperBeam targets opponent

    • attackAutoTarget

      public void attackAutoTarget(int move)
      Sets the Pokémon's attack to the attack in the move set at the given position and targets based on the move's targeting info

      Endure targets self, StealthRocks targets whole enemy team, HyperBeam targets opponent

      Parameters:
      move - The position of the attack to use
    • attackAutoTargetAll

      public void attackAutoTargetAll()
      Sets all of this participant's Pokémon to attack with their first move, using automatic targeting.
    • attackAuto

      public void attackAuto(Pokemon user)
      Targets the opponent with the first move, using the specified pokemon,
      Parameters:
      user - Which pokemon is attacking
    • attackAutoTarget

      public void attackAutoTarget(Pokemon user, int move)
      Attacks using the specified pokemon and move, with the target determined by the move's targeting info
      Parameters:
      user - Which pokemon is attacking
      move - Index of the move to use
    • attackOpponent

      public void attackOpponent(int move)
      Sets the first Pokémon's attack to the move at the given position in the moveset and targets the opponent
      Parameters:
      move - The position of the attack to use
    • attackOpponent

      public void attackOpponent(Pokemon user, int move)
      Sets the Pokémon's attack to the attack in the move set at the given position and targets the opponent
      Parameters:
      user - Which pokemon to attack with
      move - The position of the attack to use
    • attackTarget

      public void attackTarget(int move, Pokemon target)
      Sets the first Pokémon's attack to the attack in the move set at the given position and targets a specified pokemon
      Parameters:
      move - The position of the attack to use
      target - The pokemon to use the attack on
    • attackTarget

      public void attackTarget(Pokemon user, int move, Pokemon target)
      Sets the Pokémon's attack to the attack in the move set at the given position and targets a specific pokemon
      Parameters:
      user - Which pokemon to attack with
      move - The position of the attack to use
      target - The pokemon to use the attack on
    • attackTarget

      public void attackTarget(Pokemon user, int move, List<Pokemon> targets)
      Sets the Pokémon's attack to the attack in the move set at the given position and targets a specific pokemon. Used if controlling multiple pokemon.
      Parameters:
      user - Which pokemon is attacking
      move - The position of the attack to use
      targets - The pokemon to use the attack on
    • forceMiss

      public void forceMiss(TestParticipant targetOpponent)
    • forceMiss

      public void forceMiss(Pokemon attacker, Pokemon target)
    • shouldForceMiss

      public boolean shouldForceMiss(PixelmonWrapper attacker, PixelmonWrapper target)
    • onEndTurn

      public void onEndTurn(BattleController bc)
      Overrides:
      onEndTurn in class BattleParticipant
    • getDisplayName

      public net.minecraft.network.chat.MutableComponent getDisplayName()
      Description copied from class: BattleParticipant
      Returns the name of the entity the participant is representing.
      Overrides:
      getDisplayName in class BattleParticipant
      Returns:
      The name of the entity the participant is representing.
    • canMegaEvolve

      public boolean canMegaEvolve()
      Description copied from class: BattleParticipant
      Checks if the participant is allowed to Mega Evolve Pokémon.
      Overrides:
      canMegaEvolve in class BattleParticipant
      Returns:
      Whether the participant is allowed to Mega Evolve Pokémon.
    • canDynamax

      public boolean canDynamax()
      Description copied from class: BattleParticipant
      Checks if the participant is allowed to Dynamax Pokémon.
      Overrides:
      canDynamax in class BattleParticipant
      Returns:
      Whether the participant is allowed to Dynamax Pokémon.
    • resetPayDay

      public void resetPayDay()