wyvern.lib.player
Class PlayerGrave

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.lib.classes.StaticObject
              extended bywyvern.lib.player.PlayerGrave
All Implemented Interfaces:
Broadcaster, GameObject, MethodHookable, PropertyList

public class PlayerGrave
extends StaticObject

A gravestone created when a player dies.

Version:
1.0, Oct 12, 2003
Author:
Steve Yegge

Field Summary
 
Fields inherited from class wyvern.kernel.maps.MapObject
IN_MAP_EDITOR, listenerList_
 
Fields inherited from class wyvern.kernel.properties.PList
readOnly_
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Constructor Summary
PlayerGrave()
           
 
Method Summary
static java.lang.String constructKilledByMsg(GameObject attacker)
          Constructs a message such as "killed by a dracolich", or "killed by an evocation", or "killed by Rhialto".
 void destroy()
          Destroys the gravestone so it can't be used again.
 java.lang.String getOwner()
          Returns the name of the player whose death created this gravestone.
 int guildXPLost()
          Returns amount of guild XP lost to this death.
 boolean hasOwner()
          Returns true if there's a "player" property.
 void initialize()
          Sets class-default properties.
 boolean isPKGrave()
          Returns true if this is considered a "PK grave", meaning the player was killed by another player.
static PlayerGrave makeGravestone(Player player, GameObject attacker, int xpLost, int guildXPLost)
          Creates a gravestone for the specified player.
static PlayerGrave makeGravestone(java.lang.String player, java.lang.String attacker, int xpLost, int guildXPLost)
          Creates a PlayerGrave given the specified player's name, and the specified attacker description.
 boolean ownerIsOnline()
          Returns true if the owner of the grave is currently online.
 boolean playerLostXP()
          Returns true if at least 1 XP was lost with this death.
 void setInscription(java.lang.String name)
          Sets the inscription to "'s Gravestone".
 void setOwner(java.lang.String name)
          Sets the name of the player who died.
 int xpLost()
          Returns amount of normal XP lost to this death.
 
Methods inherited from class wyvern.kernel.maps.MapObject
addContainerChangeListener, addDefaultProperty, addMapChangeListener, addMapMotionListener, addMethodHook, addMotionTracker, addObjectTracker, addPrefix, addSuffix, addToMap, bless, broadcast, broadcast, broadcast, broadcast, broadcast, canEnter, canEnterBlockedBy, canMove, canMove, canMoveBlockedBy, canMoveBlockedBy, canMoveTo, canMoveToBlockedBy, checkDrop, curse, cycleFrame, ensureListenerList, ensureWeight, externalize, fireContainerEntered, fireContainerExited, fireEnteredMap, fireExitedMap, fireMovedInMap, getAlpha, getAppearance, getArchetype, getBaseName, getBaseWeight, getBitmap, getBounds, getCanonicalClassName, getCategory, getContainer, getCreator, getDamagedDescription, getDescription, getDirection, getGenderPossessive, getGenderPronoun, getImage, getImageDescriptor, getImageDescriptors, getLayer, getLocations, getMap, getMapLink, getMaterial, getMaterialDescription, getMover, getOwningPlayer, getParentMap, getPrefixes, getQuantity, getReferenceLoc, getRelativeLocs, getShortDesc, getSuffixes, getTile, getTile, getValue, getWeight, groupString, inContainer, initLocs, inMapEditor, invalidate, invalidateImage, invalidateParent, invalidateText, isAnimated, isAttackable, isBlessed, isCommandable, isCursed, isDamned, isGroupable, isIdentified, isMonster, isMonsterOrPlayer, isPlayer, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, remove, removeContainerChangeListener, removeFromMap, removeMapChangeListener, removeMapMotionListener, removeMethodHook, removeMotionTracker, removeObjectTracker, removePrefix, removeSuffix, runMethodHook, setAlpha, setAnimated, setBitmap, setCategory, setContainer, setDefaultBitmap, setDefaultCategory, setDefaultDesc, setDefaultImage, setDefaultIntProperty, setDefaultLayer, setDefaultMaterial, setDefaultProperty, setDefaultShortDesc, setDirection, setImage, setImage, setLayer, setLocations, setMap, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, teleport, toString, updateMapLocation
 
Methods inherited from class wyvern.kernel.properties.PList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, debugProperties, dismantlePropertyList, getDoubleProperty, getInheritedProperty, getInteger, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProfilingInfo, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wyvern.lib.PropertyList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, getDoubleProperty, getInheritedProperty, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 

Constructor Detail

PlayerGrave

public PlayerGrave()
Method Detail

makeGravestone

public static PlayerGrave makeGravestone(Player player,
                                         GameObject attacker,
                                         int xpLost,
                                         int guildXPLost)
Creates a gravestone for the specified player. Does not put the gravestone in the map.

Parameters:
player - the player who died
attacker - the thing that killed them
xpLost - how much normal xp they lost from dying

makeGravestone

public static PlayerGrave makeGravestone(java.lang.String player,
                                         java.lang.String attacker,
                                         int xpLost,
                                         int guildXPLost)
Creates a PlayerGrave given the specified player's name, and the specified attacker description. Primarily used for testing.

Parameters:
player - the name of the player who died
attacker - description of the attacker, e.g. attacker.toString()
xpLost - how many XP the player lost from dying
guildXPLost - how much guild XP the player lost from dying

constructKilledByMsg

public static java.lang.String constructKilledByMsg(GameObject attacker)
Constructs a message such as "killed by a dracolich", or "killed by an evocation", or "killed by Rhialto".

Returns:
a partial message that you can use as part of a gravestone (or other) message.

initialize

public void initialize()
Sets class-default properties.

Specified by:
initialize in interface GameObject
Overrides:
initialize in class StaticObject

ownerIsOnline

public boolean ownerIsOnline()
Returns true if the owner of the grave is currently online.


playerLostXP

public boolean playerLostXP()
Returns true if at least 1 XP was lost with this death.


xpLost

public int xpLost()
Returns amount of normal XP lost to this death.


guildXPLost

public int guildXPLost()
Returns amount of guild XP lost to this death.


getOwner

public java.lang.String getOwner()
Returns the name of the player whose death created this gravestone.

Returns:
the player name, in the "player" property

hasOwner

public boolean hasOwner()
Returns true if there's a "player" property.


setOwner

public void setOwner(java.lang.String name)
Sets the name of the player who died.


setInscription

public void setInscription(java.lang.String name)
Sets the inscription to "'s Gravestone".

Parameters:
name - the player's name

destroy

public void destroy()
Destroys the gravestone so it can't be used again.

Specified by:
destroy in interface GameObject
Overrides:
destroy in class MapObject

isPKGrave

public boolean isPKGrave()
Returns true if this is considered a "PK grave", meaning the player was killed by another player. If the player kills himself or herself, it's not considered a PK grave.

Returns:
true if another player killed this player