Class TestParticipant
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
com.pixelmonmod.pixelmon.battles.controller.participants.TestParticipant
- All Implemented Interfaces:
BattleViewer
A battle participant representing a player, optimized for testing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe 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 playerbooleanWhether to enforce Struggle mechanics on chosen movesintThe multiplier value used by Happy Hour to calculate the prize money.booleanWhether an Amulet Coin will double prize money.booleanWhether Happy Hour will double prize money.The actions for each pokemon as obtained in the PickAction stage of a battle turnintThe amount of money earned from Pay Day after the battle ends.booleanWhether 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, entity, evolution, isDefeated, lastFailedCapture, lastFaintedTurn, lastMoveTime, numControlledPokemon, switchingIn, switchingOut, team, totalFainted, ultraBurst, usedZ, wait -
Constructor Summary
ConstructorsConstructorDescriptionTestParticipant(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 pokemonvoidSets the first pokemon to target the opponent with the first move in its movesetvoidattackAuto(Pokemon user) Targets the opponent with the first move, using the specified pokemon,voidSets the Pokémon's attack to the attack in the move set at the first position and targets based on the move's targeting infovoidattackAutoTarget(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 infovoidattackAutoTarget(Pokemon user, int move) Attacks using the specified pokemon and move, with the target determined by the move's targeting infovoidSets all of this participant's Pokémon to attack with their first move, using automatic targeting.voidattackOpponent(int move) Sets the first Pokémon's attack to the move at the given position in the moveset and targets the opponentvoidattackOpponent(Pokemon user, int move) Sets the Pokémon's attack to the attack in the move set at the given position and targets the opponentvoidattackSelf(int move) Sets the first Pokémon's attack to the attack in the move set at the given position and targets itselfvoidattackSelf(Pokemon pw, int move) Sets the Pokémon's attack to the attack in the moveset at the given position and targets itselfvoidattackTarget(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 pokemonvoidattackTarget(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 pokemonvoidattackTarget(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.booleanChecks if the participant is allowed to Dynamax Pokémon.booleanChecks if the participant is allowed to Mega Evolve Pokémon.voidendBattle(BattleEndCause cause) Ends the battle the participant is in.voidevolve()voidvoidvoidforceMiss(TestParticipant targetOpponent) net.minecraft.network.chat.MutableComponentReturns the name of the entity the participant is representing.getMove(PixelmonWrapper pixelmonWrapper) Gets the move to be used by the specified Pokémon.net.minecraft.network.chat.ComponentgetName()Gets the name of the participant.getNextSwitch(PixelmonWrapper user) intGets the multiplier for end-of-battle prize money awarded.Finds all Pokémon in the battle allied with the player.booleanhasMessageContaining(String keyFragment) voidlogBattleMessage(net.minecraft.network.chat.Component message) intnumberOfMessageOccurrences(String keyFragment) Finds how many times a given message has been sent.voidvoidAdds the participant to a battle.voidvoidChooses an action for the participant's Pokémon.booleanshouldForceMiss(PixelmonWrapper attacker, PixelmonWrapper target) voidswitchPokemon(int switchingOut, int switchingIn) Convenience method for switching between many pokemon in a testvoidswitchPokemon(Pokemon switchingOut, Pokemon switchingIn) Causes a switch action to be performed during the turn.voiduseZMove()Causes the pokemon to use a Z-Move if possiblevoidMethods inherited from class com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
addSwitchingOut, canSwitch, checkAndHandleBossTier, checkPokemon, clearMovement, clearTurnVariables, convertEntitiesToWrapper, convertPokemonToWrapper, countAblePokemon, countFaintedPokemon, countHealthPercent, countPartyPokemon, faintedLastTurn, getActiveUnfaintedPokemon, getAllies, getAllyData, getBattleAI, getEntity, getFaintedPokemon, getHighestLevel, getLevelCap, getNextPokemon, getOpponentPokemon, getOpponents, getPartyPokemonFromUUID, getPartyPosition, getPokemonFromParty, getPokemonFromUUID, getRandomPartyPokemon, getStorage, getTeamPokemon, getTeamPokemonUUIDs, getTotalFainted, getTurnTimeSeconds, getUniqueId, getWait, getWorld, hasMorePokemon, hasMorePokemonReserve, hasRemainingPokemon, incrementFaintCount, isOnField, isPlayer, isRaid, isTrainer, isWild, loadParty, loadParty, loadSingle, onAddStatus, onHit, onOpponentKO, onSwitchIn, onTakeTurn, onTargeted, onUseAttack, onUseAttackOther, onUseAttackPost, releasePokemon, resetMoveTimer, retrieveEntityDuringBattleUnlessRiding, revivePokemon, revivePokemon, sendBattleMessage, sendBattleMessage, sendDamagePacket, sendHealPacket, sendPacket, setBattleAI, setWait, startBattle, switchAllFainted, switchPokemon, tick, updateBattlingPokemon, updateLastFaintedTurn, waitingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.BattleViewer
getPlayer, sendBattleMessage
-
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 -
preBattleChecks
public void preBattleChecks()Description copied from class:BattleParticipantAdds the participant to a battle.- Overrides:
preBattleChecksin 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:BattleParticipantEnds the battle the participant is in.- Specified by:
endBattlein classBattleParticipant
-
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.
-
getName
public net.minecraft.network.chat.Component getName()Description copied from class:BattleParticipantGets the name of the participant.- Overrides:
getNamein classBattleParticipant- Returns:
- The name of the participant.
-
getMove
Description copied from class:BattleParticipantGets the move to be used by the specified Pokémon.- Overrides:
getMovein 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:BattleParticipantChooses an action for the participant's Pokémon.- Overrides:
selectActionin 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 -
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
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
-
forceMiss
-
forceMiss
-
shouldForceMiss
-
onEndTurn
- Overrides:
onEndTurnin classBattleParticipant
-
getDisplayName
public net.minecraft.network.chat.MutableComponent getDisplayName()Description copied from class:BattleParticipantReturns the name of the entity the participant is representing.- Overrides:
getDisplayNamein classBattleParticipant- Returns:
- The name of the entity the participant is representing.
-
canMegaEvolve
public boolean canMegaEvolve()Description copied from class:BattleParticipantChecks if the participant is allowed to Mega Evolve Pokémon.- Overrides:
canMegaEvolvein classBattleParticipant- Returns:
- Whether the participant is allowed to Mega Evolve Pokémon.
-
canDynamax
public boolean canDynamax()Description copied from class:BattleParticipantChecks if the participant is allowed to Dynamax Pokémon.- Overrides:
canDynamaxin classBattleParticipant- Returns:
- Whether the participant is allowed to Dynamax Pokémon.
-
resetPayDay
public void resetPayDay()
-