return desc;
return desc.toString();
    private String criticalEntity(Entity en, int loc) {        String desc = "        Critical hit on " + en.getLocationAbbr(loc) + ". ";        int hits = 0;        int roll = Compute.d6(2);        desc += "Roll = " + roll + ";";        if (roll <= 7) {            desc += " no effect.";            return desc;        } else if (roll >= 8 && roll <= 9) {            hits = 1;            desc += " 1 location.";        } else if (roll >= 10 && roll <= 11) {            hits = 2;            desc += " 2 locations.";        } else if (roll == 12) {            if (en instanceof Tank) {                hits = 3;                desc += " 3 locations.";            } else if (en.locationIsLeg(loc)) {                desc += "<<<LIMB BLOWN OFF>>> " + en.getLocationName(loc) + " blown off.";                if (en.getInternal(loc) > 0) {                    destroyLocation(en, loc);                }                return desc;            } else if (loc == Mech.LOC_RARM || loc == Mech.LOC_LARM) {                desc += "<<<LIMB BLOWN OFF>>> " + en.getLocationName(loc) + " blown off.";                destroyLocation(en, loc);                return desc;            } else if (loc == Mech.LOC_HEAD) {                desc += "<<<HEAD BLOWN OFF>>> " + en.getLocationName(loc) + " blown off.";                destroyLocation(en, loc);                en.crew.setDoomed(true);                desc += "\n*** " + en.getDisplayName() + " PILOT KILLED! ***";                return desc;            } else {                // torso hit                hits = 3;                desc += " 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++) {                switch (Compute.d6(1)) {                    case 1 :                        desc += "\n            <<<CRITICAL HIT>>> Crew stunned for 3 turns";                        // Carried units can't unload from a stunned transport.                        // Units that escape a transport don't need to un-stun.                        tank.stunCrew();                        break;                    case 2 :                        // this one's ridiculous.  the 'main weapon' jams.                        Mounted mWeap = tank.getMainWeapon();                        if (mWeap == null) {                            desc += "\n            No main weapon crit, because no main weapon!";                        }                        else {                            desc += "\n            <<<CRITICAL HIT>>> " + mWeap.getName() +                            " jams for 1 turn.";                            tank.setJammedWeapon(mWeap);                        }                        break;                    case 3 :                        desc += "\n            <<<CRITICAL HIT>>> Engine destroyed.  Immobile.";                        tank.immobilize();                        // Does the hovercraft sink?                        Hex te_hex = game.board.getHex( en.getPosition() );                        if ( en.getMovementType() == Entity.MovementType.HOVER &&                             te_hex.levelOf(Terrain.WATER) > 0 ) {                            desc += destroyEntity(en, "a watery grave", false);                        }                        break;                    case 4 :                        desc += "\n            <<<CRITICAL HIT>>> Crew killed";                        desc += destroyEntity(en, "crew death", true);                        en.getCrew().setDoomed(true);                        break;                    case 5 :                        desc += "\n            <<<CRITICAL HIT>>> Fuel Tank / Engine Shielding Hit (Vehicle Explodes)";                        desc += destroyEntity(en, "fuel tank explosion", false, false);                        en.getCrew().setDoomed(true);                       break;                    case 6 :                        desc += "\n            <<<CRITICAL HIT>>> Power plant hit.  BOOM!";                        desc += destroyEntity(en, "power plant destruction", false, false);                        en.getCrew().setDoomed(true);                        break;                }            }        }        else {            // transfer criticals, if needed            while (hits > 0 && en.canTransferCriticals(loc)            && en.getTransferLocation(loc) != Entity.LOC_DESTROYED) {                loc = en.getTransferLocation(loc);                desc += "\n            Location is empty, so criticals transfer to " + en.getLocationAbbr(loc) +".";            }            // roll criticals            while (hits > 0) {                if (en.getHittableCriticals(loc) <= 0) {                    desc += "\n            Location has no more hittable critical slots.";                    break;                }                int slot = Compute.randomInt(en.getNumberOfCriticals(loc));                CriticalSlot cs = en.getCritical(loc, slot);                if (cs == null || !cs.isHittable()) {                    continue;                }                cs.setHit(true);                switch(cs.getType()) {                    case CriticalSlot.TYPE_SYSTEM :                        desc += "\n            <<<CRITICAL HIT>>> on " + Mech.systemNames[cs.getIndex()] + ".";                        switch(cs.getIndex()) {                            case Mech.SYSTEM_COCKPIT :                                // boink!                                en.crew.setDoomed(true);                                desc += "\n*** " + en.getDisplayName() + " PILOT KILLED! ***";                                break;                            case Mech.SYSTEM_ENGINE :                                en.engineHitsThisRound++;                                                                boolean engineExploded = false;                                StringBuffer descBuffer = new StringBuffer();                                                                if ( en.engineHitsThisRound >= 2 ) {                                  engineExploded = checkEngineExplosion(en, descBuffer);                                }                                                                desc += descBuffer.toString();                                if ( !engineExploded ) {                                  int numEngineHits = 0;                                  numEngineHits += en.getHitCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE, Mech.LOC_CT);                                  numEngineHits += en.getHitCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE, Mech.LOC_RT);                                  numEngineHits += en.getHitCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE, Mech.LOC_LT);                                    if ( numEngineHits > 2 ) {                                      // third engine hit                                      desc += destroyEntity(en, "engine destruction");                                  }                                }                                break;                            case Mech.SYSTEM_GYRO :                                if (en.getHitCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_GYRO, loc) > 1) {                                    // gyro destroyed                                    game.addPSR(new PilotingRollData(en.getId(), PilotingRollData.AUTOMATIC_FAIL, 3, "gyro destroyed"));                                } else {                                    // first gyro hit                                    game.addPSR(new PilotingRollData(en.getId(), 3, "gyro hit"));                                }                                break;                            case Mech.ACTUATOR_UPPER_LEG :                            case Mech.ACTUATOR_LOWER_LEG :                            case Mech.ACTUATOR_FOOT :                                // leg/foot actuator piloting roll                                game.addPSR(new PilotingRollData(en.getId(), 1, "leg/foot actuator hit"));                                break;                            case Mech.ACTUATOR_HIP :                                // hip piloting roll                                game.addPSR(new PilotingRollData(en.getId(), 2, "hip actuator hit"));                                break;                        }                        break;                    case CriticalSlot.TYPE_EQUIPMENT :                        Mounted mounted = en.getEquipment(cs.getIndex());                        EquipmentType eqType = mounted.getType();                        boolean hitBefore = mounted.isHit();                        desc += "\n            <<<CRITICAL HIT>>> on " + mounted.getDesc() + ".";                        mounted.setHit(true);                        // If the item is the ECM suite of a Mek Stealth system                        // then it's destruction turns off the stealth.                        if ( !hitBefore && eqType instanceof MiscType &&                             eqType.hasFlag(MiscType.F_ECM) &&                             mounted.getLinkedBy() != null ) {                            Mounted stealth = mounted.getLinkedBy();                            desc += "\n       " + stealth.getType().getName() +                               " will stop functioning at end of turn.";                            stealth.setMode( "Off" );                        }                        // Handle equipment explosions.                        if (eqType.isExplosive() && !hitBefore) {                            desc += explodeEquipment(en, loc, slot);                        }                        break;                }                hits--;            }        }                return desc;    }