4 title => 'starcraft unit cheat sheet',
7 'Reference of StarCraft unit properties,'
8 . ' comparing various statistics of all the units in Brood War'
9 . ' including costs, damage, defense, speed, ranges, and abilities.',
12 starcraft game unit statistics stats comparison table sheet cheat
13 reference software attributes properties
15 stylesheet => [qw'light'],
19 <h1>StarCraft units</h1>
22 Unit properties as seen or measured in Brood War
23 <span title="no known changes as of v1.16.1">version≥1.08</span>.
26 <style type="text/css">
28 border-collapse: separate;
32 .units th, .units td {
35 background: transparent;
40 border-top-style: dashed;
42 .units tr th:first-child {
45 .units tr:hover:not(.race) {
56 text-transform: uppercase;
58 .units thead th, .units tfoot th {
63 .unit-o {color: #C08} /* organic */
64 .unit-u {color: #44C} /* mechanic */
65 img.unit-o, img.unit-u {
67 vertical-align: middle;
73 .unit.unit-s {color: #770}
74 .unit.unit-m {color: #C70}
75 .unit.unit-l {color: #D22}
76 .hurt.unit-s::before {
80 .hurt.unit-l::before {
87 .hurtrel, .units .hurtrel {
95 .unit-detect::before {
99 vertical-align: super;
122 -webkit-column-break-before: avoid;
137 my ($name, $id) = @_;
139 (defined $get{order} ? $get{order} eq $id : !$id) ? '%2$s ▼'
140 : '<a href="?%s">%s</a>',
141 $id && "order=$id", $name
144 :><table class="units">
147 <th><:= coltoggle('name', '') :></th>
148 <th class="val min"><img src="/minerals.png" alt="min"></th>
149 <th class="val gas"><img src="/gas.png" alt="gas"></th>
150 <th class="val time"><:= coltoggle(qw'build cost') :></th>
151 <th class="unit" colspan="2"><:= coltoggle(qw'size size') :></th>
152 <th class="val unit-hp">HP</th>
153 <th class="val unit-shield">shield</th>
154 <th class="val unit-armor">armor</th>
155 <th class="val hurt" colspan="2">ground</th>
156 <th class="val hurt" colspan="2">air</th>
157 <th class="val unit-range">range</th>
158 <th class="val unit-sight">sight</th>
159 <th class="val unit-speed">speed</th>
160 <th class="unit-magic">specials</th>
164 my ($row, @elements) = @_;
168 $value = ref $value eq 'HASH' && $value->{$_} or last for @elements;
169 if (ref $value eq 'ARRAY') {
174 $min = $max = $value;
176 defined $min or return '';
178 if ($row->{upgrade}) {
179 for (@{ $row->{upgrade} }) {
180 my $increase = $_ or next;
181 $increase = ref $increase eq 'HASH' && $increase->{$_} or last for @elements;
182 $increase = $increase->[-1] if ref $increase eq 'ARRAY';
183 $max += $increase if $increase;
187 if ($elements[0] eq 'attack' and $elements[1] ne 'range' and $elements[2] eq 'cmp') {{
188 my $type = $row->{$elements[0]}->{$elements[1]}->{type} or next;
189 if ($type eq 'explosive') {
192 elsif ($type eq 'implosive') {
195 $min = int($min + .5); # round halves up
198 return $min == $max ? $min : "$min-$max";
202 my ($row, $area) = @_;
203 local $_ = $row->{attack}->{$area};
205 return '<td colspan="2" class="hurt">' unless $_;
207 my $tagbase = '<td class="val hurt';
208 if (ref $_ and $_->{type}) {
209 if ($_->{type} eq 'explosive') {
210 $tagbase .= ' unit-l';
212 elsif ($_->{type} eq 'implosive') {
213 $tagbase .= ' unit-s';
218 my $out = showrange($row, 'attack', $area, 'damage');
219 $out .= '<span class="unit-splash">+</span>' if $_->{splash};
220 $out .= '<td class="val hurt hurtrel">' . showrange($row, 'attack', $area, 'cmp');
221 return $tagbase . $out;
226 my $specials = $row->{special} or return '';
227 return join ' ', map {
228 sprintf '<span title="%s">%s</span>',
231 $_->{desc} ? ": $_->{desc}" : '',
232 $_->{range} ? sprintf(' (%s)', join ', ',
241 my $units = do 'sc-units.inc.pl';
242 die "Cannot open unit data: $_\n" for $! || $@ || ();
243 my $grouped = !exists $get{order};
244 if (exists $get{order}) {
246 if ($get{order} eq 'size') {
247 $_->{order} = $_->{unit}*8 + $_->{size} + $_->{hp}/512 + $_->{min}/8192 for @$units;
249 elsif ($get{order} eq 'cost') {
250 $_->{order} = $_->{gas}*1.5 + $_->{min} + $_->{unit}/8 + $_->{build}/256/8 for @$units;
253 $units->[$_]->{order} = $_ for 0 .. $#$units;
256 my @rows = $grouped ? @$units : sort {$a->{order} <=> $b->{order}} @$units;
258 my ($race, $cat) = ('', '');
261 printf '<tbody id="%s"><tr class="race"><th colspan="18"><h2>%s</h2>'."\n", $race, ucfirst $race
262 if $grouped and $race ne $_->{race};
263 $_->{cat} = $_->{race} if not $grouped;
264 my $sizechar = [qw/? s m l/]->[$_->{size}];
267 sprintf('<t%s class="cat">%s', $cat ne $_->{cat} ? ('h', $cat = $_->{cat}) : ('d', ' ')),
269 '<td class="val min">' . ($_->{min} || '0'),
270 '<td class="val gas">' . ($_->{gas} || ''),
271 '<td class="val time">' . sprintf('%.0f', $_->{build} || '0'),
272 sprintf('<td class="unit unit-%s">%s', $sizechar, ucfirst $sizechar),
273 '<td class="val unit">' . join('',
274 $_->{unit} ? $_->{unit} == .5 ? '½' : $_->{unit} : ' ',
275 defined $_->{organic} && sprintf(
276 '<span class="unit-%s" title="%s">%s</span>',
277 $_->{organic} ? 'o' : 'u',
278 $_->{organic} ? 'organic' : 'mechanic',
279 $_->{organic} ? 'o' : 'm',
282 '<td class="val unit-hp">' . $_->{hp},
283 '<td class="val unit-shield">' . ($_->{shield} ? $_->{shield}.'%' : ' '),
284 '<td class="val unit-armor">' . showrange($_, 'armor'),
285 showattack($_, 'ground'),
286 showattack($_, 'air'),
287 '<td class="val unit-range">' . showrange($_, 'attack', 'range'),
288 '<td class="val unit-sight">' . sprintf(
289 $_->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
290 showrange($_, 'sight')
292 '<td class="val unit-speed">' . showrange($_, 'speed'),
293 '<td class="unit-magic">' . showmagic($_),
297 for my $alt (grep { $_->{alt} } @{ $_->{special} }) {
299 '<tr class="alt"><td class="cat"><td colspan="9">' . $alt->{alt},
300 showattack($alt, 'ground'),
301 showattack($alt, 'air'),
302 '<td class="val unit-range">' . showrange($alt, 'attack', 'range'),
303 '<td class="val unit-sight">' . sprintf(
304 $alt->{detect} ? '<strong class="unit-detect">%s</strong>' : '%s',
305 showrange($alt, 'sight')
307 '<td class="val unit-speed">' . showrange($alt, 'speed'),
321 <dd>minerals+gas required to create one unit
323 <dd>relative time needed to create at least one unit
325 <dd><span class="unit unit-s">S</span>mall,
326 <span class="unit unit-m">M</span>edium,
327 or <span class="unit unit-l">L</span>arge unit damage
328 <dd>number of command points taken per unit
329 <dd><span class="unit unit-o">organic</span>/<span class="unit unit-u">mechanic</span> unit
331 total number of hitpoints (including shields)
333 <dd>percentage of HP in shields
334 <dd>shields always take full damage, irrelevant of unit size
335 <dd>does not take armor bonuses, but upgrades can decrease damage to any shield hit by upto 3
338 <dd>can be increased by upto 3 at various facilities
339 <dd>each point decreases damage per hit by one, upto a minimum of ½
340 <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>
342 <dd>damage done per single attack against ground/air units
343 <dd>2nd column indicates relative amount of damage done in
344 <span title="the time in which a dragoon fires a shot">a certain
345 amount</span> of time
346 <dd>splash damage<span class="unit-splash">+</span> hits nearby objects as well
347 <dd><span class="hurt unit-l">explosive</span> damage does only
348 50% damage to small units, 75% to medium, 100% to large
349 <dd><span class="hurt unit-s">concussive/plasma</span> damage does
350 25% to large, 50% medium, 100% to small units
352 <dd>range in which the unit detects other units
353 <dd><strong class="unit-detect">emphasis</strong> indicates ability to detect cloaked units
355 <dd>maximum range of weapon (note siege tank also has a minimum range)
357 <dd>relative speed of movement (when in full motion, startup speed ignored)
359 <dd>special abilities
360 <dd>parentheses () indicate that it needs to be researched first
361 <dd>hover for description
362 <dd>range is maximum range required to activate
363 <dd>cost is percentage of total energy lost
367 When two values are given (1-2), second value indicates attribute after all