border-collapse: separate;
border-spacing: 0;
margin: 0 auto;
+ white-space: nowrap;
}
.units th, .units td {
border: 0;
margin: 0;
text-align: center;
}
- .units th.cat {
- font-size: 70%;
- text-transform: uppercase;
- }
.units thead th, .units tfoot th {
font-size: 70%;
font-weight: normal;
margin-left: 0.2em;
vertical-align: middle;
}
+ .unit-composed {
+ color: #C88;
+ font-size: 70%;
+ }
.unit {
text-align: center;
white-space: nowrap;
display: table-cell;
}
.legend {
- min-width: 15em;
- padding-left: 2em;
+ min-width: 20em;
text-align: left;
}
+ .units {
+ float: left;
+ padding-bottom: 1em;
+ margin-right: 2em;
+ }
+ .footer {
+ clear: left;
+ }
</style>
<:
elsif ($type eq 'implosive') {
$min /= 4;
}
- $min = int($min + .5); # round halves up
}}
+ $_ = int($_ + .5) for $min, $max; # round halves up
return $min == $max ? $min : "$min-$max";
}
}
my $units = do 'sc-units.inc.pl';
- die "Cannot open unit data: $_\n" for $! || $@ || ();
+ die "Cannot open unit data: $_\n" for $@ || $! || ();
my $grouped = !exists $get{order};
if (exists $get{order}) {
$get{order} ||= '';
'<td>' . $_->{name},
'<td class="val min">' . ($_->{min} || '0'),
'<td class="val gas">' . ($_->{gas} || ''),
- '<td class="val time">' . sprintf('%.0f', $_->{build} || '0'),
+ sprintf('<td class="val time">%s%.0f',
+ !!$_->{base} && '<span class="unit-composed">+</span>',
+ $_->{build} || '0',
+ ),
sprintf('<td class="unit unit-%s">%s', $sizechar, ucfirst $sizechar),
'<td class="val unit">' . join('',
$_->{unit} ? $_->{unit} == .5 ? '½' : $_->{unit} : ' ',
<dl>
<dt>cost
<dd>minerals+gas required to create one unit
+ <dd>includes total expenses if based on existing units
<dt>build
<dd>relative time needed to create at least one unit
+ <dd>excludes construction of dependencies such as buildings
+ and <span class="unit-composed">+</span>parent units
<dt>size
- <dd><span class="unit unit-s">S</span>mall,
+ <dd>affected by <span class="unit unit-s">S</span>mall,
<span class="unit unit-m">M</span>edium,
or <span class="unit unit-l">L</span>arge unit damage
<dd>number of command points taken per unit
- <dd><span class="unit unit-o">organic</span>/<span class="unit unit-u">mechanic</span> unit
+ <dd><span class="unit unit-o">o</span>rganic/<span class="unit unit-u">m</span>echanic unit
<dt>HP<dd>
total number of hitpoints (including shields)
<dt>shield
<dd>base unit armor
<dd>can be increased by upto 3 at various facilities
<dd>each point decreases damage per hit by one, upto a minimum of ½
- <dd>reduction applies to initial damage, before size penalties <small>(so a large plasma hit of 12 to 4 armor deals 2 damage, not ½)</small>
+ <dd>reduction applies to initial damage, before size penalties <small>(so a plasma hit of 12 to 4 armor large deals 2 damage, not ½)</small>
<dt>ground/air
<dd>damage done per single attack against ground/air units
<dd>2nd column indicates relative amount of damage done in