}
if (critName.equalsIgnoreCase("Armored Cowl")) {
mech.setCowl(5);
}
if (critName.indexOf("Engine") != -1) {
mech.setCritical(loc, i, new CriticalSlot(
CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE));
continue;
}
if (critName.indexOf("Gyro") != -1) {
mech.setCritical(loc, i, new CriticalSlot(
CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_GYRO));
continue;
}
if (critName.indexOf("Life Support") != -1) {
mech.setCritical(loc, i, new CriticalSlot(
CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_LIFE_SUPPORT));
continue;
}
if (critName.indexOf("Sensors") != -1) {
mech.setCritical(loc, i, new CriticalSlot(
CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_SENSORS));
continue;
}
if (critName.indexOf("Cockpit") != -1) {
mech.setCritical(loc, i, new CriticalSlot(
CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_COCKPIT));
continue;
}
if (critName.endsWith("[LRM]") || critName.endsWith("[SRM]")) {
// This is a lame kludge for The Drawing Board, which
// identifies which type of missle weapon an
// Artemis IV system goes with.
critName = critName.substring(0, 14);
}
if (critName.endsWith("- Artemis IV")) {
// Ugh, another lame kludge to allow for loading of
// The Drawing Board's specially marked Artemis IV
// missle ammo. The only real game difference is
// c-bill cost, which we don't care about anyway.
critName = critName.substring(0, critName
.indexOf(" - Artemis IV"));
}
if (critName.endsWith("- Narc")) {
// Yet another lame kludge to allow for loading of
// The Drawing Board's specially marked Narc
// missle ammo.
critName = critName.substring(0, critName.indexOf(" - Narc"));
}
if (critName.equals("(C) Endosteel")) {
// MegaMek determines whether Endo Steel is IS or Clan
// type by techbase of mech.
critName = critName.substring(4);
}
if (critName.equals("(C) Ferro-Fibrous Armor")) {
// MegaMek determines whether FF Armor is IS or Clan
// type by techbase of mech.
critName = critName.substring(4);
}
try {
String hashPrefix;
if (critName.startsWith("(C)")) {
// equipment specifically marked as clan
hashPrefix = "Clan ";
critName = critName.substring(4);
} else if (critName.startsWith("(IS)")) {
// equipment specifically marked as inner sphere
hashPrefix = "IS ";
critName = critName.substring(5);
} else if (mech.isClan()) {
// assume equipment is clan because mech is clan
hashPrefix = "Clan ";
} else {
// assume equipment is inner sphere
hashPrefix = "IS ";
}
EquipmentType etype = EquipmentType.get(hashPrefix + critName);
if (etype == null) {
// try without prefix
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(), m));
continue;
}