Class ItemChangeGuardCreature

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

public class ItemChangeGuardCreature extends Creature
An ItemChangeGuardCreature 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 in case he/she has had an other specified item in the first place.
  • Constructor Details

    • ItemChangeGuardCreature

      public ItemChangeGuardCreature(Creature copy, String oldItemType, String itemType)
      Creates a ItemGuardCreature.
      Parameters:
      copy - base creature
      oldItemType - the quest item the player has to have in order to gain the new one
      itemType - the quest item to drop on death
  • 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").