+ or return '<td colspan=5 class="hurt">';
+
+ my $upattack = $row->{upgraded}->{attack}->[$area];
+ my $damage = $attack->{damage};
+ 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>',
+ (
+ $_ eq 'light' ? 'unit-s' :
+ $_ eq 'armored' ? 'unit-l' :
+ $_ eq 'organic' ? 'unit-o' :
+ $_ eq 'massive' ? 'unit-h' :
+ $_ eq 'shields' ? 'unit-shield' :
+ $_ eq 'structure' ? 'unit-x' :
+ '',
+ ),
+ (
+ sprintf('+%s vs %s',
+ showrangeint(
+ $attack->{bonus}->{$_},
+ ($upattack->{bonus} // $attack->{bonus})->{$_}
+ + ($upattack->{bonus} // $attack->{bonus})->{"-$_"} * 3,
+ ),
+ $_,
+ ),
+ ),
+ ) for @bonus;
+ }
+ $out .= '<span class="unit-pdd" title="projectile">•</span>'
+ if $attack->{type} eq 'projectile';
+
+ $out .= sprintf '<span title="%s">', $attack->{name} if $attack->{name};
+ $out .= showrangeint($damage, $maxdamage);
+ $out .= '</span>' if $attack->{name};
+ $out .= sprintf('<span class="unit-splash" title="%s">%s</span>',
+ $attack->{splash} eq 'line' ? ('linear', '+') : ('splash', '⁜')
+ ) if $attack->{splash};
+
+ $out .= '<td class="val hurt hurtrel">';
+ if ($attack->{dps}) {
+ # precalculated dps, do not touch
+ $out .= showrangeint($attack->{dps}->[0],
+ $upattack->{dps}->[-1] // $attack->{dps}->[-1]
+ );
+ }
+ elsif ($attack->{cooldown}) {
+ if (my $type = $attack->{type}) {
+ if ($type eq 'explosive') {
+ $damage /= 2;
+ }
+ elsif ($type eq 'implosive') {
+ $damage /= 4;
+ }