- '<td class="val unit">' . join('',
- defined $_->{unit} && $_->{unit} == .5 ? '½' : $_->{unit},
- defined $_->{organic} && sprintf(
- '<span class="unit-%s" title="%s">%s</span>',
- $_->{organic} ? 'o' : 'u',
- $_->{organic} ? 'organic' : 'mechanic',
- $_->{organic} ? 'o' : 'm',
- ),
+ '<td class="val unit">' . (
+ defined $_->{unit} && $_->{unit} == .5 ? '½' : $_->{unit}
+ ),
+ '<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>',