java.lang.Object
com.csse3200.game.components.combat.move.CombatMove
com.csse3200.game.components.combat.move.ItemMove

public class ItemMove extends CombatMove
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)
  • Constructor Details

    • ItemMove

      public ItemMove(String moveName, int hungerCost)
      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

      public CombatMove.StatsChange[] execute(CombatStatsComponent attackerStats)
      Executes the items move, increasing hunger.
      Specified by:
      execute in class CombatMove
      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 class CombatMove
      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 class CombatMove
      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 class CombatMove
      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.