Beispiel #1
0
  /** Checks for functional AES in both legs */
  @Override
  public boolean hasFunctionalLegAES() {
    boolean rightLeg = false;
    boolean leftLeg = false;

    for (Mounted mounted : getMisc()) {
      if ((mounted.getLocation() == Mech.LOC_LLEG) || (mounted.getLocation() == Mech.LOC_RLEG)) {
        if (((MiscType) mounted.getType()).hasFlag(MiscType.F_ACTUATOR_ENHANCEMENT_SYSTEM)
            && !mounted.isDestroyed()
            && !mounted.isBreached()
            && !mounted.isMissing()) {
          if (mounted.getLocation() == Mech.LOC_LLEG) {
            leftLeg = true;
          } else {
            rightLeg = true;
          }
        } // AES is destroyed their for it cannot be used.
        else if (((MiscType) mounted.getType()).hasFlag(MiscType.F_ACTUATOR_ENHANCEMENT_SYSTEM)) {
          return false;
        }
      }
    }

    return rightLeg && leftLeg;
  }
Beispiel #2
0
  /**
   * Checks to see if this bipedmech has a vibroblade in this location.
   *
   * @param location
   * @return boolean <code>true</code> if the mech has vibroblades <code>false</code> if not.
   */
  public boolean hasVibrobladesInLocation(int location) {

    // Only arms have VibroBlades.
    if ((location != Mech.LOC_RARM) && (location != Mech.LOC_LARM)) {
      return false;
    }

    for (int slot = 0; slot < this.getNumberOfCriticals(location); slot++) {
      CriticalSlot cs = getCritical(location, slot);

      if (cs == null) {
        continue;
      }
      if (cs.getType() != CriticalSlot.TYPE_EQUIPMENT) {
        continue;
      }
      Mounted m = cs.getMount();
      EquipmentType type = m.getType();
      if ((type instanceof MiscType) && ((MiscType) type).isVibroblade()) {
        return !(m.isDestroyed() || m.isMissing() || m.isBreached());
      }
    }

    return false;
  }
Beispiel #3
0
  /** Checks is Biped Mek has functional AES in the location. Only works for Arms */
  @Override
  public boolean hasFunctionalArmAES(int location) {

    boolean hasAES = false;
    if ((location != Mech.LOC_RARM) && (location != Mech.LOC_LARM)) {
      return false;
    }

    for (Mounted mounted : getMisc()) {
      if ((mounted.getLocation() == location)
          && mounted.getType().hasFlag(MiscType.F_ACTUATOR_ENHANCEMENT_SYSTEM)
          && !mounted.isDestroyed()
          && !mounted.isBreached()
          && !mounted.isMissing()) {
        hasAES = true;
      } // AES is destroyed their for it cannot be used.
      else if ((mounted.getLocation() == location)
          && mounted.getType().hasFlag(MiscType.F_ACTUATOR_ENHANCEMENT_SYSTEM)) {
        return false;
      }
    }

    return hasAES;
  }
Beispiel #4
0
  @Override
  public int getActiveVibrobladeHeat(int location, boolean ignoreMode) {
    // Only arms have VibroBlades.
    if ((location != Mech.LOC_RARM) && (location != Mech.LOC_LARM)) {
      return 0;
    }

    for (int slot = 0; slot < this.getNumberOfCriticals(location); slot++) {
      CriticalSlot cs = getCritical(location, slot);

      if (cs == null) {
        continue;
      }
      if (cs.getType() != CriticalSlot.TYPE_EQUIPMENT) {
        continue;
      }
      Mounted m = cs.getMount();
      EquipmentType type = m.getType();
      if ((type instanceof MiscType)
          && ((MiscType) type).isVibroblade()
          && (m.curMode().equals("Active") || ignoreMode)
          && !(m.isDestroyed() || m.isMissing() || m.isBreached())) {
        MiscType blade = (MiscType) type;
        if (blade.hasSubType(MiscType.S_VIBRO_LARGE)) {
          return 7;
        }
        if (blade.hasSubType(MiscType.S_VIBRO_MEDIUM)) {
          return 5;
        }
        // else
        return 3;
      }
    }

    return 0;
  }