int damageTaken = ChargeAttackAction.getChargeDamageTakenBy(ae, te);
int damageTaken = ChargeAttackAction.getChargeDamageTakenBy(ae, te, game.getOptions().booleanOption("maxtech_charge_damage"));
    private void resolveChargeDamage(Entity ae, Entity te, ToHitData toHit, int direction) {        // we hit...        int damage = ChargeAttackAction.getChargeDamageFor(ae);        int damageTaken = ChargeAttackAction.getChargeDamageTakenBy(ae, te);        PilotingRollData chargePSR = null;        // Is the target inside a building?        final boolean targetInBuilding = Compute.isInBuilding( game, te );        // Which building takes the damage?        Building bldg = game.board.getBuildingAt( te.getPosition() );        // The building shields all units from a certain amount of damage.        // The amount is based upon the building's CF at the phase's start.        int bldgAbsorbs = 0;        if ( targetInBuilding && bldg != null ) {            bldgAbsorbs = (int) Math.ceil( bldg.getPhaseCF() / 10.0 );        }        // If we're upright, we may fall down.        if ( !ae.isProne() ) {            chargePSR = new PilotingRollData(ae.getId(), 2, "charging");        }        phaseReport.append("hits.");        phaseReport.append("\n    Defender takes " ).append( damage ).append( " damage" ).append( toHit.getTableDesc() ).append( ".");        while (damage > 0) {            int cluster = Math.min(5, damage);            damage -= cluster;            if ( bldgAbsorbs > 0 ) {                int toBldg = Math.min( bldgAbsorbs, cluster );                cluster -= toBldg;                phaseReport.append( "\n  " )                    .append( damageBuilding( bldg, toBldg ) );            }            // A building may absorb the entire shot.            if ( cluster == 0 ) {                phaseReport.append( "\n  " )                    .append( te.getDisplayName() )                .append( " suffers no damage." );            } else {                HitData hit = te.rollHitLocation(toHit.getHitTable(), toHit.getSideTable());                phaseReport.append(damageEntity(te, hit, cluster));            }        }        phaseReport.append("\n    Attacker takes " ).append( damageTaken ).append( " damage.");        while (damageTaken > 0) {            int cluster = Math.min(5, damageTaken);            HitData hit = ae.rollHitLocation(ToHitData.HIT_NORMAL, ToHitData.SIDE_FRONT);            phaseReport.append(damageEntity(ae, hit, cluster));            damageTaken -= cluster;        }        // move attacker and target, if possible        Coords src = te.getPosition();        Coords dest = src.translated(direction);        if (Compute.isValidDisplacement(game, te.getId(), te.getPosition(), direction)) {            phaseReport.append("\n");            doEntityDisplacement(te, src, dest, new PilotingRollData(te.getId(), 2, "was charged"));            doEntityDisplacement(ae, ae.getPosition(), src, chargePSR);        } else {            if (game.getOptions().booleanOption("push_off_board") && !game.board.contains(dest)) {                game.removeEntity(te.getId(),                                  Entity.REMOVE_PUSHED);                send(createRemoveEntityPacket(te.getId(),                                              Entity.REMOVE_PUSHED));                phaseReport.append("\n*** " ).append( te.getDisplayName() ).append( " target has been forced from the field. ***\n");                // TODO: remove passengers and swarmers.                doEntityDisplacement(ae, ae.getPosition(), src, chargePSR);            } else {                // they stil have to roll                game.addPSR(new PilotingRollData(te.getId(), 2, "was charged"));                game.addPSR(chargePSR);            }        }        phaseReport.append("\n");    } // End private void resolveChargeDamage( Entity, Entity, ToHitData )