@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 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); }
if (m.isSplit()) { hits += entity.getDamagedCriticals(CriticalSlot.TYPE_EQUIPMENT, eqNum, m.getSecondLocation());
if (mounted.isSplit()) { loc += "/" + entity.getLocationAbbr(mounted.getSecondLocation());
if (mounted.isSplit()) { wn.append('/'); wn.append(en.getLocationAbbr(mounted.getSecondLocation()));
if ((weapon.getLocation() == Mech.LOC_RARM) || (weapon.getSecondLocation() == Mech.LOC_RARM) || (weapon.getLocation() == Mech.LOC_LARM || (weapon.getSecondLocation() == Mech.LOC_LARM))) { int otherArm = (weapon.getLocation() == Mech.LOC_RARM || weapon.getSecondLocation() == Mech.LOC_RARM)? Mech.LOC_LARM : Mech.LOC_RARM; if ((weapon.getLocation() == Mech.LOC_RARM) || (weapon.getSecondLocation() == Mech.LOC_RARM) || (weapon.getLocation() == Mech.LOC_LARM) || (weapon.getSecondLocation() == Mech.LOC_LARM)) { if (l3ProneFiringArm == weapon.getLocation() || (weapon.getSecondLocation() != Entity.NONE && l3ProneFiringArm == weapon.getSecondLocation())) { return new ToHitData(TargetRoll.IMPOSSIBLE, "Prone and propping up with this arm."); || weapon.getSecondLocation() == Mech.LOC_RARM)? Mech.LOC_LARM : Mech.LOC_RARM;
@Override public void updateConditionFromEntity(boolean checkForDestruction) { if(null != unit) { int priorHits = hits; Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted) { if(mounted.isMissing()) { remove(false); return; } hits = unit.getEntity().getDamagedCriticals(CriticalSlot.TYPE_EQUIPMENT, equipmentNum, mounted.getLocation()); if(mounted.isSplit()) { hits += unit.getEntity().getDamagedCriticals(CriticalSlot.TYPE_EQUIPMENT, equipmentNum, mounted.getSecondLocation()); } omniPodded = mounted.isOmniPodMounted(); } if(checkForDestruction && hits > priorHits && Compute.d6(2) < campaign.getCampaignOptions().getDestroyPartTarget()) { remove(false); return; } } }
@Override public String checkFixable() { // The part is only fixable if the location is not destroyed. // be sure to check location and second location if(null != unit) { Mounted m = unit.getEntity().getEquipment(equipmentNum); if(null != m) { int loc = m.getLocation(); if(loc == -1) { } if (unit.isLocationBreached(loc)) { return unit.getEntity().getLocationName(loc) + " is breached."; } if (unit.isLocationDestroyed(loc)) { return unit.getEntity().getLocationName(loc) + " is destroyed."; } loc = m.getSecondLocation(); if(loc != Entity.LOC_NONE) { if (unit.isLocationBreached(loc)) { return unit.getEntity().getLocationName(loc) + " is breached."; } if (unit.isLocationDestroyed(loc)) { return unit.getEntity().getLocationName(loc) + " is destroyed."; } } } } return null; }
@Override public String checkFixable() { if(isSalvaging()) { return null; } // The part is only fixable if the location is not destroyed. // be sure to check location and second location if(null != unit) { Mounted m = unit.getEntity().getEquipment(equipmentNum); if(null != m) { int loc = m.getLocation(); if (unit.isLocationBreached(loc)) { return unit.getEntity().getLocationName(loc) + " is breached."; } if (unit.isLocationDestroyed(loc)) { return unit.getEntity().getLocationName(loc) + " is destroyed."; } loc = m.getSecondLocation(); if(loc != Entity.LOC_NONE) { if (unit.isLocationBreached(loc)) { return unit.getEntity().getLocationName(loc) + " is breached."; } if (unit.isLocationDestroyed(loc)) { return unit.getEntity().getLocationName(loc) + " is destroyed."; } } } } return null; }
return true; if(location != Entity.LOC_NONE && mounted.getSecondLocation() == location) { return true;
return true; if(mounted.getSecondLocation() == location) { return true;
if(m.isRepairable() && (m.getLocation() == loc || m.getSecondLocation() == loc)) { return "Repairable parts in " + unit.getEntity().getLocationName(loc) + " must be salvaged or scrapped first." + m.getName();
if (((mounted.getLocation() == loc) && mounted.getType() .isHittable()) || (mounted.isSplit() && (mounted.getSecondLocation() == loc))) { if (blownOff) { mounted.setMissing(true);
if(m.isRepairable() && (m.getLocation() == loc || m.getSecondLocation() == loc)) { return "Repairable parts in " + unit.getEntity().getLocationName(loc) + " must be salvaged or scrapped first." + m.getName();
if(m.getLocation() == loc || m.getSecondLocation() == loc) { m.setHit(true); m.setDestroyed(true);