phaseReport.append("; needs " + toHit.getValue() + ", "); phaseReport.append("rolls " + roll + " : ");
phaseReport.append("; needs " ).append( toHit.getValue() ).append( ", "); phaseReport.append("rolls " ).append( roll ).append( " : ");
    private void resolveChargeAttack(ChargeAttackAction caa, int lastEntityId) {        final Entity ae = game.getEntity(caa.getEntityId());        final Entity te = game.getEntity(caa.getTargetId());                // is the attacker dead?  because that sure messes up the calculations        if (ae == null) {            return;        }                final int direction = ae.getFacing();                // entity isn't charging any more        ae.setDisplacementAttack(null);                if (lastEntityId != caa.getEntityId()) {            phaseReport.append("\nPhysical attacks for " + ae.getDisplayName() + "\n");        }                // should we even bother?        if (te == null || te.isDestroyed() || te.isDoomed() || te.crew.isDead()) {            phaseReport.append("    Charge cancelled as the target has been destroyed.\n");            return;        }                // attacker fell down?        if (ae.isProne()) {            phaseReport.append("    Charge cancelled as the attacker has fallen.\n");            return;        }                // attacker immobile?        if (ae.isImmobile()) {            phaseReport.append("    Charge cancelled as the attacker has been immobilized.\n");            return;        }                phaseReport.append("    Charging " + te.getDisplayName());                // target still in the same position?        if (!te.getPosition().equals(caa.getTargetPos())) {            phaseReport.append(" but the target has moved.\n");            return;        }                // compute to-hit        ToHitData toHit = Compute.toHitCharge(game, caa);                // if the attacker's prone, fudge the roll        int roll;        if (toHit.getValue() == ToHitData.IMPOSSIBLE) {            roll = -12;            phaseReport.append(", but the charge is impossible (" + toHit.getDesc() + ") : ");        } else {            // roll            roll = Compute.d6(2);            phaseReport.append("; needs " + toHit.getValue() + ", ");            phaseReport.append("rolls " + roll + " : ");        }                // do we hit?        if (roll < toHit.getValue()) {            Coords src = ae.getPosition();            Coords dest = Compute.getMissedChargeDisplacement(game, ae.getId(), src, direction);            phaseReport.append("misses.\n");            // move attacker to side hex            doEntityDisplacement(ae, src, dest, null);        }	else {	    // Resolve the damage.	    resolveChargeDamage( ae, te, toHit, direction );	}	return;    }