mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 19:55:07 +00:00
Player Abilities
This commit is contained in:
1 parent
06c9daf81b
commit
db6a68e430
7 files changed
+261
-28
No files matched your search
@@ -0,0 +1,112 @@
|
||||
package noppes.npcs.api.ability;
|
||||
|
||||
/**
|
||||
* Interface for managing player abilities.
|
||||
* Players reference abilities by key (built-in names or custom UUIDs).
|
||||
* <p>
|
||||
* Access via IPlayerData.getAbilityData()
|
||||
*/
|
||||
public interface IPlayerAbilityData {
|
||||
|
||||
/**
|
||||
* Get all unlocked ability keys.
|
||||
*/
|
||||
String[] getUnlockedAbilities();
|
||||
|
||||
/**
|
||||
* Unlock an ability for this player.
|
||||
*
|
||||
* @param key The ability key (built-in name or custom UUID)
|
||||
*/
|
||||
void unlockAbility(String key);
|
||||
|
||||
/**
|
||||
* Lock (remove) an ability from this player.
|
||||
*/
|
||||
void lockAbility(String key);
|
||||
|
||||
/**
|
||||
* Check if the player has unlocked a specific ability.
|
||||
*/
|
||||
boolean hasUnlockedAbility(String key);
|
||||
|
||||
/**
|
||||
* Get the currently selected ability index.
|
||||
*/
|
||||
int getSelectedIndex();
|
||||
|
||||
/**
|
||||
* Set the selected ability index.
|
||||
*/
|
||||
void setSelectedIndex(int index);
|
||||
|
||||
/**
|
||||
* Get the key of the currently selected ability.
|
||||
*/
|
||||
String getSelectedAbilityKey();
|
||||
|
||||
/**
|
||||
* Select the next ability in the list.
|
||||
*/
|
||||
void selectNext();
|
||||
|
||||
/**
|
||||
* Select the previous ability in the list.
|
||||
*/
|
||||
void selectPrevious();
|
||||
|
||||
/**
|
||||
* Check if the player is currently executing an ability.
|
||||
*/
|
||||
boolean isExecutingAbility();
|
||||
|
||||
/**
|
||||
* Get the currently executing ability.
|
||||
*/
|
||||
IAbility getCurrentAbility();
|
||||
|
||||
/**
|
||||
* Interrupt the currently executing ability.
|
||||
*/
|
||||
void interruptCurrentAbility();
|
||||
|
||||
/**
|
||||
* Check if the player is on universal cooldown.
|
||||
*/
|
||||
boolean isOnCooldown();
|
||||
|
||||
/**
|
||||
* Check if a specific ability is on cooldown.
|
||||
*
|
||||
* @param key The ability key
|
||||
* @return true if on cooldown
|
||||
*/
|
||||
boolean isOnCooldown(String key);
|
||||
|
||||
/**
|
||||
* Reset the universal cooldown.
|
||||
*/
|
||||
void resetCooldown();
|
||||
|
||||
/**
|
||||
* Reset cooldown for a specific ability key.
|
||||
*
|
||||
* @param key The ability key
|
||||
*/
|
||||
void resetCooldown(String key);
|
||||
|
||||
/**
|
||||
* Reset all cooldowns.
|
||||
*/
|
||||
void resetAllCooldowns();
|
||||
|
||||
/**
|
||||
* Activate the currently selected ability.
|
||||
*/
|
||||
boolean activateAbility();
|
||||
|
||||
/**
|
||||
* Activate a specific ability by key.
|
||||
*/
|
||||
boolean activateAbility(String key);
|
||||
}
|
||||
Reference in new issue
Block a user