Class Corpse
java.lang.Object
marauroa.common.game.Attributes
marauroa.common.game.SlotOwner
marauroa.common.game.RPObject
games.stendhal.server.entity.Entity
games.stendhal.server.entity.PassiveEntity
games.stendhal.server.entity.item.Corpse
- All Implemented Interfaces:
EquipListener
,Killer
,Cloneable
,Iterable<String>
,Serializable
- Direct Known Subclasses:
RaidCreatureCorpse
A corpse created when a creature or player is killed. It may contain items.
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID
-
Field Summary
Fields inherited from class marauroa.common.game.RPObject
INVALID_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add(PassiveEntity entity)
adds content to this corpseboolean
canBeEquippedIn(String slot)
Checks whether this object can be equipped in the given slot.describe()
Describes the entity (if a players looks at it).static void
Get the name of the owner of this corpse (the player who's deemend worthy to access the items within).protected int
The length of a degradation stepgetDescriptionName(boolean definite)
Returns the name or something that can be used to identify the entity for the player.gets the killer of this corpsegetName()
Get the entity name.getTitle()
Get the nicely formatted entity title/name.boolean
isFull()
is the corpse full so that there is no more room for additinal items?boolean
isFull(boolean boss)
boolean
Checks if looting this corpse will be rewarded (i.e.boolean
Check if a player may access the slots of this corpseprotected void
onMoved(int oldX, int oldY, int newX, int newY)
Notification of intra-zone position change.void
onRemoved(StendhalRPZone zone)
Called when this object is being removed from a zone.void
Set the killer name of the corpse.void
Set the name of the corpse.void
setStage(int newStage)
Sets the current degrading state.int
size()
Returns the number of attributes and events this object is made of.Methods inherited from class games.stendhal.server.entity.Entity
getAdjacentNodes, getArea, getArea, getCursor, getDescription, getEntitySlot, getHeight, getOrigin, getResistance, getResistance, getWidth, getX, getY, getZone, hasDescription, isInSight, isObstacle, nextTo, nextTo, notifyWorldAboutChanges, onAdded, setCursor, setDescription, setEntityClass, setEntitySubclass, setMenu, setPosition, setResistance, setSize, setVisibility, slotIterator, slots, squaredDistance, squaredDistance, stopped, update
Methods inherited from class marauroa.common.game.RPObject
addEvent, addLink, addLink, addMap, addSlot, addSlot, applyDifferences, clearEvents, clearVisible, clone, containsKey, equals, events, eventsIterator, fill, get, getBaseContainer, getBoolean, getContainer, getContainerBaseOwner, getContainerOwner, getContainerSlot, getDifferences, getDouble, getFromSlots, getID, getInt, getLink, getLinkedObject, getMap, getSlot, has, hashCode, hasLink, hasMap, hasSlot, hide, isContained, isEmpty, isHidden, isStorable, maps, put, put, put, put, readObject, remove, removeLink, removeMap, removeSlot, resetAddedAndDeleted, resetAddedAndDeletedMaps, resetAddedAndDeletedRPLink, resetAddedAndDeletedRPSlot, setAddedMaps, setAddedRPSlot, setContainer, setDeletedMaps, setDeletedRPSlot, setID, slots, slotsIterator, store, toString, unhide, unstore, writeObject, writeObject, writeToJson
Methods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlots
Methods inherited from class marauroa.common.game.Attributes
add, applyDifferences, get, getBool, getDouble, getInt, getList, getLong, getRPClass, has, instanceOf, iterator, put, put, put, put, put, readFromMap, remove, resetAddedAndDeletedAttributes, setAddedAttributes, setDeletedAttributes, setRPClass, setRPClass, toAttributeString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Corpse
non rotting corpse.- Parameters:
clazz
-x
-y
-
-
Corpse
Create a corpse.- Parameters:
victim
- The killed entity.killerName
- The killer name.
-
-
Method Details
-
onRemoved
Description copied from class:Entity
Called when this object is being removed from a zone. -
generateRPClass
public static void generateRPClass() -
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
Get the entity name. -
setKiller
Set the killer name of the corpse.- Parameters:
killer
- The corpse's killer name.
-
setName
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. -
setStage
public void setStage(int newStage)Sets the current degrading state. Set it to MAX_STAGE will remove the corpse.- Parameters:
newStage
-
-
add
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. -
describe
Description copied from class:Entity
Describes the entity (if a players looks at it). -
canBeEquippedIn
Description copied from interface:EquipListener
Checks whether this object can be equipped in the given slot.- Specified by:
canBeEquippedIn
in interfaceEquipListener
- Parameters:
slot
- name of slot- Returns:
- true, if it can be equipped; false otherwise
-
getDescriptionName
Returns the name or something that can be used to identify the entity for the player.- Overrides:
getDescriptionName
in classEntity
- Parameters:
definite
-true
for "the", andfalse
for "a/an" in case the entity has no name.- Returns:
- The description name.
-
getTitle
Get the nicely formatted entity title/name. -
getDegradationStepTimeout
protected int getDegradationStepTimeout()The length of a degradation step- Returns:
- in seconds
-
mayUse
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
gets the killer of this corpse- Returns:
- the name of the killer
-