megamek.common.actions
Class ChargeAttackAction

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

public class ChargeAttackAction
extends DisplacementAttackAction

Represents one unit charging another. Stores information about where the target is supposed to be for the charge to be successful, as well as normal attack info.

Author:
Ben Mazur
See Also:
Serialized Form

Constructor Summary
ChargeAttackAction(Entity attacker, Targetable target)
           
ChargeAttackAction(int entityId, int targetType, int targetId, Coords targetPos)
           
 
Method Summary
static int getDamageFor(Entity entity)
          Damage that a mech does with a successful charge.
static int getDamageFor(Entity entity, boolean tacops, int hexesMoved)
           
static int getDamageFor(Entity entity, Entity target, boolean tacops, int mos)
           
static int getDamageFor(Entity entity, Entity target, boolean tacops, int mos, int hexesMoved)
           
static int getDamageTakenBy(Entity entity, Building bldg, Coords coords)
          Damage that a mech suffers after a successful charge.
static int getDamageTakenBy(Entity entity, Entity target)
           
static int getDamageTakenBy(Entity entity, Entity target, boolean tacops)
           
static int getDamageTakenBy(Entity entity, Entity target, boolean tacops, int distance)
           
 ToHitData toHit(IGame game)
          To-hit number for a charge, assuming that movement has been handled
 ToHitData toHit(IGame game, boolean skid)
           
 ToHitData toHit(IGame game, MovePath md)
          Checks if a charge can hit the target, taking account of movement
 ToHitData toHit(IGame game, Targetable target, Coords src, int elevation, EntityMovementType movement, boolean skid, boolean gotUp)
          To-hit number for a charge, assuming that movement has been handled
 
Methods inherited from class megamek.common.actions.DisplacementAttackAction
getTargetPos, setTargetPos
 
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

ChargeAttackAction

public ChargeAttackAction(Entity attacker,
                          Targetable target)

ChargeAttackAction

public ChargeAttackAction(int entityId,
                          int targetType,
                          int targetId,
                          Coords targetPos)
Method Detail

toHit

public ToHitData toHit(IGame game)
To-hit number for a charge, assuming that movement has been handled


toHit

public ToHitData toHit(IGame game,
                       boolean skid)

toHit

public ToHitData toHit(IGame game,
                       Targetable target,
                       Coords src,
                       int elevation,
                       EntityMovementType movement,
                       boolean skid,
                       boolean gotUp)
To-hit number for a charge, assuming that movement has been handled


toHit

public ToHitData toHit(IGame game,
                       MovePath md)
Checks if a charge can hit the target, taking account of movement


getDamageFor

public static int getDamageFor(Entity entity)
Damage that a mech does with a successful charge. Assumes that delta_distance is correct.


getDamageFor

public static int getDamageFor(Entity entity,
                               boolean tacops,
                               int hexesMoved)

getDamageFor

public static int getDamageFor(Entity entity,
                               Entity target,
                               boolean tacops,
                               int mos)

getDamageFor

public static int getDamageFor(Entity entity,
                               Entity target,
                               boolean tacops,
                               int mos,
                               int hexesMoved)

getDamageTakenBy

public static int getDamageTakenBy(Entity entity,
                                   Building bldg,
                                   Coords coords)
Damage that a mech suffers after a successful charge.


getDamageTakenBy

public static int getDamageTakenBy(Entity entity,
                                   Entity target)

getDamageTakenBy

public static int getDamageTakenBy(Entity entity,
                                   Entity target,
                                   boolean tacops)

getDamageTakenBy

public static int getDamageTakenBy(Entity entity,
                                   Entity target,
                                   boolean tacops,
                                   int distance)