megamek.common.actions
Class PunchAttackAction

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

public class PunchAttackAction
extends PhysicalAttackAction

The attacker punches the target.

See Also:
Serialized Form

Field Summary
static int BOTH
           
static int LEFT
           
static int RIGHT
           
 
Constructor Summary
PunchAttackAction(int entityId, int targetId, int arm)
           
PunchAttackAction(int entityId, int targetType, int targetId, int arm, boolean leftBlade, boolean rightBlade)
           
 
Method Summary
 int getArm()
           
static int getDamageFor(Entity entity, int arm, boolean targetInfantry)
          Damage that the specified mech does with a punch.
 boolean isBladeExtended(int arm)
           
 void setArm(int arm)
           
 ToHitData toHit(IGame game)
           
static ToHitData toHit(IGame game, int attackerId, Targetable target, int arm)
          To-hit number for the specified arm to punch
protected static java.lang.String toHitIsImpossible(IGame game, Entity ae, Targetable target, int arm)
          punches are impossible when physical attacks are impossible, or a retractable blade is extended
 
Methods inherited from class megamek.common.actions.PhysicalAttackAction
setCommonModifiers, toHitIsImpossible
 
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
 

Field Detail

BOTH

public static final int BOTH
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values
Constructor Detail

PunchAttackAction

public PunchAttackAction(int entityId,
                         int targetId,
                         int arm)

PunchAttackAction

public PunchAttackAction(int entityId,
                         int targetType,
                         int targetId,
                         int arm,
                         boolean leftBlade,
                         boolean rightBlade)
Method Detail

getArm

public int getArm()

setArm

public void setArm(int arm)

isBladeExtended

public boolean isBladeExtended(int arm)

toHit

public ToHitData toHit(IGame game)

toHitIsImpossible

protected static java.lang.String toHitIsImpossible(IGame game,
                                                    Entity ae,
                                                    Targetable target,
                                                    int arm)
punches are impossible when physical attacks are impossible, or a retractable blade is extended

Parameters:
game -
ae -
target -
Returns:

toHit

public static ToHitData toHit(IGame game,
                              int attackerId,
                              Targetable target,
                              int arm)
To-hit number for the specified arm to punch


getDamageFor

public static int getDamageFor(Entity entity,
                               int arm,
                               boolean targetInfantry)
Damage that the specified mech does with a punch.