Class AttackPotion


public class AttackPotion extends TimedUseItem
  • Constructor Details

    • AttackPotion

      public AttackPotion(int quantity)
      Constructs a new HealingPotion with the specified quantity and a default healing effect.
      Parameters:
      quantity - the number of uses this potion has
  • Method Details

    • useItem

      public void useItem(ItemUsageContext context)
      Uses the potion by applying its effects and decreasing its number of uses. If no uses are left, the potion is marked as empty.
      Overrides:
      useItem in class TimedUseItem
      Parameters:
      context - the context in which the item is used (contains a Player to use on)
    • update

      public void update(ItemUsageContext context)
      Updates the potion state, checking if the effect duration has elapsed.
      Specified by:
      update in class TimedUseItem
      Parameters:
      context - the context in which the item is used (contains a Player to use on)