/** * Is this a primitive Mech? * * @return */ public boolean isPrimitive() { return (getCockpitType() == Mech.COCKPIT_PRIMITIVE) || (getCockpitType() == Mech.COCKPIT_PRIMITIVE_INDUSTRIAL); }
public String getCockpitTypeString() { return Mech.getCockpitTypeString(getCockpitType()); }
public boolean isCockpitLocation(int location) { if (mech.getCockpitType() == Mech.COCKPIT_TORSO_MOUNTED || mech.getCockpitType() == Mech.COCKPIT_VRRP) { return location == Mech.LOC_CT; } return location == Mech.LOC_HEAD; }
public double getWeightCockpit() { double weight = 3.0; if (mech.getCockpitType() == Mech.COCKPIT_SMALL) { weight = 2.0; } else if (mech.getCockpitType() == Mech.COCKPIT_TORSO_MOUNTED) { weight = 4.0; } else if (mech.getCockpitType() == Mech.COCKPIT_COMMAND_CONSOLE) { } else if (mech.getCockpitType() == Mech.COCKPIT_DUAL) { } else if (mech.getCockpitType() == Mech.COCKPIT_PRIMITIVE) { weight = 5.0; } else if (mech.getCockpitType() == Mech.COCKPIT_PRIMITIVE_INDUSTRIAL) { weight = 5.0; } else if ((mech.getCockpitType() == Mech.COCKPIT_SUPERHEAVY) || (mech.getCockpitType() == Mech.COCKPIT_TRIPOD)) { weight = 4.0; } else if (mech.getCockpitType() == Mech.COCKPIT_SUPERHEAVY_TRIPOD) { weight = 5.0; } else if (mech.getCockpitType() == Mech.COCKPIT_INTERFACE) { weight = 4.0; } else if (mech.getCockpitType() == Mech.COCKPIT_QUADVEE) { weight = 4.0;
private boolean isLargeTarget(final Targetable target) { if ((target instanceof LargeSupportTank) || (target instanceof FixedWingSupport) || (target instanceof Dropship && target.isAirborne())) { return true; } if (!(target instanceof Mech)) { return false; } final Mech targetMech = (Mech) target; return (Mech.COCKPIT_SUPERHEAVY == targetMech.getCockpitType()) || (Mech.COCKPIT_SUPERHEAVY_TRIPOD == targetMech.getCockpitType()); }
public TechAdvancement getCockpitTechAdvancement() { if (isIndustrial() && (getCockpitType() == COCKPIT_STANDARD)) { return getIndustrialAdvFireConTA(); } return getCockpitTechAdvancement(getCockpitType()); }
public double getGyroMultiplier() { if ((getGyroType() == GYRO_HEAVY_DUTY)) { return 1.0; } if (getGyroType() == GYRO_NONE && getCockpitType() != COCKPIT_INTERFACE) { return 0; } return 0.5; }
/** * Determines which crew slot is associated with a particular cockpit critical. * * @param cs A cockpit critical slot * @return The crew slot index associated with this critical slot, or -1 to indicate the entire crew. */ public int getCrewForCockpitSlot(int loc, CriticalSlot cs) { //For those with split cockpits, count the cockpit criticals in the location until we reach the correct //one. if (getCockpitType() == COCKPIT_COMMAND_CONSOLE || getCockpitType() == COCKPIT_DUAL || getCockpitType() == COCKPIT_QUADVEE) { int crewSlot = 0; for (int i = 0; i < getNumberOfCriticals(loc); i++) { if (getCritical(loc, i) == cs) { return crewSlot; } else if (getCritical(loc, i).getIndex() == SYSTEM_COCKPIT) { crewSlot++; } } } return -1; }
@Override public boolean isEjectionPossible() { return (getCockpitType() != Mech.COCKPIT_TORSO_MOUNTED) && getCrew().isActive() && !hasQuirk(OptionsConstants.QUIRK_NEG_NO_EJECT); }
/** * @return Returns the autoEject. */ public boolean isAutoEject() { boolean hasEjectSeat = true; if (getCockpitType() == COCKPIT_TORSO_MOUNTED) { hasEjectSeat = false; } if (isIndustrial()) { // industrials can only eject when they have an ejection seat for (Mounted misc : miscList) { if (misc.getType().hasFlag(MiscType.F_EJECTION_SEAT)) { hasEjectSeat = true; } } } return autoEject && hasEjectSeat; }
public boolean hasArmoredCockpit() { int location = getCockpitType() == Mech.COCKPIT_TORSO_MOUNTED ? Mech.LOC_CT : Mech.LOC_HEAD; for (int slot = 0; slot < getNumberOfCriticals(location); slot++) { CriticalSlot cs = getCritical(location, slot); if ((cs != null) && (cs.getType() == CriticalSlot.TYPE_SYSTEM) && (cs.getIndex() == Mech.SYSTEM_COCKPIT)) { return cs.isArmored(); } } return false; }
@Override public boolean hasCommandConsoleBonus() { return getCockpitType() == COCKPIT_COMMAND_CONSOLE && getCrew().hasActiveCommandConsole() && getWeightClass() >= EntityWeightClass.WEIGHT_HEAVY && (!isIndustrial() || hasWorkingMisc(MiscType.F_ADVANCED_FIRECONTROL)); }
if (getCockpitType() == COCKPIT_COMMAND_CONSOLE) { specialAbilities.merge(BattleForceSPA.MHQ, 1, Integer::sum); } else if (getCockpitType() == COCKPIT_VRRP) { specialAbilities.merge(BattleForceSPA.VR, 1, Integer::sum); if (getCockpitType() == Mech.COCKPIT_STANDARD) { specialAbilities.put(BattleForceSPA.AFC, null); } else {
@Override public boolean isInLocation(String loc) { if(null == unit || null == unit.getEntity() || !(unit.getEntity() instanceof Mech)) { return false; } if (unit.getEntity().getLocationFromAbbr(loc) == Mech.LOC_HEAD) { return true; } if(((Mech)unit.getEntity()).getCockpitType() == Mech.COCKPIT_TORSO_MOUNTED) { if(unit.getEntity().getLocationFromAbbr(loc) == Mech.LOC_CT) { return true; } } return false; }
@Override public boolean isInLocation(String loc) { if(null == unit || null == unit.getEntity() || !(unit.getEntity() instanceof Mech)) { return false; } if (unit.getEntity().getLocationFromAbbr(loc) == Mech.LOC_HEAD) { return true; } if(((Mech)unit.getEntity()).getCockpitType() == Mech.COCKPIT_TORSO_MOUNTED) { if(unit.getEntity().getLocationFromAbbr(loc) == Mech.LOC_CT) { return true; } } return false; }
private boolean checkSystemCriticals(StringBuffer buff) { // Engine criticals boolean engineCorrect = true; int requiredSideCrits = engine.getSideTorsoCriticalSlots().length; if ((requiredSideCrits != mech.getNumberOfCriticals( CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE, Mech.LOC_LT)) || (requiredSideCrits != mech.getNumberOfCriticals( CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE, Mech.LOC_RT))) { engineCorrect = false; } int requiredCTCrits = engine.getCenterTorsoCriticalSlots(mech.getGyroType()).length; if (requiredCTCrits != mech .getNumberOfCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE, Mech.LOC_CT)) { engineCorrect = false; } if (!engineCorrect) { buff.append("Engine: Incorrect number of criticals allocated.\n"); } if (!engineCorrect) { return false; } if (getMech().getGyroType() == Mech.GYRO_NONE && getMech().getCockpitType() != Mech.COCKPIT_INTERFACE) { buff.append("Missing Gyro!.\n"); return false; } return true; }
@Override public boolean isInLocation(String loc) { if(null == unit || null == unit.getEntity() || !(unit.getEntity() instanceof Mech)) { return false; } if(((Mech)unit.getEntity()).getCockpitType() == Mech.COCKPIT_TORSO_MOUNTED) { if(unit.getEntity().getLocationFromAbbr(loc) == Mech.LOC_LT || unit.getEntity().getLocationFromAbbr(loc) == Mech.LOC_RT) { return true; } } else if (unit.getEntity().getLocationFromAbbr(loc) == Mech.LOC_HEAD) { return true; } return false; }
@Override public boolean isInLocation(String loc) { if(null == unit || null == unit.getEntity() || !(unit.getEntity() instanceof Mech)) { return false; } if(((Mech)unit.getEntity()).getCockpitType() == Mech.COCKPIT_TORSO_MOUNTED) { if(unit.getEntity().getLocationFromAbbr(loc) == Mech.LOC_LT || unit.getEntity().getLocationFromAbbr(loc) == Mech.LOC_RT) { return true; } } else if (unit.getEntity().getLocationFromAbbr(loc) == Mech.LOC_HEAD) { return true; } return false; }
&& entity instanceof Mech && ((Mech)entity).getCockpitType() == Mech.COCKPIT_DUAL && entity.getCrew().hasDedicatedGunner()) { for (TargetRollModifier mod : toHit.getModifiers()) {
hit.getGeneralDamageType(), hit.glancingMod()); case LOC_HEAD: if (getCockpitType() == COCKPIT_TORSO_MOUNTED) { return new HitData(LOC_NONE); // not destroyed by head loss