Class TwilightElixir

All Implemented Interfaces:
EquipListener, TurnListener, UseListener, Stackable<StackableItem>, Killer, Cloneable, Comparable<ConsumableItem>, Iterable<String>, Serializable

public class TwilightElixir extends Drink
Represents a marked teleport scroll which also poisoned the player.
Author:
kymara
  • Constructor Details

    • TwilightElixir

      public TwilightElixir(String name, String clazz, String subclass, Map<String,​String> attributes)
      Creates a new marked teleport scroll.
      Parameters:
      name -
      clazz -
      subclass -
      attributes -
    • TwilightElixir

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

    • describe

      public String describe()
      Description copied from class: Entity
      Describes the entity (if a players looks at it).
      Overrides:
      describe in class Item
      Returns:
      description from the players point of view
    • onUsed

      public boolean onUsed(RPEntity user)
      the overridden method verifies item is near to player. if so splits one single item of and calls consumeItem of the player - so they get poisoned, since that's what twilight elixir does
      Specified by:
      onUsed in interface UseListener
      Overrides:
      onUsed in class ConsumableItem
      Parameters:
      user - the eating player
      Returns:
      true if consumption can be started this one first teleports the player (if they are in quest slot twilight zone, to prevent abuse) before it poisons them.