+ my $upattack = $row->{upgraded}->{attack}->[$area];
+ my $damage = $attack->{damage};
+ my $maxdamage = $upattack->{damage} // $damage;
+ $damage = $damage->[0] if ref $damage;
+ $maxdamage = $maxdamage->[-1] if ref $maxdamage;
+
+ $out .= "<small>$attack->{count}× </small>" 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';
+ $out .= sprintf('<span class="%s" title="%s">≥</span>',
+ (map {
+ $_ =~ /^light/ ? 'unit-s' :
+ $_ eq 'armored' ? 'unit-l' :
+ $_ eq 'organic' ? 'unit-o' :
+ $_ =~ /^massive/ ? 'unit-h' :
+ '',
+ } join '_', keys %{ $attack->{bonus} }),
+ join(', ', map {(
+ sprintf('+%s vs %s',
+ (map {
+ ref $_ ? showrange($_->[0], $_->[-1]) : $_
+ } $attack->{bonus}->{$_}),
+ $_,
+ ),
+ )} keys %{ $attack->{bonus} }),
+ ) if $attack->{bonus};
+ $out .= showrange($damage, $maxdamage);
+ $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->{cooldown}) {
+ if (my $type = $attack->{type}) {
+ if ($type eq 'explosive') {
+ $damage /= 2;
+ }
+ elsif ($type eq 'implosive') {
+ $damage /= 4;
+ }