if (roll > 12) { phaseReport.append("\nPilot of " + entity.getDisplayName() + " \"" + entity.crew.getName() + "\" cannot avoid damage.\n"); damageCrew(entity, 1);
if (roll.getValue() == PilotingRollData.IMPOSSIBLE) { phaseReport.append("\nPilot of " + entity.getDisplayName() + " \"" + entity.crew.getName() + "\" cannot avoid damage.\n"); phaseReport.append(damageCrew(entity, 1) + "\n");
    private void doEntityFall(Entity entity, Coords fallPos, int height,        int facing, int roll) {        // we don't need to deal damage yet, if the entity is doing DFA        if (entity.isMakingDfa()) {            phaseReport.append("But, since the 'mech is making a death from above attack, damage will be dealt during the physical phase.\n");            entity.setProne(true);            return;        }                    // facing after fall        String side;        int table;        switch(facing) {        case 1:        case 2:            side = "right side";            table = ToHitData.SIDE_RIGHT;            break;        case 3:            side = "rear";            table = ToHitData.SIDE_REAR;            break;        case 4:        case 5:            side = "left side";            table = ToHitData.SIDE_LEFT;            break;        case 0:        default:            side = "front";            table = ToHitData.SIDE_FRONT;        }        // calculate damage        int damage = (int)Math.round(entity.getWeight() / 10) * (height + 1);                // TODO: only fall to surface of water        if (game.board.getHex(fallPos).getTerrainType() == Terrain.WATER) {            damage = (int)Math.ceil(damage / 2.0);        }        // report falling        phaseReport.append("    " + entity.getDisplayName() + " falls on its " + side + ", suffering " + damage + " damage.");        // standard damage loop        while (damage > 0) {            int cluster = Math.min(5, damage);            HitData hit = entity.rollHitLocation(ToHitData.HIT_NORMAL, table);            phaseReport.append(damageEntity(entity, hit, cluster));            damage -= cluster;        }        // pilot damage?        if (roll != PilotingRollData.AUTOMATIC_FALL) {            roll += height;        }        if (roll > 12) {            phaseReport.append("\nPilot of " + entity.getDisplayName() + " \"" + entity.crew.getName() + "\" cannot avoid damage.\n");            damageCrew(entity, 1);        } else {            int diceRoll = Compute.d6(2);            phaseReport.append("\nPilot of " + entity.getDisplayName() + " \"" + entity.crew.getName() + "\" must roll " + roll + " to avoid damage; rolls " + diceRoll + " : " + (diceRoll >= roll ? "succeeds" : "fails") + ".\n");            if (diceRoll < roll) {                damageCrew(entity, 1);            }        }        entity.setProne(true);        entity.setPosition(fallPos);        entity.setFacing((entity.getFacing() + (facing - 1)) % 6);        entity.setSecondaryFacing(entity.getFacing());    }