Class EntryHazard
java.lang.Object
com.pixelmonmod.pixelmon.battles.attacks.EffectBase
com.pixelmonmod.pixelmon.battles.status.StatusBase
com.pixelmonmod.pixelmon.battles.status.EntryHazard
- Direct Known Subclasses:
Spikes
,StealthRock
,Steelsurge
,StickyWeb
,ToxicSpikes
Negatively affects Pokémon who switch in on the side that the status is laid on.
-
Field Summary
Modifier and TypeFieldDescriptionstatic List<Supplier<ImmutableAttack>>
protected PixelmonWrapper
The pokemon who placed the first layer of this hazard.protected int
The current number of layers of the entry hazard present.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.void
Triggers when the statused Pokémon switches in.void
applyHazards
(PixelmonWrapper user, PixelmonWrapper target) copy()
If necessary, makes a deep copy of the status.protected void
Affects a Pokémon when it switches in.protected abstract String
Gets the lang key for the message displayed when a hazard is triggered.abstract int
Gets the weight per Pokémon that an AI will assign to the move.int
Returns the amount of damage dealt by the entry hazard.protected abstract String
Gets the lang key for the message displayed when a hazard is first laid.Gets the pokemon who placed the initial layer of this hazard.protected String
Gets the lang key for the message displayed when a hazard layer is added to an existing one.abstract EntryHazard
Gets a new instance of the entry hazard.int
Gets the current number of layers of the entry hazard present.protected boolean
Checks if the Pokémon is flying over the entry hazard.boolean
Determines whether the status applies to the Pokémon's position in the battle.protected boolean
Checks if the Pokémon is unharmed by the entry hazard.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.Methods inherited from class com.pixelmonmod.pixelmon.battles.status.StatusBase
adjustCritStage, allowsStatChange, applyBeforeEffect, applyEndOfBattleEffect, applyRepeatedEffect, applySwitchOutEffect, canAttackThisTurn, cantMiss, getCureMessage, getCureMessageItem, getNewInstance, ignoreStatus, isImmune, 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
-
ENTRY_HAZARDS
-
numLayers
protected transient int numLayersThe current number of layers of the entry hazard present. -
initialPlacer
The pokemon who placed the first layer of this hazard.
-
-
Constructor Details
-
EntryHazard
Initializes the entry hazard.- Parameters:
type
- The type of entry hazard.maxLayers
- The maximum number of layers of the entry hazard that can be laid.
-
-
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.
-
applyHazards
-
getNumLayers
public int getNumLayers()Gets the current number of layers of the entry hazard present.- Returns:
- The current number of layers of the entry hazard present.
-
getInitialPlacer
Gets the pokemon who placed the initial layer of this hazard.- Returns:
- The pokemon who placed the first layer.
-
getNewInstance
Gets a new instance of the entry hazard.- Returns:
- A new instance of the entry hazard.
-
getFirstLayerMessage
Gets the lang key for the message displayed when a hazard is first laid.- Returns:
- The lang key for the message displayed when a hazard is first laid.
-
getMultiLayerMessage
Gets the lang key for the message displayed when a hazard layer is added to an existing one.- Returns:
- The lang key for the message displayed when a hazard layer is added to an existing one.
-
getAffectedMessage
Gets the lang key for the message displayed when a hazard is triggered.- Returns:
- The lang key for the message displayed when a hazard is triggered.
-
isTeamStatus
public boolean isTeamStatus()Description copied from class:StatusBase
Determines whether the status applies to the Pokémon's position in the battle.- Overrides:
isTeamStatus
in classStatusBase
- Returns:
- Whether the status applies to the Pokémon's position in the battle.
-
applyEffectOnSwitch
Description copied from class:StatusBase
Triggers when the statused Pokémon switches in.- Overrides:
applyEffectOnSwitch
in classStatusBase
- Parameters:
pw
- The statused Pokémon.
-
doEffect
Affects a Pokémon when it switches in.- Parameters:
pw
- The Pokémon to affect.
-
getDamage
Returns the amount of damage dealt by the entry hazard.- Parameters:
pw
- The Pokémon being damaged by the entry hazard.- Returns:
- The amount of damage dealt by the entry hazard.
-
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.
-
isAirborne
Checks if the Pokémon is flying over the entry hazard. Differs from PixelmonWrapper.isAirborne() because of Mold Breaker.- Parameters:
pw
- The Pokémon to check.- Returns:
- Whether the Pokémon is flying over the entry hazard.
-
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.
-
getAIWeight
public abstract int getAIWeight()Gets the weight per Pokémon that an AI will assign to the move.- Returns:
- The weight per Pokémon that an AI will assign to the move.
-
isUnharmed
Checks if the Pokémon is unharmed by the entry hazard.- Parameters:
pw
- The Pokémon to check.- Returns:
- Whether the Pokémon is unharmed by the entry hazard.
-