Class AttackAnimation
java.lang.Object
com.pixelmonmod.pixelmon.api.battles.attack.animation.AttackAnimation
- All Implemented Interfaces:
ActiveBattleAnimation,ContextHolder
Runtime instance of an attack animation being played in battle.
This stores the battle context for the animation, tracks its tick progress, and delegates
update, cleanup, and completion checks to the configured AttackAnimationLogic.
Additional animation-specific state can be stored in the attached StoredContext.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Attackprotected final StoredContextprotected final BattleControllerprotected intprotected final AttackAnimationLogicprotected final PixelmonWrapperprotected intprotected final PixelmonWrapper -
Constructor Summary
ConstructorsConstructorDescriptionAttackAnimation(AttackAnimationLogic logic, BattleController controller, PixelmonWrapper user, PixelmonWrapper target, Attack attack) -
Method Summary
Modifier and TypeMethodDescriptionattack()Returns the attack associated with this animation.voidcleanUp()Cleans up state owned by this animation.Returns the battle controller this animation is attached to.copy(BattleController newController) Creates a copy of this animation attached to another battle controller.voiddelay(int ticks) Delays ticking the animation logic by the supplied number of ticks.booleanReturns whether this animation has finished.logic()target()Returns the Pokemon targeted by the animated action.voidtick()Advances this animation by one battle tick.intticks()Returns the number of 20 TPS animation ticks this animation has been active.user()Returns the Pokemon using the animated action.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pixelmonmod.pixelmon.api.battles.animation.runtime.ActiveBattleAnimation
acknowledgeClient, audience, blocksBattle, cleanUpChannel, isChannelBusy, isContextAliveMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.context.ContextHolder
get, getOrDefault, has, remove, set, update
-
Field Details
-
context
-
logic
-
controller
-
user
-
target
-
attack
-
ticks
protected int ticks -
delayTicks
protected int delayTicks
-
-
Constructor Details
-
AttackAnimation
public AttackAnimation(AttackAnimationLogic logic, BattleController controller, PixelmonWrapper user, PixelmonWrapper target, Attack attack)
-
-
Method Details
-
logic
- Returns:
- the logic controlling this animation
-
delay
public void delay(int ticks) Delays ticking the animation logic by the supplied number of ticks.- Parameters:
ticks- the number of ticks to delay the animation
-
ticks
public int ticks()Description copied from interface:ActiveBattleAnimationReturns the number of 20 TPS animation ticks this animation has been active.- Specified by:
ticksin interfaceActiveBattleAnimation- Returns:
- the active animation tick count
-
controller
Description copied from interface:ActiveBattleAnimationReturns the battle controller this animation is attached to.- Specified by:
controllerin interfaceActiveBattleAnimation- Returns:
- the owning battle controller
-
user
Description copied from interface:ActiveBattleAnimationReturns the Pokemon using the animated action.- Specified by:
userin interfaceActiveBattleAnimation- Returns:
- the user Pokemon, or
nullwhen not applicable
-
target
Description copied from interface:ActiveBattleAnimationReturns the Pokemon targeted by the animated action.- Specified by:
targetin interfaceActiveBattleAnimation- Returns:
- the target Pokemon, or
nullwhen not applicable
-
attack
Description copied from interface:ActiveBattleAnimationReturns the attack associated with this animation.- Specified by:
attackin interfaceActiveBattleAnimation- Returns:
- the attack, or
nullwhen not applicable
-
getContext
- Specified by:
getContextin interfaceActiveBattleAnimation- Specified by:
getContextin interfaceContextHolder
-
copy
Description copied from interface:ActiveBattleAnimationCreates a copy of this animation attached to another battle controller.- Specified by:
copyin interfaceActiveBattleAnimation- Parameters:
newController- the replacement battle controller- Returns:
- the copied animation
-
tick
public void tick()Description copied from interface:ActiveBattleAnimationAdvances this animation by one battle tick.- Specified by:
tickin interfaceActiveBattleAnimation
-
cleanUp
public void cleanUp()Description copied from interface:ActiveBattleAnimationCleans up state owned by this animation.- Specified by:
cleanUpin interfaceActiveBattleAnimation
-
isFinished
public boolean isFinished()Description copied from interface:ActiveBattleAnimationReturns whether this animation has finished.- Specified by:
isFinishedin interfaceActiveBattleAnimation- Returns:
truewhen the animation is finished
-