Class DefenseItem

java.lang.Object
model.item.Item
model.item.DefenseItem
All Implemented Interfaces:
Applicable

public class DefenseItem extends Item
Increases the user's defense. The effect is removed after the battle ends (reset).
  • Field Details

    • defBonus

      private final int defBonus
      Defense bonus to apply.
  • Constructor Details

    • DefenseItem

      public DefenseItem(int defBonus)
      create DefenseItem
      Parameters:
      defBonus - Defense bonus to apply.
  • Method Details

    • apply

      public void apply(Entity target)
      Increases the target entity's defense.
      Specified by:
      apply in interface Applicable
      Specified by:
      apply in class Item
      Parameters:
      target - Entity to buff
    • getEffectDescription

      public String getEffectDescription()
      Returns a description of the effect for display in the UI.
      Specified by:
      getEffectDescription in interface Applicable
      Specified by:
      getEffectDescription in class Item
      Returns:
      Effect description text