- my $out = showval($row, 'attack', $area, 'damage');
- $out .= '<span class="unit-splash">+</span>' if $attack->{splash};
- $attack->{dps} = $attack->{cooldown} && [
- map { 24 * $_ / $attack->{cooldown} * ($attack->{count} // 1) }
- map { ref $_ ? @{$_} : $_ }
- $attack->{damage}
- #TODO: upgrade (zergling)
- ];
- $out .= '<td class="val hurt hurtrel">' . showval($row, 'attack', $area, 'dps');
- return $tagbase . $out;
+ my $upattack = $row->{upgraded}->{attack}->[$area];
+ my $maxdamage =
+ my $damage = $attack->{damage};
+ ($damage, $maxdamage) = ($damage->[0], $upattack->{damage} // $damage->[-1])
+ if ref $damage;
+
+ $out .= "<small>$attack->{count}× </small>" if $attack->{count} > 1;
+ $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;
+ }
+ }
+ $damage *= ($attack->{count} // 1) / $attack->{cooldown};
+ $maxdamage *= ($upattack->{count} // $attack->{count} // 1)
+ / ($upattack->{cooldown} // $attack->{cooldown});
+ $out .= showrange($damage, $maxdamage);
+ }
+
+ return $out;