Class HealItem

java.lang.Object
model.item.Item
model.item.HealItem
All Implemented Interfaces:
Applicable

public class HealItem extends Item
Restores HP to the user by a specified amount, capped at maxHp.
  • Field Details

    • healAmount

      private final int healAmount
      Amount of HP to restore.
  • Constructor Details

    • HealItem

      public HealItem(int healAmount)
      create HealItem
      Parameters:
      healAmount - Amount of HP to restore.
  • Method Details

    • apply

      public void apply(Entity target)
      Restores HP to the target entity by healAmount.
      Specified by:
      apply in interface Applicable
      Specified by:
      apply in class Item
      Parameters:
      target - Entity to heal
    • getEffectDescription

      public String getEffectDescription()
      Returns a description of the effect for display in the UI.
      Specified by:
      getEffectDescription in interface Applicable
      Specified by:
      getEffectDescription in class Item
      Returns:
      Effect description text
    • getHealAmount

      public int getHealAmount()
      Returns the amount of HP this item restores.
      Returns:
      Heal amount