- '<td class="val unit-hp">' . $_->{hp},
- '<td class="val unit-shield">' . ($_->{shield} ? $_->{shield}.'%' : ' '),
- '<td class="val unit-armor">' . showrange($_, 'armor'),
+ '<td class="unit unit-type">' . join('', grep { $_ }
+ (defined $_->{organic} || $_->{attr}->{organic})
+ && '<span class="unit-o" title="organic">o</span>',
+ (defined $_->{organic} ? !$_->{organic} : $_->{attr}->{mech})
+ && '<span class="unit-u" title="mechanic">m</span>',
+ $_->{attr}->{psionic}
+ && '<span class="unit-p" title="psionic">ψ</span>',
+ ),
+ '<td class="unit unit-attr">' . join('', grep { $_ }
+ $_->{attr}->{armored}
+ && '<span class="unit unit-l" title="armored">A</span>',
+ $_->{attr}->{light}
+ && '<span class="unit unit-s" title="light">L</span>',
+ ),
+ '<td class="val unit-hp">' . $_->{hp} // '',
+ '<td class="val unit-shield">' . (
+ $_->{shield} ? sprintf('%.0f%%', 100 * $_->{shield} / $_->{hp}) : ' '
+ ),
+ '<td class="val unit-armor">' . showval($_, 'armor'),