Package com.mg105.entities.items
Class HealthPotion
java.lang.Object
com.mg105.entities.Item
com.mg105.entities.items.HealthPotion
- All Implemented Interfaces:
Consumable
A health potion is an item that can be used to heal a character by a certain amount of points.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Heals the battleCharacter providedstatic int
Gets the healing points that the potion provides to a character.
-
Constructor Details
-
HealthPotion
public HealthPotion()Creates a new instance of health potion
-
-
Method Details
-
getHealingPoints
public static int getHealingPoints()Gets the healing points that the potion provides to a character.- Returns:
- the healing points that this potion has.
-
consume
Heals the battleCharacter provided- Specified by:
consume
in interfaceConsumable
- Parameters:
state
- the state of the gamecharacterName
- the name of the character to use the item on
-