if (critName.equalsIgnoreCase("Armored Cowl")) {
mech.setCowl(5); // Cowl starts with 5 points of armor
}
try {
EquipmentType etype = EquipmentType.get(critName);
if (etype != null) {
if (etype.isSpreadable()) {
// do we already have one of these? Key on Type
Mounted m = hSharedEquip.get(etype);
if (m != null) {
// use the existing one
mech.addCritical(loc, new CriticalSlot(
CriticalSlot.TYPE_EQUIPMENT, mech
.getEquipmentNum(m), etype
.isHittable(), isArmored, m));
continue;
}
m = mech.addEquipment(etype, loc, rearMounted);
m.setArmored(isArmored);
hSharedEquip.put(etype, m);
} else if ((etype instanceof WeaponType)
&& etype.hasFlag(WeaponType.F_SPLITABLE)) {
// do we already have this one in this or an outer
// location?
Mounted m = null;
boolean bFound = false;
for (int x = 0, n = vSplitWeapons.size(); x < n; x++) {
m = vSplitWeapons.elementAt(x);
int nLoc = m.getLocation();
if (((nLoc == loc) || (loc == Mech
.getInnerLocation(nLoc)))
&& (m.getType() == etype)) {
bFound = true;
break;
}
}
if (bFound && (m != null)) {
m.setFoundCrits(m.getFoundCrits() + 1);
if (m.getFoundCrits() >= etype.getCriticals(mech)) {
vSplitWeapons.removeElement(m);
}
// if we're in a new location, set the weapon as
// split
if (loc != m.getLocation()) {