/** * Count the number of destroyed or breached legs on the mech */ public int countBadLegs() { int badLegs = 0; for (int i = 0; i < locations(); i++) { badLegs += (locationIsLeg(i) && isLocationBad(i)) ? 1 : 0; } return badLegs; }
/** * Return true is the location is a leg and has a hip crit */ public boolean legHasHipCrit(int loc) { if (isLocationBad(loc)) { return false; } if (locationIsLeg(loc)) { return (getGoodCriticals(CriticalSlot.TYPE_SYSTEM, Mech.ACTUATOR_HIP, loc) == 0); } return false; }
/** * Count non-hip leg actuator crits */ public int countLegActuatorCrits(int loc) { if (isLocationBad(loc)) { return 0; } int legCrits = 0; if (locationIsLeg(loc)) { if (getGoodCriticals(CriticalSlot.TYPE_SYSTEM, Mech.ACTUATOR_UPPER_LEG, loc) == 0) { legCrits++; } if (getGoodCriticals(CriticalSlot.TYPE_SYSTEM, Mech.ACTUATOR_LOWER_LEG, loc) == 0) { legCrits++; } if (getGoodCriticals(CriticalSlot.TYPE_SYSTEM, Mech.ACTUATOR_FOOT, loc) == 0) { legCrits++; } } return legCrits; }
@Override public boolean canEscape() { int hipHits = 0; int legsDestroyed = 0; for (int i = 0; i < locations(); i++) { if (locationIsLeg(i)) { if (!isLocationBad(i)) { if (legHasHipCrit(i)) { hipHits++; } } else { legsDestroyed++; } } } //there is room for debate here but I think most people would agree that a //legged biped mech (and a double legged quad mech) or a hipped mech are not //escapable, although technically they still have as much MP as foot infantry which //can escape. We could also consider creating options to control this. if(((this instanceof BipedMech) && (legsDestroyed > 0)) || (legsDestroyed > 1) || (hipHits > 0)) { return false; } return super.canEscape(); }
@Override public void destroyLocation(int loc, boolean blownOff) { // If it's already destroyed, don't bother -- as of 12/06/28, super. // destroyLocation() will just return having done nothing itself and // then we'd potentially end up with a second PSR for an // already-destroyed // leg. if (getInternal(loc) < 0) { return; } super.destroyLocation(loc, blownOff); // if it's a leg, the entity falls if (locationIsLeg(loc) && canFall()) { game.addPSR(new PilotingRollData(getId(), TargetRoll.AUTOMATIC_FAIL, 5, "leg destroyed")); } }
&& m.getLocation() != Mech.LOC_RT && m.getLocation() != Mech.LOC_LT && !mech.locationIsLeg(m.getLocation())) { buff.append("Jump jet must be mounted in leg or torso\n"); illegal = true; && !mech.locationIsLeg(m.getLocation())) { buff.append("A-Pod must be mounted in leg\n"); illegal = true; if (!mech.locationIsLeg(m.getLocation())) { illegal = true; buff.append(misc.getName() + " are only legal in the Legs\n"); if (mech.locationIsLeg(loc) && countCriticalSlotsFromEquipInLocation(mech, m, loc) != 1) { illegal = true; if (!mech.locationIsLeg(m.getLocation())) { illegal = true; buff.append("Talons are only legal in the Legs\n"); if (mech.locationIsLeg(loc) && countCriticalSlotsFromEquipInLocation(mech, m, loc) != 2) { illegal = true; int legCount = 0; for (Integer loc : byLocation.keySet()) { if (mech.locationIsLeg(loc)) {
for (Mounted mounted : getMisc()) { if (mounted.isDestroyed() || mounted.isBreached() || !locationIsLeg(mounted.getLocation())) { continue;