* @param cen
* The <code>int</code> Entity Id of the entit's whose physical
* attack was last resolved
*/
private void resolvePhysicalAttack(PhysicalResult pr, int cen) {
AbstractAttackAction aaa = pr.aaa;
if (aaa instanceof PunchAttackAction) {
PunchAttackAction paa = (PunchAttackAction) aaa;
if (paa.getArm() == PunchAttackAction.BOTH) {
paa.setArm(PunchAttackAction.LEFT);
pr.aaa = paa;
resolvePunchAttack(pr, cen);
cen = paa.getEntityId();
paa.setArm(PunchAttackAction.RIGHT);
pr.aaa = paa;
resolvePunchAttack(pr, cen);
} else {
resolvePunchAttack(pr, cen);
cen = paa.getEntityId();
}
} else if (aaa instanceof KickAttackAction) {
resolveKickAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof BrushOffAttackAction) {
BrushOffAttackAction baa = (BrushOffAttackAction) aaa;
if (baa.getArm() == BrushOffAttackAction.BOTH) {
baa.setArm(BrushOffAttackAction.LEFT);
pr.aaa = baa;
resolveBrushOffAttack(pr, cen);
cen = baa.getEntityId();
baa.setArm(BrushOffAttackAction.RIGHT);
pr.aaa = baa;
resolveBrushOffAttack(pr, cen);
} else {
resolveBrushOffAttack(pr, cen);
cen = baa.getEntityId();
}
} else if (aaa instanceof ThrashAttackAction) {
resolveThrashAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof ProtomechPhysicalAttackAction) {
resolveProtoAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof ClubAttackAction) {
resolveClubAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof PushAttackAction) {
resolvePushAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof ChargeAttackAction) {
resolveChargeAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof DfaAttackAction) {
resolveDfaAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof LayExplosivesAttackAction) {
resolveLayExplosivesAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof TripAttackAction) {
resolveTripAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof JumpJetAttackAction) {
resolveJumpJetAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof GrappleAttackAction) {
resolveGrappleAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof BreakGrappleAttackAction) {
resolveBreakGrappleAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof RamAttackAction) {
resolveRamAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof TeleMissileAttackAction) {
resolveTeleMissileAttack(pr, cen);
cen = aaa.getEntityId();
} else if (aaa instanceof BAVibroClawAttackAction){
resolveBAVibroClawAttack(pr, cen);
cen = aaa.getEntityId();
} else {
// hmm, error.
}
// Not all targets are Entities.
Targetable target = game.getTarget(aaa.getTargetType(), aaa.getTargetId());
if (target instanceof Entity) {
creditKill((Entity) target, game.getEntity(cen));
}
}