Class ItemMove
java.lang.Object
com.csse3200.game.components.combat.move.CombatMove
com.csse3200.game.components.combat.move.ItemMove
The ItemMove class represents a increase stat move where the entity takes a moment to increase or restore one of
their stats (health, hunger, defense, strength)
-
Nested Class Summary
Nested classes/interfaces inherited from class com.csse3200.game.components.combat.move.CombatMove
CombatMove.StatsChange
-
Field Summary
Fields inherited from class com.csse3200.game.components.combat.move.CombatMove
hungerCost, moveName
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute
(CombatStatsComponent attackerStats) Executes the items move, increasing hunger.execute
(CombatStatsComponent attackerStats, CombatStatsComponent targetStats) Executes the item move, which simply consumes hunger.execute
(CombatStatsComponent attackerStats, CombatStatsComponent targetStats, boolean targetIsGuarded) Executes the item move, either consuming or increasing hunger.execute
(CombatStatsComponent attackerStats, CombatStatsComponent targetStats, boolean targetIsGuarded, int numHitsLanded) Executes the item move, consuming hunger.Methods inherited from class com.csse3200.game.components.combat.move.CombatMove
getHungerCost, getMoveName
-
Constructor Details
-
ItemMove
Constructor to initialize the ItemMove with its name and hunger cost.- Parameters:
moveName
- the name of the item move.hungerCost
- the hunger cost required to execute the item move.
-
-
Method Details
-
execute
Executes the items move, increasing hunger.- Specified by:
execute
in classCombatMove
- Parameters:
attackerStats
- the combat stats of the entity performing the item move.- Returns:
- an array of
CombatMove.StatsChange
representing the changes to combat stats resulting from the move, such as health or hunger adjustments.
-
execute
public CombatMove.StatsChange[] execute(CombatStatsComponent attackerStats, CombatStatsComponent targetStats) Executes the item move, which simply consumes hunger. The target is ignored in this case.- Specified by:
execute
in classCombatMove
- Parameters:
attackerStats
- the combat stats of the entity performing the move.targetStats
- the combat stats of the target (ignored for item moves).- Returns:
- an array of
CombatMove.StatsChange
representing the changes to combat stats resulting from the move, such as health or hunger adjustments.
-
execute
public CombatMove.StatsChange[] execute(CombatStatsComponent attackerStats, CombatStatsComponent targetStats, boolean targetIsGuarded) Executes the item move, either consuming or increasing hunger. The target's guarding status is ignored in this context.- Specified by:
execute
in classCombatMove
- Parameters:
attackerStats
- the combat stats of the entity performing the move.targetStats
- the combat stats of the target (ignored for item moves).targetIsGuarded
- whether the target is guarding (ignored for item moves).- Returns:
- an array of
CombatMove.StatsChange
representing the changes to combat stats resulting from the move, such as health or hunger adjustments.
-
execute
public CombatMove.StatsChange[] execute(CombatStatsComponent attackerStats, CombatStatsComponent targetStats, boolean targetIsGuarded, int numHitsLanded) Executes the item move, consuming hunger. The number of hits landed is ignored for item moves.- Specified by:
execute
in classCombatMove
- Parameters:
attackerStats
- the combat stats of the entity performing the move.targetStats
- the combat stats of the target (ignored for item moves).targetIsGuarded
- whether the target is guarding (ignored for item moves).numHitsLanded
- the number of hits landed (ignored for guard moves).- Returns:
- an array of
CombatMove.StatsChange
representing the changes to combat stats resulting from the move, such as health or hunger adjustments.
-