Class HealItem
java.lang.Object
model.item.Item
model.item.HealItem
- All Implemented Interfaces:
Applicable
Restores HP to the user by a specified amount, capped at maxHp.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRestores HP to the target entity by healAmount.Returns a description of the effect for display in the UI.intReturns the amount of HP this item restores.
-
Field Details
-
healAmount
private final int healAmountAmount of HP to restore.
-
-
Constructor Details
-
HealItem
public HealItem(int healAmount) create HealItem- Parameters:
healAmount- Amount of HP to restore.
-
-
Method Details
-
apply
Restores HP to the target entity by healAmount.- Specified by:
applyin interfaceApplicable- Specified by:
applyin classItem- Parameters:
target- Entity to heal
-
getEffectDescription
Returns a description of the effect for display in the UI.- Specified by:
getEffectDescriptionin interfaceApplicable- Specified by:
getEffectDescriptionin classItem- Returns:
- Effect description text
-
getHealAmount
public int getHealAmount()Returns the amount of HP this item restores.- Returns:
- Heal amount
-