wyvern.lib.classes.construct
Class Firewall

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.Firewall
All Implemented Interfaces:
Broadcaster, GameObject, MethodHookable, Predicate, PropertyList, Timed, WalkNotify

public class Firewall
extends Wall
implements WalkNotify, Timed

Firewall. Burns you when you're standing in it.

Version:
1.0, Sep 24, 2000
Author:
Steve Yegge

Field Summary
static int DEFAULT_DAMAGE
          The default wc-fire if the archetype doesn't specify one.
static int DEFAULT_DELAY
          The default timer delay if the archetype doesn't specify one.
protected  Monster monster_
          Tracks the last monster that stepped on this square.
 
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
Firewall()
           
 
Method Summary
 void damageMonster(Monster m)
          Does terrain-specific damage to the monster.
 int getDelay()
          Returns the delay between damage timers.
 void initialize()
          Adds class-default properties.
protected  void setDefaultDamageType()
          Sets the damage type to wc-fire.
 void steppedOn(Monster m)
          Notification that a monster has stepped in the square containing this object.
 void timerExpired()
          Damage timer went off.
 
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, destroy, 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, 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.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
 

Field Detail

monster_

protected Monster monster_
Tracks the last monster that stepped on this square.


DEFAULT_DELAY

public static final int DEFAULT_DELAY
The default timer delay if the archetype doesn't specify one.

See Also:
Constant Field Values

DEFAULT_DAMAGE

public static final int DEFAULT_DAMAGE
The default wc-fire if the archetype doesn't specify one.

See Also:
Constant Field Values
Constructor Detail

Firewall

public Firewall()
Method Detail

initialize

public void initialize()
Adds class-default properties. If an archetype inheriting from this class specifies a String property called "wctype", the value will be used as the damage type. For instance, if "wctype" is "wc-shock", the wall will do wc-shock damage. If not specified, it will do wc-fire damage. The default damage amount is compiled in as DEFAULT_DAMAGE, but you can override it by setting an int property "wcdamage".

You can change the message used when damage is done by setting a "show-defender-msg" string property to something like "The wall shocks you."

The wall's damage timer (how frequently it damages people) is compiled in as DEFAULT_DELAY, but you can override it with a "delay" int property.

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

setDefaultDamageType

protected void setDefaultDamageType()
Sets the damage type to wc-fire. Looks for a a "wctype" string property specifying the wc prop name (default: "wc-fire"). Then looks for a "wcdamage" int property specifying the damage. Sets the wc prop to the int value. To override this, you could set, for example, <string name="wctype" value="wc-shock"/> and <int name="wcdamage" value="12"/> to create a Shock Wall.


steppedOn

public void steppedOn(Monster m)
Notification that a monster has stepped in the square containing this object.

Specified by:
steppedOn in interface WalkNotify
Parameters:
m - the Monster who stepped into this square

timerExpired

public void timerExpired()
Damage timer went off. If the monster is still there, do the damage and set another timer.

Specified by:
timerExpired in interface Timed

damageMonster

public void damageMonster(Monster m)
Does terrain-specific damage to the monster. Subclasses might implement some other kind of damage. Firewall uses the "wc-fire" setting from its archetype.

Parameters:
m - the Monster to damage. Uses Combat.damageMonster to do the damage.

getDelay

public int getDelay()
Returns the delay between damage timers.

Returns:
the delay, in milliseconds