Class Projectile

All Implemented Interfaces:
EquipListener, TurnListener, UseListener, Stackable<StackableItem>, WeaponImpl, Killer, Cloneable, Iterable<String>, Serializable
Direct Known Subclasses:
NoStatsProjectile

public class Projectile extends StackableItem implements WeaponImpl
  • Constructor Details

    • Projectile

      public Projectile(String name, String clazz, String subclass, Map<String,String> attributes)
      Creates a new projectile item.
      Parameters:
      name - Name of the item.
      clazz - Class of item.
      subclass - Subclass of item.
      attributes - Projectile attributes (such as attack). May be empty or `null`.
    • Projectile

      public Projectile(Projectile item)
      Copy constructor.
      Parameters:
      item - Item to be copied.
  • Method Details

    • onAttackAttempt

      public void onAttackAttempt(RPEntity target, RPEntity attacker)
      Description copied from interface: WeaponImpl
      Action when item is used as a weapon.
      Specified by:
      onAttackAttempt in interface WeaponImpl
      Parameters:
      target - Entity targeted by attacker.
      attacker - Attacking entity.
    • onAttackSuccess

      public void onAttackSuccess(RPEntity target, RPEntity attacker, int damage)
      Description copied from interface: WeaponImpl
      Action when item is used as a weapon.
      Specified by:
      onAttackSuccess in interface WeaponImpl
      Parameters:
      target - Entity targeted by attacker.
      attacker - Attacking entity.
      damage - Amount of damage resulting from attack.