|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.properties.PList wyvern.lib.properties.ProximityProperty wyvern.lib.properties.MonsterReactions
Allows a monster to react under certain circumstances. For instance, if the monster is an elf, and sees you kill another elf, it can hate you (i.e. attack you.)
Field Summary |
Fields inherited from class wyvern.kernel.properties.PList |
readOnly_ |
Fields inherited from interface wyvern.lib.PropertyList |
PROPERTY_PACKAGE |
Constructor Summary | |
MonsterReactions()
|
Method Summary | |
boolean |
checkForAnyProp(PList agent,
java.util.List props)
Check the PList to see if it has any of the props set. |
StringList |
getDefenderProps()
We're interested in defenders with these props. |
java.lang.String[] |
getHookNames()
|
StringList |
getOKAggressorProps()
Returns properties that it's OK for the aggressor to have (i.e. the aggressor with these won't trigger the reaction). |
Rectangle |
getProximityRect()
Read the number of squares of interest out of the prop and change it too a rectangle |
void |
hookEvent(java.lang.String hookName,
GameObject target,
CommandEvent data)
Callback for prehooks. |
static void |
main(java.lang.String[] args)
|
boolean |
noticed()
returns true if we notice the event, based on a random number at the time of the call and the notice-chance property |
void |
processDamageHook(GameObject defender,
Commandable aggressor,
Monster observer)
Something is being damaged. |
void |
react(GameObject defender,
Commandable aggressor,
Monster observer)
We have determined we want to react. |
java.lang.String |
toString()
Prints debugging info. |
Methods inherited from class wyvern.lib.properties.ProximityProperty |
createClone, getTarget, notifyAdd, notifyRemove, targetEnteredMap, targetLeftMap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MonsterReactions()
Method Detail |
public Rectangle getProximityRect()
getProximityRect
in class ProximityProperty
public java.lang.String[] getHookNames()
getHookNames
in class ProximityProperty
public void hookEvent(java.lang.String hookName, GameObject target, CommandEvent data)
hookEvent
in interface ProximityCallback
hookEvent
in class ProximityProperty
public boolean noticed()
public void processDamageHook(GameObject defender, Commandable aggressor, Monster observer)
public void react(GameObject defender, Commandable aggressor, Monster observer)
public boolean checkForAnyProp(PList agent, java.util.List props)
public StringList getDefenderProps()
public StringList getOKAggressorProps()
public java.lang.String toString()
toString
in class PList
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |