Exemplo n.º 1
0
  public float getTankWeightTurret() {
    float weight = 0f;

    // 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());
    }
  }