vDesc.addAll(applyCriticalHit(entity, 0, new CriticalSlot(0, 1), false));
vDesc.addAll(applyCriticalHit(entity, 0, new CriticalSlot(0, Tank.CRIT_CREW_STUNNED), false));
    public void applySecondaryNuclearEffects(Entity entity, Coords position, Vector vDesc) {        // If it's already destroyed, give up.  We really don't care.        if (entity.isDestroyed())            return;        // Check to see if the infantry is in a protective structure.        boolean inHardenedBuilding = (Compute.isInBuilding(game, entity) && (game.getBoard().getHex(entity.getPosition()).terrainLevel(Terrains.BUILDING) == 4));        // Roll 2d6.        int roll = Compute.d6(2);        Report r = new Report(6555);        r.subject = entity.getId();        r.add(entity.getDisplayName());        r.add(roll);        // If they are in protective structure, add 2 to the roll.        if (inHardenedBuilding) {            roll += 2;            r.add(" + 2 (unit is in hardened building)");        } else {            r.add("");        }        // Also, if the entity is "hardened" against EMI, it gets a +2.        // For these purposes, I'm going to hand this off to the Entity itself to tell us.        // Right now, it IS based purely on class, but I won't rule out the idea of        // "nuclear hardening" as equipment for a support vehicle, for example.        if (entity.isNuclearHardened()) {            roll += 2;            r.add(" + 2 (unit is hardened against EMI)");        } else {            r.add("");        }        r.indent(2);        vDesc.add(r);        // Now, compare it to the table, and apply the effects.        if (roll <= 4) {            // The unit is destroyed.            // Sucks, doesn't it?            // This applies to all units.            // Yup, just sucks.            vDesc.addAll(destroyEntity(entity, "nuclear explosion secondary effects", false, false));            // Kill the crew            entity.getCrew().setDoomed(true);        } else if (roll <= 6) {            if (entity instanceof BattleArmor) {                // It takes 50% casualties, rounded up.                BattleArmor myBA = (BattleArmor)entity;                int numDeaths = (int)(Math.ceil((myBA.getNumberActiverTroopers()))/2.0);                for (int x=0; x<numDeaths; x++)                    vDesc.addAll(applyCriticalHit(entity, 0, null, false));            } else if (entity instanceof Infantry) {                // Standard infantry are auto-killed in this band, unless they're in a building.                if (game.getBoard().getHex(entity.getPosition()).containsTerrain(Terrains.BUILDING)) {                    // 50% casualties, rounded up.                    int damage = (int)(Math.ceil((((Infantry)entity).getInternal(Infantry.LOC_INFANTRY))/2.0));                    HitData hit = entity.rollHitLocation(ToHitData.HIT_NORMAL, Compute.targetSideTable(position, entity));                    vDesc.addAll(damageEntity(entity, new HitData(Infantry.LOC_INFANTRY), damage, true));                } else {                    vDesc.addAll(destroyEntity(entity, "nuclear explosion secondary effects", false, false));                    entity.getCrew().setDoomed(true);                }            } else if (entity instanceof Tank) {                // All vehicles suffer two critical hits...                HitData hd = entity.rollHitLocation(ToHitData.HIT_NORMAL, entity.sideTable(position));                vDesc.addAll(oneCriticalEntity(entity, hd.getLocation()));                hd = entity.rollHitLocation(ToHitData.HIT_NORMAL, entity.sideTable(position));                vDesc.addAll(oneCriticalEntity(entity, hd.getLocation()));                // ...and a Crew Killed hit.                vDesc.addAll(applyCriticalHit(entity, 0, new CriticalSlot(0, 4), false));            } else if ((entity instanceof Mech) || (entity instanceof Protomech)) {                // 'Mechs suffer two critical hits...                HitData hd = entity.rollHitLocation(ToHitData.HIT_NORMAL, entity.sideTable(position));                vDesc.addAll(oneCriticalEntity(entity, hd.getLocation()));                hd = entity.rollHitLocation(ToHitData.HIT_NORMAL, entity.sideTable(position));                vDesc.addAll(oneCriticalEntity(entity, hd.getLocation()));                // and four pilot hits.                vDesc.addAll(damageCrew(entity, 4));            } else {                // Buildings and gun emplacements and such are only effected by the EMI.                // No auto-crits or anything.            }        } else if (roll <= 10) {            if (entity instanceof BattleArmor) {                // It takes 25% casualties, rounded up.                BattleArmor myBA = (BattleArmor)entity;                int numDeaths = (int)(Math.ceil(((myBA.getNumberActiverTroopers()))/4.0));                for (int x=0; x<numDeaths; x++)                    vDesc.addAll(applyCriticalHit(entity, 0, null, false));            } else if (entity instanceof Infantry) {                if (game.getBoard().getHex(entity.getPosition()).containsTerrain(Terrains.BUILDING)) {                    // 25% casualties, rounded up.                    int damage = (int)(Math.ceil((((Infantry)entity).getInternal(Infantry.LOC_INFANTRY))/4.0));                    HitData hit = entity.rollHitLocation(ToHitData.HIT_NORMAL, Compute.targetSideTable(position, entity));                    vDesc.addAll(damageEntity(entity, new HitData(Infantry.LOC_INFANTRY), damage, true));                } else {                    // 50% casualties, rounded up.                    int damage = (int)(Math.ceil((((Infantry)entity).getInternal(Infantry.LOC_INFANTRY))/2.0));                    HitData hit = entity.rollHitLocation(ToHitData.HIT_NORMAL, Compute.targetSideTable(position, entity));                    vDesc.addAll(damageEntity(entity, new HitData(Infantry.LOC_INFANTRY), damage, true));                }            } else if (entity instanceof Tank) {                // It takes one crit...                HitData hd = entity.rollHitLocation(ToHitData.HIT_NORMAL, entity.sideTable(position));                vDesc.addAll(oneCriticalEntity(entity, hd.getLocation()));                // Plus a Crew Stunned critical.                vDesc.addAll(applyCriticalHit(entity, 0, new CriticalSlot(0, 1), false));            } else if ((entity instanceof Mech) || (entity instanceof Protomech)) {                // 'Mechs suffer a critical hit...                HitData hd = entity.rollHitLocation(ToHitData.HIT_NORMAL, entity.sideTable(position));                vDesc.addAll(oneCriticalEntity(entity, hd.getLocation()));                // and two pilot hits.                vDesc.addAll(damageCrew(entity, 2));            } else {                // Buildings and gun emplacements and such are only effected by the EMI.                // No auto-crits or anything.            }        }        // If it's 11+, there are no secondary effects beyond EMI.        // Lucky bastards.        // And lastly, the unit is now affected by electromagnetic interference.        entity.setEMI(true);    }