wyvern.lib.spells.effects
Class Slower

java.lang.Object
  extended bywyvern.lib.spells.effects.Slower
All Implemented Interfaces:
Dispellable, Timed

public class Slower
extends java.lang.Object
implements Timed, Dispellable

When placed on a monster, cuts the move-speed in half by doubling the event delay. The Slower attaches itself in the target's property list under the property name "@slower".

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

Field Summary
static int DEFAULT_DELAY
           
static int DEFAULT_DURATION
           
 
Constructor Summary
Slower()
          Constructs a new Slower, ready to place on the specified monster.
Slower(Monster target)
          Constructs a new Slower on the specified monster.
Slower(Monster target, int duration)
          Constructs a new Slower
 
Method Summary
 void dispel()
          Stops paralyzing the target.
 int getDelay()
          Retrieves the total delay for this confusion.
 int getDuration()
          Retrieves the total duration for this confusion.
 void setDelay(int delay)
          Sets the delay (how much to add to the move-speed) for the effect.
 void setDuration(int duration)
          Sets the duration for being slowed.
 void slow(Monster target)
          Attaches to, and slows, the specified target.
 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

DEFAULT_DURATION

public static final int DEFAULT_DURATION
See Also:
Constant Field Values

DEFAULT_DELAY

public static final int DEFAULT_DELAY
See Also:
Constant Field Values
Constructor Detail

Slower

public Slower()
Constructs a new Slower, ready to place on the specified monster.


Slower

public Slower(Monster target)
Constructs a new Slower on the specified monster.

Parameters:
target - the target to slow

Slower

public Slower(Monster target,
              int duration)
Constructs a new Slower

Parameters:
target - the monster to slow
duration - the time (in millis) to slow the target
Method Detail

setDuration

public void setDuration(int duration)
Sets the duration for being slowed. Make sure to call this *before* calling slow(), or it'll be ignored.

Parameters:
duration - length of time to slow the target (in millis)

getDuration

public int getDuration()
Retrieves the total duration for this confusion.

Returns:
the total time it'll be active

setDelay

public void setDelay(int delay)
Sets the delay (how much to add to the move-speed) for the effect. Make sure to call this *before* calling slow(), or it'll be ignored.

Parameters:
delay - length of time to slow the target (in millis)

getDelay

public int getDelay()
Retrieves the total delay for this confusion.

Returns:
the total time it'll be active

slow

public void slow(Monster target)
Attaches to, and slows, the specified target. Can only slow one target at a time, so if it's already confusing another target, it removes itself from the existing target first.

If it finds a previous @slower on the target, it dispels the old one before adding the new one.

Parameters:
target - the monster to slow

timerExpired

public void timerExpired()
Time to stop.

Specified by:
timerExpired in interface Timed

dispel

public void dispel()
Stops paralyzing the target.

Specified by:
dispel in interface Dispellable

toString

public java.lang.String toString()
Debugging string.