Class PlayerCombos
java.lang.Object
studio.magemonkey.fabled.api.player.PlayerCombos
Represents the click combos available for a player to use along
with their current click pattern
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a skill to the available combos.void
applyClick
(Click click) Applies a click for the player, counting towards their current combo and casts the skill if the combo is completed.void
Clears the player's current click combo, causing them to not count their recent clicks towards a comboint
Retrieves the number of clicks in the player's active combo.getComboString
(Skill skill) Retrieves the combo string for the skill according to the player's personal settings.getConflicts
(int id) Checks whether there would be a conflict with the given combo ID if it were to be addedRetrieves the current combo string for the playerRetrieves the data of the owning playerRetrieves the map of combo IDs to skills.getSkillName
(int id) Retrieves the name of the skill bound to the combo ID.boolean
Checks whether the skill has a combo associated with itboolean
hasConflict
(int id) Checks whether there would be a conflict with the given combo ID if it were to be addedboolean
isComboUsed
(int id) Checks if a combo is currently active with any skill for the player.boolean
isValidCombo
(int id) Checks if the combo ID is a valid combovoid
removeSkill
(Skill skill) Removes a skill from the available combosboolean
Sets the combo for a skill, overriding any previous combo for the skill.
-
Constructor Details
-
PlayerCombos
Initializes a new empty combo set- Parameters:
data
- owning player's data
-
-
Method Details
-
getComboCount
public int getComboCount()Retrieves the number of clicks in the player's active combo. Once this reaches the size of a combo, the combo will activate and try to cast a skill.- Returns:
- current number of clicks in the active combo
-
getSkillMap
Retrieves the map of combo IDs to skills.- Returns:
- map of combo IDs to skills
-
getPlayerData
Retrieves the data of the owning player- Returns:
- owning player's data
-
getSkillName
Retrieves the name of the skill bound to the combo ID. If no skill is bound to the ID, this will instead return null.- Parameters:
id
- combo ID to get the bound skill for- Returns:
- skill name bound to the ID or null if none
-
clearCombo
public void clearCombo()Clears the player's current click combo, causing them to not count their recent clicks towards a combo -
applyClick
Applies a click for the player, counting towards their current combo and casts the skill if the combo is completed.- Parameters:
click
- click to apply for the player
-
getCurrentComboString
Retrieves the current combo string for the player- Returns:
- current combo string
-
hasConflict
public boolean hasConflict(int id) Checks whether there would be a conflict with the given combo ID if it were to be added- Parameters:
id
- combo ID- Returns:
- true if conflict, false otherwise
-
getConflicts
Checks whether there would be a conflict with the given combo ID if it were to be added- Parameters:
id
- combo ID- Returns:
- ID of conflict or -1 if no conflict
-
addSkill
Adds a skill to the available combos. This will not do anything if the skill is already added.- Parameters:
skill
- skill to add
-
removeSkill
Removes a skill from the available combos- Parameters:
skill
- skill to remove
-
isComboUsed
public boolean isComboUsed(int id) Checks if a combo is currently active with any skill for the player.- Parameters:
id
- ID of the combo- Returns:
- true if active, false otherwise
-
isValidCombo
public boolean isValidCombo(int id) Checks if the combo ID is a valid combo- Parameters:
id
- ID of the combo- Returns:
- true if valid, false otherwise
-
hasCombo
Checks whether the skill has a combo associated with it- Parameters:
skill
- the skill to check- Returns:
- true if has a combo, false otherwise
-
setSkill
Sets the combo for a skill, overriding any previous combo for the skill. If the skill didn't have a combo before, this will add it anyway. If the combo ID is already in use, it will reassign the conflicting skill.- Parameters:
skill
- skill to set the combo forid
- ID of the combo to use- Returns:
- true if set successfully, false otherwise
-
getComboString
Retrieves the combo string for the skill according to the player's personal settings.- Parameters:
skill
- skill to get the string for- Returns:
- combo string
-