Example #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());
    }
  }
Example #2
0
 @Override
 public float getWeightControls() {
   if (tank.hasNoControlSystems()) {
     return 0;
   } else {
     return TestEntity.ceilMaxHalf(tank.getWeight() / 20.0f, getWeightCeilingControls());
   }
 }
Example #3
0
 public float getTankWeightLifting() {
   switch (tank.getMovementMode()) {
     case HOVER:
     case VTOL:
     case HYDROFOIL:
     case SUBMARINE:
     case WIGE:
       return TestEntity.ceilMaxHalf(tank.getWeight() / 10.0f, getWeightCeilingLifting());
     default:
       return 0f;
   }
 }