Class ANIMAGUS_INCANTATION
ANIMAGUS_INCANTATION is a temporary effect that marks an active Animagus transformation spell casting
session. Unlike ANIMAGUS_EFFECT (which represents the permanent animal form transformation),
this effect simply tracks that the player is in the process of reciting the incantation. The duration
of this effect corresponds to the time the player has to continue reciting the spell before completion
or expiration.
This effect serves as a state marker for spell progression systems and prevents multiple simultaneous incantation attempts. When the incantation is complete (or expires), this effect is removed and may be replaced by an ANIMAGUS_EFFECT if the spell succeeds.
-
Field Summary
Fields inherited from class net.pottercraft.ollivanders2.effect.O2Effect
affectedPlayerText, duration, effectType, informousText, kill, legilimensText, p, permanent, targetID -
Constructor Summary
ConstructorsConstructorDescriptionANIMAGUS_INCANTATION(@NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull UUID pid) Constructor for creating an Animagus incantation marker effect. -
Method Summary
Modifier and TypeMethodDescriptionvoidAge the incantation effect to track its remaining duration.voiddoRemove()Perform cleanup when the incantation effect is removed.voidsetPermanent(boolean perm) Overridden to prevent permanent status - animagus incantation is always temporary.Methods inherited from class net.pottercraft.ollivanders2.effect.O2Effect
age, getAffectedPlayerText, getInformousText, getLegilimensText, getMaxDuration, getMinDuration, getRemainingDuration, getTargetID, isKilled, isPermanent, kill
-
Constructor Details
-
ANIMAGUS_INCANTATION
public ANIMAGUS_INCANTATION(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid) Constructor for creating an Animagus incantation marker effect.Creates a temporary effect that marks the player as actively reciting the Animagus spell. The duration parameter specifies how long the incantation remains active before expiring.
- Parameters:
plugin- a callback to the MC pluginduration- the duration of the incantation state in game ticksisPermanent- ignored - animagus incantation is always temporarypid- the unique ID of the player reciting the Animagus incantation
-
-
Method Details
-
checkEffect
public void checkEffect()Age the incantation effect to track its remaining duration.Called every game tick by the effect system. Decrements the effect's duration by 1 tick. When the duration reaches zero or below, the effect is automatically killed and removed.
- Specified by:
checkEffectin classO2Effect
-
doRemove
public void doRemove()Perform cleanup when the incantation effect is removed.The default implementation does nothing, as the incantation marker effect has no state to clean up. Removal of this effect simply ends the incantation state, allowing the player to attempt the spell again or move on to other actions.
-
setPermanent
public void setPermanent(boolean perm) Overridden to prevent permanent status - animagus incantation is always temporary.ANIMAGUS_INCANTATION enforces non-permanent behavior by ignoring all setPermanent() calls. This effect is designed as a temporary marker for the incantation spell casting state and cannot be converted to permanent status. Attempts to set this effect to permanent are silently ignored.
- Overrides:
setPermanentin classO2Effect- Parameters:
perm- the requested permanent status (ignored - effect remains temporary regardless)
-