Class Magic


  • public class Magic
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Magic​(KSContext ctx)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cast​(Spell spell)
      Casts a spell with no specific target.
      void cast​(Spell spell, int actionIndex)
      Casts a spell with a specific action index.
      void cast​(Spell spell, int actionIndex, int opcode)
      Casts a spell with a specific action index and opcode.
      void cast​(Spell spell, KSGroundItem target)
      Casts a spell on a ground item target.
      void cast​(Spell spell, KSItem target)
      Casts a spell on a target item.
      void cast​(Spell spell, KSNPC target)
      Casts a spell on an NPC target.
      void cast​(Spell spell, KSObject target)
      Casts a spell on a tile object target.
      void cast​(Spell spell, KSPlayer target)
      Casts a spell on a player target.
      boolean isAutoCasting()
      Checks if the player is currently auto-casting a spell.
      boolean isSpellSelected​(Spell spell)
      Checks if the specified spell is currently selected.
      void lastTeleport()  
      void selectSpell​(Spell spell)
      Selects the specified spell for casting.
      void teleportHome()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • isAutoCasting

        public boolean isAutoCasting()
        Checks if the player is currently auto-casting a spell.
        Returns:
        True if auto-casting, false otherwise.
      • isSpellSelected

        public boolean isSpellSelected​(Spell spell)
        Checks if the specified spell is currently selected.
        Parameters:
        spell - The spell to check.
        Returns:
        True if the spell is selected, false otherwise.
      • cast

        public void cast​(Spell spell,
                         KSItem target)
        Casts a spell on a target item.
        Parameters:
        spell - The spell to cast.
        target - The target item.
      • cast

        public void cast​(Spell spell,
                         KSNPC target)
        Casts a spell on an NPC target.
        Parameters:
        spell - The spell to cast.
        target - The target NPC.
      • cast

        public void cast​(Spell spell,
                         KSPlayer target)
        Casts a spell on a player target.
        Parameters:
        spell - The spell to cast.
        target - The target player.
      • cast

        public void cast​(Spell spell,
                         KSGroundItem target)
        Casts a spell on a ground item target.
        Parameters:
        spell - The spell to cast.
        target - The ground item target.
      • cast

        public void cast​(Spell spell,
                         KSObject target)
        Casts a spell on a tile object target.
        Parameters:
        spell - The spell to cast.
        target - The tile object target.
      • selectSpell

        public void selectSpell​(Spell spell)
        Selects the specified spell for casting.
        Parameters:
        spell - The spell to select.
      • cast

        public void cast​(Spell spell)
        Casts a spell with no specific target.
        Parameters:
        spell - The spell to cast.
      • cast

        public void cast​(Spell spell,
                         int actionIndex)
        Casts a spell with a specific action index.
        Parameters:
        spell - The spell to cast.
        actionIndex - The action index to use.
      • cast

        public void cast​(Spell spell,
                         int actionIndex,
                         int opcode)
        Casts a spell with a specific action index and opcode.
        Parameters:
        spell - The spell to cast.
        actionIndex - The action index to use.
        opcode - The opcode to use.
      • lastTeleport

        public void lastTeleport()
      • teleportHome

        public void teleportHome()