wyvern.lib.monsters
Class AbstractCounterAttack

java.lang.Object
  extended bywyvern.lib.monsters.AbstractCounterAttack
All Implemented Interfaces:
CounterAttack
Direct Known Subclasses:
AcidSplash, ColdAttack, FearAttack, FireAttack, RandomAttack, RustCounterAttack, ShockAttack, ShriekAttack

public abstract class AbstractCounterAttack
extends java.lang.Object
implements CounterAttack

Handles base-class stuff for counterattacks; in particular, setting and getting the chance that the attack will trigger.

Version:
1.0, Jun 14, 2001
Author:
Steve Yegge

Field Summary
protected  int chance_
           
static int DEFAULT_CHANCE
           
protected  int level_
           
 
Constructor Summary
AbstractCounterAttack()
           
 
Method Summary
 int getChance()
          Returns the chance that this attack will be triggered when the defender is hit.
 int getLevel()
          Returns the power level of the attack.
 void setChance(int chance)
          Sets the chance (in 100) that this attack will be triggered when the defender is hit.
 void setLevel(int level)
          Sets the power level of the attack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface wyvern.lib.properties.CounterAttack
notifyAttacked
 

Field Detail

DEFAULT_CHANCE

public static final int DEFAULT_CHANCE
See Also:
Constant Field Values

chance_

protected int chance_

level_

protected int level_
Constructor Detail

AbstractCounterAttack

public AbstractCounterAttack()
Method Detail

getChance

public int getChance()
Returns the chance that this attack will be triggered when the defender is hit.

Specified by:
getChance in interface CounterAttack

setChance

public void setChance(int chance)
Sets the chance (in 100) that this attack will be triggered when the defender is hit.

Specified by:
setChance in interface CounterAttack

getLevel

public int getLevel()
Returns the power level of the attack.


setLevel

public void setLevel(int level)
Sets the power level of the attack. May not mean anything for a given counterattack.