private void regenerateShields() {
    final OutfitType type = (OutfitType) outfit.type ;
    final float regenTime =
      SHIELD_REGEN_TIME * 2f / (2 + type.shieldBonus) ;
    final float maxShield = maxShields() ;
    if (currentShields < maxShield) {
      final float nudge = maxShield / regenTime ;
      currentShields += nudge ;
      fuelCells -= nudge / 10f ;
      if (currentShields > maxShield) currentShields = maxShield ;
      if (fuelCells < 0) fuelCells = 0 ;
    }
    else {
      currentShields -= SHIELD_CHARGE / regenTime ;
      if (currentShields < maxShield) currentShields = maxShield ;
    }
  }