- my $tagbase = '<td class="val hurt';
- if (ref $attack and $attack->{type}) {
- if ($attack->{type} eq 'explosive') {
- $tagbase .= ' unit-l';
- }
- elsif ($attack->{type} eq 'implosive') {
- $tagbase .= ' unit-s';
- }
- }
- $tagbase .= '">';
+ my $out = '<td class="val hurt">';
+ $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' :
+ $_ eq 'shields' ? 'unit-shield' :
+ '',
+ } join '_', keys %{ $attack->{bonus} }),
+ join(', ', map {(
+ sprintf('+%s vs %s',
+ (map {
+ ref $_ ? showrange($_->[0], $_->[-1]) : $_
+ } $attack->{bonus}->{$_}),
+ $_,
+ ),
+ )} keys %{ $attack->{bonus} }),
+ ) if $attack->{bonus};
+ $out .= '<span class="unit-pdd" title="projectile">•</span>'
+ if $attack->{type} eq 'projectile';