/** * Returns true if this weapon fires into the secondary facing arc. If * false, assume it fires into the primary. */ @Override public boolean isSecondaryArcWeapon(int weaponId) { if (getEquipment(weaponId).getLocation() == getLocTurret()) { return true; } return false; }
@Override protected int implicitClanCASE() { if (!isClan()) { return 0; } int explicit = 0; Set<Integer> caseLocations = new HashSet<>(); for (Mounted m : getEquipment()) { if ((m.getType() instanceof MiscType) && (m.getType().hasFlag(MiscType.F_CASE))) { explicit++; } else if (m.getType().isExplosive(m)) { caseLocations.add(m.getLocation()); if (m.getSecondLocation() >= 0) { caseLocations.add(m.getSecondLocation()); } } } return Math.max(0, caseLocations.size() - explicit); }
@Override public boolean doomedInVacuum() { for (Mounted m : getEquipment()) { if ((m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_VACUUM_PROTECTION)) { return false; } if ((m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_ENVIRONMENTAL_SEALING)) { return false; } } return true; }
for (Mounted mounted : getEquipment()) { if ((mounted.getType() instanceof MiscType) && mounted.getType().hasFlag(MiscType.F_MODULAR_ARMOR) for (Mounted mounted : getEquipment()) { EquipmentType etype = mounted.getType();
specialAbilities.put(BattleForceSPA.SRCH, null); for (Mounted m : getEquipment()) { if (m.getType().hasFlag(MiscType.F_ADVANCED_FIRECONTROL)) { specialAbilities.put(BattleForceSPA.AFC, null);
for (Mounted mount : tank.getEquipment()) { if ((mount.getType() instanceof MiscType) && mount.getType().hasFlag(MiscType.F_CARGO)) {
/** * Checks if a mech has an armed MASC system. Note that the mech will have * to exceed its normal run to actually engage the MASC system */ public boolean hasArmedMASC() { for (Mounted m : getEquipment()) { if (!m.isDestroyed() && !m.isBreached() && (m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_MASC) && (m.curMode().equals("Armed") || m.getType().hasSubType( MiscType.S_JETBOOSTER))) { return true; } } return false; }
for (Mounted m : tank.getEquipment()) { if (m.getLocation() == VTOL.LOC_ROTOR) { buff.append("rotor equipment must be placed in mast mount");
public double getTankWeightDualTurret() { double weight = 0; // For omni vees, the base chassis sets a turret weight if (tank.isOmni() && tank.getBaseChassisTurret2Weight() >= 0) { weight = tank.getBaseChassisTurret2Weight(); } else { // For non-omnis, count up the weight of eq in the turret for (Mounted m : tank.getEquipment()) { if ((m.getLocation() == tank.getLocTurret2()) && !(m.getType() instanceof AmmoType)) { weight += m.getType().getTonnage(tank); } } // Turrets weight 10% of the weight of weapons in them weight = weight / 10.0f; } return TestEntity.ceilMaxHalf(weight, getWeightCeilingTurret()); }
public double getTankWeightTurret() { double weight = 0; // For omni vees, the base chassis sets a turret weight if (tank.isOmni() && tank.getBaseChassisTurretWeight() >= 0) { weight = tank.getBaseChassisTurretWeight(); } else { // For non-omnis, count up the weight of eq in the turret for (Mounted m : tank.getEquipment()) { if ((m.getLocation() == tank.getLocTurret()) && !(m.getType() instanceof AmmoType)) { weight += m.getType().getTonnage(tank); } } // Turrets weight 10% of the weight of weapons in them weight = weight / 10.0f; } if (tank.isSupportVehicle()) { if (getEntity().getWeight() < 5) { return TestEntity.ceil(weight, Ceil.KILO); } else { return TestEntity.ceil(weight, Ceil.HALFTON); } } else { return TestEntity.ceilMaxHalf(weight, getWeightCeilingTurret()); } }
int usedSlots = 0; boolean addedCargo = false; for (Mounted mount : this.getEquipment()) { if ((mount.getType() instanceof MiscType) && mount.getType().hasFlag(MiscType.F_CARGO)) {
for (Mounted m : tank.getEquipment()) { if ((m.getLocation() == tank.getLocTurret2()) && !(m.getType() instanceof AmmoType)) {
final Mounted mounted = getEquipment(wn);