Class ProxyBattleParticipant
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
com.pixelmonmod.pixelmon.battles.controller.participants.ProxyBattleParticipant
- All Implemented Interfaces:
BattleViewer,ContextHolder
-
Field Summary
Fields inherited from class com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
allPokemon, ashNinja, bc, context, controlledPokemon, dynamax, entity, evolution, isDefeated, lastFailedCapture, lastFaintedTurn, lastMoveTime, numControlledPokemon, originalPokemon, switchingIn, switchingOut, team, terastal, totalFainted, ultraBurst, wait -
Constructor Summary
ConstructorsConstructorDescriptionProxyBattleParticipant(MultiLaneBattleController raidController, BattleParticipant parent, Pokemon bossPokemon) -
Method Summary
Modifier and TypeMethodDescriptioncopy(BattleController controller) intCalculated number of unfainted Pokémon in the entire team.voidendBattle(BattleEndCause cause) Ends the battle the participant is in.net.minecraft.core.Holder<BattleAI> net.minecraft.network.chat.MutableComponentReturns the name of the entity the participant is representing.net.minecraft.world.entity.LivingEntityGets the entity that this participant is representing.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.@Nullable net.minecraft.server.level.ServerPlayerGets the player this is representing.booleanChecks if the participant has Pokémon that can battlebooleanFor use with switching in new Pokémon.booleanisRaid()If the participant is a raid.booleanonAddStatus(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) voidparent()voidAdds the participant to a battle.Gets the multi-lane battle controller that owns this proxy participant.booleanselectBattleAction(BattleParticipant actor, BattleAction action) Lets this participant handle a selected battle action from another participant.booleanshouldKeepFaintedOpponentPokemon(BattleParticipant opponent, PixelmonWrapper fainted) booleanshouldSkipTurnAgainstOpponent(BattleParticipant opponent, PixelmonWrapper pokemon) switchPokemon(PixelmonWrapper pw, UUID newPixelmonUUID) Switches the participant's Pokémon for another one.voidtick()Updates the participant every tick.Methods inherited from class com.pixelmonmod.pixelmon.battles.controller.participants.BattleParticipant
addSwitchingOut, canDynamax, canMegaEvolve, canSwitch, canTerastallize, checkAndHandleBossTier, checkPokemon, clearMovement, clearPendingSelection, clearTurnVariables, copyAll, copyTo, countFaintedPokemon, countHealthPercent, countPartyPokemon, enforcedSwitch, faintedLastTurn, findTargets, getActiveUnfaintedPokemon, getAllies, getAllyData, getBattleController, getFaintedPokemon, getHighestLevel, getLevelCap, getMove, getOpponentPokemon, getOpponents, getPartyPokemonFromUUID, getPartyPosition, getPokemonFromParty, getPokemonFromUUID, getPossibleSwitchIDs, getPrizeMoneyMultiplier, getRandomPartyPokemon, getStorage, getTeam, getTeamBenchedPokemon, getTeamPokemon, getTeamPokemon, getTeamPokemonUUIDs, getTotalFainted, getTurnTimeSeconds, getUniqueId, getWait, getWorld, givePlayerExperience, hasDisconnected, hasExpAll, hasRemainingPokemon, hasUsedZMove, incrementFaintCount, is, isOnField, isPlayer, isTrainer, isValidSwitchTarget, isWild, releasePokemon, resetMoveTimer, retrieveEntityDuringBattleUnlessRiding, revivePokemon, revivePokemon, selectAction, sendBattleMessage, setBattleAI, setBattleAI, setupTeam, setUsedZMove, setWait, shouldKeepFaintedPokemon, shouldWaitForPokemon, startBattle, switchAllFainted, syncContext, terastallized, updateBattlingPokemon, updateLastFaintedTurn, waiting, 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
sendBattleMessage, sendBattleMessage, sendPacketMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.context.ContextHolder
get, getOrDefault, has, remove, set, update
-
Constructor Details
-
ProxyBattleParticipant
public ProxyBattleParticipant(MultiLaneBattleController raidController, BattleParticipant parent, Pokemon bossPokemon)
-
-
Method Details
-
parent
-
getPlayer
@Nullable public @Nullable net.minecraft.server.level.ServerPlayer getPlayer()Description copied from interface:BattleViewerGets the player this is representing.
Note: this method may return null if the entity is not a player.- Returns:
- The player this is representing.
-
selectBattleAction
Description copied from class:BattleParticipantLets this participant handle a selected battle action from another participant.- Overrides:
selectBattleActionin classBattleParticipant- Parameters:
actor- The participant selecting the action.action- The selected action.- Returns:
trueif this participant accepted the action.
-
raidController
Gets the multi-lane battle controller that owns this proxy participant.- Returns:
- The owning multi-lane battle controller.
-
asWrapper
-
getContext
- Specified by:
getContextin interfaceContextHolder- Overrides:
getContextin classBattleParticipant
-
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.
-
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.
-
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.
-
getBattleAI
- Overrides:
getBattleAIin 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.
-
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.
-
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.
-
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.
-
getEntity
public net.minecraft.world.entity.LivingEntity 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.
-
onSwitchIn
- Overrides:
onSwitchInin classBattleParticipant
-
tick
public void tick()Description copied from class:BattleParticipantUpdates the participant every tick.- Overrides:
tickin classBattleParticipant
-
onEndTurn
- Overrides:
onEndTurnin classBattleParticipant
-
onTakeTurn
- Overrides:
onTakeTurnin classBattleParticipant
-
onUseAttack
- Overrides:
onUseAttackin classBattleParticipant
-
onUseAttackPost
- Overrides:
onUseAttackPostin classBattleParticipant
-
onUseAttackOther
public boolean onUseAttackOther(BattleController bc, Attack attack, BattleParticipant bp, PixelmonWrapper user) - Overrides:
onUseAttackOtherin classBattleParticipant
-
onTargeted
- Overrides:
onTargetedin classBattleParticipant
-
onAddStatus
public boolean onAddStatus(BattleController bc, PixelmonWrapper user, PixelmonWrapper target, StatusBase status) - Overrides:
onAddStatusin classBattleParticipant
-
onHit
- Overrides:
onHitin classBattleParticipant
-
onOpponentKO
- Overrides:
onOpponentKOin classBattleParticipant
-
isRaid
public boolean isRaid()Description copied from class:BattleParticipantIf the participant is a raid.- Overrides:
isRaidin classBattleParticipant- Returns:
- Whether the participant is a raid.
-
shouldKeepFaintedOpponentPokemon
public boolean shouldKeepFaintedOpponentPokemon(BattleParticipant opponent, PixelmonWrapper fainted) - Overrides:
shouldKeepFaintedOpponentPokemonin classBattleParticipant
-
shouldSkipTurnAgainstOpponent
- Overrides:
shouldSkipTurnAgainstOpponentin classBattleParticipant
-
copy
- Specified by:
copyin classBattleParticipant
-