Class LYCANTHROPY


public class LYCANTHROPY extends ShapeShiftSuper
Permanent lycanthropy curse that transforms player into a werewolf during full moons.

LYCANTHROPY is a permanent curse that transforms the affected player into a werewolf during full moons (every 8 in-game days). The curse is tied to the lunar cycle: the player transforms into wolf form after moonrise (game time > 13000) on full moon days and reverts to human form before moonrise or after sunrise on full moon days, or on any non-full-moon day. While transformed, additional effects are automatically applied: aggressive behavior (AGGRESSION with level 10) and wolf-like speech (LYCANTHROPY_SPEECH). The effect is always permanent and cannot be modified via setPermanent(). The curse can spread through damage dealt by angry wolves transformed by this effect. Detectable by mind-reading spells (Legilimens) which report the player "is a werewolf".

Transformation Cycle (based on in-game full moon every 8 days):

  • Checks for full moon day and time after sunset (game time > 13000)
  • On full moon after moonrise: transforms to wolf, applies AGGRESSION and LYCANTHROPY_SPEECH
  • Before moonrise on full moon or after sunrise: reverts to human form, removes additional effects
  • On non-full-moon days: reverts to human form, removes additional effects

Infection Mechanism:

  • Angry wolves transformed by this effect can infect other players through damage
  • Infection occurs 1 second (20 ticks) after damage is dealt to allow event processing
  • New infection creates new LYCANTHROPY effect on the damaged player

Relief Mechanism:

  • LYCANTHROPY_RELIEF effect can temporarily suppress transformation
  • When relief is active, player does not transform even during full moon periods
  • Relief flag is managed by setRelief() and getRelief() methods
See Also:
  • Constructor Details

    • LYCANTHROPY

      public LYCANTHROPY(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid)
      Constructor for creating a permanent lycanthropy curse effect.

      Creates a permanent curse that ties the player's form to the lunar cycle. The player will transform into a wolf during full moons and revert to human form otherwise. Sets the detection text for mind-reading spells to "is a werewolf". The effect is always permanent and transformation is controlled by the upkeep() method based on in-game time and moon phase.

      Parameters:
      plugin - a callback to the MC plugin
      duration - duration parameter (ignored - lycanthropy is always permanent)
      isPermanent - ignored - lycanthropy is always permanent
      pid - the unique ID of the player to curse with lycanthropy
  • Method Details

    • kill

      public void kill()
      Kill the lycanthropy effect and restore the player to human form.

      Reverts the player to human form if currently transformed, removes any additional effects (AGGRESSION, LYCANTHROPY_SPEECH) that were applied, and marks the effect for removal from the player's effect list.

      Overrides:
      kill in class ShapeShiftSuper
    • doCheckEffect

      protected void doCheckEffect()
      Age the lycanthropy effect and manage transformation based on lunar cycle and relief status.

      Called each game tick. This method performs transformation checks in the following priority:

      1. If relief flag is active: revert to human form and remove secondary effects
      2. If on full moon day and time is between moonrise (13000) and dawn (23000): transform to wolf and apply AGGRESSION and LYCANTHROPY_SPEECH effects
      3. Otherwise: revert to human form and remove secondary effects

      Transformation is automatically managed by this check cycle and persists indefinitely until the effect is manually killed or relief is applied.

      Specified by:
      doCheckEffect in class ShapeShiftSuper
    • setPermanent

      public void setPermanent(boolean perm)
      Prevent any code from modifying the permanent status of lycanthropy.

      Overrides the parent method to ensure lycanthropy always remains permanent. The duration parameter is ignored and the effect cannot be made temporary through this method.

      Overrides:
      setPermanent in class O2Effect
      Parameters:
      perm - ignored - lycanthropy is always permanent
    • doRemove

      public void doRemove()
      Perform cleanup when the lycanthropy effect is removed.

      The default implementation does nothing. The main cleanup is handled by the kill() method which restores the player to human form and removes additional effects. Once killed, the player is no longer affected by the lunar cycle transformation.

      Specified by:
      doRemove in class O2Effect
    • setRelief

      public void setRelief(boolean relief)
      Set the relief flag to suppress or allow werewolf transformation.

      When relief is set to true, the player will revert to human form and will not transform even during full moon periods. When set to false, normal transformation behavior resumes. This method is called by LYCANTHROPY_RELIEF effect to toggle relief state.

      Parameters:
      relief - true to suppress transformation, false to allow normal transformation
    • getRelief

      public boolean getRelief()
      Get the current relief flag status.

      Returns whether the lycanthropy transformation is currently suppressed by relief.

      Returns:
      true if relief is active and transformation is suppressed, false otherwise