Class ChargeItem

    • Method Detail

      • getChargeParameters

        public ChargeParameters getChargeParameters()
        Returns:
        The charge parameters defined for this item
      • getLastUpdateTick

        public int getLastUpdateTick()
        Returns:
        The tick at which this was last updated, relative to Game.getTickCount()
      • getRemainingCharges

        public abstract int getRemainingCharges()
        Returns:
        The number of remaining charges. For items like blowpipe this will only return the primary charge (scales)
      • resetCharges

        public abstract void resetCharges()
        Resets charges to 0. For items like blowpipe this will also reset darts
      • isTracked

        public boolean isTracked()
        Returns:
        true if this item has ever had its charges updated. It will hold true after the first check
      • isCheckRequired

        public boolean isCheckRequired​(int ticks)
      • getKey

        public abstract String getKey()
        Returns:
        an identifier for this item
      • onObservation

        public abstract void onObservation​(ChargeObservation observation)
        Parameters:
        observation - Triggers an observation sequence for this item
      • getUnchargedIds

        public abstract int[] getUnchargedIds()
        Returns:
        The uncharged item ids
      • getItem

        public Item getItem​(Inventory inventory)
        Parameters:
        inventory - The inventory to get the item for
        Returns:
        The first occurence of this charge item in the given inventory
      • getWornElseCarried

        public Item getWornElseCarried()
      • setLastUpdateTick

        public void setLastUpdateTick​(int lastUpdateTick)