desc.append( "\n*** " ) .append( en.getDisplayName() ) .append( " PILOT KILLED! ***" );
desc.append( "\n" ) .append( destroyEntity(en, "pilot death", true) );
    private String criticalEntity(Entity en, int loc, int critMod) {        CriticalSlot slot = null;        StringBuffer desc = new StringBuffer();        Hex h = game.board.getHex(en.getPosition());        desc.append( "        Critical hit on " )            .append( en.getLocationAbbr(loc) )            .append( ". " );        int hits = 0;        int roll = Compute.d6(2);        desc.append( "Roll = " );        if ( critMod != 0 ) {            desc.append( "(" ).append( roll );            if ( critMod > 0 ) {                desc.append( "+" );            }            desc.append( critMod ).append( ") = " );            roll += critMod;        }        desc.append( roll ).append( ";" );        if (roll <= 7) {            desc.append( " no effect." );            return desc.toString();        } else if (roll >= 8 && roll <= 9) {            hits = 1;            desc.append( " 1 location." );        } else if (roll >= 10 && roll <= 11) {            hits = 2;            desc.append( " 2 locations." );        } else if (roll == 12) {            if (en instanceof Tank) {                hits = 3;                desc.append( " 3 locations." );            } else if (en instanceof Protomech) {            	hits=3;            	desc.append( " 3 locations" );            } else if (en.locationIsLeg(loc)) {                desc.append( "<<<LIMB BLOWN OFF>>> " )                    .append( en.getLocationName(loc) )                    .append( " blown off." );                if (en.getInternal(loc) > 0) {                    destroyLocation(en, loc);                }                if (!h.contains( Terrain.LEGS)) {                    h.addTerrain(new Terrain(Terrain.LEGS, 1));                }                else h.addTerrain(new Terrain(Terrain.LEGS, h.levelOf(Terrain.LEGS)+1));                sendChangedHex(en.getPosition());                return desc.toString();            } else if (loc == Mech.LOC_RARM || loc == Mech.LOC_LARM) {                desc.append( "<<<LIMB BLOWN OFF>>> " )                    .append( en.getLocationName(loc) )                    .append( " blown off." );                destroyLocation(en, loc);                if (!h.contains( Terrain.ARMS)) {                   h.addTerrain(new Terrain(Terrain.ARMS, 1));                }                else h.addTerrain(new Terrain(Terrain.ARMS, h.levelOf(Terrain.ARMS)+1));                sendChangedHex(en.getPosition());                return desc.toString();            } else if (loc == Mech.LOC_HEAD) {                desc.append( "<<<HEAD BLOWN OFF>>> " )                    .append( en.getLocationName(loc) )                    .append( " blown off." );                destroyLocation(en, loc);                // Don't kill a pilot multiple times.                if ( Pilot.DEATH > en.getCrew().getHits() ) {                    en.crew.setDoomed(true);                    desc.append( "\n*** " )                        .append( en.getDisplayName() )                        .append( " PILOT KILLED! ***" );                }                return desc.toString();            } else {                // torso hit                hits = 3;                desc.append( " 3 locations." );            }        }        // vehicle handle crits in their own 'special' way        if (en instanceof Tank) {            Tank tank = (Tank)en;            for (int x = 0; x < hits && !tank.isDoomed(); x++) {                slot = new CriticalSlot( CriticalSlot.TYPE_SYSTEM,                                         Compute.d6(1) );                desc.append( applyCriticalHit(en, Entity.NONE, slot, true) );            }        }        else {            // transfer criticals, if needed            while (hits > 0 && en.canTransferCriticals(loc)                   && en.getTransferLocation(loc) != Entity.LOC_DESTROYED) {                loc = en.getTransferLocation(loc);                desc.append( "\n            Location is empty, " )                    .append( "so criticals transfer to " )                    .append( en.getLocationAbbr(loc) )                    .append( "." );            }            // Roll critical hits in this location.            while (hits > 0) {                // Have we hit all available slots in this location?                if (en.getHittableCriticals(loc) <= 0) {                    desc.append( "\n            Location has no more " )                        .append( "hittable critical slots." );                    break;                }                // Randomly pick a slot to be hit.                int slotIndex = Compute.randomInt                    ( en.getNumberOfCriticals(loc) );                slot = en.getCritical(loc, slotIndex);                // Ignore empty or unhitable slots (this                // includes all previously hit slots).                if (slot != null && slot.isHittable()) {                    desc.append( applyCriticalHit(en, loc, slot, true) );                    hits--;                }            } // Hit another slot in this location.        }        return desc.toString();    }