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
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, entity, evolution, isDefeated, lastFailedCapture, lastFaintedTurn, lastMoveTime, numControlledPokemon, 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 is allowed to Mega Evolve Pokémon.void
endBattle
(BattleEndCause cause) Ends the battle the participant is in.void
evolve()
void
void
void
forceMiss
(TestParticipant targetOpponent) net.minecraft.network.chat.MutableComponent
Returns 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.Component
getName()
Gets the name of the participant.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.boolean
hasMessageContaining
(String keyFragment) void
logBattleMessage
(net.minecraft.network.chat.Component message) int
numberOfMessageOccurrences
(String keyFragment) Finds how many times a given message has been sent.void
void
Adds the participant to a battle.void
void
Chooses an action for the participant's Pokémon.boolean
shouldForceMiss
(PixelmonWrapper attacker, PixelmonWrapper target) void
switchPokemon
(int switchingOut, int switchingIn) Convenience method for switching between many pokemon in a testvoid
switchPokemon
(Pokemon switchingOut, Pokemon switchingIn) Causes a switch action to be performed during the turn.void
useZMove()
Causes the pokemon to use a Z-Move if possiblevoid
Methods 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, waiting
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:BattleParticipant
Adds the participant to a battle.- Overrides:
preBattleChecks
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
-
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:BattleParticipant
Gets the name of the participant.- Overrides:
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.- Overrides:
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 -
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:
onEndTurn
in classBattleParticipant
-
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 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()
-