wyvern.lib.magic.weapon
Class MageWhip

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.lib.classes.weapons.WeaponImpl
              extended bywyvern.lib.classes.weapons.MeleeWeapon
                  extended bywyvern.lib.classes.weapons.Whip
                      extended bywyvern.lib.magic.weapon.MageWhip
All Implemented Interfaces:
Applyable, Attack, Broadcaster, Damageable, GameObject, MethodHookable, Movable, PickupInterest, PropertyList, Readyable, Weapon

public final class MageWhip
extends Whip

A magical whip created by the "magic whip" spell, for mages only. You can't drop it or give it away, just wield/unwield it and dispel it.

Version:
1.0, Nov 26, 1999
Author:
Steve Yegge

Field Summary
 
Fields inherited from class wyvern.lib.classes.weapons.WeaponImpl
DEFAULT_WEAPON_HP, wcs_
 
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
MageWhip(Commandable owner)
          Unlike most GameObjects, we only have one constructor, and it requires an owner to be specified.
 
Method Summary
 java.lang.String checkDrop(Commandable agent, Container dest)
          Determines whether the object can be dropped, thrown, given away, etc.
 java.util.LinkedList externalize()
          Don't let us be written out to a map file.
 java.util.List getWC(GameObject opponent)
          Gets the weapon class against the specified opponent.
 void initialize()
          Adds class-default properties.
 void setMap()
          Don't let it be placed in a map.
 boolean setWielded(boolean wielded, Commandable agent)
          Someone is trying to wield the whip.
 
Methods inherited from class wyvern.lib.classes.weapons.Whip
getWeaponSkill
 
Methods inherited from class wyvern.lib.classes.weapons.WeaponImpl
addSlayWC, adjustHP, apply, canReady, canUnready, checkHit, destroy, didDamage, dropped, forceUnwield, getDescription, getHP, getMaxHP, getRequiredSlots, getToHit, hitMonster, isReadied, isWielded, kill, notifyReady, notifyUnready, pickedUp, recomputeWCs, setDefaultHP, setShowAttackerMessage, setToHit, setWC, shouldStop, showAttackerMessage, toString, tryGettingCaught
 
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, curse, cycleFrame, ensureListenerList, ensureWeight, fireContainerEntered, fireContainerExited, fireEnteredMap, fireExitedMap, fireMovedInMap, getAlpha, getAppearance, getArchetype, getBaseName, getBaseWeight, getBitmap, getBounds, getCanonicalClassName, getCategory, getContainer, getCreator, getDamagedDescription, 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, 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, curse, cycleFrame, getAlpha, getAppearance, getArchetype, getBaseWeight, getBitmap, getBounds, getCanonicalClassName, getCategory, getContainer, getCreator, getDamagedDescription, 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, isAttackable, 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

MageWhip

public MageWhip(Commandable owner)
Unlike most GameObjects, we only have one constructor, and it requires an owner to be specified. This is so that if the whip is stolen or removed from the mage (despite our attempts to prevent this scenario), it will not function for its new owner.

Method Detail

initialize

public void initialize()
Adds class-default properties.

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

checkDrop

public java.lang.String checkDrop(Commandable agent,
                                  Container dest)
Determines whether the object can be dropped, thrown, given away, etc.

Specified by:
checkDrop in interface GameObject
Overrides:
checkDrop in class WeaponImpl

setMap

public void setMap()
Don't let it be placed in a map.


setWielded

public boolean setWielded(boolean wielded,
                          Commandable agent)
Someone is trying to wield the whip.

Specified by:
setWielded in interface Weapon
Overrides:
setWielded in class WeaponImpl

externalize

public java.util.LinkedList externalize()
Don't let us be written out to a map file.

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

getWC

public java.util.List getWC(GameObject opponent)
Gets the weapon class against the specified opponent. We check the wielder's death-magic skill each time, so they can't cheat by putting on a magic item that increases sk-death, casting the spell, and taking off the item.

Specified by:
getWC in interface Attack
Overrides:
getWC in class WeaponImpl