megamek.common.actions
Class RamAttackAction

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

public class RamAttackAction
extends AbstractAttackAction

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
RamAttackAction(Entity attacker, Targetable target)
           
RamAttackAction(int entityId, int targetType, int targetId, Coords targetPos)
           
 
Method Summary
static int getDamageFor(Aero entity, Aero target)
          Damage that an Aero does on a successful ramming attack
static int getDamageFor(Aero entity, Aero target, Coords atthex, int avel, int tvel)
           
static int getDamageTakenBy(Aero entity, Aero target)
          Damage that an Aero suffers after a successful charge.
static int getDamageTakenBy(Aero entity, Aero target, Coords atthex, int avel, int tvel)
           
 ToHitData toHit(IGame game)
          To-hit number for a ram, assuming that movement has been handled
 ToHitData toHit(IGame game, MovePath md)
          Checks if a ram can hit the target, taking account of movement
 ToHitData toHit(IGame game, Targetable target, Coords src, int elevation, Coords priorSrc, EntityMovementType movement)
          To-hit number for a ram, assuming that movement has been handled
 
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

RamAttackAction

public RamAttackAction(Entity attacker,
                       Targetable target)

RamAttackAction

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

toHit

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


toHit

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


toHit

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


getDamageFor

public static int getDamageFor(Aero entity,
                               Aero target)
Damage that an Aero does on a successful ramming attack


getDamageFor

public static int getDamageFor(Aero entity,
                               Aero target,
                               Coords atthex,
                               int avel,
                               int tvel)

getDamageTakenBy

public static int getDamageTakenBy(Aero entity,
                                   Aero target)
Damage that an Aero suffers after a successful charge.


getDamageTakenBy

public static int getDamageTakenBy(Aero entity,
                                   Aero target,
                                   Coords atthex,
                                   int avel,
                                   int tvel)