megamek.common.actions
Class ThrashAttackAction

java.lang.Object
  extended by megamek.common.actions.AbstractEntityAction
      extended by megamek.common.actions.AbstractAttackAction
          extended by megamek.common.actions.ThrashAttackAction
All Implemented Interfaces:
java.io.Serializable, AttackAction, EntityAction

public class ThrashAttackAction
extends AbstractAttackAction

The prone attacker thrashes at the target.

See Also:
Serialized Form

Constructor Summary
ThrashAttackAction(int entityId, int targetId)
           
ThrashAttackAction(int entityId, int targetType, int targetId)
           
ThrashAttackAction(int entityId, Targetable target)
           
 
Method Summary
static int getDamageFor(Entity entity)
          Damage caused by a successfull thrashing attack.
 ToHitData toHit(IGame game)
          To-hit number for thrashing attack.
 
Methods inherited from class megamek.common.actions.AbstractAttackAction
getEntity, getTarget, getTargetId, getTargetType, nightModifiers, setTargetId, setTargetType
 
Methods inherited from class megamek.common.actions.AbstractEntityAction
getEntityId, setEntityId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface megamek.common.actions.EntityAction
getEntityId, setEntityId
 

Constructor Detail

ThrashAttackAction

public ThrashAttackAction(int entityId,
                          int targetId)

ThrashAttackAction

public ThrashAttackAction(int entityId,
                          int targetType,
                          int targetId)

ThrashAttackAction

public ThrashAttackAction(int entityId,
                          Targetable target)
Method Detail

toHit

public ToHitData toHit(IGame game)
To-hit number for thrashing attack. This attack can only be made by a prone Mek in a clear or pavement terrain hex that contains infantry. This attack will force a PSR check for the prone Mek; if the PSR is missed, the Mek takes normal falling damage.

Parameters:
game - - the IGame object containing all entities.
Returns:
the ToHitData containing the target roll.

getDamageFor

public static int getDamageFor(Entity entity)
Damage caused by a successfull thrashing attack.

Parameters:
entity - - the Entity conducting the thrash attack.
Returns:
The int amount of damage caused by this attack.