Class TrainerParticipant
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
com.pixelmonmod.pixelmon.battles.controller.participants.TrainerParticipant
- All Implemented Interfaces:
BattleViewer
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, entity, evolution, isDefeated, lastFailedCapture, lastFaintedTurn, lastMoveTime, numControlledPokemon, 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 is allowed to Mega Evolve Pokémon.void
checkAndHandleBossTier
(PixelmonWrapper wrapper) Checks if the participant is a boss and then applies the boss tier logic to the provided wrapper.void
endBattle
(BattleEndCause cause) Ends the battle the participant is in.net.minecraft.network.chat.MutableComponent
Returns the name of the entity the participant is representing.Returns the Pokémon storage of the participant.boolean
If the participant is a trainer.void
Adds the participant to a battle.Methods inherited from class com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
addSwitchingOut, canSwitch, checkPokemon, clearMovement, clearTurnVariables, convertEntitiesToWrapper, convertPokemonToWrapper, countAblePokemon, countFaintedPokemon, countHealthPercent, countPartyPokemon, faintedLastTurn, getActiveUnfaintedPokemon, getAllies, getAllyData, getBattleAI, getEntity, getFaintedPokemon, getHighestLevel, getLevelCap, getMove, getName, getNextPokemon, getOpponentPokemon, getOpponents, getPartyPokemonFromUUID, getPartyPosition, getPokemonFromParty, getPokemonFromUUID, getRandomPartyPokemon, getTeamPokemon, getTeamPokemonUUIDs, getTotalFainted, getTurnTimeSeconds, getUniqueId, getWait, getWorld, hasMorePokemon, hasMorePokemonReserve, hasRemainingPokemon, incrementFaintCount, isOnField, isPlayer, isRaid, isWild, loadParty, loadParty, loadSingle, onAddStatus, onEndTurn, onHit, onOpponentKO, onSwitchIn, onTakeTurn, onTargeted, onUseAttack, onUseAttackOther, onUseAttackPost, releasePokemon, resetMoveTimer, retrieveEntityDuringBattleUnlessRiding, revivePokemon, revivePokemon, selectAction, 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
-
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
-
preBattleChecks
public void preBattleChecks()Description copied from class:BattleParticipant
Adds the participant to a battle.- Overrides:
preBattleChecks
in classBattleParticipant
-
endBattle
Description copied from class:BattleParticipant
Ends the battle the participant is in.- Specified by:
endBattle
in classBattleParticipant
-
checkAndHandleBossTier
Description copied from class:BattleParticipant
Checks if the participant is a boss and then applies the boss tier logic to the provided wrapper.- Overrides:
checkAndHandleBossTier
in classBattleParticipant
- Parameters:
wrapper
- The wrapper to apply the boss tier logic to.
-
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.
-
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.
-
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.
-
isTrainer
public boolean isTrainer()Description copied from class:BattleParticipant
If the participant is a trainer.- Overrides:
isTrainer
in classBattleParticipant
- Returns:
- Whether the participant is a trainer.
-