+ my $maxdamage = $upattack->{damage} // $damage;
+ $maxdamage += ($upattack->{upgrade} // $attack->{upgrade}) * 3;
+
+ my $out = '<td class="val hurt">';
+ $out .= sprintf '<span title="%s">¤</span> ', showcost($attack, $row)
+ if $attack->{cost};
+ $out .= sprintf('<small>%s× </small>',
+ showrangeint($attack->{count}, $upattack->{count}),
+ ) if $attack->{count} > 1;
+ $out .= '<span class="unit-l" title="explosive">*</span>'
+ if $attack->{type} eq 'explosive';
+ $out .= '<span class="unit-s" title="implosive">~</span>'
+ if $attack->{type} eq 'implosive';
+ if (my @bonus = sort grep { !/^-/ } keys %{ $attack->{bonus} }) {
+ $out .= sprintf('<span class="%s" title="%s">≥</span>',
+ (map {
+ $_ eq 'light' ? 'unit-s' :
+ $_ eq 'armored' ? 'unit-l' :
+ $_ eq 'organic' ? 'unit-o' :
+ $_ eq 'massive' ? 'unit-h' :
+ $_ eq 'shields' ? 'unit-shield' :
+ '',
+ } join '_', @bonus),
+ join(', ', map {(
+ sprintf('+%s vs %s',
+ showrangeint(
+ $attack->{bonus}->{$_},
+ $attack->{bonus}->{$_} + $attack->{bonus}->{"-$_"} * 3,
+ ),
+ $_,
+ ),
+ )} @bonus),
+ );
+ }
+ $out .= '<span class="unit-pdd" title="projectile">•</span>'
+ if $attack->{type} eq 'projectile';