Class Spell


  • public class Spell
    extends java.lang.Object
    Describes a Crossfire spell.
    • Constructor Summary

      Constructors 
      Constructor Description
      Spell​(@NotNull java.lang.String name, @NotNull SkillSet skillSet, @NotNull Stats stats)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSpellListener​(@NotNull SpellListener listener)
      Adds a SpellListener to be notified of changes.
      int getCastingTime()
      Returns the casting time.
      int getDamage()
      Returns the damage done by the spell.
      int getFaceNum()
      Returns the face number.
      int getGrace()
      Returns the grace needed to cast the spell.
      int getLevel()
      Returns the spell level.
      int getMana()
      Returns the mana needed to cast the spell.
      @NotNull java.lang.String getMessage()
      Returns the description.
      @NotNull java.lang.String getName()
      Returns the spell name.
      int getPath()
      Returns the spell path.
      int getSkill()
      Returns the spell's skill.
      int getTag()
      Returns the tag ID.
      @NotNull java.lang.String getTooltipText()
      Returns a description for this spell to be used in tooltips.
      boolean isUnknown()
      Returns whether this spell is unknown to the character.
      void removeSpellListener​(@NotNull SpellListener listener)
      Removes a SpellListener to be notified of changes.
      void setParameters​(int faceNum, int tag, @NotNull java.lang.String message, int level, int castingTime, int mana, int grace, int damage, int skill, int path)
      Updates the spell's parameters.
      void setUnknown​(boolean unknown)
      Marks this spell as known or unknown for the character.
      @NotNull java.lang.String toString()  
      void updateParameters​(boolean updateMana, int mana, boolean updateGrace, int grace, boolean updateDamage, int damage)
      Updates the spell's parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Spell

        public Spell​(@NotNull
                     @NotNull java.lang.String name,
                     @NotNull
                     @NotNull SkillSet skillSet,
                     @NotNull
                     @NotNull Stats stats)
        Creates a new instance.
        Parameters:
        name - the spell name
        skillSet - the skills
        stats - the stats instance
    • Method Detail

      • getTag

        public int getTag()
        Returns the tag ID.
        Returns:
        the tag ID
      • getLevel

        public int getLevel()
        Returns the spell level.
        Returns:
        the spell level
      • getCastingTime

        public int getCastingTime()
        Returns the casting time.
        Returns:
        the casting time
      • getMana

        public int getMana()
        Returns the mana needed to cast the spell.
        Returns:
        the mana
      • getGrace

        public int getGrace()
        Returns the grace needed to cast the spell.
        Returns:
        the grace
      • getDamage

        public int getDamage()
        Returns the damage done by the spell.
        Returns:
        the damage
      • getSkill

        public int getSkill()
        Returns the spell's skill. See Stats.CS_STAT_SKILLINFO.
        Returns:
        the spell's skill
      • getPath

        public int getPath()
        Returns the spell path.
        Returns:
        the spell path
      • getName

        @NotNull
        public @NotNull java.lang.String getName()
        Returns the spell name.
        Returns:
        the spell name
      • getMessage

        @NotNull
        public @NotNull java.lang.String getMessage()
        Returns the description.
        Returns:
        the description
      • getFaceNum

        public int getFaceNum()
        Returns the face number.
        Returns:
        the face number
      • isUnknown

        public boolean isUnknown()
        Returns whether this spell is unknown to the character.
        Returns:
        whether this spell is unknown
      • setUnknown

        public void setUnknown​(boolean unknown)
        Marks this spell as known or unknown for the character.
        Parameters:
        unknown - whether this spell is unknown
      • setParameters

        public void setParameters​(int faceNum,
                                  int tag,
                                  @NotNull
                                  @NotNull java.lang.String message,
                                  int level,
                                  int castingTime,
                                  int mana,
                                  int grace,
                                  int damage,
                                  int skill,
                                  int path)
        Updates the spell's parameters.
        Parameters:
        faceNum - the face number
        tag - the tag ID
        message - the description
        level - the spell level
        castingTime - the casting time
        mana - the mana needed to cast the spell
        grace - the grace needed to cast the spell
        damage - the damage done by the spell
        skill - the spell's skill
        path - the spell path
      • updateParameters

        public void updateParameters​(boolean updateMana,
                                     int mana,
                                     boolean updateGrace,
                                     int grace,
                                     boolean updateDamage,
                                     int damage)
        Updates the spell's parameters.
        Parameters:
        updateMana - whether to update the mana
        mana - the mana needed to cast the spell
        updateGrace - whether to update the grace
        grace - the grace needed to cast the spell
        updateDamage - whether to update the damage
        damage - the damage done by the spell
      • toString

        @NotNull
        public @NotNull java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getTooltipText

        @NotNull
        public @NotNull java.lang.String getTooltipText()
        Returns a description for this spell to be used in tooltips.
        Returns:
        the tooltip text
      • addSpellListener

        public void addSpellListener​(@NotNull
                                     @NotNull SpellListener listener)
        Adds a SpellListener to be notified of changes.
        Parameters:
        listener - the listener to add
      • removeSpellListener

        public void removeSpellListener​(@NotNull
                                        @NotNull SpellListener listener)
        Removes a SpellListener to be notified of changes.
        Parameters:
        listener - the listener to remove