printf '<tbody id="%s"><tr class="race"><th colspan="18"><h2>%s</h2>'."\n", $race, ucfirst $race
if $grouped and $race ne $_->{race};
$_->{cat} = $_->{race} if not $grouped;
+ $_->{hp} += $_->{shield};
my $suitchar = [qw/? s m l/]->[$_->{suit}];
print(
'<tr>',
),
),
'<td class="val unit-hp">' . $_->{hp},
- '<td class="val unit-shield">' . ($_->{shield} ? $_->{shield}.'%' : ' '),
+ '<td class="val unit-shield">' . (
+ $_->{shield} ? sprintf('%.0f%%', 100 * $_->{shield} / $_->{hp}) : ' '
+ ),
'<td class="val unit-armor">' . showrange($_, 'armor'),
showattack($_, 'ground'),
showattack($_, 'air'),