java.lang.Object
com.adventure.models.items.Item
com.adventure.models.items.UsableItem
- All Implemented Interfaces:
Usable
Usable item. Gives some boost or nerf.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintGet the additional attack value.intGet the additional defence value.intgetHp()Get the additional hp value.voidsetAdditionalAttack(int atk) Set additional attack value.voidsetAdditionalDefence(int def) Set additional defence value.voidsetAdditionalHp(int hp) Set additional hp value.toString()
-
Constructor Details
-
UsableItem
Default constructor- attack: 0
- defence: 0
- hp: 0
- Parameters:
name- Name of the item
-
-
Method Details
-
getAttack
public int getAttack()Description copied from interface:UsableGet the additional attack value. -
getDefence
public int getDefence()Description copied from interface:UsableGet the additional defence value.- Specified by:
getDefencein interfaceUsable- Returns:
- additional defence value.
-
getHp
public int getHp()Description copied from interface:UsableGet the additional hp value. -
setAdditionalAttack
public void setAdditionalAttack(int atk) Description copied from interface:UsableSet additional attack value. This value will be added to the current attack value of the player.- Specified by:
setAdditionalAttackin interfaceUsable- Parameters:
atk- Additional attack value.
-
setAdditionalDefence
public void setAdditionalDefence(int def) Description copied from interface:UsableSet additional defence value. This value will be added to the current defence value of the player.- Specified by:
setAdditionalDefencein interfaceUsable- Parameters:
def- Additional defence value.
-
setAdditionalHp
public void setAdditionalHp(int hp) Description copied from interface:UsableSet additional hp value. This value will be added to the current hp value of the player.- Specified by:
setAdditionalHpin interfaceUsable- Parameters:
hp- Additional hp value.
-
toString
-
equals
-