fields.put("slots", eq.getCriticals(entity) * count); weaponList.add(fields);
} else { fields.put("location", loc); fields.put("slots", eq.getCriticals(entity) * count);
public boolean correctCriticals(StringBuffer buff) { Vector<Mounted> unallocated = new Vector<Mounted>(); boolean correct = true; for (Mounted mount : tank.getMisc()) { if (mount.getLocation() == Entity.LOC_NONE && !(mount.getType().getCriticals(tank) == 0)) { unallocated.add(mount); } } for (Mounted mount : tank.getWeaponList()) { if (mount.getLocation() == Entity.LOC_NONE) { unallocated.add(mount); } } for (Mounted mount : tank.getAmmo()) { int ammoType = ((AmmoType)mount.getType()).getAmmoType(); if ((mount.getLocation() == Entity.LOC_NONE) && (mount.getUsableShotsLeft() > 1 || ammoType == AmmoType.T_CRUISE_MISSILE )) { unallocated.add(mount); } } if (!unallocated.isEmpty()) { buff.append("Unallocated Equipment:\n"); for (Mounted mount : unallocated) { buff.append(mount.getType().getInternalName()).append("\n"); } correct = false; } return correct; }
continue; int nCrits = m.getType().getCriticals(entity); int eqNum = entity.getEquipmentNum(m); int hits = entity.getDamagedCriticals(CriticalSlot.TYPE_EQUIPMENT,
public void setStructureType(String strucType) { if (!(strucType.startsWith("Clan ") || strucType.startsWith("IS "))) { strucType = isClan() ? "Clan " + strucType : "IS " + strucType; } EquipmentType et = EquipmentType.get(strucType); setStructureType(EquipmentType.getStructureType(et)); if (et == null) { structureTechLevel = TechConstants.T_TECH_UNKNOWN; } else { structureTechLevel = et.getTechLevel(year); // TODO: Is this needed? WTF is the point of it? if (et.getCriticals(this) == 0) { try { this.addEquipment(et, LOC_NONE); } catch (LocationFullException e) { // can't happen e.printStackTrace(); } } } recalculateTechAdvancement(); }
public void setArmorType(String armType, int loc) { if (!(armType.startsWith("Clan ") || armType.startsWith("IS "))) { armType = TechConstants.isClan(getArmorTechLevel(0)) ? "Clan " + armType : "IS " + armType; } EquipmentType et = EquipmentType.get(armType); if (et == null) { setArmorType(EquipmentType.T_ARMOR_UNKNOWN, loc); } else { setArmorType(EquipmentType.getArmorType(et), loc); // TODO: Is this needed? WTF is the point of it? if (et.getCriticals(this) == 0) { try { this.addEquipment(et, LOC_NONE); } catch (LocationFullException e) { // can't happen e.printStackTrace(); } } } recalculateTechAdvancement(); }
criticals = calcMiscCrits((MiscType) et); } else { criticals = et.getCriticals(entity);
public void setArmorType(String armType) { if (!(armType.startsWith("Clan ") || armType.startsWith("IS "))) { armType = TechConstants.isClan(getArmorTechLevel(0)) ? "Clan " + armType : "IS " + armType; } EquipmentType et = EquipmentType.get(armType); if (et == null) { setArmorType(EquipmentType.T_ARMOR_UNKNOWN); } else { setArmorType(EquipmentType.getArmorType(et)); // TODO: Is this needed? WTF is the point of it? if (et.getCriticals(this) == 0) { try { this.addEquipment(et, LOC_NONE); } catch (LocationFullException e) { // can't happen e.printStackTrace(); } } } recalculateTechAdvancement(); }
nameWidth = name.length() + 1; row.put("slots", m.getType().getCriticals(ba)); if (m.getType() instanceof AmmoType) { row.put("mass", ((AmmoType) m.getType()).getKgPerShot() * m.getOriginalShots());
public void checkCriticalSlotsForEquipment(Entity entity, Vector<Mounted> unallocated, Vector<Serializable> allocation, Vector<Integer> heatSinks) { for (Mounted m : entity.getEquipment()) { if (m.getLocation() == Entity.LOC_NONE) { if ((m.getType() instanceof AmmoType) && (m.getUsableShotsLeft() <= 1)) { continue; } if ((entity instanceof Aero) && (m.getType().getCriticals(entity) == 0)) { continue; } if (!(m.getType() instanceof MiscType)) { unallocated.addElement(m); continue; } MiscType mt = (MiscType) m.getType(); if (!mt.hasFlag(MiscType.F_HEAT_SINK) && !mt.hasFlag(MiscType.F_DOUBLE_HEAT_SINK) && !mt.hasFlag(MiscType.F_IS_DOUBLE_HEAT_SINK_PROTOTYPE)) { unallocated.addElement(m); continue; } } } }
&& eq.hasFlag(MiscType.F_MECH_EQUIPMENT) && techManager.isLegal(eq) && (!isLam || (eq.getCriticals(null) == 0)) && (!industrialOnly || ((MiscType)eq).isIndustrial())) { retVal.add(eq); && eq2.hasFlag(MiscType.F_MECH_EQUIPMENT) && techManager.isLegal(eq2) && (!isLam || (eq2.getCriticals(null) == 0)) && (!industrialOnly || ((null != eq) && ((MiscType)eq).isIndustrial()))) { retVal.add(eq2);
if (ba.countWorkingMisc(MiscType.F_MASC) > boosterType.getCriticals(ba)) { buff.append("BattleArmor may only mount 1 " + "myomer booster!"); return false;
continue; if ((entity instanceof Mech) && (m.getType().getCriticals(entity) == 0)) { continue;
if (m.getFoundCrits() >= equipment.getCriticals(mech)) { vSplitWeapons.removeElement(m);
mountBv += ((MiscType) mount.getLinkedBy().getType()).getBV( this, mount); bv += mountBv * 0.05 * (mount.getType().getCriticals(this) + 1); } else if (mountBv > 0) { bv += mountBv * 0.05 * mount.getType().getCriticals(this); } else { bv += 5;
slots = BombType.getBombCost(type); } else { slots = mounted.getType().getCriticals(this);
final EquipmentType armor = EquipmentType.get(armorName); setModelData("armorType", armor.getName().replaceAll("^BA\\s+", "")); setModelData("armorSlots", armor.getCriticals(ba)); setModelData("armorMass", testBA.getWeightArmor() * 1000); setModelData("armorValue", ba.getOArmor(BattleArmor.LOC_TROOPER_1));
if ((m.getType().getCriticals(entity) == 0) && !((m.getType() instanceof InfantryWeapon) && !m.isAPMMounted())) {
numUsedCrits++; } else { numUsedCrits += m.getType().getCriticals(ba); newCrits = 1; } else { newCrits = newMount.getType().getCriticals(ba);
int reqSlots = mounted.getType().getCriticals(this); if (mounted.getType().isSpreadable() || mounted.isSplitable()) { reqSlots = 1;