System.err.println( "MegaMek should perform an accidental DFA for " + entity.getShortName() + " to land on " + violation.getShortName() + " but it doesn't.  We're working on it." );
phaseReport.append(entity.getDisplayName() ).append( " falls " ).append( fallElevation ).append( " levels into hex " ).append( dest.getBoardNum() ).append( ", violating stacking with " ).append( violation.getDisplayName() ).append( ".\n");   ToHitData toHit = new ToHitData(7, "base"); toHit.append(Compute.getTargetMovementModifier(game, violation.getId())); toHit.append(Compute.getTargetTerrainModifier(game, violation));   final int diceRoll = Compute.d6(2); phaseReport.append("Collision occurs on a " ).append( toHit.getValue() ).append( " or greater.  Rolls " ).append( diceRoll); if (diceRoll >= toHit.getValue()) { phaseReport.append(", hits!\n");  int damage = Compute.getAffaDamageFor(entity); phaseReport.append(violation.getDisplayName() ).append( " takes " ).append( damage ).append( " from the collision."); while (damage > 0) { int cluster = Math.min(5, damage); HitData hit = violation.rollHitLocation(ToHitData.HIT_PUNCH, ToHitData.SIDE_FRONT); phaseReport.append(damageEntity(violation, hit, cluster)); damage -= cluster; } phaseReport.append("\n");    PilotingRollData pilotRoll = entity.getBasePilotingRoll(); pilotRoll.append(roll); doEntityFall(entity, dest, fallElevation, 3, pilotRoll); doEntityDisplacementMinefieldCheck(entity, src, dest);   Coords targetDest = Compute.getValidDisplacement(game, violation.getId(), dest, direction); if (targetDest != null) { doEntityDisplacement(violation, dest, targetDest, new PilotingRollData(violation.getId(), 2, "fallen on"));  entityUpdate( violation.getId() ); } else {    phaseReport.append(destroyEntity(violation, "impossible displacement", (violation instanceof Mech), (violation instanceof Mech))); } } else { phaseReport.append(", misses.\n");  Coords targetDest = Compute.getValidDisplacement(game, entity.getId(), dest, direction); if (targetDest != null) { doEntityDisplacement(entity, src, targetDest, new PilotingRollData(entity.getId(), PilotingRollData.IMPOSSIBLE, "pushed off a cliff"));  entityUpdate( entity.getId() ); } else {    phaseReport.append(destroyEntity(entity, "impossible displacement", (entity instanceof Mech), (entity instanceof Mech))); } } return;
    private void doEntityFallsInto(Entity entity, Coords src, Coords dest, PilotingRollData roll) {        final Hex srcHex = game.board.getHex(src);        final Hex destHex = game.board.getHex(dest);        final int fallElevation = Math.abs(destHex.floor() - srcHex.floor());        int direction = src.direction(dest);        // check entity in target hex        Entity violation = Compute.stackingViolation(game, entity.getId(), dest);        // check if we can fall in that hex        if (violation != null        && !Compute.isValidDisplacement(game, violation.getId(), src, dest)) {            // if target can't be displaced, fall in source hex.            // NOTE: source hex should never contain a non-displacable entity            Coords temp = dest;            dest = src;            src = temp;            violation = Compute.stackingViolation(game, entity.getId(), dest);        }        // falling mech falls        phaseReport.append(entity.getDisplayName() ).append( " falls "        ).append( fallElevation ).append( " level(s) into hex "        ).append( dest.getBoardNum() ).append( ".\n");        // if hex was empty, deal damage and we're done        if (violation == null) {            doEntityFall(entity, dest, fallElevation, roll);            return;        }        // hmmm... somebody there... problems.        if (fallElevation >= 2) {            // accidental death from above            // TODO : code me!!!            System.err.println( "MegaMek should perform an accidental DFA for "                                + entity.getShortName() +                                " to land on " + violation.getShortName()                                + " but it doesn't.  We're working on it." );        } else {            // damage as normal            doEntityFall(entity, dest, fallElevation, roll);            // target gets displaced            doEntityDisplacement(violation, dest, dest.translated(direction), new PilotingRollData(violation.getId(), 0, "domino effect"));            // Update the violating entity's postion on the client.            entityUpdate( violation.getId() );        }    }