Class CustomAbility

java.lang.Object
dev.aurelium.auraskills.api.ability.CustomAbility
All Implemented Interfaces:
Ability, AbstractAbility, Optioned, NamespaceIdentified

public class CustomAbility extends Object implements Ability
  • Method Details

    • builder

      Gets a new CustomAbility.CustomAbilityBuilder used to create a custom ability.
      Parameters:
      id - the NamespacedId identifying the ability
      Returns:
      a new builder
    • getDefined

      public CustomAbility.Defined getDefined()
    • getDisplayName

      public String getDisplayName(Locale locale)
      Description copied from interface: Ability
      Gets the ability display name as defined in the locale's messages file.
      Specified by:
      getDisplayName in interface Ability
      Parameters:
      locale - the locale to get the display name in
      Returns:
      the display name in the specified locale or in a fallback language
    • getDescription

      public String getDescription(Locale locale)
      Description copied from interface: Ability
      Gets the ability description as defined in the locale's messages file.
      Specified by:
      getDescription in interface Ability
      Parameters:
      locale - the locale to get the description in
      Returns:
      the description in the specified locale or in a fallback language
    • getInfo

      public String getInfo(Locale locale)
      Description copied from interface: Ability
      Gets the ability info text as defined in the locale's messages file. The info text shows an ability's effects for a given level in a concise way and is shown in the main skills menu.
      Specified by:
      getInfo in interface Ability
      Parameters:
      locale - the locale to get the info in
      Returns:
      the info text in the specified locale or in a fallback language
    • name

      public String name()
      Description copied from interface: Ability
      Gets a fully uppercase String of the ability name without the namespace
      Specified by:
      name in interface Ability
      Returns:
      the ability name in all upper case
    • hasSecondaryValue

      public boolean hasSecondaryValue()
      Description copied from interface: Ability
      Gets whether the ability has a secondary value that varies with the ability level
      Specified by:
      hasSecondaryValue in interface Ability
      Returns:
      whether the ability has a secondary value
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: Ability
      Gets whether the ability is enabled in the configuration. Abilities that are not loaded in any skill will always return false. Disabled abilities should have no effect on gameplay.
      Specified by:
      isEnabled in interface Ability
      Returns:
      whether the ability is enabled
    • getBaseValue

      public double getBaseValue()
      Description copied from interface: Ability
      Gets the value of an ability when it is at level 1 (just unlocked).
      Specified by:
      getBaseValue in interface Ability
      Returns:
      the base value
    • getSecondaryBaseValue

      public double getSecondaryBaseValue()
      Description copied from interface: Ability
      Gets the secondary value of an ability when it is at level 1 (just unlocked). If Ability.hasSecondaryValue() returns false, this method will return 0.
      Specified by:
      getSecondaryBaseValue in interface Ability
      Returns:
      the secondary base value
    • getValue

      public double getValue(int level)
      Description copied from interface: Ability
      Gets the value of the ability at a specific ability level.
      Specified by:
      getValue in interface Ability
      Parameters:
      level - the ability level
      Returns:
      the value at the level
    • getValuePerLevel

      public double getValuePerLevel()
      Description copied from interface: Ability
      Gets the amount that the ability value is increased by for every ability level. This value only starts being added from ability level 2. A negative value means the ability value is decreased when leveled up.
      Specified by:
      getValuePerLevel in interface Ability
      Returns:
      the change in value per ability level
    • getSecondaryValuePerLevel

      public double getSecondaryValuePerLevel()
      Description copied from interface: Ability
      Gets the amount that the secondary ability value is increased by for every ability level. This value only starts being added from ability level 2. A negative value means the ability value is decreased when leveled up. If Ability.hasSecondaryValue() returns false, this method will return 0.
      Specified by:
      getSecondaryValuePerLevel in interface Ability
      Returns:
      the change in secondary value per ability level
    • getSecondaryValue

      public double getSecondaryValue(int level)
      Description copied from interface: Ability
      Gets the secondary value of the ability at a specific ability level. If Ability.hasSecondaryValue() returns false, this method will return 0.
      Specified by:
      getSecondaryValue in interface Ability
      Parameters:
      level - the ability level
      Returns:
      the secondary value at the level
    • getSkill

      public Skill getSkill()
      Description copied from interface: AbstractAbility
      Gets the skill the ability is leveled up by based on the configuration in the skills.yml file.
      Specified by:
      getSkill in interface AbstractAbility
      Returns:
      the skill the ability belongs to
    • getId

      public NamespacedId getId()
      Description copied from interface: NamespaceIdentified
      Gets the NamespacedId of the object
      Specified by:
      getId in interface NamespaceIdentified
      Returns:
      the NamespacedId
    • getMaxLevel

      public int getMaxLevel()
      Description copied from interface: AbstractAbility
      Gets the max level of the ability based on the configuration.
      Specified by:
      getMaxLevel in interface AbstractAbility
      Returns:
      the max level
    • getUnlock

      public int getUnlock()
      Description copied from interface: AbstractAbility
      Gets the skill level the ability is unlocked at based on the configuration.
      Specified by:
      getUnlock in interface AbstractAbility
      Returns:
      the skill level the ability is unlocked at
    • getLevelUp

      public int getLevelUp()
      Description copied from interface: AbstractAbility
      Gets the interval of skill levels between ability level ups. A value of 5 means the ability levels up every 5 levels, starting at the value of AbstractAbility.getUnlock().
      Specified by:
      getLevelUp in interface AbstractAbility
      Returns:
      the level up interval
    • optionBoolean

      public boolean optionBoolean(String key)
      Specified by:
      optionBoolean in interface Optioned
    • optionBoolean

      public boolean optionBoolean(String key, boolean def)
      Specified by:
      optionBoolean in interface Optioned
    • optionInt

      public int optionInt(String key)
      Specified by:
      optionInt in interface Optioned
    • optionInt

      public int optionInt(String key, int def)
      Specified by:
      optionInt in interface Optioned
    • optionDouble

      public double optionDouble(String key)
      Specified by:
      optionDouble in interface Optioned
    • optionDouble

      public double optionDouble(String key, double def)
      Specified by:
      optionDouble in interface Optioned
    • optionString

      public String optionString(String key)
      Specified by:
      optionString in interface Optioned
    • optionString

      public String optionString(String key, String def)
      Specified by:
      optionString in interface Optioned
    • optionStringList

      public List<String> optionStringList(String key)
      Specified by:
      optionStringList in interface Optioned
    • optionMap

      public Map<String,Object> optionMap(String key)
      Specified by:
      optionMap in interface Optioned
    • toString

      public String toString()
      Overrides:
      toString in class Object