We present detailed observations of the shock waves emitted at the collapse of single cavitation bubbles using simultaneous time-resolved shadowgraphy and hydrophone pressure measurements. The geometry of the bubbles is systematically varied from spherical to very nonspherical by decreasing their distance to a free or rigid surface or by modulating the gravity-induced pressure gradient aboard parabolic flights. The nonspherical collapse produces multiple shocks that are clearly associated with different processes, such as the jet impact and the individual collapses of the distinct bubble segments. For bubbles collapsing near a free surface, the energy and timing of each shock are measured separately as a function of the anisotropy parameter zeta, which represents the dimensionless equivalent of the Kelvin impulse. For a given source of bubble deformation (free surface, rigid surface, or gravity), the normalized shock energy depends only on zeta, irrespective of the bubble radius R-0 and driving pressure Delta p. Based on this finding, we develop a predictive framework for the peak pressure and energy of shock waves from nonspherical bubble collapses. Combining statistical analysis of the experimental data with theoretical derivations, we find that the shock peak pressures can be estimated as jet impact-induced hammer pressures, expressed as p(h) = 0.45(rho c(2) Delta p)(1/2) zeta(-1) at zeta > 10(-3). The same approach is found to explain the shock energy decreasing as a function of zeta(-2/3).