wyvern.lib.monsters
Class ShriekAttack

java.lang.Object
  extended bywyvern.lib.monsters.AbstractCounterAttack
      extended bywyvern.lib.monsters.ShriekAttack
All Implemented Interfaces:
CounterAttack

public class ShriekAttack
extends AbstractCounterAttack

Monster shrieks or shouts when attacked, waking up other monsters. If monster has an "alarm-msg", then the message will be broadcast when the monster is attacked. The alarm is only sounded if the getChance() succeeds; otherwise the monster doesn't sound the alarm.

If the monster has no "alarm-msg" property, then it will still wake up monsters in the map, but it won't broadcast any message that it has done so.

If the monster has an "alarm-chance" message, then it will only emit the shriek message if it rolls less than the (int) percentage value in the property. It will still always wake up the monster. This is to make it slightly more realistic for intelligent monsters, who won't call for help every time you hit them.

Version:
1.0, May 13, 2003
Author:
Steve Yegge

Field Summary
 
Fields inherited from class wyvern.lib.monsters.AbstractCounterAttack
chance_, DEFAULT_CHANCE, level_
 
Constructor Summary
ShriekAttack()
           
 
Method Summary
 void notifyAttacked(GameObject attacker, GameObject defender, Attack attack)
          Triggers the counter-attack.
 
Methods inherited from class wyvern.lib.monsters.AbstractCounterAttack
getChance, getLevel, setChance, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShriekAttack

public ShriekAttack()
Method Detail

notifyAttacked

public void notifyAttacked(GameObject attacker,
                           GameObject defender,
                           Attack attack)
Triggers the counter-attack.

Parameters:
attacker - the attacker (can be null)
defender - the defender (the one with this counterattack)
attack - the weapon (can be null)