Class PlayerCombos

java.lang.Object
studio.magemonkey.fabled.api.player.PlayerCombos

public class PlayerCombos extends Object
Represents the click combos available for a player to use along with their current click pattern
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes a new empty combo set
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addSkill(Skill skill)
    Adds a skill to the available combos.
    void
    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 combo
    int
    Retrieves the number of clicks in the player's active combo.
    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 added
    Retrieves the current combo string for the player
    Retrieves the data of the owning player
    Retrieves the map of combo IDs to skills.
    getSkillName(int id)
    Retrieves the name of the skill bound to the combo ID.
    boolean
    hasCombo(Skill skill)
    Checks whether the skill has a combo associated with it
    boolean
    hasConflict(int id)
    Checks whether there would be a conflict with the given combo ID if it were to be added
    boolean
    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 combo
    void
    Removes a skill from the available combos
    boolean
    setSkill(Skill skill, int id)
    Sets the combo for a skill, overriding any previous combo for the skill.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlayerCombos

      public PlayerCombos(PlayerData data)
      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

      public HashMap<Integer,String> getSkillMap()
      Retrieves the map of combo IDs to skills.
      Returns:
      map of combo IDs to skills
    • getPlayerData

      public PlayerData getPlayerData()
      Retrieves the data of the owning player
      Returns:
      owning player's data
    • getSkillName

      public String getSkillName(int id)
      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

      public void applyClick(Click click)
      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

      public String 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

      public List<Integer> getConflicts(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:
      ID of conflict or -1 if no conflict
    • addSkill

      public void addSkill(Skill skill)
      Adds a skill to the available combos. This will not do anything if the skill is already added.
      Parameters:
      skill - skill to add
    • removeSkill

      public void removeSkill(Skill skill)
      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

      public boolean hasCombo(Skill skill)
      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

      public boolean setSkill(Skill skill, int id)
      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 for
      id - ID of the combo to use
      Returns:
      true if set successfully, false otherwise
    • getComboString

      public String getComboString(Skill skill)
      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