...when there are previous combats to account for.
(It passes the attack simulator check.)
The basic problem with the old system is that it treated the number of
strikes as an independent variable, even though it depends on the
number of hit points.
There is some additional overhead with this method, but I optimized
some things for the common case (no swarm), and benchmarking indicated
a negligible 1% increase in run time when no units had swarm.
...and benchmarking.
Biggest change: the first unit, which has all checked specials, gets
to actually attack.
(Previously, its swarm special and low hit points resulted in no attacks.)
...and verification.
The old set had several deficiencies, such as every unit with slow
also having only one attack and having the swarm special (so usually
no attacks). This set keeps the specials and stats on separate cycles.