wyvern.lib.classes
Class QuestItem

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.lib.classes.DynamicObject
              extended bywyvern.lib.classes.QuestItem
All Implemented Interfaces:
Broadcaster, ContainerChangeListener, Damageable, java.util.EventListener, GameObject, MethodHookable, PickupInterest, PropertyList

public class QuestItem
extends DynamicObject
implements PickupInterest, ContainerChangeListener

Quest items cannot be dropped, thrown, given away or otherwise removed from inventory (or they disappear). One special case: if it's being given to a monster with the property "quest-monster", it won't disappear, and will successfully transfer to the monster.

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

Field Summary
protected  boolean solving_
           
 
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
QuestItem()
           
 
Method Summary
 void dropped(Commandable agent)
          Notifies the object that the specified agent has dropped it.
 java.lang.String getDestroyMessage()
          Returns the message to print when the object disappears, as a result of being dropped or whatever.
 void initialize()
          Sets default properties
 void pickedUp(Commandable agent)
          Notifies the object that the specified agent has picked it up.
 void sayGoodbye()
          Broadcasts the fact that it's going away.
 void setMap(GameMap map, int x, int y)
          If we're active (someone has picked us up), don't go in map.
 void solvingQuest()
          Notifies the item that it's being given to a quest monster, so it shouldn't disappear when it's removed from inventory.
 void targetEnteredContainer(ContainerChangeEvent event)
          Target object was added to a bag or inventory.
 void targetLeftContainer(ContainerChangeEvent event)
          Target object was removed from a bag or inventory.
 
Methods inherited from class wyvern.lib.classes.DynamicObject
adjustHP, computeHP, getHP, getMaxHP, kill
 
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, 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, 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.GameObject
addContainerChangeListener, addMapChangeListener, addMapMotionListener, addMotionTracker, addObjectTracker, addPrefix, addSuffix, bless, canEnter, canEnterBlockedBy, canMove, canMove, canMoveBlockedBy, canMoveBlockedBy, canMoveTo, canMoveToBlockedBy, checkDrop, curse, cycleFrame, destroy, externalize, getAlpha, getAppearance, getArchetype, 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, 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, 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
 

Field Detail

solving_

protected boolean solving_
Constructor Detail

QuestItem

public QuestItem()
Method Detail

initialize

public void initialize()
Sets default properties

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

targetEnteredContainer

public void targetEnteredContainer(ContainerChangeEvent event)
Target object was added to a bag or inventory.

Specified by:
targetEnteredContainer in interface ContainerChangeListener

targetLeftContainer

public void targetLeftContainer(ContainerChangeEvent event)
Target object was removed from a bag or inventory.

Specified by:
targetLeftContainer in interface ContainerChangeListener

pickedUp

public void pickedUp(Commandable agent)
Notifies the object that the specified agent has picked it up.

Specified by:
pickedUp in interface PickupInterest
Parameters:
agent - the agent picking up the object

dropped

public void dropped(Commandable agent)
Notifies the object that the specified agent has dropped it.

Specified by:
dropped in interface PickupInterest
Parameters:
agent - the agent that dropped the object

setMap

public void setMap(GameMap map,
                   int x,
                   int y)
If we're active (someone has picked us up), don't go in map.

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

sayGoodbye

public void sayGoodbye()
Broadcasts the fact that it's going away. QuestItem is on a lot of different hooks to make sure it can't be bypassed, so this method may get called multiple times while the item is being destroyed. We set a property to make sure we only actually do the broadcast once.


solvingQuest

public void solvingQuest()
Notifies the item that it's being given to a quest monster, so it shouldn't disappear when it's removed from inventory.


getDestroyMessage

public java.lang.String getDestroyMessage()
Returns the message to print when the object disappears, as a result of being dropped or whatever.