First test of new damage formulas

The basic damage formula is the same regardless of type: Take a weighted
average of all relevant attack stats, average the defensive stats and
treat that as a percentage reduction, then put the whole thing on a
cubic damage curve.  Besides that, just a bunch of minor tweaks and
fixes, nothing groundbreaking.