for (Enumeration i = equipmentList.elements(); i.hasMoreElements();) { Mounted mounted = (Mounted)i.nextElement();
for (Mounted mounted : getEquipment()) {
    public int calculateBattleValue() {        // Was our battle value set at construction?        if ( myBV > 0 ) {            // Adjust BV for crew skills.            double pilotFactor = crew.getBVSkillMultiplier();            return (int)(pilotFactor * myBV);        }        double dbv = 0; // defensive battle value        double obv = 0; // offensive bv        // total armor points        dbv += getTotalArmor();        // total internal structure        dbv += getTotalInternal() / 2;        // add defensive equipment        double dEquipmentBV = 0;        for (Enumeration i = equipmentList.elements(); i.hasMoreElements();) {            Mounted mounted = (Mounted)i.nextElement();            EquipmentType etype = mounted.getType();            // don't count destroyed equipment            if (mounted.isDestroyed())                continue;            if ((etype instanceof WeaponType && etype.hasFlag(WeaponType.F_AMS))            || (etype instanceof AmmoType && ((AmmoType)etype).getAmmoType() == AmmoType.T_AMS)            || etype.hasFlag(MiscType.F_ECM)) {                dEquipmentBV += etype.getBV(this);            }        }        dbv += dEquipmentBV;        dbv +=weight;        // adjust for target movement modifier        int tmmRan = Compute.getTargetMovementModifier(getOriginalRunMP(), false, false, false).getValue();        if (tmmRan > 5) {            tmmRan = 5;        }        double[] tmmFactors = { 1.0, 1.1, 1.2, 1.3, 1.4, 1.5 };        dbv *= (tmmFactors[tmmRan]+.1);        double weaponBV = 0;        // figure out base weapon bv        double weaponsBVFront = 0;        double weaponsBVRear = 0;        for (Enumeration i = weaponList.elements(); i.hasMoreElements();) {            Mounted mounted = (Mounted)i.nextElement();            WeaponType wtype = (WeaponType)mounted.getType();            double dBV = wtype.getBV(this);            // don't count destroyed equipment            if (mounted.isDestroyed())                continue;            // don't count AMS, it's defensive            if (wtype.hasFlag(WeaponType.F_AMS)) {                continue;            }                weaponsBVFront += dBV;        }        if (weaponsBVFront > weaponsBVRear) {            weaponBV += weaponsBVFront;            weaponBV += (weaponsBVRear * 0.5);        } else {            weaponBV += weaponsBVRear;            weaponBV += (weaponsBVFront * 0.5);        }        // add ammo bv        double ammoBV = 0;        for (Enumeration i = ammoList.elements(); i.hasMoreElements();) {            Mounted mounted = (Mounted)i.nextElement();            AmmoType atype = (AmmoType)mounted.getType();            // don't count depleted ammo            if (mounted.getShotsLeft() == 0)                continue;            // don't count AMS, it's defensive            if (atype.getAmmoType() == AmmoType.T_AMS) {                continue;            }            ammoBV += atype.getBV(this);        }        weaponBV += ammoBV;        // adjust further for speed factor        double speedFactor = getOriginalRunMP() - 5;        speedFactor /= 10;        speedFactor++;        speedFactor = Math.pow(speedFactor, 1.2);        speedFactor = Math.round(speedFactor * 100) / 100.0;        obv = weaponBV * speedFactor;        // Possibly adjust for TAG and Arrow IV.        if (getsTagBVPenalty()) {            dbv += 200;        }        if (getsHomingBVPenalty()) {            dbv += 200;        }        // and then factor in pilot        double pilotFactor = crew.getBVSkillMultiplier();        return (int)Math.round((dbv + obv) * pilotFactor);    }