Class LEGILIMENS
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe failure message when the spell finds a target but fails to read their mindstatic final intThe radius that legilimens can find a target inFields inherited from class net.pottercraft.ollivanders2.spell.O2Spell
branch, cooldownMessage, defaultRadius, flavorText, isAllowedFailureMessage, location, maxProjectileDistance, maxSpellLifetime, noProjectile, player, rightWand, spellMasteryLevel, spellType, text, usesModifier, vector -
Constructor Summary
ConstructorsConstructorDescriptionLEGILIMENS(@NotNull Ollivanders2 plugin, @NotNull org.bukkit.entity.Player player, @NotNull Double rightWand) Constructor.LEGILIMENS(Ollivanders2 plugin) Default constructor for use in generating spell text. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAttempt to read nearby (within 3 blocks) players' minds when spell is active.Methods inherited from class net.pottercraft.ollivanders2.spell.O2Spell
checkEffect, getCloseEntities, getCoolDown, getFailureMessage, getFlavorText, getLevel, getLifeTicks, getMagicBranch, getName, getNearbyDamageableEntities, getNearbyItems, getNearbyLivingEntities, getNearbyPlayers, getSuccessMessage, getTargetBlock, getText, getWorldGuardFlags, hasHitTarget, isAtMaxDistance, isKilled, isSpellAllowed, kill, move, revert, sendFailureMessage, sendSuccessMessage, setUsesModifier
-
Field Details
-
radius
public static final int radiusThe radius that legilimens can find a target in- See Also:
-
mindReadFailureMessage
The failure message when the spell finds a target but fails to read their mind- See Also:
-
-
Constructor Details
-
LEGILIMENS
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 pluginplayer- the player who cast this spellrightWand- 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:
doCheckEffectin classO2Spell
-