Class Corpse

All Implemented Interfaces:
EquipListener, Killer, Cloneable, Iterable<String>, Serializable
Direct Known Subclasses:
RaidCreatureCorpse

public class Corpse extends PassiveEntity implements EquipListener
A corpse created when a creature or player is killed. It may contain items.
  • Constructor Details

    • Corpse

      public Corpse(String clazz, int x, int y)
      non rotting corpse.
      Parameters:
      clazz -
      x -
      y -
    • Corpse

      public Corpse(RPEntity victim, String killerName)
      Create a corpse.
      Parameters:
      victim - The killed entity.
      killerName - The killer name.
  • Method Details

    • onRemoved

      public void onRemoved(StendhalRPZone zone)
      Description copied from class: Entity
      Called when this object is being removed from a zone.
      Overrides:
      onRemoved in class Entity
      Parameters:
      zone - The zone this will be removed from.
    • generateRPClass

      public static void generateRPClass()
    • getCorpseOwner

      public String getCorpseOwner()
      Get the name of the owner of this corpse (the player who's deemend worthy to access the items within).
      Returns:
      the name of the owner or null if anyone may use the items
    • getName

      public String getName()
      Get the entity name.
      Specified by:
      getName in interface Killer
      Overrides:
      getName in class Entity
      Returns:
      The entity's name, or null if undefined.
    • setKiller

      public void setKiller(String killer)
      Set the killer name of the corpse.
      Parameters:
      killer - The corpse's killer name.
    • setName

      public void setName(String name)
      Set the name of the corpse.
      Parameters:
      name - The corpse name.
    • onMoved

      protected void onMoved(int oldX, int oldY, int newX, int newY)
      Description copied from class: Entity
      Notification of intra-zone position change.
      Overrides:
      onMoved in class Entity
      Parameters:
      oldX - The old X coordinate.
      oldY - The old Y coordinate.
      newX - The new X coordinate.
      newY - The new Y coordinate.
    • setStage

      public void setStage(int newStage)
      Sets the current degrading state. Set it to MAX_STAGE will remove the corpse.
      Parameters:
      newStage -
    • add

      public void add(PassiveEntity entity)
      adds content to this corpse
      Parameters:
      entity - PassiveEntity to add
    • isFull

      public boolean isFull()
      is the corpse full so that there is no more room for additinal items?
      Returns:
      true if the corpse is full, false otherwise
    • isFull

      public boolean isFull(boolean boss)
    • size

      public int size()
      Description copied from class: RPObject
      Returns the number of attributes and events this object is made of.
      Overrides:
      size in class RPObject
      Returns:
      amount of attributes
    • describe

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

      public boolean canBeEquippedIn(String slot)
      Description copied from interface: EquipListener
      Checks whether this object can be equipped in the given slot.
      Specified by:
      canBeEquippedIn in interface EquipListener
      Parameters:
      slot - name of slot
      Returns:
      true, if it can be equipped; false otherwise
    • getDescriptionName

      public String getDescriptionName(boolean definite)
      Returns the name or something that can be used to identify the entity for the player.
      Overrides:
      getDescriptionName in class Entity
      Parameters:
      definite - true for "the", and false for "a/an" in case the entity has no name.
      Returns:
      The description name.
    • getTitle

      public String getTitle()
      Get the nicely formatted entity title/name.
      Overrides:
      getTitle in class Entity
      Returns:
      The title, or null if unknown.
    • getDegradationStepTimeout

      protected int getDegradationStepTimeout()
      The length of a degradation step
      Returns:
      in seconds
    • mayUse

      public boolean mayUse(Player player)
      Check if a player may access the slots of this corpse
      Parameters:
      player - the player trying to use the items in the corpse
      Returns:
      true iff the player may access the items in the slots
    • isItemLootingRewardable

      public boolean isItemLootingRewardable()
      Checks if looting this corpse will be rewarded (i.e. for achievements).
      Returns:
      true if looting should be rewarded
    • getKiller

      public String getKiller()
      gets the killer of this corpse
      Returns:
      the name of the killer