Class AreaUseItem

All Implemented Interfaces:
EquipListener, TurnListener, UseListener, Killer, Cloneable, Iterable<String>, Serializable
Direct Known Subclasses:
MetalDetector, Shovel

public class AreaUseItem extends Item
  • Field Details

    • use_sound

      protected String use_sound
  • Constructor Details

    • AreaUseItem

      public AreaUseItem(String name, String clazz, String subclass, Map<String,​String> attributes)
    • AreaUseItem

      public AreaUseItem(AreaUseItem item)
      Copy constructor.
      Parameters:
      item - Item to copy.
  • Method Details

    • onUsed

      public boolean onUsed(RPEntity user)
      Description copied from interface: UseListener
      Invoked when the object is used.
      Specified by:
      onUsed in interface UseListener
      Overrides:
      onUsed in class Item
      Parameters:
      user - the RPEntity who uses the object
      Returns:
      true if successful
    • onUsedInArea

      protected boolean onUsedInArea(RPEntity user, StendhalRPZone zone, int x, int y)
      Inheriting classes can override this to determine action to execute when item is used in correct area.
      Parameters:
      user - Entity using the item.
      zone - Zone the entity is currently in.
      x - X coordinate of entity's position.
      y - Y coordinate of entity's position.
      Returns:
      true if item used successfully.
    • onUsedInArea

      protected boolean onUsedInArea(RPEntity user)
      Inheriting classes can override this to determine action to execute when item is used in correct area.
      Parameters:
      user - Entity using the item.
      Returns:
      true if item used successfully.