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
FieldsModifier and TypeFieldDescriptionstatic List<Supplier<ImmutableAttack>>protected PixelmonWrapperThe pokemon who placed the first layer of this hazard.protected intThe current number of layers of the entry hazard present.Fields inherited from class com.pixelmonmod.pixelmon.battles.status.StatusBase
battleTurnGained, turnGained, typeFields inherited from class com.pixelmonmod.pixelmon.battles.attacks.EffectBase
modifiers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEffect(PixelmonWrapper user, PixelmonWrapper target) Causes various effects during the move.voidTriggers when the statused Pokémon switches in.voidapplyHazards(PixelmonWrapper user, PixelmonWrapper target) copy()If necessary, makes a deep copy of the status.protected voidAffects a Pokémon when it switches in.protected abstract StringGets the lang key for the message displayed when a hazard is triggered.abstract intGets the weight per Pokémon that an AI will assign to the move.intReturns the amount of damage dealt by the entry hazard.protected abstract StringGets 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 StringGets the lang key for the message displayed when a hazard layer is added to an existing one.abstract EntryHazardGets a new instance of the entry hazard.intGets the current number of layers of the entry hazard present.protected booleanChecks if the Pokémon is flying over the entry hazard.booleanDetermines whether the status applies to the Pokémon's position in the battle.protected booleanChecks if the Pokémon is unharmed by the entry hazard.voidweightEffect(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, stopsSwitchingMethods 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:EffectBaseCauses various effects during the move.- Overrides:
applyEffectin 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:StatusBaseDetermines whether the status applies to the Pokémon's position in the battle.- Overrides:
isTeamStatusin classStatusBase- Returns:
- Whether the status applies to the Pokémon's position in the battle.
-
applyEffectOnSwitch
Description copied from class:StatusBaseTriggers when the statused Pokémon switches in.- Overrides:
applyEffectOnSwitchin 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:StatusBaseIf necessary, makes a deep copy of the status.- Overrides:
copyin 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:EffectBaseDetermines a weight for the move that has this effect. Used for battle AI.- Overrides:
weightEffectin 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.
-