java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
com.pixelmonmod.pixelmon.battles.controller.participants.TestParticipant

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
    • getType

      public ParticipantType getType()
      Description copied from class: BattleParticipant
      Gets the type of participant that this participant is.
      Specified by:
      getType in class BattleParticipant
      Returns:
      The type of participant that this participant is.
    • canGainXP

      public boolean canGainXP()
      Description copied from class: BattleParticipant
      Checks if the participant's Pokémon can give experience.
      Specified by:
      canGainXP in class BattleParticipant
      Returns:
      Whether the participant's Pokémon can give experience.
    • hasMorePokemonReserve

      public boolean hasMorePokemonReserve()
      Description copied from class: BattleParticipant
      For use with switching in new Pokémon. Checks if they have Pokémon in reserve. Normally calls countablePokemon.
      Specified by:
      hasMorePokemonReserve in class BattleParticipant
      Returns:
      True if the player has a Pokémon in reserve.
    • startBattle

      public void startBattle()
      Description copied from class: BattleParticipant
      Adds the participant to a battle.
      Overrides:
      startBattle 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
    • getNextPokemon

      public void getNextPokemon(int position)
      Description copied from class: BattleParticipant
      Sends out the next unfainted Pokémon in the participant's party.
      Specified by:
      getNextPokemon in class BattleParticipant
      Parameters:
      position - The position to send out the Pokémon at.
    • 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.
    • getNextPokemonUUID

      public UUID getNextPokemonUUID()
      Description copied from class: BattleParticipant
      Gets the UUID of the next Pokémon in the participant's party that can battle;
      Specified by:
      getNextPokemonUUID in class BattleParticipant
      Returns:
      the UUID of the next Pokémon in the participant's party that can battle, or null if there aren't any.
    • getName

      public net.minecraft.network.chat.Component getName()
      Description copied from class: BattleParticipant
      Gets the name of the participant.
      Specified by:
      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.
      Specified by:
      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
    • 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
    • onEndTurn

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

      public PixelmonWrapper switchPokemon(PixelmonWrapper pw, UUID newPixelmonUUID)
      Implements the switch for a pokemon, called by BattleController
      Specified by:
      switchPokemon in class BattleParticipant
      Parameters:
      pw - The Pokémon to switch out.
      newPixelmonUUID - The UUID of the Pokémon's to switch in.
      Returns:
      The Pokémon who switched in.
    • checkPokemon

      public boolean checkPokemon()
      Checks all pokemon are legal, requirement from BattleParticipant superclass
      Specified by:
      checkPokemon in class BattleParticipant
      Returns:
      Whether the participant's Pokémon are in a valid state.
    • updatePokemon

      public void updatePokemon(PixelmonWrapper pw)
      Blank methods to ignore Server/Client communication for PlayerParticipants
      Specified by:
      updatePokemon in class BattleParticipant
      Parameters:
      pw - The Pokémon to update.
    • getEntity

      public net.minecraft.world.entity.LivingEntity getEntity()
      Description copied from class: BattleParticipant
      Gets the entity that this participant is representing.
      Specified by:
      getEntity in class BattleParticipant
      Returns:
      The entity that this participant is representing.
    • updateOtherPokemon

      public void updateOtherPokemon()
      Description copied from class: BattleParticipant
      Updates the opponent's Pokémon client-side.
      Specified by:
      updateOtherPokemon in class BattleParticipant
    • getHighestLevel

      public int getHighestLevel()
      Gets the pokemonLevel of the highest-leveled Pokémon in the player's party.
      Returns:
      The pokemonLevel of the highest-leveled Pokémon in the player's party
    • getDisplayName

      public String 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()