Class CustomAbility
java.lang.Object
dev.aurelium.auraskills.api.ability.CustomAbility
- All Implemented Interfaces:
Ability,AbstractAbility,Optioned,NamespaceIdentified
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionbuilder(NamespacedId id) Gets a newCustomAbility.CustomAbilityBuilderused to create a custom ability.doubleGets the value of an ability when it is at level 1 (just unlocked).getDescription(Locale locale) Gets the ability description as defined in the locale's messages file.getDescription(Locale locale, boolean formatted) getDisplayName(Locale locale) Gets the ability display name as defined in the locale's messages file.getDisplayName(Locale locale, boolean formatted) getId()Gets theNamespacedIdof the objectGets the ability info text as defined in the locale's messages file.intGets the interval of skill levels between ability level ups.intGets the max level of the ability based on the configuration.doubleGets the secondary value of an ability when it is at level 1 (just unlocked).doublegetSecondaryValue(int level) Gets the secondary value of the ability at a specific ability level.doubleGets the amount that the secondary ability value is increased by for every ability level.getSkill()Gets the skill the ability is leveled up by based on the configuration in the skills.yml file.intGets the skill level the ability is unlocked at based on the configuration.doublegetValue(int level) Gets the value of the ability at a specific ability level.doubleGets the amount that the ability value is increased by for every ability level.booleanGets whether the ability has a secondary value that varies with the ability levelbooleanGets whether the ability is enabled in the configuration.name()Gets a fully uppercase String of the ability name without the namespacebooleanoptionBoolean(String key) booleanoptionBoolean(String key, boolean def) doubleoptionDouble(String key) doubleoptionDouble(String key, double def) intintoptionString(String key) optionString(String key, String def) optionStringList(String key) toString()
-
Method Details
-
builder
Gets a newCustomAbility.CustomAbilityBuilderused to create a custom ability.- Parameters:
id- theNamespacedIdidentifying the ability- Returns:
- a new builder
-
getDefined
-
getDisplayName
Description copied from interface:AbilityGets the ability display name as defined in the locale's messages file.- Specified by:
getDisplayNamein interfaceAbility- Parameters:
locale- the locale to get the display name in- Returns:
- the display name in the specified locale or in a fallback language
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAbility
-
getDescription
Description copied from interface:AbilityGets the ability description as defined in the locale's messages file.- Specified by:
getDescriptionin interfaceAbility- Parameters:
locale- the locale to get the description in- Returns:
- the description in the specified locale or in a fallback language
-
getDescription
- Specified by:
getDescriptionin interfaceAbility
-
getInfo
Description copied from interface:AbilityGets 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. -
getInfo
-
name
Description copied from interface:AbilityGets a fully uppercase String of the ability name without the namespace -
hasSecondaryValue
public boolean hasSecondaryValue()Description copied from interface:AbilityGets whether the ability has a secondary value that varies with the ability level- Specified by:
hasSecondaryValuein interfaceAbility- Returns:
- whether the ability has a secondary value
-
isEnabled
public boolean isEnabled()Description copied from interface:AbilityGets 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. -
getBaseValue
public double getBaseValue()Description copied from interface:AbilityGets the value of an ability when it is at level 1 (just unlocked).- Specified by:
getBaseValuein interfaceAbility- Returns:
- the base value
-
getSecondaryBaseValue
public double getSecondaryBaseValue()Description copied from interface:AbilityGets the secondary value of an ability when it is at level 1 (just unlocked). IfAbility.hasSecondaryValue()returns false, this method will return 0.- Specified by:
getSecondaryBaseValuein interfaceAbility- Returns:
- the secondary base value
-
getValue
public double getValue(int level) Description copied from interface:AbilityGets the value of the ability at a specific ability level. -
getValuePerLevel
public double getValuePerLevel()Description copied from interface:AbilityGets 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:
getValuePerLevelin interfaceAbility- Returns:
- the change in value per ability level
-
getSecondaryValuePerLevel
public double getSecondaryValuePerLevel()Description copied from interface:AbilityGets 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. IfAbility.hasSecondaryValue()returns false, this method will return 0.- Specified by:
getSecondaryValuePerLevelin interfaceAbility- Returns:
- the change in secondary value per ability level
-
getSecondaryValue
public double getSecondaryValue(int level) Description copied from interface:AbilityGets the secondary value of the ability at a specific ability level. IfAbility.hasSecondaryValue()returns false, this method will return 0.- Specified by:
getSecondaryValuein interfaceAbility- Parameters:
level- the ability level- Returns:
- the secondary value at the level
-
getSkill
Description copied from interface:AbstractAbilityGets the skill the ability is leveled up by based on the configuration in the skills.yml file.- Specified by:
getSkillin interfaceAbstractAbility- Returns:
- the skill the ability belongs to
-
getId
Description copied from interface:NamespaceIdentifiedGets theNamespacedIdof the object- Specified by:
getIdin interfaceNamespaceIdentified- Returns:
- the
NamespacedId
-
getMaxLevel
public int getMaxLevel()Description copied from interface:AbstractAbilityGets the max level of the ability based on the configuration.- Specified by:
getMaxLevelin interfaceAbstractAbility- Returns:
- the max level
-
getUnlock
public int getUnlock()Description copied from interface:AbstractAbilityGets the skill level the ability is unlocked at based on the configuration.- Specified by:
getUnlockin interfaceAbstractAbility- Returns:
- the skill level the ability is unlocked at
-
getLevelUp
public int getLevelUp()Description copied from interface:AbstractAbilityGets 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 ofAbstractAbility.getUnlock().- Specified by:
getLevelUpin interfaceAbstractAbility- Returns:
- the level up interval
-
optionBoolean
- Specified by:
optionBooleanin interfaceOptioned
-
optionBoolean
- Specified by:
optionBooleanin interfaceOptioned
-
optionInt
-
optionInt
-
optionDouble
- Specified by:
optionDoublein interfaceOptioned
-
optionDouble
- Specified by:
optionDoublein interfaceOptioned
-
optionString
- Specified by:
optionStringin interfaceOptioned
-
optionString
- Specified by:
optionStringin interfaceOptioned
-
optionStringList
- Specified by:
optionStringListin interfaceOptioned
-
optionMap
-
toString
-