Class TrainerParticipant
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
com.pixelmonmod.pixelmon.battles.controller.participants.TrainerParticipant
An NPC Trainer battle participant.
-
Field Summary
Modifier and TypeFieldDescriptionThe Trainer entity that this participant is representing.Fields 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
ConstructorDescriptionTrainerParticipant
(NPCTrainer trainer, int numPokemon) Initializes the participant.TrainerParticipant
(NPCTrainer trainer, net.minecraft.world.entity.player.Player opponent, int numPokemon) Initializes the participant.TrainerParticipant
(NPCTrainer trainer, net.minecraft.world.entity.player.Player opponent, int numPokemon, List<Pokemon> teamSelection) Initializes the participant. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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 if the participant's Pokémon are in a valid state.void
endBattle
(BattleEndCause cause) Ends the battle the participant is in.Returns the name of the entity the participant is representing.net.minecraft.world.entity.Mob
Gets the entity that this participant is representing.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;Returns the Pokémon storage of the participant.getType()
Gets the type of participant that this participant is.boolean
For use with switching in new Pokémon.void
Adds the participant to a battle.switchPokemon
(PixelmonWrapper oldPokemon, UUID newPixelmonUUID) Switches the participant's Pokémon for another one.void
Updates the opponent's Pokémon client-side.void
Updates the specified Pokémon client-side.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, getTeamPokemon, getTotalFainted, getTurnTimeSeconds, getWait, getWorld, hasMorePokemon, hasRemainingPokemon, incrementFaintCount, loadParty, loadParty, loadSingle, onAddStatus, onEndTurn, onHit, onOpponentKO, onSwitchIn, onTakeTurn, onTargeted, onUseAttack, onUseAttackOther, onUseAttackPost, resetMoveTimer, retrieveEntityDuringBattleUnlessRiding, selectAction, sendDamagePacket, sendHealPacket, sendMessage, setBattleAI, setNumControlledPokemon, switchAllFainted, tick, updateLastFaintedTurn
-
Field Details
-
trainer
The Trainer entity that this participant is representing.
-
-
Constructor Details
-
TrainerParticipant
public TrainerParticipant(NPCTrainer trainer, net.minecraft.world.entity.player.Player opponent, int numPokemon) throws IllegalStateException Initializes the participant.- Parameters:
trainer
- The Trainer entity that this participant is representing.opponent
- The player that is battling the Trainer.numPokemon
- The number of Pokémon to be sent out by the Trainer.- Throws:
IllegalStateException
- When the player is prevented from battling the NPC.
-
TrainerParticipant
public TrainerParticipant(NPCTrainer trainer, net.minecraft.world.entity.player.Player opponent, int numPokemon, List<Pokemon> teamSelection) throws IllegalStateException Initializes the participant.- Parameters:
trainer
- The Trainer entity that this participant is representing.opponent
- The player that is battling the Trainer.numPokemon
- The number of Pokémon to be sent out by the Trainer.teamSelection
- The team selected by the Trainer for battle.- Throws:
IllegalStateException
- When the player is prevented from battling the NPC.
-
TrainerParticipant
Initializes the participant.- Parameters:
trainer
- The Trainer entity that this participant is representing.numPokemon
- The number of Pokémon to be sent out by the Trainer.- Throws:
IllegalStateException
- When the player is prevented from battling the NPC.
-
-
Method Details
-
startBattle
public void startBattle()Description copied from class:BattleParticipant
Adds the participant to a battle.- Overrides:
startBattle
in classBattleParticipant
-
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.
-
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.
-
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.
-
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.
-
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:
p
- The Pokémon to get a move for.- Returns:
- The move to be used by the specified Pokémon.
-
switchPokemon
Description copied from class:BattleParticipant
Switches the participant's Pokémon for another one.- Specified by:
switchPokemon
in classBattleParticipant
- Parameters:
oldPokemon
- 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()Description copied from class:BattleParticipant
Checks if the participant's Pokémon are in a valid state.- Specified by:
checkPokemon
in classBattleParticipant
- Returns:
- Whether the participant's Pokémon are in a valid state.
-
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.
-
updatePokemon
Description copied from class:BattleParticipant
Updates the specified Pokémon client-side.- Specified by:
updatePokemon
in classBattleParticipant
- Parameters:
p
- The Pokémon to update.
-
getEntity
public net.minecraft.world.entity.Mob 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
-
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.
-
getStorage
Description copied from class:BattleParticipant
Returns the Pokémon storage of the participant.- Overrides:
getStorage
in classBattleParticipant
- Returns:
- The Pokémon storage of the participant.
-