Class TestParticipant
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
com.pixelmonmod.pixelmon.battles.controller.participants.TestParticipant
A battle participant representing a player, optimized for testing.
-
Field Summary
Modifier and TypeFieldDescriptionint
The multiplier value used by the Amulet Coin to calculate the prize money.List<net.minecraft.network.chat.Component>
A record of all the battle messages that would have appeared onscreen for a playerboolean
Whether to enforce Struggle mechanics on chosen movesint
The multiplier value used by Happy Hour to calculate the prize money.boolean
Whether an Amulet Coin will double prize money.boolean
Whether Happy Hour will double prize money.The actions for each pokemon as obtained in the PickAction stage of a battle turnint
The amount of money earned from Pay Day after the battle ends.boolean
Whether to disable Max move conversion when attacking while dynamaxedWhich battle gimmicks are unlockedFields inherited from class com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
allPokemon, ashNinja, bc, controlledPokemon, dynamax, evolution, isDefeated, lastFailedCapture, lastFaintedTurn, lastMoveTime, numControlledPokemon, startedBattle, switchingIn, switchingOut, team, totalFainted, ultraBurst, usedZ, wait
-
Constructor Summary
ConstructorDescriptionTestParticipant
(int numControlled, Pokemon... team) Initializes the test participant.TestParticipant
(Pokemon... team) Initializes the test participant. -
Method Summary
Modifier and TypeMethodDescriptionAccess the default pokemon as a PixelmonWrapperAccess any pokemon in the participant's party, can be used to access fainted pokemonvoid
Sets the first pokemon to target the opponent with the first move in its movesetvoid
attackAuto
(Pokemon user) Targets the opponent with the first move, using the specified pokemon,void
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 infovoid
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 infovoid
attackAutoTarget
(Pokemon user, int move) Attacks using the specified pokemon and move, with the target determined by the move's targeting infovoid
Sets all of this participant's Pokémon to attack with their first move, using automatic targeting.void
attackOpponent
(int move) Sets the first Pokémon's attack to the move at the given position in the moveset and targets the opponentvoid
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 opponentvoid
attackSelf
(int move) Sets the first Pokémon's attack to the attack in the move set at the given position and targets itselfvoid
attackSelf
(Pokemon pw, int move) Sets the Pokémon's attack to the attack in the moveset at the given position and targets itselfvoid
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 pokemonvoid
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 pokemonvoid
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.boolean
Checks if the participant is allowed to Dynamax Pokémon.boolean
Checks if the participant's Pokémon can give experience.boolean
Checks if the participant is allowed to Mega Evolve Pokémon.boolean
Checks all pokemon are legal, requirement from BattleParticipant superclassvoid
endBattle
(BattleEndCause cause) Ends the battle the participant is in.void
evolve()
void
Returns the name of the entity the participant is representing.net.minecraft.world.entity.LivingEntity
Gets the entity that this participant is representing.int
Gets the pokemonLevel of the highest-leveled Pokémon in the player's party.getMove
(PixelmonWrapper pixelmonWrapper) Gets the move to be used by the specified Pokémon.net.minecraft.network.chat.Component
getName()
Gets the name of the participant.void
getNextPokemon
(int position) Sends out the next unfainted Pokémon in the participant's party.Gets the UUID of the next Pokémon in the participant's party that can battle;getNextSwitch
(PixelmonWrapper user) int
Gets the multiplier for end-of-battle prize money awarded.Finds all Pokémon in the battle allied with the player.getType()
Gets the type of participant that this participant is.boolean
hasMessageContaining
(String keyFragment) boolean
For use with switching in new Pokémon.void
logBattleMessage
(net.minecraft.network.chat.Component message) int
numberOfMessageOccurrences
(String keyFragment) Finds how many times a given message has been sent.void
void
void
Chooses an action for the participant's Pokémon.void
Adds the participant to a battle.void
switchPokemon
(Pokemon switchingOut, Pokemon switchingIn) Causes a switch action to be performed during the turn.switchPokemon
(PixelmonWrapper pw, UUID newPixelmonUUID) Implements the switch for a pokemon, called by BattleControllervoid
Updates the opponent's Pokémon client-side.void
Blank methods to ignore Server/Client communication for PlayerParticipantsvoid
useZMove()
Causes the pokemon to use a Z-Move if possiblevoid
Methods inherited from class com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
addSwitchingOut, canSwitch, clearTurnVariables, countAblePokemon, countHealthPercent, countTeam, faintedLastTurn, getActiveUnfaintedPokemon, getAllies, getBattleAI, getCurrentTime, getFaintedPokemon, getOpponentPokemon, getOpponents, getPartyPokemonFromUUID, getPartyPosition, getPokemonFromParty, getPokemonFromParty, getPokemonFromUUID, getRandomPartyPokemon, getStorage, getTeamPokemon, getTotalFainted, getTurnTimeSeconds, getWait, getWorld, hasMorePokemon, hasRemainingPokemon, incrementFaintCount, loadParty, loadParty, loadSingle, onAddStatus, onHit, onOpponentKO, onSwitchIn, onTakeTurn, onTargeted, onUseAttack, onUseAttackOther, onUseAttackPost, resetMoveTimer, retrieveEntityDuringBattleUnlessRiding, sendDamagePacket, sendHealPacket, sendMessage, setBattleAI, setNumControlledPokemon, switchAllFainted, tick, updateLastFaintedTurn
-
Field Details
-
hasAmuletCoin
public boolean hasAmuletCoinWhether an Amulet Coin will double prize money. -
amuletCoinMultiplier
public int amuletCoinMultiplierThe multiplier value used by the Amulet Coin to calculate the prize money. -
hasHappyHour
public boolean hasHappyHourWhether Happy Hour will double prize money. -
happyHourMultiplier
public int happyHourMultiplierThe multiplier value used by Happy Hour to calculate the prize money. -
payDay
public int payDayThe amount of money earned from Pay Day after the battle ends. -
unlocked
Which battle gimmicks are unlocked -
moveChoices
The actions for each pokemon as obtained in the PickAction stage of a battle turn -
battleMessages
A record of all the battle messages that would have appeared onscreen for a player -
enforceStruggle
public boolean enforceStruggleWhether to enforce Struggle mechanics on chosen moves -
skipMax
public boolean skipMaxWhether to disable Max move conversion when attacking while dynamaxed
-
-
Constructor Details
-
TestParticipant
Initializes the test participant.- Parameters:
team
- The participant's party.
-
TestParticipant
Initializes the test participant.- Parameters:
numControlled
- How many pokemon are controlled at onceteam
- The participant's party.
-
-
Method Details
-
asWrapper
Access the default pokemon as a PixelmonWrapper -
asWrapper
Access any pokemon in the participant's party, can be used to access fainted pokemon -
getType
Description copied from class:BattleParticipant
Gets the type of participant that this participant is.- Specified by:
getType
in classBattleParticipant
- 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 classBattleParticipant
- 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 classBattleParticipant
- 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 classBattleParticipant
-
logBattleMessage
public void logBattleMessage(net.minecraft.network.chat.Component message) -
lastMessageKey
-
hasMessageContaining
-
numberOfMessageOccurrences
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
Finds all Pokémon in the battle allied with the player.- Returns:
- An array of Pokémon allied with the player.
-
endBattle
Description copied from class:BattleParticipant
Ends the battle the participant is in.- Specified by:
endBattle
in classBattleParticipant
-
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 classBattleParticipant
- Parameters:
position
- The position to send out the Pokémon at.
-
getNextSwitch
-
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
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 classBattleParticipant
- 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 classBattleParticipant
- Returns:
- The name of the participant.
-
getMove
Description copied from class:BattleParticipant
Gets the move to be used by the specified Pokémon.- Specified by:
getMove
in classBattleParticipant
- 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 classBattleParticipant
-
evolve
public void evolve() -
evolve
-
useZMove
public void useZMove()Causes the pokemon to use a Z-Move if possible -
useZMove
-
switchPokemon
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
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 attackmove
- 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 infoEndure 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 infoEndure 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
Targets the opponent with the first move, using the specified pokemon,- Parameters:
user
- Which pokemon is attacking
-
attackAutoTarget
Attacks using the specified pokemon and move, with the target determined by the move's targeting info- Parameters:
user
- Which pokemon is attackingmove
- 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
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 withmove
- The position of the attack to use
-
attackTarget
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 usetarget
- The pokemon to use the attack on
-
attackTarget
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 withmove
- The position of the attack to usetarget
- The pokemon to use the attack on
-
attackTarget
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 attackingmove
- The position of the attack to usetargets
- The pokemon to use the attack on
-
onEndTurn
- Overrides:
onEndTurn
in classBattleParticipant
-
switchPokemon
Implements the switch for a pokemon, called by BattleController- Specified by:
switchPokemon
in classBattleParticipant
- 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 classBattleParticipant
- Returns:
- Whether the participant's Pokémon are in a valid state.
-
updatePokemon
Blank methods to ignore Server/Client communication for PlayerParticipants- Specified by:
updatePokemon
in classBattleParticipant
- 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 classBattleParticipant
- 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 classBattleParticipant
-
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
Description copied from class:BattleParticipant
Returns the name of the entity the participant is representing.- Overrides:
getDisplayName
in classBattleParticipant
- 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 classBattleParticipant
- 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 classBattleParticipant
- Returns:
- Whether the participant is allowed to Dynamax Pokémon.
-
resetPayDay
public void resetPayDay()
-