Class LogBattleParticipant
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
com.pixelmonmod.pixelmon.battles.controller.participants.LogBattleParticipant
- All Implemented Interfaces:
BattleViewer
-
Field Summary
FieldsFields inherited from class com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
allPokemon, ashNinja, bc, controlledPokemon, dynamax, entity, evolution, isDefeated, lastFailedCapture, lastFaintedTurn, lastMoveTime, numControlledPokemon, originalPokemon, switchingIn, switchingOut, team, totalFainted, ultraBurst, usedZ, wait -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a Pokémon to the list of Pokémon switching out.booleanChecks if the participant is allowed to Dynamax Pokémon.booleanChecks if the participant is allowed to Mega Evolve Pokémon.voidcheckAndHandleBossTier(PixelmonWrapper wrapper) Checks if the participant is a boss and then applies the boss tier logic to the provided wrapper.booleanChecks if the participant's Pokémon are in a valid state.protected voidvoidResets turn-specific variables for the participant's Pokémon.intCalculated number of unfainted Pokémon in the entire team.intCounts the number of fainted Pokémon in the participant's party.floatCounts the percentage of health remaining in the participant's party.intcountPartyPokemon(Predicate<PixelmonWrapper> predicate) Counts the number of Pokémon in the participant's party that match the provided predicate.voidendBattle(BattleEndCause cause) Ends the battle the participant is in.voidenforcedSwitch(PixelmonWrapper itemHolder) booleanReturns whether one of the participant's pokemon fainted last turn.Returns all active, unfainted Pokémon that the participant is controlling.Finds the participants on the allied side of the battle.Gets data about the player's allied Pokémon.net.minecraft.network.chat.MutableComponentReturns the name of the entity the participant is representing.@Nullable net.minecraft.world.entity.EntityGets the entity that this participant is representing.Gets the first fainted Pokémon in the participant's party.intGets the highest level of the participant's Pokémon.protected intGets the level cap for the participant.getMove(PixelmonWrapper pokemon) Gets the move to be used by the specified Pokémon.net.minecraft.network.chat.ComponentgetName()Gets the name of the participant.voidgetNextPokemon(int position) Sends out the next unfainted Pokémon in the participant's party.Returns all Pokemon on the opposite side of the battle that the participant is on.Finds the participants on the opposing side of the battle.getPartyPokemonFromUUID(UUID uuid) Gets a Pokémon from its UUID.intgetPartyPosition(PixelmonWrapper pokemon) Gets the base position of the Pokémon in the participant's party.getPokemonFromParty(UUID uuid) Gets the Pokémon from the participant's party who matches the given Pokémon UUID.getPokemonFromUUID(UUID uuid) Gets a controlled Pokémon from its UUID.Gets a random Pokémon from the participant's party that isn't already sent out.Returns the Pokémon storage of the participant.Returns all Pokemon on the side of the battle that the participant is on.Finds all Pokémon in the battle allied with the player.intReturns the number of Pokémon that have fainted for this participant this battle.longGets the time since the participant last made a move.Gets the UUID of the participant.booleangetWait()Checks if the participant is waiting in battle.net.minecraft.world.level.LevelgetWorld()Gets the world that the participant is in.booleanChecks if the participant has Pokémon that can battlebooleanFor use with switching in new Pokémon.booleanChecks if the participant has unfainted Pokémon remaining.voidIncrements the number of fainted pokemon.protected booleanbooleanonAddStatus(BattleController bc, PixelmonWrapper user, PixelmonWrapper target, StatusBase status) voidfloatonHit(PixelmonWrapper source, float damage, DamageTypeEnum damageType) voidvoidbooleanbooleanonTargeted(PixelmonWrapper user, Attack attack) booleanbooleanonUseAttackOther(BattleController bc, Attack attack, BattleParticipant bp, PixelmonWrapper user) voidvoidAdds the participant to a battle.protected voidreleasePokemon(PixelmonWrapper pixelmonWrapper) Attempts to spawn the entity for the provided wrapper.voidResets the timer for the participant making a move.voidIf a player/trainer is riding their Pokémon and gets in a battle while riding it, they shouldn't be knocked off their Pokémon.voidrevivePokemon(float healthPercentage) protected voidrevivePokemon(PixelmonWrapper pokemon, float healthPercentage) voidChooses an action for the participant's Pokémon.voidsendBattleMessage(String message) voidsendBattleMessage(String message, Object... args) Sends a battle message to this participant.voidsendBattleMessage(net.minecraft.network.chat.Component component) Sends a battle message to this participant.voidsendDamagePacket(PixelmonWrapper user, int damage) Updates the client when a Pokémon takes damage.voidsendHealPacket(PixelmonWrapper target, int amount) Updates the client when a Pokémon heals.voidsendPacket(PixelmonPacket message) Sends a packet to this participant, wont do anything if its not a player.voidvoidsetWait(boolean wait) voidvoidSwitches out all fainted Pokémon for their replacements.switchPokemon(PixelmonWrapper pw, UUID newPixelmonUUID) Switches the participant's Pokémon for another one.voidtick()Updates the participant every tick.voidUpdates the opponent's Pokémon client-side.voidbooleanwaiting()Methods inherited from class com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
canSwitch, getPrizeMoneyMultiplier, givePlayerExperience, hasExpAll, isPlayer, isRaid, isTrainer, isWild, setupTeam, syncContext, wrapPokemonMethods 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
-
Field Details
-
original
-
-
Constructor Details
-
LogBattleParticipant
-
-
Method Details
-
sendDamagePacket
Description copied from class:BattleParticipantUpdates the client when a Pokémon takes damage.- Specified by:
sendDamagePacketin interfaceBattleViewer- Overrides:
sendDamagePacketin classBattleParticipant- Parameters:
user- The Pokémon who took damage.damage- The amount of damage dealt.
-
sendHealPacket
Description copied from class:BattleParticipantUpdates the client when a Pokémon heals.- Specified by:
sendHealPacketin interfaceBattleViewer- Overrides:
sendHealPacketin classBattleParticipant- Parameters:
target- The Pokémon who healed.amount- The amount of hp healed.
-
startBattle
public void startBattle()- Overrides:
startBattlein classBattleParticipant
-
preBattleChecks
public void preBattleChecks()Description copied from class:BattleParticipantAdds the participant to a battle.- Overrides:
preBattleChecksin classBattleParticipant
-
endBattle
Description copied from class:BattleParticipantEnds the battle the participant is in.- Specified by:
endBattlein classBattleParticipant
-
getNextPokemon
public void getNextPokemon(int position) Description copied from class:BattleParticipantSends out the next unfainted Pokémon in the participant's party.- Overrides:
getNextPokemonin classBattleParticipant- Parameters:
position- The position to send out the Pokémon at.
-
selectAction
public void selectAction()Description copied from class:BattleParticipantChooses an action for the participant's Pokémon.- Overrides:
selectActionin classBattleParticipant
-
getMove
Description copied from class:BattleParticipantGets the move to be used by the specified Pokémon.- Overrides:
getMovein classBattleParticipant- Parameters:
pokemon- The Pokémon to get a move for.- Returns:
- The move to be used by the specified Pokémon.
-
updateBattlingPokemon
public void updateBattlingPokemon()Description copied from class:BattleParticipantUpdates the opponent's Pokémon client-side.- Overrides:
updateBattlingPokemonin classBattleParticipant
-
tick
public void tick()Description copied from class:BattleParticipantUpdates the participant every tick.- Overrides:
tickin 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.
-
getStorage
Description copied from class:BattleParticipantReturns the Pokémon storage of the participant.- Overrides:
getStoragein classBattleParticipant- Returns:
- The Pokémon storage of the participant.
-
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.
-
revivePokemon
public void revivePokemon(float healthPercentage) - Overrides:
revivePokemonin classBattleParticipant
-
sendPacket
Description copied from class:BattleParticipantSends a packet to this participant, wont do anything if its not a player.- Specified by:
sendPacketin interfaceBattleViewer- Overrides:
sendPacketin classBattleParticipant- Parameters:
message- The packet to send to this player
-
sendBattleMessage
public void sendBattleMessage(net.minecraft.network.chat.Component component) Description copied from class:BattleParticipantSends a battle message to this participant.- Specified by:
sendBattleMessagein interfaceBattleViewer- Overrides:
sendBattleMessagein classBattleParticipant- Parameters:
component- The message to send.
-
enforcedSwitch
- Overrides:
enforcedSwitchin classBattleParticipant
-
resetMoveTimer
public void resetMoveTimer()Description copied from class:BattleParticipantResets the timer for the participant making a move.- Overrides:
resetMoveTimerin classBattleParticipant
-
getTurnTimeSeconds
public long getTurnTimeSeconds()Description copied from class:BattleParticipantGets the time since the participant last made a move.- Overrides:
getTurnTimeSecondsin classBattleParticipant- Returns:
- The time since the participant last made a move.
-
waiting
public boolean waiting()- Overrides:
waitingin classBattleParticipant
-
setWait
public void setWait(boolean wait) - Overrides:
setWaitin classBattleParticipant
-
clearMovement
- Overrides:
clearMovementin classBattleParticipant
-
getUniqueId
Description copied from class:BattleParticipantGets the UUID of the participant.- Overrides:
getUniqueIdin classBattleParticipant- Returns:
- The UUID of the participant.
-
hasMorePokemon
public boolean hasMorePokemon()Description copied from class:BattleParticipantChecks if the participant has Pokémon that can battle- Overrides:
hasMorePokemonin classBattleParticipant- Returns:
- True if the player has a Pokémon that can battle.
-
hasMorePokemonReserve
public boolean hasMorePokemonReserve()Description copied from class:BattleParticipantFor use with switching in new Pokémon. Checks if they have Pokémon in reserve.- Overrides:
hasMorePokemonReservein classBattleParticipant- Returns:
- True if the player has a Pokémon in reserve.
-
isOnField
- Overrides:
isOnFieldin classBattleParticipant
-
releasePokemon
Description copied from class:BattleParticipantAttempts to spawn the entity for the provided wrapper.- Overrides:
releasePokemonin classBattleParticipant- Parameters:
pixelmonWrapper- The wrapper to spawn the entity for.
-
getLevelCap
protected int getLevelCap()Description copied from class:BattleParticipantGets the level cap for the participant.
This may be different for boss related entities.- Overrides:
getLevelCapin classBattleParticipant- Returns:
- The level cap for the participant.
-
getTeamPokemonUUIDs
Description copied from class:BattleParticipantFinds all Pokémon in the battle allied with the player.- Overrides:
getTeamPokemonUUIDsin classBattleParticipant- Returns:
- An array of Pokémon allied with the player.
-
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.
-
switchPokemon
Description copied from class:BattleParticipantSwitches the participant's Pokémon for another one.- Overrides:
switchPokemonin 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.
-
sendBattleMessage
Description copied from class:BattleParticipantSends a battle message to this participant.- Specified by:
sendBattleMessagein interfaceBattleViewer- Overrides:
sendBattleMessagein classBattleParticipant- Parameters:
message- The message to send.args- The arguments to format the message with.
-
checkAndHandleBossTier
Description copied from class:BattleParticipantChecks if the participant is a boss and then applies the boss tier logic to the provided wrapper.- Overrides:
checkAndHandleBossTierin classBattleParticipant- Parameters:
wrapper- The wrapper to apply the boss tier logic to.
-
getHighestLevel
public int getHighestLevel()Description copied from class:BattleParticipantGets the highest level of the participant's Pokémon.- Overrides:
getHighestLevelin classBattleParticipant- Returns:
- The highest level
-
checkPokemon
public boolean checkPokemon()Description copied from class:BattleParticipantChecks if the participant's Pokémon are in a valid state.- Overrides:
checkPokemonin classBattleParticipant- Returns:
- Whether the participant's Pokémon are in a valid state.
-
getEntity
@Nullable public @Nullable net.minecraft.world.entity.Entity getEntity()Description copied from class:BattleParticipantGets the entity that this participant is representing.- Specified by:
getEntityin interfaceBattleViewer- Overrides:
getEntityin classBattleParticipant- Returns:
- The entity that this participant is representing.
-
countAblePokemon
public int countAblePokemon()Description copied from class:BattleParticipantCalculated number of unfainted Pokémon in the entire team.- Overrides:
countAblePokemonin classBattleParticipant- Returns:
- The number of unfainted Pokémon, sent out or not.
-
countHealthPercent
public float countHealthPercent()Description copied from class:BattleParticipantCounts the percentage of health remaining in the participant's party.- Overrides:
countHealthPercentin classBattleParticipant- Returns:
- The percentage of health remaining in the participant's party.
-
getAllyData
Description copied from class:BattleParticipantGets data about the player's allied Pokémon.- Overrides:
getAllyDatain classBattleParticipant- Returns:
- Data about the player's allied Pokémon.
-
clearTurnVariables
public void clearTurnVariables()Description copied from class:BattleParticipantResets turn-specific variables for the participant's Pokémon.- Overrides:
clearTurnVariablesin classBattleParticipant
-
getWait
public boolean getWait()Description copied from class:BattleParticipantChecks if the participant is waiting in battle.- Overrides:
getWaitin classBattleParticipant- Returns:
- Whether the participant is waiting in battle.
-
getFaintedPokemon
Description copied from class:BattleParticipantGets the first fainted Pokémon in the participant's party.- Overrides:
getFaintedPokemonin classBattleParticipant- Returns:
- The first fainted Pokémon in the participant's party.
-
hasRemainingPokemon
public boolean hasRemainingPokemon()Description copied from class:BattleParticipantChecks if the participant has unfainted Pokémon remaining.- Overrides:
hasRemainingPokemonin classBattleParticipant- Returns:
- Whether the participant has unfainted Pokémon remaining.
-
faintedLastTurn
public boolean faintedLastTurn()Description copied from class:BattleParticipantReturns whether one of the participant's pokemon fainted last turn.- Overrides:
faintedLastTurnin classBattleParticipant- Returns:
- Whether one of the participant's pokemon fainted in the previous turn.
-
updateLastFaintedTurn
public void updateLastFaintedTurn()- Overrides:
updateLastFaintedTurnin classBattleParticipant
-
getTotalFainted
public int getTotalFainted()Description copied from class:BattleParticipantReturns the number of Pokémon that have fainted for this participant this battle.- Overrides:
getTotalFaintedin classBattleParticipant- Returns:
- Number of total fainted, including revived pokemon.
-
incrementFaintCount
public void incrementFaintCount()Description copied from class:BattleParticipantIncrements the number of fainted pokemon. To be called when a Pokémon faints.- Overrides:
incrementFaintCountin classBattleParticipant
-
getOpponents
Description copied from class:BattleParticipantFinds the participants on the opposing side of the battle.- Overrides:
getOpponentsin classBattleParticipant- Returns:
- The participant's opponents.
-
getAllies
Description copied from class:BattleParticipantFinds the participants on the allied side of the battle.- Overrides:
getAlliesin classBattleParticipant- Returns:
- The participant's allies.
-
getOpponentPokemon
Description copied from class:BattleParticipantReturns all Pokemon on the opposite side of the battle that the participant is on.- Overrides:
getOpponentPokemonin classBattleParticipant- Returns:
- A list of all Pokemon on the opposite of the battle that the participant is on.
-
getTeamPokemon
Description copied from class:BattleParticipantReturns all Pokemon on the side of the battle that the participant is on.- Overrides:
getTeamPokemonin classBattleParticipant- Returns:
- A list of all Pokemon on the side of the battle that the participant is on.
-
getActiveUnfaintedPokemon
Description copied from class:BattleParticipantReturns all active, unfainted Pokémon that the participant is controlling.- Overrides:
getActiveUnfaintedPokemonin classBattleParticipant- Returns:
- A list of all active, unfainted Pokémon that the participant is controlling.
-
getPokemonFromUUID
Description copied from class:BattleParticipantGets a controlled Pokémon from its UUID.- Overrides:
getPokemonFromUUIDin classBattleParticipant- Parameters:
uuid- The UUID of the Pokémon to get.- Returns:
- The Pokémon with the specified UUID, or null if no Pokémon has the UUID.
-
getPartyPokemonFromUUID
Description copied from class:BattleParticipantGets a Pokémon from its UUID.- Overrides:
getPartyPokemonFromUUIDin classBattleParticipant- Parameters:
uuid- The UUID of the Pokémon to get.- Returns:
- The Pokémon with the specified UUID, or null if no Pokémon has the UUID.
-
getPartyPosition
Description copied from class:BattleParticipantGets the base position of the Pokémon in the participant's party.- Overrides:
getPartyPositionin classBattleParticipant- Parameters:
pokemon- The Pokémon to get the position of.- Returns:
- The base position of the Pokémon in the participant's party.
-
getPokemonFromParty
Description copied from class:BattleParticipantGets the Pokémon from the participant's party who matches the given Pokémon UUID.- Overrides:
getPokemonFromPartyin classBattleParticipant- Parameters:
uuid- The UUID to get a Pokémon with.- Returns:
- The Pokémon from the participant's party who matches the given Pokémon UUID.
-
getWorld
public net.minecraft.world.level.Level getWorld()Description copied from class:BattleParticipantGets the world that the participant is in.- Overrides:
getWorldin classBattleParticipant- Returns:
- The world that the participant is in.
-
addSwitchingOut
Description copied from class:BattleParticipantAdds a Pokémon to the list of Pokémon switching out.- Overrides:
addSwitchingOutin classBattleParticipant- Parameters:
pw- The Pokémon to add to the list.- Returns:
- Whether the participant has Pokémon in reserve to switch out with.
-
switchAllFainted
public void switchAllFainted()Description copied from class:BattleParticipantSwitches out all fainted Pokémon for their replacements.- Overrides:
switchAllFaintedin classBattleParticipant
-
getRandomPartyPokemon
Description copied from class:BattleParticipantGets a random Pokémon from the participant's party that isn't already sent out.- Overrides:
getRandomPartyPokemonin classBattleParticipant- Returns:
- A random Pokémon from the participant's party that isn't already sent out, or null if there aren't any.
-
getBattleAI
- Overrides:
getBattleAIin classBattleParticipant
-
setBattleAI
- Overrides:
setBattleAIin classBattleParticipant
-
revivePokemon
- Overrides:
revivePokemonin classBattleParticipant
-
countFaintedPokemon
public int countFaintedPokemon()Description copied from class:BattleParticipantCounts the number of fainted Pokémon in the participant's party.- Overrides:
countFaintedPokemonin classBattleParticipant- Returns:
- The number of fainted Pokémon in the participant's party.
-
countPartyPokemon
Description copied from class:BattleParticipantCounts the number of Pokémon in the participant's party that match the provided predicate.- Overrides:
countPartyPokemonin classBattleParticipant- Parameters:
predicate- The predicate to match Pokémon against.- Returns:
- The number of Pokémon in the participant's party that match the provided predicate.
-
onEndTurn
- Overrides:
onEndTurnin classBattleParticipant
-
onTakeTurn
- Overrides:
onTakeTurnin classBattleParticipant
-
onUseAttack
- Overrides:
onUseAttackin classBattleParticipant
-
onUseAttackPost
- Overrides:
onUseAttackPostin classBattleParticipant
-
onAddStatus
public boolean onAddStatus(BattleController bc, PixelmonWrapper user, PixelmonWrapper target, StatusBase status) - Overrides:
onAddStatusin classBattleParticipant
-
onHit
- Overrides:
onHitin classBattleParticipant
-
onOpponentKO
- Overrides:
onOpponentKOin classBattleParticipant
-
onTargeted
- Overrides:
onTargetedin classBattleParticipant
-
onUseAttackOther
public boolean onUseAttackOther(BattleController bc, Attack attack, BattleParticipant bp, PixelmonWrapper user) - Overrides:
onUseAttackOtherin classBattleParticipant
-
onSwitchIn
- Overrides:
onSwitchInin classBattleParticipant
-
retrieveEntityDuringBattleUnlessRiding
Description copied from class:BattleParticipantIf a player/trainer is riding their Pokémon and gets in a battle while riding it, they shouldn't be knocked off their Pokémon.- Overrides:
retrieveEntityDuringBattleUnlessRidingin classBattleParticipant- Parameters:
pw- The Pokémon that is currently in battle that the player may or may not be riding upon.
-
sendBattleMessage
-