} else if (aaa instanceof KickAttackAction) {
KickAttackAction kaa = (KickAttackAction) aaa;
toHit = kaa.toHit(game);
damage = KickAttackAction.getDamageFor(ae, kaa.getLeg(), (kaa.getTarget(game) instanceof Infantry) && !(kaa.getTarget(game) instanceof BattleArmor));
} else if (aaa instanceof ProtomechPhysicalAttackAction) {
ProtomechPhysicalAttackAction paa = (ProtomechPhysicalAttackAction) aaa;
toHit = paa.toHit(game);
damage = ProtomechPhysicalAttackAction.getDamageFor(ae);
} else if (aaa instanceof PunchAttackAction) {
PunchAttackAction paa = (PunchAttackAction) aaa;
int arm = paa.getArm();
int damageRight = 0;
paa.setArm(PunchAttackAction.LEFT);
toHit = paa.toHit(game);
paa.setArm(PunchAttackAction.RIGHT);
ToHitData toHitRight = paa.toHit(game);
damage = PunchAttackAction.getDamageFor(ae, PunchAttackAction.LEFT, (paa.getTarget(game) instanceof Infantry) && !(paa.getTarget(game) instanceof BattleArmor));
damageRight = PunchAttackAction.getDamageFor(ae, PunchAttackAction.RIGHT, (paa.getTarget(game) instanceof Infantry) && !(paa.getTarget(game) instanceof BattleArmor));
paa.setArm(arm);
// If we're punching while prone (at a Tank,
// duh), then we can only use one arm.
if (ae.isProne()) {
double oddsLeft = Compute.oddsAbove(toHit.getValue());
double oddsRight = Compute.oddsAbove(toHitRight.getValue());
// Use the best attack.
if (oddsLeft * damage > oddsRight * damageRight) {
paa.setArm(PunchAttackAction.LEFT);
} else {
paa.setArm(PunchAttackAction.RIGHT);
}
}
pr.damageRight = damageRight;
pr.toHitRight = toHitRight;
pr.rollRight = Compute.d6(2);
} else if (aaa instanceof PushAttackAction) {
PushAttackAction paa = (PushAttackAction) aaa;
toHit = paa.toHit(game);
} else if (aaa instanceof TripAttackAction) {
TripAttackAction paa = (TripAttackAction) aaa;
toHit = paa.toHit(game);
} else if (aaa instanceof LayExplosivesAttackAction) {
LayExplosivesAttackAction leaa = (LayExplosivesAttackAction) aaa;
toHit = leaa.toHit(game);
damage = LayExplosivesAttackAction.getDamageFor(ae);
} else if (aaa instanceof ThrashAttackAction) {