wyvern.lib.classes.construct
Class QuestPerson

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.kernel.commands.AbstractCommandable
              extended bywyvern.kernel.monsters.MonsterImpl
                  extended bywyvern.lib.classes.construct.QuestPerson
All Implemented Interfaces:
Attackable, Broadcaster, Commandable, Damageable, GameObject, GiveInterest, HeartbeatCallback, Hookable, MethodHookable, MethodHookCallback, Monster, MouseInterest, PropertyList, RemoteAudio

public class QuestPerson
extends MonsterImpl
implements GiveInterest

A monster or NPC who will give you something, and/or perform some command, when you give it the right item. Configurable through various properties. The properties are all required unless specified otherwise.

The QuestPerson is a Monster object, so you can add all the normal properties you'd put on a monster, including its appearance, size, AI properties, Talker object, and so on.

Version:
1.0, May 1, 2002
Author:
Steve Yegge

Nested Class Summary
 
Nested classes inherited from class wyvern.kernel.monsters.MonsterImpl
MonsterImpl.WalkVisitor
 
Field Summary
 
Fields inherited from class wyvern.kernel.monsters.MonsterImpl
beats_, python_, walkVisitor_
 
Fields inherited from class wyvern.kernel.commands.AbstractCommandable
hookList_, queue_, started_
 
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.Monster
DEFAULT_MONSTER_ATTACK_SPEED, DEFAULT_MONSTER_SPEED, DEFAULT_MONSTER_STRENGTH, MONSTER_XP_CAP
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Fields inherited from interface wyvern.common.net.RemoteAudio
DEFAULT_ALERT_GAIN, DEFAULT_ALERT_REPEAT_DELAY, DEFAULT_ALERT_REPEATS, DEFAULT_GAIN, DEFAULT_REPEAT_DELAY, DEFAULT_REPEATS
 
Constructor Summary
QuestPerson()
           
 
Method Summary
 void handleGift(Commandable p, GameObject item)
          Handles getting the correct item.
 void initialize()
          Sets class-default properties, after loading from the archetype.
 void receivedGift(Commandable agent, GameObject item)
          Someone gave something to the NPC.
 void wrongItem(Commandable agent)
          Prints the wrong-item message, if any.
 
Methods inherited from class wyvern.kernel.monsters.MonsterImpl
addCustomAttacks, addToMap, adjustHP, adjustSP, adjustStat, adjustWallet, burial, checkDirection, createGenericAttacks, createInventory, dropAll, dropAllForce, ensureAI, ensurePartsList, generateInventory, getDamagedDescription, getHP, getInventory, getLevel, getMaxHP, getMaxSP, getPartsList, getSP, getSpellList, getWallet, getXPAward, heartbeat, initInventory, isAlive, isAttackable, isHostile, isMonster, isMonsterOrPlayer, isNeutral, isPeaceful, isPlayer, kill, message, message, methodCalled, mouseClicked, notifyAttacked, remove, setDefaultAttackSpeed, setHP, setLevelProperties, setMap, setSP, snuffActiveSpells, start, stop
 
Methods inherited from class wyvern.kernel.commands.AbstractCommandable
addAttack, addHook, addMessageListener, addMethodHook, checkAnimated, command, command, commandNow, destroy, ensureEventQueue, fireMessageReceived, getAI, getCapName, getCombatQueue, getCommand, getEncumbrance, getFiringPoint, getHookList, getHooks, getName, getQueue, isCommandable, isStarted, isTelnet, message, pauseSound, playAlert, playAlert, playDefaultMusic, playPriorityMusic, playPriorityMusic, playSound, playSound, registerCommand, removeAttack, removeHook, removeMessageListener, removeMethodHook, resumeSound, runFailedPostHook, runMethodHook, runPostHook, runPreHook, sendPicture, sendPicture, setAI, setEncumbrance, setMusicGain, setName, setSoundGain, stopAllSounds, stopMusic, stopSound, unregisterCommand
 
Methods inherited from class wyvern.kernel.maps.MapObject
addContainerChangeListener, addDefaultProperty, addMapChangeListener, addMapMotionListener, addMotionTracker, addObjectTracker, addPrefix, addSuffix, 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, isCursed, isDamned, isGroupable, isIdentified, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, removeContainerChangeListener, removeFromMap, removeMapChangeListener, removeMapMotionListener, removeMotionTracker, removeObjectTracker, removePrefix, removeSuffix, 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.Commandable
addAttack, addMessageListener, command, command, commandNow, getAI, getCapName, getCombatQueue, getCommand, getEncumbrance, getFiringPoint, getName, getQueue, isStarted, isTelnet, message, registerCommand, removeAttack, removeMessageListener, sendPicture, sendPicture, setAI, setEncumbrance, setName, unregisterCommand
 
Methods inherited from interface wyvern.lib.Hookable
addHook, getHookList, getHooks, removeHook, runFailedPostHook, runPostHook, runPreHook
 
Methods inherited from interface wyvern.lib.MethodHookable
addMethodHook, removeMethodHook, runMethodHook
 
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, 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, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, 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.Broadcaster
broadcast, broadcast, broadcast, broadcast, broadcast
 
Methods inherited from interface wyvern.common.net.RemoteAudio
pauseSound, playAlert, playAlert, playDefaultMusic, playPriorityMusic, playPriorityMusic, playSound, playSound, resumeSound, setMusicGain, setSoundGain, stopAllSounds, stopMusic, stopSound
 

Constructor Detail

QuestPerson

public QuestPerson()
Method Detail

initialize

public void initialize()
Description copied from class: MonsterImpl
Sets class-default properties, after loading from the archetype.

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

receivedGift

public void receivedGift(Commandable agent,
                         GameObject item)
Someone gave something to the NPC.

Specified by:
receivedGift in interface GiveInterest
Parameters:
agent - the player
item - the item the Player gave to the NPC

wrongItem

public void wrongItem(Commandable agent)
Prints the wrong-item message, if any.


handleGift

public void handleGift(Commandable p,
                       GameObject item)
Handles getting the correct item.

Parameters:
p - the player
item - the item the player gave to the QuestPerson