Class ItemGuardCreature

All Implemented Interfaces:
Killer, Cloneable, Iterable<String>, Serializable

public class ItemGuardCreature extends Creature
An ItemGuardCreature is a creature that is responsible for guarding a special item (e.g. a key). Once it is killed, a copy of this special item is given to the player who killed it. If a quest is specified then the player only gets the item if the quest isn't completed. If a queststate (and optionally, index) is also specified then the player only gets the item if the quest is in that state
  • Constructor Details

    • ItemGuardCreature

      public ItemGuardCreature(Creature copy, String itemType)
      Creates an ItemGuardCreature.
      Parameters:
      copy - base creature
      itemType - the quest item to drop on death
    • ItemGuardCreature

      public ItemGuardCreature(Creature copy, String itemType, String questSlot, String questState)
      Creates an ItemGuardCreature.
      Parameters:
      copy - base creature
      itemType - the quest item to drop on death
      questSlot - the quest slot for the active quest
      questState - the state of the quest to check on dead for
    • ItemGuardCreature

      public ItemGuardCreature(Creature copy, String itemType, String questSlot, String questState, int questIndex)
      Creates an ItemGuardCreature.
      Parameters:
      copy - base creature
      itemType - the quest item to drop on death
      questSlot - the quest slot for the active quest
      questState - the state of the quest to check on dead for
      questIndex - the index of the quest slot to look in
    • ItemGuardCreature

      public ItemGuardCreature(Creature copy, String itemType, String itemInfostring, String itemDescr, String questSlot, String questState, int questIndex)
      Creates an ItemGuardCreature.
      Parameters:
      copy - base creature
      itemType - the quest item to drop on death
      itemInfostring - optional info string to add to item
      itemDescr - optional description string to add to item
      questSlot - the quest slot for the active quest
      questState - the state of the quest to check on dead for
      questIndex - the index of the quest slot to look in
  • Method Details

    • getNewInstance

      public Creature getNewInstance()
      Description copied from class: Creature
      creates a new instance, using this creature as template
      Overrides:
      getNewInstance in class Creature
      Returns:
      a new creature
    • onDead

      public void onDead(Killer killer, boolean remove)
      Description copied from class: RPEntity
      This method is called when this entity has been killed (hp == 0).
      Overrides:
      onDead in class Creature
      Parameters:
      killer - The entity who caused the death, i.e. who did the last hit.
      remove - true iff this entity should be removed from the world. For almost everything remove is true, but not for the players, who are instead moved to afterlife ("reborn").