wyvern.lib.spells.effects
Class Scarer

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

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

When invoked on a monster, enqueues a number of random moves for the monster.

Version:
1.0, Nov 26, 1999
Author:
Steve Yegge

Field Summary
static int BUNGLE_CHANCE
          Additional chance to bungle spells while scared.
static int DEFAULT_INTERVAL
          This number is tricky to get right, since enqueueing moves is a major source of lag for international players, or players on very slow (or high-latency) connections, like handhelds.
static int DEFAULT_LEVEL
          Default level for the spell.
static java.lang.String[] MESSAGES
          Random messages a player can emit when scared.
 
Constructor Summary
Scarer()
          Constructs a new Scarer, ready to invoke on the specified monster.
Scarer(Monster target)
          Constructs a new Scarer on the specified monster.
Scarer(Monster target, int level)
          Constructs a new Scarer
 
Method Summary
 void checkLegs(Monster target)
          Checks if the target has legs.
 void dispel()
          Dispels the effect.
 void dispelPrevious()
          Dispels any previous Scarer, silently, so we can replace it.
 void emitMessage()
          Target broadcasts a panicked message, chosen from random list.
 void scare(Monster target, int level)
          Scares the specified target.
 void setSilent()
          Sets silent-mode, so the agent won't hear messages when it's dispelled.
 void spookMonster()
          Enqueues a random, small number of random moves into the monster's queue, and issues a message to the monster.
 void timerExpired()
          Dispels the effect.
 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_LEVEL

public static final int DEFAULT_LEVEL
Default level for the spell.

See Also:
Constant Field Values

BUNGLE_CHANCE

public static final int BUNGLE_CHANCE
Additional chance to bungle spells while scared.

See Also:
Constant Field Values

DEFAULT_INTERVAL

public static final int DEFAULT_INTERVAL
This number is tricky to get right, since enqueueing moves is a major source of lag for international players, or players on very slow (or high-latency) connections, like handhelds. Have to play with it a bit.

See Also:
Constant Field Values

MESSAGES

public static final java.lang.String[] MESSAGES
Random messages a player can emit when scared.

Constructor Detail

Scarer

public Scarer()
Constructs a new Scarer, ready to invoke on the specified monster.


Scarer

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

Parameters:
target - the target to confuse

Scarer

public Scarer(Monster target,
              int level)
Constructs a new Scarer

Parameters:
target - the monster to confuse
level - level of the spell
Method Detail

scare

public void scare(Monster target,
                  int level)
Scares the specified target. Scarers don't attach to the monster, so they can be reused on multiple monsters.

Parameters:
target - the monster to scare
level - level of the spell

dispelPrevious

public void dispelPrevious()
Dispels any previous Scarer, silently, so we can replace it.


checkLegs

public void checkLegs(Monster target)
Checks if the target has legs.


spookMonster

public void spookMonster()
Enqueues a random, small number of random moves into the monster's queue, and issues a message to the monster.


emitMessage

public void emitMessage()
Target broadcasts a panicked message, chosen from random list.


timerExpired

public void timerExpired()
Dispels the effect.

Specified by:
timerExpired in interface Timed

dispel

public void dispel()
Dispels the effect.

Specified by:
dispel in interface Dispellable

setSilent

public void setSilent()
Sets silent-mode, so the agent won't hear messages when it's dispelled. Used when a new Scarer is replacing an old one.


toString

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