if (type instanceof MiscType && ((MiscType)type).isShield() && m.curMode().equals(MiscType.S_ACTIVE_SHIELD)) {
if (type instanceof MiscType && ((MiscType)type).isShield()) {
    public int getCurrentDamageCapacity(Entity entity, int location){        //Shields can only be used in arms so if you've got a shield in a location        //other then an arm your SOL --Torren.        if ( location != Mech.LOC_RARM && location != Mech.LOC_LARM )            return 0;                int base = baseDamageCapacity;        for ( int slot = 0; slot < entity.getNumberOfCriticals(location); slot++){            CriticalSlot cs = entity.getCritical(location,slot);                        if ( cs == null )                continue;                        if ( cs.getType() != CriticalSlot.TYPE_EQUIPMENT )                continue;                        Mounted m = entity.getEquipment(cs.getIndex());            EquipmentType type = m.getType();            if (type instanceof MiscType && ((MiscType)type).isShield()                    && m.curMode().equals(MiscType.S_ACTIVE_SHIELD)) {                if ( cs.isDamaged() )                    base -= 5;            }        }                    return Math.max(0,base-damageTaken);    }