if (tagCount > 1) {
buff.append("Unit has more than one TAG\n");
illegal = true;
}
if (getEntity() instanceof Mech) {
Mech mech = (Mech)getEntity();
//TODO: disallow the weapons on quads, except unless it's one per
// side torso
for (int loc = Mech.LOC_RARM; loc <= Mech.LOC_LARM; loc++) {
if (mech.hasSystem(Mech.ACTUATOR_HAND, loc)) {
for (Mounted m : mech.getMisc()) {
EquipmentType et = m.getType();
if ((m.getLocation() == loc) &&
(et.hasSubType(MiscType.S_CHAINSAW)
|| et.hasSubType(MiscType.S_BACKHOE)
|| et.hasSubType(MiscType.S_DUAL_SAW)
|| et.hasSubType(MiscType.S_COMBINE)
|| et.hasSubType(MiscType.S_PILE_DRIVER)
|| et.hasSubType(MiscType.S_MINING_DRILL)
|| et.hasSubType(MiscType.S_ROCK_CUTTER)
|| et.hasSubType(MiscType.S_SPOT_WELDER)
|| et.hasSubType(MiscType.S_WRECKING_BALL)
|| et.hasFlag(MiscType.F_SALVAGE_ARM))) {
buff.append("Unit mounts hand-actuator incompatible system in arm with hand\n");
illegal = true;
}
}
}
}
if (mech.hasNullSig()) {
if (mech.hasStealth()) {
buff.append("Unit mounts both null-signature-system and stealth armor\n");
illegal = true;
}
if (mech.hasTargComp()) {
buff.append("Unit mounts both null-signature-system and targeting computer\n");
illegal = true;
}
if (mech.hasVoidSig()) {
buff.append("Unit mounts both null-signature-system and void-signature-system\n");
illegal = true;
}
if (mech.hasC3()) {
buff.append("Unit mounts both null-signature-system and a c3 system\n");
illegal = true;
}
}
if (mech.hasVoidSig()) {
if (mech.hasStealth()) {
buff.append("Unit mounts both void-signature-system and stealth armor\n");
illegal = true;
}
if (mech.hasTargComp()) {
buff.append("Unit mounts both void-signature-system and targeting computer\n");
illegal = true;
}
if (mech.hasC3()) {
buff.append("Unit mounts both void-signature-system and a c3 system\n");
illegal = true;
}
if (mech.hasChameleonShield()) {
buff.append("Unit mounts both void-signature-system and a chameleon light polarisation shield\n");
illegal = true;
}
}
if (mech.hasChameleonShield() && mech.hasStealth()) {
buff.append("Unit mounts both chameleon-light-polarization-system and stealth armor\n");
illegal = true;
}
if (mech.isIndustrial()) {
if (mech.hasTSM()) {
buff.append("industrial mech can't mount normal TSM");
illegal = true;
}
if (mech.hasMASC()) {
buff.append("industrial mech can't mount MASC");
illegal = true;
}
if ((mech.getCockpitType() == Mech.COCKPIT_INDUSTRIAL) || (mech.getCockpitType() == Mech.COCKPIT_PRIMITIVE_INDUSTRIAL)) {
if (mech.hasC3()) {
buff.append("industrial mech without advanced fire control can't use c3 computer");
illegal = true;
}
if (mech.hasTargComp()) {
buff.append("industrial mech without advanced fire control can't use targeting computer");
illegal = true;
}
if (mech.hasBAP()) {
buff.append("industrial mech without advanced fire control can't use BAP");
illegal = true;
}
for (Mounted mounted : mech.getMisc()) {
if (mounted.getType().hasFlag(MiscType.F_ARTEMIS)) {
buff.append("industrial mech without advanced fire control can't use artemis");
illegal = true;
}
}
if ((mech.getJumpType() != Mech.JUMP_STANDARD) && (mech.getJumpType() != Mech.JUMP_NONE)) {
buff.append("industrial mechs can only mount standard jump jets");
illegal = true;
}
if (mech.getGyroType() != Mech.GYRO_STANDARD) {
buff.append("industrial mechs can only mount standard gyros");
illegal = true;
}
}
} else {
if (mech.hasIndustrialTSM()) {
buff.append("standard mech can't mount industrial TSM");
illegal = true;
}
if (mech.hasEnvironmentalSealing()) {
buff.append("standard mech can't mount environmental sealing");
illegal = true;
}
}
if (mech.isPrimitive()) {
if (mech.isOmni()) {
buff.append("primitive mechs can't be omnis");
illegal = true;
}
if (!((mech.getStructureType() == EquipmentType.T_STRUCTURE_STANDARD) || (mech.getStructureType() == EquipmentType.T_STRUCTURE_INDUSTRIAL))) {
buff.append("primitive mechs can't mount advanced inner structure");
illegal = true;
}
if ((mech.getEngine().getEngineType() == Engine.XL_ENGINE) ||
(mech.getEngine().getEngineType() == Engine.LIGHT_ENGINE) ||
(mech.getEngine().getEngineType() == Engine.COMPACT_ENGINE) ||
mech.getEngine().hasFlag(Engine.LARGE_ENGINE) ||
(mech.getEngine().getEngineType() == Engine.XXL_ENGINE)) {
buff.append("primitive mechs can't mount XL, Light, Compact, XXL or Large Engines");
illegal = true;
}
if (mech.hasMASC() || mech.hasTSM()) {
buff.append("primitive mechs can't mount advanced myomers");
illegal = true;
}
if (mech.isIndustrial()) {
if (mech.getArmorType() != EquipmentType.T_ARMOR_COMMERCIAL) {
buff.append("primitive industrialmechs must mount commercial armor");
illegal = true;
}
} else {
if (mech.getArmorType() != EquipmentType.T_ARMOR_INDUSTRIAL) {
buff.append("primitive battlemechs must mount primitive battlemech (industrial) armor");
illegal = true;
}
}
}