Class LEGILIMENS

java.lang.Object
net.pottercraft.ollivanders2.spell.O2Spell
net.pottercraft.ollivanders2.spell.LEGILIMENS

public final class LEGILIMENS extends O2Spell
Mind-reading spell that reveals information about a target player.

The spell attempts to read the mind of a nearby player and reveal various information depending on the caster's experience level and the target's resistance. Success depends on comparing the caster's Legilimens skill against the target's skill.

Information Revealed (by Legilimens Level):

  • Base (any level): Whether target is a muggle or witch/wizard, house and year (if sorted)
  • Level 2+: Target's wand type (50% chance)
  • Level 3+: Last spell cast by target (50% chance)
  • Level 4+: Target's mastered spell for non-verbal casting (33% chance, if enabled)
  • Level 6+: Active magical effects on target (40% chance)
  • Level 10+: Whether target is an animagus and their form (10% chance)

Success Rate by Skill Comparison:

  • 80% success when caster's skill > target's skill
  • 66% success when skills are equal
  • 10% success when caster's skill < target's skill

Animagus Form: When target is in animagus form, only level 10+ casters can attempt mind reading, with a 10% success rate. Lower level casters cannot read an animagus's mind.

See Also:
  • Field Details

    • radius

      public static final int radius
      The radius that legilimens can find a target in
      See Also:
    • mindReadFailureMessage

      public static final String mindReadFailureMessage
      The failure message when the spell finds a target but fails to read their mind
      See Also:
  • Constructor Details

    • LEGILIMENS

      public LEGILIMENS(Ollivanders2 plugin)
      Default constructor for use in generating spell text. Do not use to cast the spell.
      Parameters:
      plugin - the Ollivanders2 plugin
    • LEGILIMENS

      public LEGILIMENS(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull Double rightWand)
      Constructor.
      Parameters:
      plugin - a callback to the MC plugin
      player - the player who cast this spell
      rightWand - which wand the player was using
  • Method Details

    • doCheckEffect

      protected void doCheckEffect()
      Attempt to read nearby (within 3 blocks) players' minds when spell is active.

      Finds nearby players (excluding the caster) and determines success based on skill comparison. If successful, reveals information about the target. If unsuccessful, the target resists. The spell kills itself after attempting to read one target.

      Special handling for animagus form: only level 10+ casters can attempt reading, with 10% success.

      Specified by:
      doCheckEffect in class O2Spell