megamek.common.actions
Class BrushOffAttackAction
java.lang.Object
megamek.common.actions.AbstractEntityAction
megamek.common.actions.AbstractAttackAction
megamek.common.actions.BrushOffAttackAction
- All Implemented Interfaces:
- java.io.Serializable, AttackAction, EntityAction
public class BrushOffAttackAction
- extends AbstractAttackAction
The attacker brushes the target off.
- See Also:
- Serialized Form
|
Method Summary |
int |
getArm()
|
static int |
getDamageFor(Entity entity,
int arm)
Damage that the specified mech does with a brush off attack. |
void |
setArm(int arm)
|
ToHitData |
toHit(IGame game)
To-hit number for the specified arm to brush off swarming infantry. |
static ToHitData |
toHit(IGame game,
int attackerId,
Targetable target,
int arm)
To-hit number for the specified arm to brush off swarming infantry. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
BrushOffAttackAction
public BrushOffAttackAction(int entityId,
int targetType,
int targetId,
int arm)
getArm
public int getArm()
setArm
public void setArm(int arm)
getDamageFor
public static int getDamageFor(Entity entity,
int arm)
- Damage that the specified mech does with a brush off attack. This equals
the damage done by a punch from the same arm.
- Parameters:
entity - - the Entity brushing off the swarm.arm - - the int of the arm making the attack; this
value must be BrushOffAttackAction.RIGHT or
BrushOffAttackAction.LEFT.
- Returns:
- the
int amount of damage caused by the attack. If
the attack hits, the swarming infantry takes the damage; if the
attack misses, the entity deals the damage to themself.
toHit
public ToHitData toHit(IGame game)
- To-hit number for the specified arm to brush off swarming infantry. If
this attack misses, the Mek will suffer punch damage. This same action is
used to remove iNARC pods.
- Parameters:
game - - the IGame object containing all entities.
- Returns:
- the
ToHitData containing the target roll.
toHit
public static ToHitData toHit(IGame game,
int attackerId,
Targetable target,
int arm)
- To-hit number for the specified arm to brush off swarming infantry. If
this attack misses, the Mek will suffer punch damage. This same action is
used to remove iNARC pods.
- Parameters:
game - - the IGame object containing all entities.attackerId - - the int ID of the attacking unit.target - - the Targetable object being targeted.arm - - the int of the arm making the attack; this
value must be BrushOffAttackAction.RIGHT or
BrushOffAttackAction.LEFT.
- Returns:
- the
ToHitData containing the target roll.