Package dev.twilite.game.facade
Class Magic
java.lang.Object
dev.twilite.game.facade.Magic
Magic spellbook helpers backed by item parameters and live player state.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSpellbook families available through the magic tab. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidSelects a spell for autocasting.static booleanReturns whether the current combat setup supports spell autocasting.static SpellReturns the currently autocasted spell, ornullif none is selected.static booleanautocasted(Spell spell) Returns whether the supplied spell is currently selected for autocasting.static booleanReturns whether any spell is currently selected for autocasting.static Magic.Bookbook()Returns the currently active spellbook.static voidCasts a spell from the current spellbook interface.static voidcast(Spell spell, Interactable target) Casts a spell on an interactable target.static booleanReturns whether the player currently has the runes and level required forspell.static booleanReturns whether the supplied equipment context has the runes and level required forspell.static booleanReturns whether autocast is set to defensive casting mode.static intReturns the available count for a rune, including combination runes, rune pouch, and equipment.static intReturns the available count for a rune using the supplied equipment context.
-
Constructor Details
-
Magic
public Magic()
-
-
Method Details
-
book
Returns the currently active spellbook. -
autocasting
public static boolean autocasting()Returns whether any spell is currently selected for autocasting. -
autocastable
public static boolean autocastable()Returns whether the current combat setup supports spell autocasting. -
defensiveCasting
public static boolean defensiveCasting()Returns whether autocast is set to defensive casting mode. -
autocast
Selects a spell for autocasting.If the autocast interface is already open, this selects the spell from it. Otherwise, this opens the normal or defensive autocast selector and returns. The method does nothing when the requested spell and casting mode are already active, when the player lacks the required Magic level, or when the spell has no autocast component index or the current combat setup does not enable autocasting.
- Parameters:
spell- spell to select for autocastingdefensiveCasting-trueto use defensive autocasting
-
autocasted
Returns whether the supplied spell is currently selected for autocasting. -
cast
Casts a spell from the current spellbook interface.- Parameters:
spell- spell to cast
-
cast
Casts a spell on an interactable target.- Parameters:
spell- spell to casttarget- target to receive the selected spell action
-
autocasted
Returns the currently autocasted spell, ornullif none is selected. -
castable
Returns whether the player currently has the runes and level required forspell.- Parameters:
spell- spell to check
-
castable
Returns whether the supplied equipment context has the runes and level required forspell. -
runeCount
Returns the available count for a rune, including combination runes, rune pouch, and equipment. -
runeCount
Returns the available count for a rune using the supplied equipment context.
-