|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.spells.effects.Confuser
When placed on a monster, makes about half the intended moves go the wrong way. The Confuser attaches itself in the target's property list under the property name "@confuser".
Field Summary | |
static int |
BUNGLE_CHANCE
|
static int |
DEFAULT_DURATION
|
protected int |
duration_
|
protected Monster |
target_
|
protected Timer |
timer_
|
Constructor Summary | |
Confuser()
Constructs a new Confuser, ready to place on the specified monster. |
|
Confuser(Monster target)
Constructs a new Confuser on the specified monster. |
|
Confuser(Monster target,
int duration)
Constructs a new Confuser |
Method Summary | |
void |
confuse(Monster target)
Attaches to, and confuses, the specified target. |
void |
dispel()
Stops confusing the target. |
int |
getDuration()
Retrieves the total duration for this confusion. |
void |
hookEvent(java.lang.String hookName,
CommandEvent event)
Chooses a random direction for the target to move. |
void |
setDuration(int duration)
Sets the duration for the confusion. |
void |
timerExpired()
Time to stop. |
java.lang.String |
toString()
Debugging string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Monster target_
protected Timer timer_
protected int duration_
public static final int BUNGLE_CHANCE
public static final int DEFAULT_DURATION
Constructor Detail |
public Confuser()
public Confuser(Monster target)
target
- the target to confusepublic Confuser(Monster target, int duration)
target
- the monster to confuseduration
- the time (in millis) to confuse the targetMethod Detail |
public void setDuration(int duration)
duration
- length of time to confuse the target (in millis)public int getDuration()
public void confuse(Monster target)
If it finds a previous @confuser on the target, it dispels the old one before adding the new one.
target
- the monster to confusepublic void hookEvent(java.lang.String hookName, CommandEvent event)
hookEvent
in interface HookCallback
event
- the move/push eventhookName
- the name of the hook, such as "movePreHook".public void timerExpired()
timerExpired
in interface Timed
public void dispel()
dispel
in interface Dispellable
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |