wyvern.lib.classes.construct
Class DiggableWall

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.lib.classes.construct.ConnectedObject
              extended bywyvern.lib.classes.construct.Wall
                  extended bywyvern.lib.classes.construct.DiggableWall
All Implemented Interfaces:
Attackable, Broadcaster, Damageable, GameObject, MethodHookable, Predicate, PropertyList

public class DiggableWall
extends Wall
implements Attackable

A wall you can break through.

Version:
1.0, Oct 2, 2000
Author:
Steve Yegge

Field Summary
 
Fields inherited from class wyvern.lib.classes.construct.ConnectedObject
baseBitmapName_
 
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
DiggableWall()
           
 
Method Summary
 void adjustHP(int adjust)
          Adjusts the wall's hit points upwards or downwards.
 void destroy()
          Tells the object to destroy itself.
 java.lang.String getDamagedDescription()
          Returns a message like "It is badly damaged".
 int getHP()
          Returns the object's current hit points.
 int getMaxHP()
          Returns the object's maximum hit points.
 int getXPAward()
          Returns XP for this wall.
 void initialize()
          Initializes the object's default properties.
 boolean isAttackable()
          Returns true if this is an Attackable.
 void kill(GameObject attacker)
          Destroys the object.
 void notifyAttacked(Commandable attacker)
          Notifies the object it's being attacked.
 
Methods inherited from class wyvern.lib.classes.construct.Wall
getNeighborPredicate, predicate, remove, setMap
 
Methods inherited from class wyvern.lib.classes.construct.ConnectedObject
applyBitmap, checkNeighbor, doUpdate, getWallBaseName, haveNeighbor, processNeighbor, setBaseBitmap, stripDirs, teleport, updateBitmap, updateBitmapAndNeighbors
 
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, 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, isBlessed, isCommandable, isCursed, isDamned, isGroupable, isIdentified, isMonster, isMonsterOrPlayer, isPlayer, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, 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, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, 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.GameObject
addContainerChangeListener, addMapChangeListener, addMapMotionListener, addMotionTracker, addObjectTracker, addPrefix, addSuffix, bless, canEnter, canEnterBlockedBy, canMove, canMove, canMoveBlockedBy, canMoveBlockedBy, canMoveTo, canMoveToBlockedBy, checkDrop, curse, cycleFrame, externalize, getAlpha, getAppearance, getArchetype, getBaseWeight, getBitmap, getBounds, getCanonicalClassName, getCategory, getContainer, getCreator, 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, inContainer, inMapEditor, invalidate, invalidateImage, invalidateParent, invalidateText, isAnimated, isBlessed, isCommandable, isCursed, isDamned, isGroupable, isIdentified, isMonster, isMonsterOrPlayer, isPlayer, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, remove, removeContainerChangeListener, removeMapChangeListener, removeMapMotionListener, removeMotionTracker, removeObjectTracker, removePrefix, removeSuffix, setAlpha, setAnimated, setBitmap, setCategory, setContainer, setDirection, setImage, setImage, setLayer, setLocations, setMap, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, teleport
 
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
 
Methods inherited from interface wyvern.lib.MethodHookable
addMethodHook, removeMethodHook, runMethodHook
 
Methods inherited from interface wyvern.lib.Broadcaster
broadcast, broadcast, broadcast, broadcast, broadcast
 

Constructor Detail

DiggableWall

public DiggableWall()
Method Detail

initialize

public void initialize()
Description copied from interface: GameObject
Initializes the object's default properties. Any GameObject implementation that wishes to initialize itself should do so here, rather than in the constructor. This is because nearly all game objects inherit from an archetype, and the archetype parent pointer isn't set until the object's constructor finishes. This is a good place to add any class-default properties for an object - properties that the object gets regardless of which archetype it inherits from. WARNING: don't forget to call the superclass' initialize() method, or the object may not function properly. For instance, it won't become animated even if it specifies animation parameters in the archetype.

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

getHP

public int getHP()
Returns the object's current hit points.

Specified by:
getHP in interface Damageable

getMaxHP

public int getMaxHP()
Returns the object's maximum hit points.

Specified by:
getMaxHP in interface Damageable

adjustHP

public void adjustHP(int adjust)
Adjusts the wall's hit points upwards or downwards. Also adjusts the wall's appearance based on its remaining hit points. Subclasses can override this to set their appearance accordingly.

Specified by:
adjustHP in interface Damageable
Parameters:
adjust - a number (possibly negative) to add to the wall's hp

notifyAttacked

public void notifyAttacked(Commandable attacker)
Notifies the object it's being attacked. Happens during the successful execution of the AttackEvent, before the damage is computed.

Specified by:
notifyAttacked in interface Attackable

kill

public void kill(GameObject attacker)
Destroys the object. Invokes destroy().

Specified by:
kill in interface Damageable
Parameters:
attacker - the player/monster/iron-gate/whatever that did the final blow. Can be null.

destroy

public void destroy()
Description copied from interface: GameObject
Tells the object to destroy itself. The default implementation removes the object from its parent container (a map, bag or inventory). Subclasses can override this method to do other cleanup that might be necessary, such as removing transient properties or hook callbacks the object has set somewhere.

This method is called when the object's parent map is unloaded, when a wizard disposes the object, or when the object is destroyed via some natural force (e.g. a fireball). If you override this method, make sure to call the superclass version, so the superclass can perform its own cleanup if needed.

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

getXPAward

public int getXPAward()
Returns XP for this wall.

Specified by:
getXPAward in interface Attackable
Returns:
the number of experience points to distribute among the agents that killed the monster.

getDamagedDescription

public java.lang.String getDamagedDescription()
Returns a message like "It is badly damaged".

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

isAttackable

public boolean isAttackable()
Description copied from interface: GameObject
Returns true if this is an Attackable.

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