phaseReport.append("\n").append(entity.getDisplayName())
desc.append("\n").append(entity.getDisplayName())
    public void ejectEntity(Entity entity, boolean autoEject) {        // An entity can only eject it's crew once.        if (entity.getCrew().isEjected())             return;        // Mek pilots may get hurt during ejection,        // and run around the board afterwards.        if (entity instanceof Mech) {            PilotingRollData rollTarget = new PilotingRollData(entity.getId(), entity.getCrew().getPiloting(), "ejecting");            if (entity.isProne()) {                rollTarget.addModifier(5, "Mech is prone");            }            if (entity.getCrew().isUnconscious()) {                rollTarget.addModifier(3, "pilot unconscious");            }            if (autoEject) {                rollTarget.addModifier(1, "automatic ejection");            }            if (entity.getInternal(Mech.LOC_HEAD) < 3) {                rollTarget.addModifier(Math.min(3 - entity.getInternal(Mech.LOC_HEAD),2), "Head Internal Structure Damage");             }            int facing = entity.getFacing();            Coords targetCoords = entity.getPosition().translated((facing + 3)%6);            Hex targetHex = game.board.getHex(targetCoords);            if (targetHex != null) {                if (targetHex.levelOf(Terrain.WATER) > 0) {                    rollTarget.addModifier(-1, "landing in water");                } else if (targetHex.levelOf(Terrain.ROUGH) > 0) {                    rollTarget.addModifier(0, "landing in rough");                } else if (targetHex.levelOf(Terrain.RUBBLE) > 0) {                    rollTarget.addModifier(0, "landing in rubble");                } else if (targetHex.levelOf(Terrain.WOODS) == 1) {                    rollTarget.addModifier(2, "landing in light woods");                } else if (targetHex.levelOf(Terrain.WOODS) == 2) {                    rollTarget.addModifier(3, "landing in heavy woods");                } else if (targetHex.levelOf(Terrain.BLDG_ELEV) > 0) {                    rollTarget.addModifier(targetHex.levelOf(Terrain.BLDG_ELEV), "landing in a building");                } else rollTarget.addModifier(-2, "landing in clear terrain");            } else {                    rollTarget.addModifier(-2, "landing off the board");            }            if (autoEject) {                phaseReport.append("\n").append(entity.getDisplayName())                    .append(" suffers an ammunition explosion, but the autoeject system was engaged.");                 }            // okay, print the info            phaseReport.append("\n" ).append( entity.getDisplayName() )                .append( " must make a piloting skill check (" )                .append( rollTarget.getLastPlainDesc() ).append( ")" ).append( ".\n");            // roll            final int diceRoll = Compute.d6(2);            phaseReport.append("Needs " ).append( rollTarget.getValueAsString()            ).append( " [" ).append( rollTarget.getDesc() ).append( "]"            ).append( ", rolls " ).append( diceRoll ).append( " : ");            if (diceRoll < rollTarget.getValue()) {                phaseReport.append("fails.\n");                phaseReport.append(damageCrew(entity, 1));                if (resolveCrewDamage(entity, false)) {                    phaseReport.append("\n");                }            } else {                phaseReport.append("succeeds.\n");            }            // ASSUMPTION: Pilot dies if he ejects unconsciously, BMRr does not            // specify either way.            if (entity.getCrew().isDoomed()                || entity.getCrew().isUnconscious()) {                phaseReport.append("but the pilot does not survive!\n");            }            else {                // Add the pilot as an infantry unit on the battlefield.                MechWarrior pilot = new MechWarrior(entity);                pilot.setDeployed(true);                if ( Entity.NONE == pilot.getId() ) {                    pilot.setId(getFreeEntityId());                }                game.addEntity(pilot.getId(), pilot);                send(createAddEntityPacket(pilot.getId()));                if (game.board.contains(targetCoords)) {                    pilot.setPosition(targetCoords);                    /* Can pilots eject into water???   ASSUMPTION : They can (because they get a -1 mod to the PSR.                    // Did the pilot land in water?                    if ( game.board.getHex( targetCoords).levelOf                         ( Terrain.WATER ) > 0 ) {                        phaseReport.append("and the pilot ejects, but lands in water!!!\n");                        destroyEntity( pilot, "a watery grave", false );                    } else {                        phaseReport.append("and the pilot ejects safely!\n");                    }*/                    phaseReport.append("and the pilot ejects safely!\n");                    doEntityDisplacementMinefieldCheck( pilot,                                                        entity.getPosition(),                                                        targetCoords );                } else {                    phaseReport.append("and the pilot ejects safely and lands far from the battle!");                    game.removeEntity( pilot.getId(), Entity.REMOVE_IN_RETREAT );                    send(createRemoveEntityPacket(pilot.getId(), Entity.REMOVE_IN_RETREAT) );                                  }            } // Pilot safely ejects.        } // End entity-is-Mek        // Mark the entity's crew as "ejected".        entity.getCrew().setEjected( true );        destroyEntity(entity, "ejection", true, true);                // only remove the unit that ejected in the movement phase        if (game.getPhase() == Game.PHASE_MOVEMENT) {            game.removeEntity( entity.getId(), Entity.REMOVE_EJECTED );            send(createRemoveEntityPacket(entity.getId(), Entity.REMOVE_EJECTED));        }    }