Class Sleep
java.lang.Object
com.pixelmonmod.pixelmon.battles.attacks.EffectBase
com.pixelmonmod.pixelmon.battles.status.StatusBase
com.pixelmonmod.pixelmon.battles.status.StatusPersist
com.pixelmonmod.pixelmon.battles.status.Sleep
Makes the Pokémon incapable of any action for a number of turns.
-
Field Summary
Fields inherited from class com.pixelmonmod.pixelmon.battles.status.StatusBase
battleTurnGained, turnGained, type
Fields inherited from class com.pixelmonmod.pixelmon.battles.attacks.EffectBase
modifiers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyEffect
(PixelmonWrapper user, PixelmonWrapper target) Causes various effects during the move.boolean
canAttackThisTurn
(PixelmonWrapper user, Attack a) Determines whether the statused Pokémon can attack.copy()
If necessary, makes a deep copy of the status.Gets the lang key for the message that is displayed when the status is cured.Gets the lang key for the message that is displayed when the status is cured with a held item.boolean
isImmune
(PixelmonWrapper pokemon) Checks if the Pokémon is immune to the status.restoreFromNBT
(net.minecraft.nbt.CompoundTag nbt) Loads the status from NBT.static boolean
sleep
(PixelmonWrapper user, PixelmonWrapper target, Attack attack, boolean showMessage) Puts the Pokémon to sleep if possible.static boolean
uproarActive
(PixelmonWrapper pokemon) Checks if any Pokémon in battle are using Uproar.void
weightEffect
(PixelmonWrapper pw, MoveChoice userChoice, List<MoveChoice> userChoices, List<MoveChoice> bestUserChoices, List<MoveChoice> opponentChoices, List<MoveChoice> bestOpponentChoices) Determines a weight for the move that has this effect.void
writeToNBT
(net.minecraft.nbt.CompoundTag nbt) Writes the status to NBT.Methods inherited from class com.pixelmonmod.pixelmon.battles.status.StatusPersist
addStatus, alreadyHasStatus, isStatus, readStatusFromNBT
Methods inherited from class com.pixelmonmod.pixelmon.battles.status.StatusBase
adjustCritStage, allowsStatChange, applyBeforeEffect, applyEffectOnSwitch, applyEndOfBattleEffect, applyRepeatedEffect, applySwitchOutEffect, cantMiss, getNewInstance, ignoreStatus, isTeamStatus, isWholeTeamStatus, modifyBaseStats, modifyDamageIncludeFixed, modifyEffectiveTypes, modifyMoveEffectChanceTarget, modifyMoveEffectChanceUser, modifyPowerAndAccuracyTarget, modifyPowerAndAccuracyUser, modifyStats, modifyStatsCancellable, modifyWeight, onAttackEnd, onAttackUsed, onDamageReceived, onDynamaxTriggered, onEndOfAttackersTurn, onEndOfTurn, onFormChanged, redirectAttack, skipsTurn, stopsEvolution, stopsForcedSwitches, stopsIncomingAttack, stopsIncomingAttackMessage, stopsIncomingAttackUser, stopsSelfStatusMove, stopsStatusChange, stopsSwitching
Methods inherited from class com.pixelmonmod.pixelmon.battles.attacks.EffectBase
applyEarlyEffect, applyEffectAfterAllTargets, applyEffectAfterStatus, applyEffectHitOrMiss, applyEffectStart, applyMissEffect, canHitMultipleTargets, changeChance, checkChance, dealtDamage, dealtDamagePerHit, doesPersist, getChance, getWeightWithChance, isChance, isUser, modifyDamage, modifyPriority, modifyTargets, modifyTypeEffectiveness, modifyTypeEffectiveness, preventsRedirection, setChance
-
Field Details
-
effectTurns
public transient int effectTurnsThe number of turns left for sleep to last.
-
-
Constructor Details
-
Sleep
public Sleep() -
Sleep
Initializes a new sleep with a random duration. -
Sleep
public Sleep(int i) Initializes a new sleep with a specified duration.- Parameters:
i
- The duration of sleep.
-
-
Method Details
-
applyEffect
Description copied from class:EffectBase
Causes various effects during the move.- Overrides:
applyEffect
in classStatusBase
- Parameters:
user
- The move's user.target
- The move's target.
-
sleep
public static boolean sleep(PixelmonWrapper user, PixelmonWrapper target, Attack attack, boolean showMessage) Puts the Pokémon to sleep if possible.- Parameters:
user
- The Pokémon causing the sleep.target
- The Pokémon to put to sleep.attack
- The attack causing the sleep.showMessage
- Whether to show messages depending on what occurs.- Returns:
- Whether the target was put to sleep successfully.
-
isImmune
Description copied from class:StatusBase
Checks if the Pokémon is immune to the status.- Overrides:
isImmune
in classStatusBase
- Parameters:
pokemon
- The Pokémon to check.- Returns:
- Whether the Pokémon is immune to the status.
-
canAttackThisTurn
Description copied from class:StatusBase
Determines whether the statused Pokémon can attack.- Overrides:
canAttackThisTurn
in classStatusBase
- Parameters:
user
- The statused Pokémon.a
- The attack to be used by the Pokémon.- Returns:
- Whether the Pokémon can attack.
-
writeToNBT
public void writeToNBT(net.minecraft.nbt.CompoundTag nbt) Description copied from class:StatusPersist
Writes the status to NBT.- Overrides:
writeToNBT
in classStatusPersist
- Parameters:
nbt
- The NBT tag to write to.
-
restoreFromNBT
Description copied from class:StatusPersist
Loads the status from NBT.- Specified by:
restoreFromNBT
in classStatusPersist
- Parameters:
nbt
- The NBT tag to read from.- Returns:
- A new instance of the status.
-
uproarActive
Checks if any Pokémon in battle are using Uproar.- Parameters:
pokemon
- A Pokémon in the battle.- Returns:
- Whether any Pokémon are using Uproar.
-
copy
Description copied from class:StatusBase
If necessary, makes a deep copy of the status.- Overrides:
copy
in classStatusBase
- Returns:
- A deep copy of the status.
-
getCureMessage
Description copied from class:StatusBase
Gets the lang key for the message that is displayed when the status is cured.- Overrides:
getCureMessage
in classStatusBase
- Returns:
- The lang key for the message that is displayed when the status is cured.
-
getCureMessageItem
Description copied from class:StatusBase
Gets the lang key for the message that is displayed when the status is cured with a held item.- Overrides:
getCureMessageItem
in classStatusBase
- Returns:
- The lang key for the message that is displayed when the status is cured with a held item.
-
weightEffect
public void weightEffect(PixelmonWrapper pw, MoveChoice userChoice, List<MoveChoice> userChoices, List<MoveChoice> bestUserChoices, List<MoveChoice> opponentChoices, List<MoveChoice> bestOpponentChoices) Description copied from class:EffectBase
Determines a weight for the move that has this effect. Used for battle AI.- Overrides:
weightEffect
in classEffectBase
- Parameters:
pw
- The Pokémon using the move.userChoice
- The move with this effect.userChoices
- All choices the Pokémon has for the turn.bestUserChoices
- The best offensive choices the Pokémon has for the turn.opponentChoices
- All choices the opponent has for the turn.bestOpponentChoices
- The best choices the opponent has for the turn.
-