public class PixelmonWrapper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
Element |
addedType
A temporary type added to the Pokémon.
|
int |
amountOfTimesHit
The amount of times the Pokémon has taken an instance of damage over the entire battle.
|
boolean |
animateHP
Whether to animate hp changes client-side.
|
Attack |
attack
The Pokémon's current attack.
|
int |
battlePosition
The Pokémon's position in battle.
|
BattleController |
bc
The battle controller for the battle the Pokémon is in.
|
boolean |
canAttack
Whether the Pokémon can attack in the turn.
|
boolean |
changeBurmy
Whether the Pokémon is a Burmy that should change form after the battle.
|
Attack |
choiceLocked
The attack that a choice item has restricted the holder to.
|
boolean |
choiceSwapped
Whether the Pokémon's choice item was just swapped with another.
|
int |
damageTakenThisTurn
The amount of damage the Pokémon has taken in the turn.
|
int |
dynamaxAnimationTicks |
static int |
dynamaxAnimationTicksDown |
static float |
dynamaxAnimationTicksDownAmount |
static int |
dynamaxAnimationTicksUp |
static float |
dynamaxAnimationTicksUpAmount |
int |
dynamaxTurns |
boolean |
eatenBerry
Whether the Pokémon has eaten a Berry during the battle.
|
boolean |
eatingBerry
Whether the Pokémon is currently eating a Berry to cure status.
|
PixelmonEntity |
entity
The Pokémon wrapped by this wrapper.
|
int |
escapeAttempts
The number of times the Pokémon has attempted to escape in the battle.
|
EvolutionQuery |
evolution
The query used to Mega Evolve the Pokémon.
|
boolean |
evolvedThisTurn
Whether the Pokémon mega evolved/dynamaxed during this turn.
|
boolean |
faintedAtEndOfTurn
Whether the Pokémon fainted due to end of turn effects.
|
boolean |
hasAwardedExp
Whether the Pokémon has awarded experience upon fainting.
|
boolean |
hasBeenInBattle
Whether the Pokémon has been in battle previously
|
boolean |
ignoringZCrystal |
Pokemon |
initialCopyOfPokemon |
boolean |
inMultipleHit
Whether the user is in the middle of a multi-hit move.
|
boolean |
inParentalBond
Whether the user is on the first hit of Parental Bond.
|
int |
isDynamax
Whether the Pokémon is Dynamaxed (1)/Gigantamaxed (2).
|
boolean |
isMega
Whether the Pokémon is Mega Evolved.
|
boolean |
isSwitching
Whether the Pokémon is switching in the turn.
|
Attack |
lastAttack
The Pokémon's previous attack.
|
AttackCategory |
lastDirectCategory
The damage category of the last direct damage that was dealt the Pokémon was attacked in the current turn.
|
int |
lastDirectDamage
The amount of direct damage that was dealt the last time the Pokémon was attacked in the current turn.
|
int |
lastDirectPosition
The last position of the Pokémon in the battle.
|
int |
lastHP
The amount of HP this pokemon had before recieving damage.
|
Attack |
lastSimulatedAttack
The Pokémon's previous attack that the AI simulated.
|
java.util.List<PixelmonWrapper> |
lastSimulatedTargets |
Attack |
lastSimulatedTempAttack
The Pokémon's previous temp attack that the AI simulated.
|
java.util.List<PixelmonWrapper> |
lastTargets |
Attack |
lastTempAttack
The Pokémon's previous temp attack.
|
int |
maxShields |
int |
metronomeBoost
The current boost from a Metronome held item.
|
java.util.UUID |
newPokemonUUID
The Pokémon that this Pokémon will switch into.
|
boolean |
nextSwitchIsMove
Whether the Pokémon is switching out because of the effects of a move.
|
boolean |
onBattlefield
Whether the Pokémon is fighting on the field of battle instead of in the party.
|
Pokemon |
pokemon
The Pokemon object underlying this wrapper.
|
Stats |
prevForm |
java.lang.String |
prevPaletteName |
float |
priority
The Pokémon's priority in the turn.
|
int |
protectsInARow
The number of times the Pokémon has successfully used Protect (or similar moves) in a row.
|
Attack |
selectedAttack
The attack the Pokémon selected for the turn.
|
int |
shields
Barriers for Raid Pokémon.
|
boolean |
skipZConvert |
boolean |
switchedLastTurn
Whether the Pokémon switched in during the previous turn.
|
boolean |
switchedThisTurn
Whether the Pokémon switched in during the current turn.
|
boolean |
takenTurn
Whether the Pokémon has already chosen the action for its turn.
|
int |
targetIndex
The index of the current target of an attack when iterating through targets.
|
java.util.List<PixelmonWrapper> |
targets
The targets of the Pokémon's attack.
|
Ability |
tempAbility
The temporary Ability of the Pokémon if it is changed.
|
Moveset |
temporaryMoveset |
protected PokemonLevel |
temporaryPokemonLevel |
java.util.List<Element> |
type
The Pokémon's type.
|
java.util.Set<Attack> |
usedMoves
The moves used by the Pokémon since it last entered battle.
|
boolean |
usingZ
Whether or not the Pokémon is using a Z-Move.
|
boolean |
wait
Whether the Pokémon is currently waiting for other combatants to make a move in battle.
|
boolean |
willEvolve
Whether the Pokémon will evolve during the turn.
|
boolean |
willTryFlee
Whether the Pokémon will try to flee in the turn.
|
net.minecraft.item.ItemStack |
willUseItemInStack
The item that is being used on the Pokémon.
|
int |
willUseItemInStackInfo
An additional argument for the item used on the Pokémon.
|
java.util.UUID |
willUseItemPokemon
The UUID of the Pokémon.
|
ZMove |
zMove |
Constructor and Description |
---|
PixelmonWrapper(BattleParticipant participant,
PixelmonEntity entity,
int partyPosition)
Constructs the wrapper.
|
PixelmonWrapper(BattleParticipant participant,
PixelmonEntity pixelmon,
int partyPosition,
BattleController bc)
Constructs up the wrapper.
|
PixelmonWrapper(BattleParticipant participant,
Pokemon pokemon,
int partyPosition)
Constructs the wrapper.
|
PixelmonWrapper(PixelmonWrapper pw)
Makes a deep copy of the PixelmonWrapper object
|
Modifier and Type | Method and Description |
---|---|
void |
addAttackers()
Updates experience-gaining Pokémon to and from the Pokémon.
|
void |
addGlobalStatus(GlobalStatusBase g)
Adds a global statuses and allows items to catch when one is added.
|
boolean |
addStatus(StatusBase e,
PixelmonWrapper opponent)
Adds a status to the Pokémon.
|
boolean |
addStatus(StatusBase e,
PixelmonWrapper opponent,
net.minecraft.util.text.TranslationTextComponent message)
Adds a status to the Pokémon.
|
boolean |
addTeamStatus(StatusBase status,
PixelmonWrapper cause)
Adds a team status to all Pokémon on this Pokémon's side of the field.
|
void |
afterSwitch()
Handles effects that occur just after switching out.
|
void |
beforeSwitch(PixelmonWrapper switchingIn)
Handles effects that occur just before switching out.
|
boolean |
canAttackThisTurn(Attack a) |
boolean |
canDynamax()
Checks if the Pokémon can Dynamax.
|
static boolean |
canDynamax(Stats form,
HeldItem item)
Checks if a Pokémon can Dynamax.
|
boolean |
canGigantamax()
Checks if the Pokémon can Gigantamax.
|
static boolean |
canGigantamax(boolean gigantamaxFactor,
Species species,
Stats form)
Checks if a Pokémon can Gigantamax.
|
boolean |
canMegaEvolve()
Checks if the Pokémon can Mega Evolve with its held item.
|
static boolean |
canMegaEvolve(HeldItem heldItem,
Species species,
java.lang.String form)
Checks if a Pokémon can Mega Evolve with a held item.
|
static boolean |
canMegaEvolve(net.minecraft.item.ItemStack heldItem,
Species pokemon,
java.lang.String form)
Checks if a Pokémon can Mega Evolve with a held item.
|
boolean |
cannotHaveStatus(StatusBase t,
PixelmonWrapper opponent)
Checks whether the Pokémon can receive the status.
|
boolean |
cannotHaveStatus(StatusBase t,
PixelmonWrapper opponent,
boolean ignorePrimaryOverlap)
Checks whether the Pokémon can receive the status.
|
boolean |
canUltraBurst()
Checks if the Pokémon can Ultra Burst with its held item.
|
static boolean |
canUltraBurst(Species species,
HeldItem heldItem,
Stats form)
Checks if a Pokémon can Ultra Burst (Necrozma only) with a held item.
|
static boolean |
canUseZMove(net.minecraft.item.ItemStack heldItem) |
void |
chooseMove()
Chooses a move to use depending on the AI.
|
void |
chooseMove(MoveChoice moveChoice)
Prepares a move based on a move choice.
|
void |
clearStatus()
Removes all statuses from the Pokémon.
|
void |
clearTurnVariables()
Resets variables that keep track of aspects within turns.
|
void |
consumeItem()
Consumes the Pokémon's held item.
|
PixelmonWrapper |
copy() |
int |
countStatuses(StatusType... statuses)
Counts the number of statuses from a list that the Pokémon has.
|
float |
doBattleDamage(PixelmonWrapper source,
float damage,
DamageTypeEnum damageType)
Damages the Pokémon in battle.
|
boolean |
doesLevel()
Checks if the Pokémon can gain experience and pokemonLevel up.
|
PixelmonWrapper |
doSwitch()
Handles switching.
|
boolean |
dynamax(boolean revert,
float healthPercentage) |
void |
enableReturnHeldItem()
Causes the Pokémon to regain a lost held item after the battle ends.
|
void |
endTurn() |
boolean |
equals(java.lang.Object other) |
protected PixelmonWrapper |
findPixelmon(java.util.UUID uuid) |
void |
forcePursuitAttackers()
Force a Pokémon targeting the current Pokémon with Pursuit to attack.
|
void |
forceRandomSwitch(java.util.UUID switchPokemon)
Randomly switches the Pokémon out for another.
|
Ability |
getAbility()
Gets the Pokémon's Ability.
|
java.util.Set<PixelmonWrapper> |
getAttackers()
Gets Pokémon that this Pokémon has faced during battle.
|
Nature |
getBaseNature()
Gets the Pokémon's actual Nature.
|
Ability |
getBattleAbility()
Gets the Pokémon's active Ability in battle.
|
Ability |
getBattleAbility(boolean canIgnore)
Gets the Pokémon's Ability in battle.
|
Ability |
getBattleAbility(boolean canIgnore,
PixelmonWrapper moveUser)
Gets the Pokémon's Ability in battle.
|
Ability |
getBattleAbility(PixelmonWrapper moveUser)
Gets the Pokémon's Ability in battle.
|
BattleAIBase |
getBattleAI()
Gets the battle AI of the Pokémon's participant.
|
BattleStats |
getBattleStats()
Gets the Pokémon's stats and stat modifiers.
|
HeldItem |
getConsumedItem()
Returns the Pokémon's most recent consumed held item.
|
int |
getControlledIndex()
Returns the index of the Pokémon in its participant's controlled Pokémon array.
|
double |
getDynamaxHealthMod() |
java.util.List<Element> |
getEffectiveTypes(PixelmonWrapper user,
PixelmonWrapper target)
Modifies the Pokémon's type to calculate type effectiveness if there are statuses that do so.
|
java.util.List<EntryHazard> |
getEntryHazards()
Gets the entry hazards on the Pokémon's side of the field.
|
int |
getExp()
Gets the Pokémon's experience.
|
Stats |
getForm()
Gets the form index of the Pokémon.
|
net.minecraft.util.text.ITextComponent |
getFormattedNickname() |
int |
getFriendship()
Gets the object that tracks friendship.
|
Gender |
getGender()
Gets the Pokémon's gender.
|
float |
getHealPercent(float amount)
Returns the percentage of health that the Pokémon will recover from an amount.
|
int |
getHealth() |
int |
getHealth(boolean ignoreDynamax)
Returns the current hp of the Pokémon.
|
int |
getHealthDeficit()
Returns the difference between the Pokémon's maximum and current health.
|
float |
getHealthPercent()
Returns the Pokémon's current health percentage.
|
float |
getHealthPercent(float amount)
Returns the Pokémon's health percentage compared to a certain amount.
|
HeldItem |
getHeldItem()
Gets the type of the item the Pokémon is holding.
|
java.util.List<Element> |
getInitialType()
Gets the original type of the Pokémon if it is changed.
|
Pokemon |
getInnerLink()
Gets the Pokémon stored inside this wrapper.
|
int |
getMaxHealth() |
int |
getMaxHealth(boolean ignoreDynamax)
Returns the maximum hp of the Pokémon.
|
Moveset |
getMoveset()
Returns the Pokémon's moveset.
|
Nature |
getNature()
Gets the Pokémon's Nature.
|
java.lang.String |
getNickname()
Deprecated.
|
java.util.ArrayList<PixelmonWrapper> |
getOpponentPokemon()
Gets all Pokémon on the opposite side of the battle.
|
java.lang.String |
getOriginalTrainer()
Gets the name of the Pokémon's original Trainer.
|
java.lang.String |
getOwnerName() |
BattleParticipant |
getParticipant()
Returns the Pokémon's battle participant.
|
int |
getPartyPosition()
Gets the position of the Pokémon in the party.
|
int |
getPercentMaxHealth(float percent) |
int |
getPercentMaxHealth(float percent,
boolean ignoreDynamax)
Gets an amount of the Pokémon's maximum hp from a percentage.
|
net.minecraft.entity.player.ServerPlayerEntity |
getPlayerOwner()
Gets the player who owns the Pokémon.
|
PokemonLevel |
getPokemonLevel()
Gets the Pokémon's pokemonLevel container.
|
int |
getPokemonLevelNum()
Gets the Pokémon's pokemonLevel.
|
java.lang.String |
getPokemonName()
Gets the Pokémon's unlocalized pokemon name.
|
java.util.UUID |
getPokemonUUID()
Gets the ID of the Pokémon.
|
java.util.Optional<Pokerus> |
getPokerus() |
Stats |
getPrevForm()
Gets the previous form.
|
StatusPersist |
getPrimaryStatus()
Returns the Pokémon's non-volatile status.
|
net.minecraft.util.text.ITextComponent |
getRealFormattedNickname()
Gets the Pokémon's nickname, ignoring Illusion.
|
java.lang.String |
getRealNickname()
Deprecated.
|
java.lang.String |
getRealTextureNoCheck()
Gets the texture of the Pokémon, ignoring in-battle transformations and texture existence checks (used
server-side).
|
Species |
getSpecies()
Gets the Pokémon's pokemon.
|
PermanentStats |
getStats()
Gets the Pokémon's stat numbers.
|
StatusBase |
getStatus(int i)
Returns the Pokémon's status at the specified index.
|
StatusBase |
getStatus(StatusType type)
Gets the specified status on the Pokémon.
|
java.util.List<StatusBase> |
getStatuses()
Returns the Pokémon's statuses.
|
int |
getStatusIndex(StatusType findStatus)
Returns the index of the status.
|
int |
getStatusSize()
Returns the number of statuses the Pokémon has.
|
java.util.ArrayList<PixelmonWrapper> |
getTargets(Attack chosenAttack)
Randomly selects targets for an attack.
|
java.util.ArrayList<PixelmonWrapper> |
getTeamPokemon()
Gets all Pokémon on this Pokémon's side of the battle.
|
java.util.ArrayList<PixelmonWrapper> |
getTeamPokemonExcludeSelf()
Gets all Pokémon on this Pokémon's side of the battle excluding itself.
|
NPCTrainer |
getTrainerOwner()
Gets the trainer who owns the Pokémon.
|
HeldItem |
getUsableHeldItem()
Gets the type of the item the Pokémon is holding if it is currently usable.
|
float |
getWeight(boolean ignoreAbility)
Returns the Pokémon's weight, factoring in modifications from other sources.
|
net.minecraft.world.World |
getWorld()
Gets the world that the Pokémon is in.
|
net.minecraft.util.math.BlockPos |
getWorldPosition()
Gets the world position of the Pokémon.
|
boolean |
hasCompatibleMegaStone()
Checks if the Pokémon is holding a Mega Stone that it can Mega Evolve with.
|
static boolean |
hasCompatibleMegaStone(HeldItem heldItem,
Stats form)
Checks if a Pokémon is holding a Mega Stone that it can Mega Evolve with.
|
boolean |
hasFullHealth()
Checks if the Pokémon is at full health.
|
boolean |
hasFullHealth(boolean ignoreAbility)
Checks if the Pokémon is at full health.
|
boolean |
hasGigantamaxFactor()
Gets the Gigantamax Factor of the Pokémon.
|
boolean |
hasHeldItem()
Checks if the Pokémon has a held item.
|
boolean |
hasMoved()
Checks if the Pokémon has already moved during the turn.
|
boolean |
hasNonVolatileStatus()
Returns whether the Pokémon has a non-volatile status.
|
boolean |
hasNonVolatileStatus(boolean includeComatose)
Returns whether the Pokémon has a non-volatile status.
|
boolean |
hasSpecialItem(PixelmonWrapper user)
Checks if the Pokémon has a special item that cannot be removed in battle by the given user.
|
boolean |
hasStatus(StatusType... statuses)
Checks if the Pokémon has any of the specified statuses.
|
boolean |
hasType(Element... types)
Checks if the Pokémon's type is one of a list of types.
|
int |
healByPercent(float percent)
Heals the Pokémon by a certain percentage of its maximum health.
|
int |
healEntityBy(int i)
Heals a Pokémon by a specified amount.
|
boolean |
isAirborne()
Checks if the Pokémon is airborne, preventing Ground-type attacks from hitting it.
|
boolean |
isAlive()
Returns whether the Pokémon can battle.
|
boolean |
isAlly(PixelmonWrapper pokemon) |
boolean |
isDynamax() |
boolean |
isFainted()
Returns whether the Pokémon is fainted.
|
boolean |
isFirstTurn()
Checks if it is the first turn that the Pokémon has been out.
|
boolean |
isGigantamax() |
boolean |
isGrounded()
Determines whether the Pokémon is grounded by an effect, negating being airborne.
|
boolean |
isImmuneToPowder()
Checks if the Pokémon is immune to powder moves.
|
boolean |
isItemGivable(HeldItem item)
Checks if this held item can be given to this pokemon during battle.
|
boolean |
isItemRemovable(PixelmonWrapper user)
Checks if this Pokémon's held item can be removed during battle.
|
boolean |
isMovingLast()
Checks if the pokemon is moving last of everyone this turn.
|
boolean |
isOpponent(PixelmonWrapper pokemon) |
boolean |
isRaidPokemon()
Gets whether this is a raid Pokémon.
|
boolean |
isSameTeam(PixelmonWrapper other)
Checks if a Pokémon is on the same team as this Pokémon.
|
boolean |
isSingleType()
Checks if the Pokémon is a single-typed Pokémon.
|
boolean |
isSingleType(Element type)
Checks if the Pokémon is a single-typed Pokémon of a certain type.
|
boolean |
isWildPokemon()
Gets whether this is a wild Pokémon.
|
boolean |
megaEvolve()
Mega Evolves the Pokémon.
|
void |
recalculateMaxHP() |
boolean |
reducePP(boolean reducePP,
boolean affectPP)
Reduce the Power Points (PP) of a move after it has been used.
|
boolean |
registerZMove()
Register a Z-Move as used after it has been used.
|
void |
removeHeldItem()
Removes the Pokémon's held item.
|
StatusBase |
removePrimaryStatus()
Removes the Pokémon's non-volatile status and returns it.
|
StatusBase |
removePrimaryStatus(boolean showMessage)
Removes the Pokémon's non-volatile status and returns it.
|
void |
removeStatus(int i)
Removes the status at the specified index.
|
void |
removeStatus(StatusBase e)
Removes the status from the Pokémon.
|
void |
removeStatus(StatusBase e,
boolean showMessage)
Removes the status from the Pokémon.
|
boolean |
removeStatus(StatusType s)
Removes the specified status from the Pokémon.
|
boolean |
removeStatus(StatusType s,
boolean message)
Removes the specified status from the Pokémon.
|
boolean |
removeStatuses(boolean showMessage,
StatusType... statuses)
Removes the specified statuses from the Pokémon.
|
boolean |
removeStatuses(StatusType... statuses)
Removes the specified statuses from the Pokémon.
|
boolean |
removeTeamStatus(StatusBase status)
Removes a team status from Pokémon on this Pokémon's side of the field.
|
boolean |
removeTeamStatus(StatusType... statuses)
Removes team statuses from Pokémon on this Pokémon's side of the field.
|
void |
resetBattleEvolution()
Resets a Mega and Ash-Greninja Evolved Pokémon back to their base form.
|
void |
resetOnSwitch()
Resets Pokémon attributes when switching.
|
void |
returnToBasePos()
Returns the Pokémon to where it was at the start of the battle.
|
void |
savePreviousAttackValues()
Saves all the data on this attack to the info for the previous attack.
|
void |
selectAIAction()
Decides what action the AI will take during battle.
|
void |
sendStatusPacket(int statusID)
Sends a status update to the client.
|
void |
setAttack(Attack attack,
java.util.List<PixelmonWrapper> targets,
boolean megaEvolving)
Sets the Pokémon's attack to an attack.
|
void |
setAttack(int buttonId,
java.util.List<PixelmonWrapper> targets,
boolean megaEvolving)
Sets the Pokémon's attack to the button pressed.
|
void |
setAttackFailed()
Marks the Pokémon's current attack as failed.
|
void |
setBasePosition(double[] ds)
Sets the Pokémon's initial position.
|
void |
setConsumedItem(HeldItem heldItem)
Sets the Pokémon's most recent consumed item.
|
void |
setExp(int experience)
Sets the Pokémon's experience.
|
void |
setForm(Stats form)
Sets the form of a Pokémon.
|
void |
setForm(java.lang.String form)
Sets the form of a Pokémon.
|
void |
setHealth(int newHP)
Sets the Pokémon's current hp.
|
void |
setHeldItem(HeldItem newItem)
Sets the Pokémon's held item.
|
void |
setHeldItem(net.minecraft.item.ItemStack itemStack)
Sets the Pokémon's held item.
|
void |
setLevelNum(int level)
Sets the Pokémon's pokemonLevel.
|
void |
setMoveTargets(PixelmonWrapper... pokemon)
Sets the targets of the Pokémon's attack.
|
void |
setNewHeldItem(HeldItem heldItem)
Sets a new held item for the Pokémon during battle.
|
void |
setPalette(java.lang.String paletteName)
Sets the palette of a Pokémon.
|
void |
setPrevForm(Stats form)
Sets the previous form.
|
void |
setPrevForm(java.lang.String form)
Sets the previous form.
|
void |
setPrevPaletteName(java.lang.String paletteName)
Sets the palette of a Pokémon.
|
void |
setRaidShields(int shields) |
void |
setStatus(int i,
StatusBase newStatus)
Changes a status into a different status.
|
void |
setStruggle(java.util.ArrayList<PixelmonWrapper> targets)
Sets the Pokémon's attack to Struggle.
|
void |
setTempAbility(Ability newAbility)
Sets a temporary Ability for the Pokémon if its Ability changes during battle.
|
void |
setTempAbility(Ability newAbility,
boolean formChange)
Sets a temporary Ability for the Pokémon if its Ability changes during battle.
|
void |
setTempLevel(int level)
Sets a temporary pokemonLevel for the Pokémon to use in battle.
|
void |
setTemporaryMoveset(Moveset moveset) |
void |
setTempType(Element newType)
Sets a temporary type for the Pokémon if it changes during battle.
|
void |
setTempType(java.util.List<Element> newType)
Sets a temporary type for the Pokémon if it changes during battle.
|
void |
setUpSwitchMove()
Sets up variables for the Pokémon to switch out due to a move.
|
boolean |
shouldReturnHeldItem() |
boolean |
skipsTurn()
Checks if the turn is skipped for the Pokémon
|
boolean |
stopsForcedSwitches(PixelmonWrapper cause)
Checks if the Pokémon prevents being forced out
|
boolean |
switchThisTurn()
Switches the Pokémon during its turn.
|
void |
takeTurn()
Does the Pokémon's action for the turn.
|
void |
targetAllAdjacentOpponents()
Forces this Pokémon to target to all adjacent opponents instead of initial target.
|
java.util.List<PixelmonWrapper> |
targetNewNonFaintedPokemon(java.util.List<PixelmonWrapper> correctedTargets,
PixelmonWrapper target)
.
|
java.lang.String |
toString() |
void |
turnTick()
Handles end-of-turn effects.
|
void |
update(EnumUpdateType... types)
Updates the Pokémon client-side.
|
void |
updateBattleDamage(int damage)
Updates the client with changes to the Pokémon's health in battle.
|
void |
updateHPIncrease()
Updates Pokémon in battle.
|
void |
updateRaidShields(int shields) |
void |
useAttack()
Uses an attack and processes the results of the attack.
|
void |
useAttack(boolean affectPP)
Uses an attack and processes the results of the attack.
|
MoveResults[] |
useAttackOnly()
Uses an attack without doing anything else.
|
void |
useItem()
Uses an item on the Pokémon.
|
void |
useTempAttack(Attack tempAttack)
Used if the attack used was called by another attack.
|
void |
useTempAttack(Attack tempAttack,
java.util.List<PixelmonWrapper> targets)
Used if the attack used was called by another attack.
|
void |
useTempAttack(Attack tempAttack,
java.util.List<PixelmonWrapper> targets,
boolean affectPP)
Used if the attack used was called by another attack.
|
void |
useTempAttack(Attack tempAttack,
PixelmonWrapper target)
Used if the attack used was called by another attack.
|
void |
writeToNBT()
Saves the battling Pokémon's data to NBT.
|
public PixelmonEntity entity
public Pokemon pokemon
public Pokemon initialCopyOfPokemon
public BattleController bc
public Attack attack
public Attack selectedAttack
public Attack lastAttack
public Attack lastSimulatedAttack
public Attack lastTempAttack
public Attack lastSimulatedTempAttack
public java.util.List<PixelmonWrapper> lastTargets
public java.util.List<PixelmonWrapper> lastSimulatedTargets
public int targetIndex
public java.util.Set<Attack> usedMoves
public int escapeAttempts
public int damageTakenThisTurn
public int amountOfTimesHit
public float priority
public boolean canAttack
public boolean willTryFlee
public boolean isSwitching
public boolean willEvolve
public boolean nextSwitchIsMove
public java.util.UUID willUseItemPokemon
public net.minecraft.item.ItemStack willUseItemInStack
public int willUseItemInStackInfo
public boolean takenTurn
public boolean wait
public boolean onBattlefield
public int battlePosition
public Element addedType
public Ability tempAbility
public Moveset temporaryMoveset
public java.util.List<PixelmonWrapper> targets
public java.util.UUID newPokemonUUID
public boolean inMultipleHit
public boolean inParentalBond
public int protectsInARow
public boolean hasAwardedExp
public boolean switchedThisTurn
public boolean hasBeenInBattle
public boolean switchedLastTurn
public boolean evolvedThisTurn
public boolean faintedAtEndOfTurn
public boolean changeBurmy
public Attack choiceLocked
public boolean choiceSwapped
public int metronomeBoost
public boolean eatenBerry
public boolean eatingBerry
public int lastDirectDamage
public int lastHP
public AttackCategory lastDirectCategory
public int lastDirectPosition
public EvolutionQuery evolution
protected PokemonLevel temporaryPokemonLevel
public java.util.List<Element> type
public boolean isMega
public int isDynamax
public int dynamaxTurns
public int dynamaxAnimationTicks
public Stats prevForm
public java.lang.String prevPaletteName
public static final int dynamaxAnimationTicksUp
public static final float dynamaxAnimationTicksUpAmount
public static final int dynamaxAnimationTicksDown
public static final float dynamaxAnimationTicksDownAmount
public boolean animateHP
public boolean usingZ
public ZMove zMove
public boolean ignoringZCrystal
public boolean skipZConvert
public int shields
public int maxShields
public PixelmonWrapper(BattleParticipant participant, PixelmonEntity entity, int partyPosition)
participant
- The battle participant owning the Pokémon.entity
- The Pokémon wrapped by the wrapper.partyPosition
- The Pokémon's position in the party.public PixelmonWrapper(BattleParticipant participant, PixelmonEntity pixelmon, int partyPosition, BattleController bc)
participant
- The battle participant owning the Pokémon.pixelmon
- The Pokémon wrapped by the wrapper.partyPosition
- The Pokémon's position in the party.bc
- The battle controller of the battle the Pokémon is in.public PixelmonWrapper(BattleParticipant participant, Pokemon pokemon, int partyPosition)
participant
- The battle participant owning the Pokémon.pokemon
- The Pokemon data of the Pokémon wrapped by the wrapper.partyPosition
- The Pokémon's position in the party.public PixelmonWrapper(PixelmonWrapper pw)
pw
- The Pokémon that is being assignedpublic PermanentStats getStats()
public BattleStats getBattleStats()
public java.util.List<Element> getInitialType()
public int getFriendship()
public java.util.Set<PixelmonWrapper> getAttackers()
public java.util.Optional<Pokerus> getPokerus()
public boolean hasType(Element... types)
types
- The types to compare the Pokémon's types against.public void clearTurnVariables()
public void setMoveTargets(PixelmonWrapper... pokemon)
pokemon
- The targeted Pokémon.public void selectAIAction()
public boolean skipsTurn()
public boolean stopsForcedSwitches(PixelmonWrapper cause)
public void chooseMove()
public void chooseMove(MoveChoice moveChoice)
moveChoice
- The move choice to prepare a move with.public java.util.ArrayList<PixelmonWrapper> getTargets(Attack chosenAttack)
chosenAttack
- The attack to find targets for.public void useAttack()
public void useAttack(boolean affectPP)
affectPP
- Whether PP should be deducted after the attack is used.public void targetAllAdjacentOpponents()
public java.util.List<PixelmonWrapper> targetNewNonFaintedPokemon(java.util.List<PixelmonWrapper> correctedTargets, PixelmonWrapper target)
correctedTargets
- A list of the Pokémon that will be the new target(s).public void savePreviousAttackValues()
public boolean reducePP(boolean reducePP, boolean affectPP)
reducePP
- Whether the move reduces PP.affectPP
- Whether the PP will be reduced this turn.public boolean registerZMove()
public MoveResults[] useAttackOnly()
public void useItem()
public void useTempAttack(Attack tempAttack)
tempAttack
- The attack to use.public void useTempAttack(Attack tempAttack, PixelmonWrapper target)
tempAttack
- The attack to use.target
- The target of the attack.public void useTempAttack(Attack tempAttack, java.util.List<PixelmonWrapper> targets)
tempAttack
- The attack to use.targets
- The targets of the attack.public void useTempAttack(Attack tempAttack, java.util.List<PixelmonWrapper> targets, boolean affectPP)
tempAttack
- The attack to use.targets
- The targets of the attack.public void turnTick()
public void endTurn()
public BattleParticipant getParticipant()
public PixelmonWrapper doSwitch()
public void beforeSwitch(PixelmonWrapper switchingIn)
public void afterSwitch()
public boolean switchThisTurn()
protected PixelmonWrapper findPixelmon(java.util.UUID uuid)
public void forcePursuitAttackers()
public void takeTurn()
public boolean canAttackThisTurn(Attack a)
public boolean dynamax(boolean revert, float healthPercentage)
public boolean megaEvolve()
public void setAttack(int buttonId, java.util.List<PixelmonWrapper> targets, boolean megaEvolving)
buttonId
- The ID of the pressed button.targets
- The attack's targets.megaEvolving
- Whether the Pokémon will Mega Evolve when using the attack.public void setAttack(Attack attack, java.util.List<PixelmonWrapper> targets, boolean megaEvolving)
attack
- The attack to be used.targets
- The attack's target.megaEvolving
- Whether the Pokémon will Mega Evolve when using the attack.public boolean isFainted()
public boolean isAlive()
public void setStruggle(java.util.ArrayList<PixelmonWrapper> targets)
targets
- The targets of Struggle.public void returnToBasePos()
public void setBasePosition(double[] ds)
ds
- The initial position.public void setTempType(Element newType)
newType
- The Pokémon's new temporary type.public void setTempType(java.util.List<Element> newType)
newType
- The Pokémon's new temporary type.public void setTempAbility(Ability newAbility)
newAbility
- The Ability for the Pokémon to receive.public void setTempAbility(Ability newAbility, boolean formChange)
newAbility
- The Ability for the Pokémon to receive.formChange
- Whether the Ability is the result of a form change.public void resetOnSwitch()
public float getWeight(boolean ignoreAbility)
ignoreAbility
- Whether to ignore the Pokémon's Ability when calculating weight.public void consumeItem()
public void setConsumedItem(HeldItem heldItem)
heldItem
- The consumed held item.public HeldItem getConsumedItem()
public void setNewHeldItem(HeldItem heldItem)
heldItem
- The new held item for the Pokémon.public boolean isGrounded()
public boolean isAirborne()
public boolean addTeamStatus(StatusBase status, PixelmonWrapper cause)
status
- The status to add.cause
- The Pokémon who caused the status to occur.public boolean removeTeamStatus(StatusBase status)
status
- The status to remove.public boolean removeTeamStatus(StatusType... statuses)
statuses
- The statuses to remove.public java.util.ArrayList<PixelmonWrapper> getTeamPokemon()
public java.util.ArrayList<PixelmonWrapper> getTeamPokemonExcludeSelf()
public java.util.ArrayList<PixelmonWrapper> getOpponentPokemon()
public boolean isAlly(PixelmonWrapper pokemon)
public boolean isOpponent(PixelmonWrapper pokemon)
public int getControlledIndex()
public BattleAIBase getBattleAI()
public void setUpSwitchMove()
public void forceRandomSwitch(java.util.UUID switchPokemon)
switchPokemon
- The Pokémon replacing this Pokémon.public boolean isImmuneToPowder()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean hasMoved()
public boolean isFirstTurn()
public boolean isMovingLast()
public boolean isSameTeam(PixelmonWrapper other)
other
- The Pokémon to check.public Moveset getMoveset()
public void setTemporaryMoveset(Moveset moveset)
public boolean removeStatus(StatusType s)
s
- The status to remove.public boolean removeStatus(StatusType s, boolean message)
s
- The status to remove.message
- Whether to send message or not.public boolean removeStatuses(StatusType... statuses)
statuses
- The statuses to remove.public boolean removeStatuses(boolean showMessage, StatusType... statuses)
showMessage
- Whether to show messages when statuses are removed.statuses
- The statuses to remove.public void removeStatus(int i)
i
- The index of the status to remove.public StatusBase getStatus(StatusType type)
type
- The status to get.public boolean hasStatus(StatusType... statuses)
statuses
- The statuses to check.public boolean hasNonVolatileStatus()
public boolean hasNonVolatileStatus(boolean includeComatose)
includeComatose
- Whether Comatose is valid or not for this.public int countStatuses(StatusType... statuses)
statuses
- The statuses to take into account when counting.public int getStatusSize()
public java.util.List<StatusBase> getStatuses()
public StatusBase getStatus(int i)
i
- The index of the status.public int getStatusIndex(StatusType findStatus)
findStatus
- The status to get the index of.public StatusPersist getPrimaryStatus()
public void setStatus(int i, StatusBase newStatus)
i
- The index of the old status.newStatus
- The status to turn the old status into.public void clearStatus()
public boolean addStatus(StatusBase e, PixelmonWrapper opponent)
e
- The status to add.opponent
- The Pokémon who caused the status.public boolean addStatus(StatusBase e, PixelmonWrapper opponent, net.minecraft.util.text.TranslationTextComponent message)
e
- The status to add.opponent
- The Pokémon who caused the status.message
- The message to display when the status is added.public void sendStatusPacket(int statusID)
statusID
- The ID of the status to add, or -1 to remove it.public void removeStatus(StatusBase e)
e
- The status to remove.public void removeStatus(StatusBase e, boolean showMessage)
e
- The status to remove.public StatusBase removePrimaryStatus()
public StatusBase removePrimaryStatus(boolean showMessage)
showMessage
- Whether to show a message when a status is cured.public boolean cannotHaveStatus(StatusBase t, PixelmonWrapper opponent)
t
- The status to check.opponent
- The Pokémon causing the status.public boolean cannotHaveStatus(StatusBase t, PixelmonWrapper opponent, boolean ignorePrimaryOverlap)
t
- The status to check.opponent
- The Pokémon causing the status.ignorePrimaryOverlap
- Whether to ignore the restriction that primary statuses cannot overlap with each
other.public java.util.List<EntryHazard> getEntryHazards()
public void updateBattleDamage(int damage)
damage
- The damage that was dealt to the Pokémon.public java.util.List<Element> getEffectiveTypes(PixelmonWrapper user, PixelmonWrapper target)
user
- The attack's user.target
- The attack's target.public float doBattleDamage(PixelmonWrapper source, float damage, DamageTypeEnum damageType)
source
- The Pokémon who caused the damage.damage
- The amount of damage to deal.damageType
- The type of damage that is to be dealt.public Ability getAbility()
public Ability getBattleAbility()
public Ability getBattleAbility(PixelmonWrapper moveUser)
moveUser
- The Pokémon using a move on this Pokémon.public Ability getBattleAbility(boolean canIgnore)
canIgnore
- Whether to acknowledge if the Pokémon's Ability is inactive.public Ability getBattleAbility(boolean canIgnore, PixelmonWrapper moveUser)
canIgnore
- Whether to acknowledge if the Pokémon's Ability is inactive.moveUser
- The Pokémon using a move on this Pokémon.public boolean hasHeldItem()
public HeldItem getHeldItem()
public HeldItem getUsableHeldItem()
public void removeHeldItem()
public void setHeldItem(HeldItem newItem)
newItem
- The held item to set.public void setHeldItem(net.minecraft.item.ItemStack itemStack)
itemStack
- The held item to set.public boolean canMegaEvolve()
public boolean canUltraBurst()
public boolean canDynamax()
public boolean canGigantamax()
public static boolean canMegaEvolve(net.minecraft.item.ItemStack heldItem, Species pokemon, java.lang.String form)
heldItem
- The Pokémon's held item.pokemon
- The Pokémon's pokemon.form
- The Pokémon's form index.public static boolean canUseZMove(net.minecraft.item.ItemStack heldItem)
public static boolean canMegaEvolve(HeldItem heldItem, Species species, java.lang.String form)
heldItem
- The Pokémon's held item.species
- The Pokémon's pokemon.form
- The Pokémon's form index.public static boolean canUltraBurst(Species species, HeldItem heldItem, Stats form)
species
- The Pokémon's pokemon.heldItem
- The Pokémon's held item.form
- The Pokémon's form index.public static boolean canDynamax(Stats form, HeldItem item)
form
- The Pokémon's form.public static boolean canGigantamax(boolean gigantamaxFactor, Species species, Stats form)
gigantamaxFactor
- The Pokémon's Gigantamax Factor.species
- The Pokémon's pokemon.form
- The Pokémon's form.public boolean hasCompatibleMegaStone()
public static boolean hasCompatibleMegaStone(HeldItem heldItem, Stats form)
heldItem
- The Pokémon's held item.form
- The Pokémon's formpublic boolean isItemRemovable(PixelmonWrapper user)
user
- The Pokémon attempting to remove the item.public boolean isItemGivable(HeldItem item)
isItemRemovable(com.pixelmonmod.pixelmon.battles.controller.participants.PixelmonWrapper)
item
- The held item being given to this Pokémon.public boolean hasSpecialItem(PixelmonWrapper user)
@Deprecated public java.lang.String getNickname()
public net.minecraft.util.text.ITextComponent getFormattedNickname()
@Deprecated public java.lang.String getRealNickname()
public net.minecraft.util.text.ITextComponent getRealFormattedNickname()
public Gender getGender()
public int getHealth(boolean ignoreDynamax)
ignoreDynamax
- Whether to ignore the increase to maximum hp from Dynamax or not.public int getHealth()
public int getMaxHealth(boolean ignoreDynamax)
ignoreDynamax
- Whether to ignore the increase to maximum hp from Dynamax or not.public void recalculateMaxHP()
public int getMaxHealth()
public double getDynamaxHealthMod()
public float getHealthPercent()
public float getHealthPercent(float amount)
amount
- The amount of health to get a percentage for.public float getHealPercent(float amount)
amount
- The amount of health that the Pokémon can recover.public int getHealthDeficit()
public boolean hasFullHealth(boolean ignoreAbility)
ignoreAbility
- Whether the Pokémon's ability should be ignored for this check or not.public boolean hasFullHealth()
public int getPercentMaxHealth(float percent, boolean ignoreDynamax)
percent
- The percentage of the Pokémon's maximum hp to get.ignoreDynamax
- Whether to ignore the increase to maximum hp from Dynamax or not.public int getPercentMaxHealth(float percent)
public int healByPercent(float percent)
percent
- The percentage of the Pokémon maximum health to heal it by.public int healEntityBy(int i)
i
- The amount to heal the Pokémon by.public void setHealth(int newHP)
newHP
- The new current hp of the Pokémon.public void setAttackFailed()
public boolean doesLevel()
public java.util.UUID getPokemonUUID()
public void update(EnumUpdateType... types)
types
- The types of data to update.public Stats getForm()
public void setForm(java.lang.String form)
form
- The index of the new form.public void setForm(Stats form)
form
- The index of the new form.public Stats getPrevForm()
public void setPrevForm(java.lang.String form)
form
- The index of the previous form.public void setPrevForm(Stats form)
form
- The index of the previous form.public void setPalette(java.lang.String paletteName)
paletteName
- The name of the palette.public void setPrevPaletteName(java.lang.String paletteName)
paletteName
- The name of the palette.public boolean hasGigantamaxFactor()
public void resetBattleEvolution()
public net.minecraft.util.math.BlockPos getWorldPosition()
public net.minecraft.world.World getWorld()
public net.minecraft.entity.player.ServerPlayerEntity getPlayerOwner()
public NPCTrainer getTrainerOwner()
public java.lang.String getOwnerName()
public boolean isWildPokemon()
public boolean isRaidPokemon()
public boolean isSingleType()
public boolean isSingleType(Element type)
type
- The type to check for.public void addAttackers()
public java.lang.String getOriginalTrainer()
public java.lang.String getRealTextureNoCheck()
public java.lang.String getPokemonName()
public Species getSpecies()
public Nature getNature()
public Nature getBaseNature()
public PokemonLevel getPokemonLevel()
public int getPokemonLevelNum()
public int getExp()
public void setLevelNum(int level)
level
- The Pokémon's pokemonLevel.public void setExp(int experience)
experience
- The Pokémon's experience.public void setTempLevel(int level)
level
- The pokemonLevel for the Pokémon to use.public Pokemon getInnerLink()
public int getPartyPosition()
public void enableReturnHeldItem()
public boolean shouldReturnHeldItem()
public void writeToNBT()
public void updateHPIncrease()
public boolean isDynamax()
public boolean isGigantamax()
public void setRaidShields(int shields)
public void updateRaidShields(int shields)
public void addGlobalStatus(GlobalStatusBase g)
g
- The GlobalStatusBase to be added to the battle.public PixelmonWrapper copy()